summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore10
-rwxr-xr-xbin/elf2e32_qtwrapper.pl2
-rw-r--r--config.profiles/symbian/headerexport411
-rw-r--r--config.profiles/symbian/package_definition.xml4
-rw-r--r--config.profiles/symbian/qtconfig.flm2
-rw-r--r--config.profiles/symbian/translations/qt_fr_symbian.ts4
-rw-r--r--config.profiles/symbian/translations/qt_pl_symbian.ts4
-rw-r--r--config.profiles/symbian/translations/qt_ru_symbian.ts4
-rw-r--r--config.profiles/symbian/translations/qt_zh_cn_symbian.ts2
-rw-r--r--config.profiles/symbian/translations/qt_zh_tw_symbian.ts4
-rw-r--r--config.tests/mac/coreservices/coreservices.mm2
-rw-r--r--config.tests/unix/opengldesktop/opengldesktop.cpp2
-rwxr-xr-xconfigure13
-rw-r--r--demos/browser/networkaccessmanager.cpp9
-rw-r--r--demos/browser/networkaccessmanager.h1
-rw-r--r--dist/changes-4.7.2271
-rw-r--r--dist/changes-4.7.30
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc8
-rw-r--r--doc/src/declarative/elements.qdoc2
-rw-r--r--doc/src/declarative/extending.qdoc6
-rw-r--r--doc/src/declarative/qmlinuse.qdoc2
-rw-r--r--doc/src/declarative/whatsnew.qdoc97
-rw-r--r--doc/src/development/qmake-manual.qdoc49
-rw-r--r--doc/src/examples/multicastreceiver.qdoc2
-rw-r--r--doc/src/examples/multicastsender.qdoc2
-rw-r--r--doc/src/examples/wheel.qdoc2
-rw-r--r--doc/src/getting-started/installation.qdoc23
-rw-r--r--doc/src/images/roaming-states.pngbin0 -> 9527 bytes
-rw-r--r--doc/src/platforms/platform-notes-rtos.qdoc109
-rw-r--r--doc/src/platforms/platform-notes.qdoc69
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc7
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc12
-rw-r--r--doc/src/snippets/declarative/application.qml2
-rw-r--r--doc/src/snippets/declarative/componentCreation.js7
-rw-r--r--doc/src/snippets/declarative/focus/focusColumn.qml2
-rw-r--r--doc/src/snippets/declarative/layoutmirroring.qml64
-rw-r--r--doc/src/snippets/declarative/states/statechangescript.qml3
-rw-r--r--doc/src/snippets/declarative/webview/webview.qml2
-rw-r--r--doc/src/snippets/qmake/spaces.pro8
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qml2
-rw-r--r--examples/declarative/positioners/layoutdirection/layoutdirection.qml24
-rw-r--r--examples/declarative/touchinteraction/pincharea/flickresize.qml13
-rw-r--r--examples/itemviews/chart/chart.pro2
-rw-r--r--examples/network/multicastreceiver/main.cpp2
-rw-r--r--examples/network/multicastreceiver/receiver.cpp2
-rw-r--r--examples/network/multicastreceiver/receiver.h2
-rw-r--r--examples/network/multicastsender/main.cpp2
-rw-r--r--examples/network/multicastsender/sender.cpp2
-rw-r--r--examples/network/multicastsender/sender.h2
-rw-r--r--examples/opengl/pbuffers/cube.cpp49
-rw-r--r--examples/opengl/pbuffers/cube.h3
-rw-r--r--examples/opengl/pbuffers/glwidget.cpp2
-rw-r--r--examples/painting/painterpaths/painterpaths.pro2
-rw-r--r--examples/scroller/graphicsview/main.cpp2
-rw-r--r--examples/scroller/plot/main.cpp2
-rw-r--r--examples/scroller/plot/plotwidget.cpp2
-rw-r--r--examples/scroller/plot/plotwidget.h2
-rw-r--r--examples/scroller/plot/settingswidget.cpp2
-rw-r--r--examples/scroller/plot/settingswidget.h2
-rw-r--r--examples/scroller/wheel/main.cpp2
-rw-r--r--examples/scroller/wheel/wheelwidget.cpp2
-rw-r--r--examples/scroller/wheel/wheelwidget.h2
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro2
-rw-r--r--mkspecs/common/armcc.conf1
-rw-r--r--mkspecs/common/mac/qplatformdefs.h2
-rw-r--r--mkspecs/common/symbian/symbian-makefile.conf20
-rw-r--r--mkspecs/common/symbian/symbian.conf36
-rw-r--r--mkspecs/common/symbian/symbianincludes.h58
-rw-r--r--mkspecs/features/default_post.prf4
-rw-r--r--mkspecs/features/link_pkgconfig.prf7
-rw-r--r--mkspecs/features/qt_functions.prf27
-rw-r--r--mkspecs/features/symbian/localize_deployment.prf9
-rw-r--r--mkspecs/features/symbian/symbian_building.prf142
-rw-r--r--mkspecs/features/unix/gdb_dwarf_index.prf2
-rw-r--r--mkspecs/features/win32/embed_manifest_dll.prf2
-rw-r--r--mkspecs/features/win32/embed_manifest_exe.prf2
-rw-r--r--mkspecs/qws/linux-nacl-g++/qplatformdefs.h2
-rw-r--r--mkspecs/qws/macx-nacl-g++/qplatformdefs.h2
-rw-r--r--mkspecs/symbian-armcc/qmake.conf5
-rw-r--r--mkspecs/symbian-armcc/qplatformdefs.h2
-rw-r--r--mkspecs/symbian-gcce/qmake.conf20
-rw-r--r--mkspecs/symbian-gcce/qplatformdefs.h2
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm18
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm1
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qt.xml5
-rw-r--r--mkspecs/unsupported/integrity-ghs/qmake.conf72
-rw-r--r--mkspecs/unsupported/integrity-ghs/qplatformdefs.h201
-rw-r--r--mkspecs/unsupported/linux-armcc/qmake.conf32
-rw-r--r--mkspecs/unsupported/linux-armcc/qplatformdefs.h100
-rw-r--r--mkspecs/unsupported/linux-clang/qplatformdefs.h2
-rw-r--r--mkspecs/unsupported/macx-clang/qplatformdefs.h2
-rw-r--r--mkspecs/unsupported/qws/integrity-arm-cxarm/qmake.conf12
-rw-r--r--mkspecs/unsupported/qws/integrity-arm-cxarm/qplatformdefs.h42
-rw-r--r--mkspecs/unsupported/qws/integrity-ppc-cxppc/qmake.conf12
-rw-r--r--mkspecs/unsupported/qws/integrity-ppc-cxppc/qplatformdefs.h42
-rw-r--r--mkspecs/win32-g++/qmake.conf2
-rw-r--r--qmake/Makefile.unix9
-rw-r--r--qmake/Makefile.win328
-rw-r--r--qmake/Makefile.win32-g++7
-rw-r--r--qmake/Makefile.win32-g++-sh8
-rw-r--r--qmake/generators/integrity/gbuild.cpp442
-rw-r--r--qmake/generators/integrity/gbuild.h74
-rw-r--r--qmake/generators/metamakefile.cpp32
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp3
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp15
-rw-r--r--qmake/generators/unix/unixmake.cpp4
-rw-r--r--qmake/generators/unix/unixmake2.cpp2
-rw-r--r--qmake/generators/win32/mingw_make.cpp80
-rw-r--r--qmake/generators/win32/mingw_make.h4
-rw-r--r--qmake/generators/win32/winmakefile.cpp44
-rw-r--r--qmake/option.cpp2
-rw-r--r--qmake/option.h2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp13
-rw-r--r--src/3rdparty/phonon/qt7/videowidget.mm10
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri4
-rw-r--r--src/3rdparty/zlib/zlib.h2
-rw-r--r--src/corelib/animation/qabstractanimation.cpp11
-rw-r--r--src/corelib/animation/qabstractanimation.h6
-rw-r--r--src/corelib/arch/arch.pri2
-rw-r--r--src/corelib/arch/integrity/arch.pri3
-rw-r--r--src/corelib/arch/qatomic_arch.h4
-rw-r--r--src/corelib/arch/qatomic_armv5.h4
-rw-r--r--src/corelib/arch/qatomic_armv7.h2
-rw-r--r--src/corelib/arch/qatomic_integrity.h289
-rw-r--r--src/corelib/codecs/qtextcodec.cpp6
-rw-r--r--src/corelib/concurrent/qfutureinterface.cpp9
-rw-r--r--src/corelib/concurrent/qfutureinterface_p.h5
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qconfig-minimal-system-dependencies.h2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qglobal.h187
-rw-r--r--src/corelib/global/qnaclunimplemented.cpp2
-rw-r--r--src/corelib/global/qnaclunimplemented.h2
-rw-r--r--src/corelib/global/qnamespace.h7
-rw-r--r--src/corelib/global/qnamespace.qdoc41
-rw-r--r--src/corelib/io/io.pri4
-rw-r--r--src/corelib/io/qdir_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_mac.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine_symbian.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp10
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp2
-rw-r--r--src/corelib/io/qfilesystementry.cpp2
-rw-r--r--src/corelib/io/qfilesystementry_p.h2
-rw-r--r--src/corelib/io/qfilesystemiterator_p.h2
-rw-r--r--src/corelib/io/qfilesystemiterator_symbian.cpp2
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp2
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp2
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp8
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp14
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h10
-rw-r--r--src/corelib/io/qprocess_unix.cpp4
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/kernel/kernel.pri16
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h16
-rw-r--r--src/corelib/kernel/qcrashhandler.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp5
-rw-r--r--src/corelib/kernel/qeventloop.cpp5
-rw-r--r--src/corelib/kernel/qobject.h8
-rw-r--r--src/corelib/kernel/qsystemerror.cpp2
-rw-r--r--src/corelib/kernel/qsystemerror_p.h2
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/plugin/plugin.pri4
-rw-r--r--src/corelib/plugin/qelfparser_p.cpp2
-rw-r--r--src/corelib/plugin/qelfparser_p.h2
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp4
-rw-r--r--src/corelib/thread/qmutex.h9
-rw-r--r--src/corelib/thread/qthread_p.h2
-rw-r--r--src/corelib/thread/qthread_unix.cpp55
-rw-r--r--src/corelib/thread/qthread_win.cpp5
-rw-r--r--src/corelib/thread/thread.pri4
-rw-r--r--src/corelib/tools/qchar.cpp4
-rw-r--r--src/corelib/tools/qscopedvaluerollback.cpp84
-rw-r--r--src/corelib/tools/qscopedvaluerollback.h81
-rw-r--r--src/corelib/tools/qshareddata.h4
-rw-r--r--src/corelib/tools/tools.pri8
-rw-r--r--src/dbus/qdbusdemarshaller.cpp21
-rw-r--r--src/dbus/qdbusmetaobject.cpp21
-rw-r--r--src/dbus/qdbusxmlparser.cpp53
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp4
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver_p.h2
-rw-r--r--src/declarative/debugger/qdeclarativedebugserverconnection_p.h2
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p.h2
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp97
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp25
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp23
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp143
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h8
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp605
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h17
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp190
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h54
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp551
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h16
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp40
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea_p_p.h7
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp120
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h15
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h30
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp280
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp211
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h9
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp317
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h18
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h27
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp11
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp34
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp49
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h1
-rw-r--r--src/declarative/qml/qdeclarativecustomparser.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp18
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp31
-rw-r--r--src/declarative/qml/qdeclarativelist.cpp1
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeparser.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp2
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp35
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp1
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp66
-rw-r--r--src/declarative/qml/qperformancetimer.cpp2
-rw-r--r--src/declarative/qml/qperformancetimer_p.h2
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp10
-rw-r--r--src/declarative/util/qdeclarativeanimation_p_p.h3
-rw-r--r--src/declarative/util/qdeclarativeapplication.cpp2
-rw-r--r--src/declarative/util/qdeclarativeapplication_p.h2
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp14
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp2
-rw-r--r--src/declarative/util/qdeclarativepropertymap.cpp15
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp170
-rw-r--r--src/gui/dialogs/qfiledialog.cpp1
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp6
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp1
-rw-r--r--src/gui/embedded/embedded.pri16
-rw-r--r--src/gui/embedded/qkbddriverfactory_qws.cpp8
-rw-r--r--src/gui/embedded/qkbdintegrity_qws.cpp197
-rw-r--r--src/gui/embedded/qkbdintegrity_qws.h81
-rw-r--r--src/gui/embedded/qmousedriverfactory_qws.cpp8
-rw-r--r--src/gui/embedded/qmouseintegrity_qws.cpp271
-rw-r--r--src/gui/embedded/qmouseintegrity_qws.h82
-rw-r--r--src/gui/embedded/qscreen_qws.h3
-rw-r--r--src/gui/embedded/qscreendriverfactory_qws.cpp8
-rw-r--r--src/gui/embedded/qscreenintegrityfb_qws.cpp405
-rw-r--r--src/gui/embedded/qscreenintegrityfb_qws.h83
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h1
-rw-r--r--src/gui/graphicsview/qgridlayoutengine.cpp2
-rw-r--r--src/gui/image/image.pri15
-rw-r--r--src/gui/image/qnativeimagehandleprovider_p.h (renamed from src/network/access/qnetworkaccessdatabackend_p.h)37
-rw-r--r--src/gui/image/qpixmap.cpp20
-rw-r--r--src/gui/image/qpixmap_blitter.cpp2
-rw-r--r--src/gui/image/qpixmap_blitter_p.h2
-rw-r--r--src/gui/image/qpixmap_raster.cpp3
-rw-r--r--src/gui/image/qpixmap_s60.cpp2
-rw-r--r--src/gui/image/qpixmapdata_p.h4
-rw-r--r--src/gui/image/qvolatileimage.cpp318
-rw-r--r--src/gui/image/qvolatileimage_p.h101
-rw-r--r--src/gui/image/qvolatileimagedata.cpp113
-rw-r--r--src/gui/image/qvolatileimagedata_p.h97
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp474
-rw-r--r--src/gui/image/qxpmhandler.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h11
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp250
-rw-r--r--src/gui/itemviews/qheaderview.cpp14
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp15
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.h1
-rw-r--r--src/gui/itemviews/qtreeview.cpp11
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/kernel/qapplication_qws.cpp5
-rw-r--r--src/gui/kernel/qapplication_s60.cpp142
-rw-r--r--src/gui/kernel/qapplication_x11.cpp31
-rw-r--r--src/gui/kernel/qcocoaintrospection_mac.mm2
-rw-r--r--src/gui/kernel/qcocoaintrospection_p.h2
-rw-r--r--src/gui/kernel/qcocoapanel_mac_p.h7
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h4
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm4
-rw-r--r--src/gui/kernel/qcocoawindow_mac_p.h7
-rw-r--r--src/gui/kernel/qcursor_mac.mm2
-rw-r--r--src/gui/kernel/qdesktopwidget_qpa_p.h2
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp162
-rw-r--r--src/gui/kernel/qevent.cpp76
-rw-r--r--src/gui/kernel/qevent.h9
-rw-r--r--src/gui/kernel/qevent_p.h8
-rw-r--r--src/gui/kernel/qeventdispatcher_glib_qpa.cpp2
-rw-r--r--src/gui/kernel/qeventdispatcher_glib_qpa_p.h2
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm68
-rw-r--r--src/gui/kernel/qeventdispatcher_qpa.cpp2
-rw-r--r--src/gui/kernel/qeventdispatcher_qpa_p.h2
-rw-r--r--src/gui/kernel/qkeymapper_p.h1
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp32
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.h2
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformeventloopintegration_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformeventloopintegration_qpa.h2
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.h2
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h2
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_qpa_p.h2
-rw-r--r--src/gui/kernel/qplatformintegrationplugin_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformintegrationplugin_qpa.h2
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.h2
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.h2
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.h2
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm7
-rw-r--r--src/gui/kernel/qt_s60_p.h89
-rw-r--r--src/gui/kernel/qwidget.cpp27
-rw-r--r--src/gui/kernel/qwidget_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp61
-rw-r--r--src/gui/kernel/qwidget_x11.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.h2
-rw-r--r--src/gui/math3d/qgenericmatrix.h6
-rw-r--r--src/gui/math3d/qmatrix4x4.h6
-rw-r--r--src/gui/math3d/qvector2d.cpp5
-rw-r--r--src/gui/math3d/qvector3d.cpp5
-rw-r--r--src/gui/math3d/qvector4d.cpp5
-rw-r--r--src/gui/painting/qbackingstore.cpp5
-rw-r--r--src/gui/painting/qbackingstore_p.h3
-rw-r--r--src/gui/painting/qblendfunctions.cpp2
-rw-r--r--src/gui/painting/qblittable.cpp2
-rw-r--r--src/gui/painting/qblittable_p.h2
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd.cpp4
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h4
-rw-r--r--src/gui/painting/qgraphicssystem.cpp5
-rw-r--r--src/gui/painting/qgraphicssystem_p.h2
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp1
-rw-r--r--src/gui/painting/qpaintengine_blitter.cpp2
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp15
-rw-r--r--src/gui/painting/qpaintengine_s60.cpp21
-rw-r--r--src/gui/painting/qpainterpath.cpp2
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp2
-rw-r--r--src/gui/painting/qprinterinfo_p.h2
-rw-r--r--src/gui/painting/qstroker.cpp40
-rw-r--r--src/gui/painting/qunifiedtoolbarsurface_mac.cpp2
-rw-r--r--src/gui/painting/qunifiedtoolbarsurface_mac_p.h2
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp11
-rw-r--r--src/gui/s60framework/qs60mainappui.h1
-rw-r--r--src/gui/s60framework/qs60maindocument.cpp20
-rw-r--r--src/gui/statemachine/qguistatemachine.cpp1
-rw-r--r--src/gui/styles/qmacstyle_mac.mm7
-rw-r--r--src/gui/styles/qs60style.cpp7
-rw-r--r--src/gui/styles/qs60style_s60.cpp26
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--src/gui/styles/qstylesheetstyle_default.cpp2
-rw-r--r--src/gui/text/qcssparser.cpp44
-rw-r--r--src/gui/text/qcssparser_p.h3
-rw-r--r--src/gui/text/qfont.cpp3
-rw-r--r--src/gui/text/qfont_qpa.cpp2
-rw-r--r--src/gui/text/qfontdatabase.cpp6
-rw-r--r--src/gui/text/qfontdatabase.h1
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp33
-rw-r--r--src/gui/text/qfontengine_coretext.mm5
-rw-r--r--src/gui/text/qfontengine_coretext_p.h2
-rw-r--r--src/gui/text/qfontengine_mac_p.h2
-rw-r--r--src/gui/text/qfontengine_qpa.cpp2
-rw-r--r--src/gui/text/qfontengine_qpa_p.h2
-rw-r--r--src/gui/text/qfontengine_qws.cpp51
-rw-r--r--src/gui/text/qglyphs.cpp2
-rw-r--r--src/gui/text/qglyphs.h2
-rw-r--r--src/gui/text/qglyphs_p.h2
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.h2
-rw-r--r--src/gui/text/qtextcontrol.cpp133
-rw-r--r--src/gui/text/qtextcontrol_p_p.h20
-rw-r--r--src/gui/text/qtextengine.cpp18
-rw-r--r--src/gui/text/qtextengine_mac.cpp5
-rw-r--r--src/gui/text/qtextobject.cpp2
-rw-r--r--src/gui/util/qflickgesture.cpp2
-rw-r--r--src/gui/util/qflickgesture_p.h2
-rw-r--r--src/gui/util/qscroller.cpp2
-rw-r--r--src/gui/util/qscroller.h2
-rw-r--r--src/gui/util/qscroller_mac.mm2
-rw-r--r--src/gui/util/qscroller_p.h2
-rw-r--r--src/gui/util/qscrollerproperties.cpp2
-rw-r--r--src/gui/util/qscrollerproperties.h2
-rw-r--r--src/gui/util/qscrollerproperties_p.h2
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp8
-rw-r--r--src/gui/widgets/qeffects.cpp29
-rw-r--r--src/gui/widgets/qlinecontrol.cpp11
-rw-r--r--src/gui/widgets/qlinecontrol_p.h1
-rw-r--r--src/gui/widgets/qmdiarea.cpp79
-rw-r--r--src/gui/widgets/qmdiarea.h12
-rw-r--r--src/gui/widgets/qmdiarea_p.h4
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
-rw-r--r--src/gui/widgets/qsizegrip.cpp4
-rw-r--r--src/gui/widgets/qtoolbarlayout.cpp8
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp2
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp4
-rw-r--r--src/multimedia/audio/qaudiooutput_symbian_p.cpp2
-rw-r--r--src/network/access/access.pri8
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp6
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp37
-rw-r--r--src/network/access/qhttpnetworkreply.cpp6
-rw-r--r--src/network/access/qhttpnetworkreply_p.h1
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp518
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h285
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager.cpp297
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager_p.h107
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp22
-rw-r--r--src/network/access/qnetworkaccessbackend_p.h15
-rw-r--r--src/network/access/qnetworkaccessfilebackend.cpp2
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp795
-rw-r--r--src/network/access/qnetworkaccesshttpbackend_p.h43
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp267
-rw-r--r--src/network/access/qnetworkaccessmanager.h2
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h10
-rw-r--r--src/network/access/qnetworkcookie.cpp21
-rw-r--r--src/network/access/qnetworkdiskcache.cpp2
-rw-r--r--src/network/access/qnetworkreplydataimpl.cpp2
-rw-r--r--src/network/access/qnetworkreplydataimpl_p.h2
-rw-r--r--src/network/access/qnetworkreplyfileimpl.cpp48
-rw-r--r--src/network/access/qnetworkreplyfileimpl_p.h8
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp59
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h3
-rw-r--r--src/network/access/qnetworkrequest.cpp7
-rw-r--r--src/network/access/qnetworkrequest.h4
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp20
-rw-r--r--src/network/bearer/qnetworksession.cpp4
-rw-r--r--src/network/bearer/qnetworksession.h5
-rw-r--r--src/network/bearer/qsharednetworksession.cpp2
-rw-r--r--src/network/bearer/qsharednetworksession_p.h2
-rw-r--r--src/network/kernel/kernel.pri1
-rw-r--r--src/network/kernel/qnetworkinterface_symbian.cpp2
-rw-r--r--src/network/socket/qabstractsocket.cpp11
-rw-r--r--src/network/socket/qhttpsocketengine.cpp5
-rw-r--r--src/network/socket/qlocalsocket.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp25
-rw-r--r--src/network/socket/socket.pri10
-rw-r--r--src/network/ssl/qsslsocket.cpp42
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp35
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp3
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h1
-rw-r--r--src/network/ssl/qsslsocket_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qglshadercache_meego_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qglshadercache_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp4
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qgl_qpa.cpp2
-rw-r--r--src/opengl/qglfunctions.cpp2
-rw-r--r--src/opengl/qglfunctions.h2
-rw-r--r--src/opengl/qglpixelbuffer_stub.cpp2
-rw-r--r--src/opengl/qgraphicssystem_gl.cpp12
-rw-r--r--src/opengl/qpixmapdata_gl.cpp2
-rw-r--r--src/opengl/qwindowsurface_gl.cpp4
-rw-r--r--src/opengl/util/meego/main.cpp2
-rw-r--r--src/openvg/qpaintengine_vg.cpp57
-rw-r--r--src/openvg/qpaintengine_vg_p.h2
-rw-r--r--src/openvg/qpixmapdata_vg.cpp177
-rw-r--r--src/openvg/qpixmapdata_vg_p.h26
-rw-r--r--src/openvg/qvg_symbian.cpp182
-rw-r--r--src/openvg/qvgfontglyphcache_p.h2
-rw-r--r--src/openvg/qvgimagepool.cpp15
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp8
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp5
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp12
-rw-r--r--src/plugins/generic/tslib/main.cpp2
-rw-r--r--src/plugins/generic/tslib/qtslib.cpp2
-rw-r--r--src/plugins/generic/tslib/qtslib.h2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp5
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp46
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h1
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.cpp2
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.h2
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.cpp2
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.h2
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.cpp2
-rw-r--r--src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.h2
-rw-r--r--src/plugins/graphicssystems/meego/dithering.cpp147
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp7
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.h1
-rw-r--r--src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp21
-rw-r--r--src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h7
-rw-r--r--src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp18
-rw-r--r--src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h2
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbblitter.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbblitter.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbconvenience.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbconvenience.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbglcontext.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbglcontext.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindowsurface.h2
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.cpp2
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.h2
-rw-r--r--src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp2
-rw-r--r--src/plugins/platforms/eglconvenience/qeglplatformcontext.h2
-rw-r--r--src/plugins/platforms/eglfs/main.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindowsurface.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindowsurface.h2
-rw-r--r--src/plugins/platforms/fb_base/fb_base.cpp2
-rw-r--r--src/plugins/platforms/fb_base/fb_base.h2
-rw-r--r--src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp2
-rw-r--r--src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.h2
-rw-r--r--src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp2
-rw-r--r--src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h2
-rw-r--r--src/plugins/platforms/fontdatabases/genericunix/qgenericunixfontdatabase.h2
-rw-r--r--src/plugins/platforms/minimal/main.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.h2
-rw-r--r--src/plugins/platforms/minimal/qminimalwindowsurface.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalwindowsurface.h2
-rw-r--r--src/plugins/platforms/openkode/main.cpp2
-rw-r--r--src/plugins/platforms/openkode/openkodekeytranslator.h2
-rw-r--r--src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp2
-rw-r--r--src/plugins/platforms/openkode/qopenkodeeventloopintegration.h2
-rw-r--r--src/plugins/platforms/openkode/qopenkodeintegration.cpp2
-rw-r--r--src/plugins/platforms/openkode/qopenkodeintegration.h2
-rw-r--r--src/plugins/platforms/openkode/qopenkodewindow.cpp2
-rw-r--r--src/plugins/platforms/openkode/qopenkodewindow.h2
-rw-r--r--src/plugins/platforms/openkode/shaders/frag.glslf2
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/plugins/qmltooling/qmltooling.pro (renamed from src/plugins/qmldebugging/qmldebugging.pro)0
-rw-r--r--src/plugins/qmltooling/tcpserver/qtcpserverconnection.cpp (renamed from src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp)2
-rw-r--r--src/plugins/qmltooling/tcpserver/qtcpserverconnection.h (renamed from src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h)2
-rw-r--r--src/plugins/qmltooling/tcpserver/tcpserver.pro (renamed from src/plugins/qmldebugging/tcpserver/tcpserver.pro)4
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri6
-rw-r--r--src/qbase.pri2
-rw-r--r--src/s60installs/bwins/QtCoreu.def6
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def53
-rw-r--r--src/s60installs/bwins/QtGuiu.def57
-rw-r--r--src/s60installs/bwins/QtOpenGLu.def131
-rw-r--r--src/s60installs/bwins/QtOpenVGu.def7
-rw-r--r--src/s60installs/bwins/QtTestu.def89
-rw-r--r--src/s60installs/eabi/QtCoreu.def5
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def47
-rw-r--r--src/s60installs/eabi/QtGuiu.def63
-rw-r--r--src/s60installs/eabi/QtOpenGLu.def32
-rw-r--r--src/s60installs/eabi/QtOpenVGu.def3
-rw-r--r--src/s60installs/eabi/QtTestu.def94
-rw-r--r--src/s60installs/s60installs.pro19
-rw-r--r--src/script/api/qscriptcontext.cpp10
-rw-r--r--src/script/api/qscriptcontextinfo.cpp10
-rw-r--r--src/script/api/qscriptengine.cpp35
-rw-r--r--src/script/api/qscriptprogram.cpp1
-rw-r--r--src/script/api/qscriptvalue.cpp17
-rw-r--r--src/script/script.pro6
-rw-r--r--src/sql/models/qsqltablemodel.cpp4
-rw-r--r--src/sql/models/qsqltablemodel_p.h2
-rw-r--r--src/src.pro3
-rw-r--r--src/testlib/qbenchmark_p.h4
-rw-r--r--src/testlib/qtestcase.cpp53
-rw-r--r--src/testlib/qtestlog_p.h2
-rw-r--r--src/testlib/qtestresult_p.h2
-rw-r--r--src/testlib/qtesttable_p.h2
-rw-r--r--src/tools/moc/main.cpp10
-rw-r--r--src/tools/moc/moc.cpp5
-rw-r--r--src/tools/moc/parser.cpp6
-rw-r--r--src/tools/moc/parser.h4
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp38
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.h4
-rw-r--r--tests/arthur/baselineserver/src/main.cpp2
-rw-r--r--tests/arthur/baselineserver/src/report.cpp27
-rw-r--r--tests/arthur/baselineserver/src/report.h5
-rw-r--r--tests/arthur/common/baselineprotocol.cpp4
-rw-r--r--tests/arthur/common/baselineprotocol.h2
-rw-r--r--tests/arthur/common/lookup3.cpp2
-rw-r--r--tests/arthur/common/qbaselinetest.cpp2
-rw-r--r--tests/arthur/common/qbaselinetest.h2
-rw-r--r--tests/auto/baselineexample/baselineexample.pro2
-rw-r--r--tests/auto/baselineexample/tst_baselineexample.cpp2
-rw-r--r--tests/auto/corelib.pro1
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/fill.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/margins.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp211
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp49
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/Double.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp51
-rw-r--r--tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp40
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml33
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp29
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp34
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml4
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/mirroring.qml43
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp391
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml54
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp267
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml26
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml42
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp287
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml21
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml13
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml6
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml5
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp64
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml24
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp125
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml41
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml6
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp78
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp34
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp122
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml10
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp118
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/navigation.qml1
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp630
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp713
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp52
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp23
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.pngbin0 -> 641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml69
-rw-r--r--tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp2
-rw-r--r--tests/auto/gui.pro4
-rw-r--r--tests/auto/lancelot/lancelot.pro8
-rw-r--r--tests/auto/lancelot/tst_lancelot.cpp2
-rw-r--r--tests/auto/mediaobject/dummy/dummy.pro2
-rw-r--r--tests/auto/moc/tst_moc.cpp152
-rw-r--r--tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro6
-rw-r--r--tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp237
-rw-r--r--tests/auto/network.pro2
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp2
-rw-r--r--tests/auto/other.pro3
-rw-r--r--tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp2
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp2
-rw-r--r--tests/auto/qclipboard/tst_qclipboard.cpp2
-rw-r--r--tests/auto/qdbusinterface/tst_qdbusinterface.cpp44
-rw-r--r--tests/auto/qdbusmarshall/test/test.pro3
-rw-r--r--tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp210
-rw-r--r--tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp13
-rw-r--r--tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp5
-rw-r--r--tests/auto/qfileopenevent/qfileopenevent.pro2
-rw-r--r--tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp72
-rw-r--r--tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro10
-rw-r--r--tests/auto/qfileopenevent/test/test.pro7
-rw-r--r--tests/auto/qfileopenevent/test/tst_qfileopenevent.cpp362
-rw-r--r--tests/auto/qfilesystementry/tst_qfilesystementry.cpp2
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp6
-rw-r--r--tests/auto/qfont/tst_qfont.cpp7
-rw-r--r--tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp12
-rw-r--r--tests/auto/qglfunctions/tst_qglfunctions.cpp2
-rw-r--r--tests/auto/qglyphs/tst_qglyphs.cpp2
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp112
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp31
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp37
-rw-r--r--tests/auto/qimagereader/images/corrupt-pixel-count.xpm11
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp3
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp32
-rw-r--r--tests/auto/qmdiarea/tst_qmdiarea.cpp73
-rw-r--r--tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp24
-rw-r--r--tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp6
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp137
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp22
-rw-r--r--tests/auto/qpixmap/qpixmap.pro1
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp106
-rw-r--r--tests/auto/qscopedvaluerollback/qscopedvaluerollback.pro4
-rw-r--r--tests/auto/qscopedvaluerollback/tst_qscopedvaluerollback.cpp203
-rw-r--r--tests/auto/qscriptclass/tst_qscriptclass.cpp4
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp12
-rw-r--r--tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp6
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp78
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp51
-rw-r--r--tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp2
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp2
-rw-r--r--tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp2
-rw-r--r--tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp7
-rw-r--r--tests/auto/qscriptjstestsuite/expect_fail.txt198
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro2
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.qrc6
-rw-r--r--tests/auto/qscriptjstestsuite/skip.txt9
-rw-r--r--tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp819
-rw-r--r--tests/auto/qscriptv8testsuite/abstracttestsuite.cpp481
-rw-r--r--tests/auto/qscriptv8testsuite/abstracttestsuite.h125
-rw-r--r--tests/auto/qscriptv8testsuite/abstracttestsuite.pri4
-rw-r--r--tests/auto/qscriptv8testsuite/expect_fail.txt16
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro1
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc2
-rw-r--r--tests/auto/qscriptv8testsuite/skip.txt17
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp366
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp15
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/testgenerator.h2
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp2
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h2
-rw-r--r--tests/auto/qscroller/tst_qscroller.cpp2
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp57
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp21
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp8
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro36
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp225
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro36
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp226
-rw-r--r--tests/auto/qstringref/tst_qstringref.cpp2
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp18
-rw-r--r--tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp5
-rw-r--r--tests/auto/qtextblock/tst_qtextblock.cpp7
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp13
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp25
-rw-r--r--tests/auto/qthread/tst_qthread.cpp16
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp8
-rw-r--r--tests/auto/qvolatileimage/qvolatileimage.pro7
-rw-r--r--tests/auto/qvolatileimage/tst_qvolatileimage.cpp403
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp2
-rw-r--r--tests/benchmarks/corelib/corelib.pro3
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp2
-rw-r--r--tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp2
-rw-r--r--tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp13
-rw-r--r--tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp2
-rw-r--r--tests/benchmarks/script/script.pro4
-rw-r--r--tests/benchmarks/script/sunspider/tst_sunspider.cpp4
-rw-r--r--tests/benchmarks/script/v8/tst_v8.cpp6
-rwxr-xr-xtests/manual/mkspecs/test.sh2
-rw-r--r--tools/assistant/tools/assistant/doc/assistant.qdocconf2
-rw-r--r--tools/assistant/tools/assistant/globalactions.cpp2
-rw-r--r--tools/assistant/tools/assistant/globalactions.h2
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp2
-rw-r--r--tools/assistant/tools/assistant/openpagesmanager.cpp2
-rw-r--r--tools/assistant/tools/assistant/openpagesmanager.h2
-rw-r--r--tools/assistant/tools/assistant/openpagesmodel.cpp2
-rw-r--r--tools/assistant/tools/assistant/openpagesmodel.h2
-rw-r--r--tools/assistant/tools/assistant/openpagesswitcher.cpp2
-rw-r--r--tools/assistant/tools/assistant/openpagesswitcher.h2
-rw-r--r--tools/assistant/tools/assistant/openpageswidget.cpp2
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp1
-rw-r--r--tools/designer/src/components/propertyeditor/propertyeditor.cpp4
-rw-r--r--tools/designer/src/components/signalsloteditor/signalslot_utils.cpp7
-rw-r--r--tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp8
-rw-r--r--tools/designer/src/components/taskmenu/button_taskmenu.cpp2
-rw-r--r--tools/designer/src/designer/qdesigner_formwindow.cpp1
-rw-r--r--tools/designer/src/designer/qdesigner_workbench.cpp4
-rw-r--r--tools/designer/src/lib/shared/grid.cpp20
-rw-r--r--tools/doxygen/config/footer.html2
-rw-r--r--tools/qdoc3/cppcodemarker.cpp2
-rw-r--r--tools/qdoc3/doc/files/qt.qdocconf8
-rw-r--r--tools/qdoc3/doc/qdoc-manual.qdocconf2
-rw-r--r--tools/qdoc3/jscodemarker.cpp2
-rw-r--r--tools/qdoc3/qmlcodemarker.cpp2
-rw-r--r--tools/qdoc3/qmlcodeparser.cpp2
-rw-r--r--tools/qdoc3/qmlmarkupvisitor.cpp2
-rw-r--r--tools/qdoc3/qmlmarkupvisitor.h2
-rw-r--r--tools/qdoc3/qmlvisitor.cpp2
-rw-r--r--tools/qdoc3/test/carbide-eclipse-integration.qdocconf2
-rw-r--r--tools/qdoc3/test/jambi.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-project.qdocconf10
-rw-r--r--tools/qdoc3/test/standalone-eclipse-integration.qdocconf2
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp2
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.cpp12
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.h1
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp2
-rw-r--r--tools/qml/qml.pri12
-rw-r--r--tools/qml/qml.pro4
-rw-r--r--tools/runonphone/main.cpp33
-rw-r--r--tools/shared/symbian/epocroot.cpp5
-rwxr-xr-xtranslations/assistant_cs.ts2
-rw-r--r--translations/assistant_sl.ts2
-rwxr-xr-xtranslations/designer_cs.ts2
-rwxr-xr-xtranslations/linguist_cs.ts4
-rw-r--r--translations/linguist_sl.ts2
-rwxr-xr-xtranslations/qt_cs.ts4
-rw-r--r--translations/qt_gl.ts4
-rw-r--r--translations/qtconfig_sl.ts2
-rw-r--r--util/integrity/qt.bod111
-rw-r--r--util/qlalr/doc/qlalr.qdocconf2
836 files changed, 22611 insertions, 4867 deletions
diff --git a/.gitignore b/.gitignore
index d446680..462f8e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -249,3 +249,13 @@ src/network/lib
src/xml/lib/
.pc/
+
+# INTEGRITY generated files
+*.gpj
+*.int
+*.ael
+*.dla
+*.dnm
+*.dep
+*.map
+work
diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl
index a90877e..02f4f0d 100755
--- a/bin/elf2e32_qtwrapper.pl
+++ b/bin/elf2e32_qtwrapper.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#############################################################################
##
-## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/config.profiles/symbian/headerexport b/config.profiles/symbian/headerexport
index d9f99e5..e59979c 100644
--- a/config.profiles/symbian/headerexport
+++ b/config.profiles/symbian/headerexport
@@ -48,7 +48,6 @@ my %modules = ( # path to module name map
"QtDesigner" => "$basedir/tools/designer/src/lib",
"QtUiTools" => "$basedir/tools/designer/src/uitools",
"QtDBus" => "$basedir/src/dbus",
-# "QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore", // :TODO:disabled since QtWebKit built separately, better logic needed here.
"phonon" => "$basedir/src/phonon",
"QtMultimedia" => "$basedir/src/multimedia",
"QtMeeGoGraphicsSystemHelper" => "$basedir/tools/qmeegographicssystemhelper",
@@ -61,22 +60,12 @@ my %moduleheaders = ( # restrict the module headers to those found in relative p
#$modules{"QtCore"} .= ";$basedir/mkspecs/" . $ENV{"MKSPEC"} if defined $ENV{"MKSPEC"};
# global variables (modified by options)
-my $module = 0;
-my $showonly = 0;
-my $quiet = 0;
-my $remove_stale = 1;
my $force_win = 0;
-my $force_relative = 0;
my $check_includes = 0;
-my $copy_headers = 0;
my $create_uic_class_map = 1;
-my $create_private_headers = 1;
-my $oneway = 0;
my @modules_to_sync ;
-$force_relative = 1 if ( -d "/System/Library/Frameworks" );
my $out_basedir = $basedir;
$out_basedir =~ s=\\=/=g;
-my $out_subdir = 'include';
# functions ----------------------------------------------------------
@@ -90,17 +79,8 @@ my $out_subdir = 'include';
sub showUsage
{
print "$0 usage:\n";
- print " -copy Copy headers instead of include-fwd(default: " . ($copy_headers ? "yes" : "no") . ")\n";
- print " -remove-stale Removes stale headers (default: " . ($remove_stale ? "yes" : "no") . ")\n";
- print " -relative Force relative symlinks (default: " . ($force_relative ? "yes" : "no") . ")\n";
print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n";
- print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n";
print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n";
- print " -outsubdir <DIR> Target subdir under outdir (default: $out_subdir)\n";
- print " -public Create only public headers (default: " . ($create_private_headers ? "no" : "yes") . ")\n";
- print " -oneway Don't sync back from outdir (default: " . ($oneway ? "yes" : "no") . ")\n";
- print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n";
- print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR> Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n";
print " -help This help\n";
exit 0;
}
@@ -331,7 +311,7 @@ sub syncHeader {
unless(-e $header) {
my $header_dir = dirname($header);
- mkpath $header_dir, !$quiet;
+ mkpath $header_dir;
#write it
my $iheader_out = fixPaths($iheader, $header_dir);
@@ -459,7 +439,7 @@ sub copyFile
close I;
my $ifile_dir = dirname($ifile);
- mkpath $ifile_dir, !$quiet unless(-e $ifile_dir);
+ mkpath $ifile_dir unless(-e $ifile_dir);
open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)";
local $/;
binmode O;
@@ -469,36 +449,6 @@ sub copyFile
}
######################################################################
-# Syntax: symlinkFile(file, ifile)
-# Params: file, string, filename to create "symlink" for
-# ifile, string, destination name of symlink
-#
-# Purpose: File is symlinked to ifile (or copied if filesystem doesn't
-# support symlink).
-# Returns: 1 on success, else 0.
-######################################################################
-sub symlinkFile
-{
- my ($file,$ifile) = @_;
-
- if ($isunix) {
- print "symlink created for $file " unless $quiet;
- if ( $force_relative && ($ifile =~ /^$basedir/)) {
- my $t = getcwd();
- my $c = -1;
- my $p = "../";
- $t =~ s-^$basedir/--;
- $p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 );
- $file =~ s-^$basedir/-$p-;
- print " ($file)\n" unless $quiet;
- }
- print "\n" unless $quiet;
- return symlink($file, $ifile);
- }
- return copyFile($file, $ifile);
-}
-
-######################################################################
# Syntax: findFiles(dir, match, descend)
# Params: dir, string, directory to search for name
# match, string, regular expression to match in dir
@@ -550,9 +500,6 @@ while ( @ARGV ) {
if ($arg eq "-h" || $arg eq "-help" || $arg eq "?") {
$var = "show_help";
$val = "yes";
- } elsif($arg eq "-copy") {
- $var = "copy";
- $val = "yes";
} elsif($arg eq "-o" || $arg eq "-outdir") {
$var = "output";
$val = shift @ARGV;
@@ -567,96 +514,28 @@ while ( @ARGV ) {
} elsif($arg eq "-inc") {
$var = "output";
$val = shift @ARGV;
- } elsif($arg eq "-module") {
- $var = "module";
- $val = shift @ARGV;
- } elsif($arg eq "-separate-module") {
- $var = "separate-module";
- $val = shift @ARGV;
- } elsif($arg eq "-show") {
- $var = "showonly";
- $val = "yes";
- } elsif($arg eq "-quiet") {
- $var = "quiet";
- $val = "yes";
} elsif($arg eq "-base-dir") {
# skip, it's been dealt with at the top of the file
shift @ARGV;
next;
- } elsif("$arg" eq "-outsubdir") {
- $var = "outsubdir";
- $val = shift @ARGV;
- } elsif("$arg" eq "-public") {
- $var = "public";
- $val = "yes";
- } elsif("$arg" eq "-oneway") {
- $var = "oneway";
- $val = "yes";
}
#do something
if(!$var || $var eq "show_help") {
print "Unknown option: $arg\n\n" if(!$var);
showUsage();
- } elsif ($var eq "copy") {
- if($val eq "yes") {
- $copy_headers++;
- } elsif($showonly) {
- $copy_headers--;
- }
- } elsif ($var eq "showonly") {
- if($val eq "yes") {
- $showonly++;
- } elsif($showonly) {
- $showonly--;
- }
- } elsif ($var eq "quiet") {
- if($val eq "yes") {
- $quiet++;
- } elsif($quiet) {
- $quiet--;
- }
} elsif ($var eq "check-includes") {
if($val eq "yes") {
$check_includes++;
} elsif($check_includes) {
$check_includes--;
}
- } elsif ($var eq "remove-stale") {
- if($val eq "yes") {
- $remove_stale++;
- } elsif($remove_stale) {
- $remove_stale--;
- }
} elsif ($var eq "windows") {
if($val eq "yes") {
$force_win++;
} elsif($force_win) {
$force_win--;
}
- } elsif ($var eq "relative") {
- if($val eq "yes") {
- $force_relative++;
- } elsif($force_relative) {
- $force_relative--;
- }
- } elsif ("$var" eq "public") {
- $create_private_headers = ("$val" eq "yes" ? 0 : 1);
- } elsif ("$var" eq "oneway") {
- $oneway = ("$val" eq "yes" ? 1 : 0);
- } elsif ("$var" eq "outsubdir") {
- $out_subdir = $val;
- } elsif ($var eq "module") {
- print "module :$val:\n" unless $quiet;
- die "No such module: $val" unless(defined $modules{$val});
- push @modules_to_sync, $val;
- } elsif ($var eq "separate-module") {
- my ($module, $prodir, $headerdir) = split(/:/, $val);
- $modules{$module} = $prodir;
- push @modules_to_sync, $module;
- $moduleheaders{$module} = $headerdir;
- $create_uic_class_map = 0;
- $create_private_headers = 0;
} elsif ($var eq "output") {
my $outdir = $val;
if(checkRelative($outdir)) {
@@ -675,8 +554,8 @@ while ( @ARGV ) {
$isunix = checkUnix; #cache checkUnix
# create path
-mkpath "$out_basedir/include", !$quiet;
-mkpath "$out_basedir/$out_subdir/Qt", !$quiet;
+mkpath "$out_basedir/include";
+mkpath "$out_basedir/mw/Qt";
my @ignore_headers = ();
my $class_lib_map_contents = "";
@@ -734,41 +613,39 @@ foreach my $lib (@modules_to_sync) {
}
#remove the old files
- if($remove_stale) {
- my @subdirs = ("$out_basedir/$out_subdir/$lib");
- foreach my $subdir (@subdirs) {
- if (opendir DIR, $subdir) {
- while(my $t = readdir(DIR)) {
- my $file = "$subdir/$t";
- if(-d $file) {
- push @subdirs, $file unless($t eq "." || $t eq "..");
- } else {
- my @files = ($file);
- #push @files, "$out_basedir/$out_subdir/Qt/$t" if(-e "$out_basedir/$out_subdir/Qt/$t");
- foreach my $file (@files) {
- my $remove_file = 0;
- if(open(F, "<$file")) {
- while(my $line = <F>) {
- chomp $line;
- if($line =~ /^\#include \"([^\"]*)\"$/) {
- my $include = $1;
- $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/");
- $remove_file = 1 unless(-e $include);
- } else {
- $remove_file = 0;
- last;
- }
+ my @subdirs = ("$out_basedir/mw/$lib");
+ foreach my $subdir (@subdirs) {
+ if (opendir DIR, $subdir) {
+ while(my $t = readdir(DIR)) {
+ my $file = "$subdir/$t";
+ if(-d $file) {
+ push @subdirs, $file unless($t eq "." || $t eq "..");
+ } else {
+ my @files = ($file);
+ #push @files, "$out_basedir/mw/Qt/$t" if(-e "$out_basedir/mw/Qt/$t");
+ foreach my $file (@files) {
+ my $remove_file = 0;
+ if(open(F, "<$file")) {
+ while(my $line = <F>) {
+ chomp $line;
+ if($line =~ /^\#include \"([^\"]*)\"$/) {
+ my $include = $1;
+ $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/");
+ $remove_file = 1 unless(-e $include);
+ } else {
+ $remove_file = 0;
+ last;
}
- close(F);
- unlink $file if($remove_file);
}
+ close(F);
+ unlink $file if($remove_file);
}
}
}
- closedir DIR;
}
-
+ closedir DIR;
}
+
}
#create the new ones
@@ -813,91 +690,85 @@ foreach my $lib (@modules_to_sync) {
my $iheader = $subdir . "/" . $header;
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
my @classes = $public_header ? classNames($iheader) : ();
- if($showonly) {
- print "$header [$lib]\n";
- foreach(@classes) {
- print "SYMBOL: $_\n";
- }
- } else {
- #find out all the places it goes..
- my @headers;
- if ($public_header) {
- @headers = ( "$out_basedir/$out_subdir/$lib/$header" );
- # write forwarding headers to include/Qt
- if ($lib ne "phonon" && $subdir =~ /^$basedir\/src/) {
- my $file_name = "$out_basedir/$out_subdir/Qt/$header";
- my $file_op = '>';
- my $header_content = '';
- if (exists $colliding_headers{$file_name}) {
- $file_op = '>>';
- } else {
- $colliding_headers{$file_name} = 1;
- my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
- $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
- " #if defined(__GNUC__)\n" .
- " #warning \"$warning_msg\"\n" .
- " #elif defined(_MSC_VER)\n" .
- " #pragma message(\"WARNING: $warning_msg\")\n" .
- " #endif\n".
- "#endif\n\n";
- }
- $header_content .= '#include "' . "../$lib/$header" . "\"\n";
- open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n";
- print HEADERFILE $header_content;
- close HEADERFILE;
+ #find out all the places it goes..
+ my @headers;
+ if ($public_header) {
+ @headers = ( "$out_basedir/mw/$lib/$header" );
+
+ # write forwarding headers to include/Qt
+ if ($lib ne "phonon" && $subdir =~ /^$basedir\/src/) {
+ my $file_name = "$out_basedir/mw/Qt/$header";
+ my $file_op = '>';
+ my $header_content = '';
+ if (exists $colliding_headers{$file_name}) {
+ $file_op = '>>';
+ } else {
+ $colliding_headers{$file_name} = 1;
+ my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
+ $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
+ " #if defined(__GNUC__)\n" .
+ " #warning \"$warning_msg\"\n" .
+ " #elif defined(_MSC_VER)\n" .
+ " #pragma message(\"WARNING: $warning_msg\")\n" .
+ " #endif\n".
+ "#endif\n\n";
}
+ $header_content .= '#include "' . "../$lib/$header" . "\"\n";
+ open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n";
+ print HEADERFILE $header_content;
+ close HEADERFILE;
+ }
- foreach my $full_class (@classes) {
- my $header_base = basename($header);
- # Strip namespaces:
- my $class = $full_class;
- $class =~ s/^.*:://;
+ foreach my $full_class (@classes) {
+ my $header_base = basename($header);
+ # Strip namespaces:
+ my $class = $full_class;
+ $class =~ s/^.*:://;
# if ($class =~ m/::/) {
# class =~ s,::,/,g;
# }
- $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n";
- $header_copies++ if(syncHeader("$out_basedir/$out_subdir/$lib/$class", "$out_basedir/$out_subdir/$lib/$header", 0));
+ $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n";
+ $header_copies++ if(syncHeader("$out_basedir/mw/$lib/$class", "$out_basedir/mw/$lib/$header", 0));
- # KDE-Compat headers for Phonon
- if ($lib eq "phonon") {
- $header_copies++ if (syncHeader("$out_basedir/$out_subdir/phonon_compat/Phonon/$class", "$out_basedir/$out_subdir/$lib/$header", 0));
- }
+ # KDE-Compat headers for Phonon
+ if ($lib eq "phonon") {
+ $header_copies++ if (syncHeader("$out_basedir/mw/phonon_compat/Phonon/$class", "$out_basedir/mw/$lib/$header", 0));
}
- } elsif ($create_private_headers) {
- @headers = ( "$out_basedir/$out_subdir/$lib/private/$header" );
- }
- foreach(@headers) { #sync them
- $header_copies++ if(syncHeader($_, $iheader, $copy_headers));
}
+ } else {
+ @headers = ( "$out_basedir/mw/$lib/private/$header" );
+ }
+ foreach(@headers) { #sync them
+ $header_copies++ if(syncHeader($_, $iheader, 1));
+ }
- if($public_header) {
- #put it into the master file
- $master_contents .= "#include \"$public_header\"\n" if(shouldMasterInclude($iheader));
+ if($public_header) {
+ #put it into the master file
+ $master_contents .= "#include \"$public_header\"\n" if(shouldMasterInclude($iheader));
- #deal with the install directives
- if($public_header) {
- my $pri_install_iheader = fixPaths($iheader, $current_dir);
- foreach my $class (@classes) {
- # Strip namespaces:
- $class =~ s/^.*:://;
+ #deal with the install directives
+ if($public_header) {
+ my $pri_install_iheader = fixPaths($iheader, $current_dir);
+ foreach my $class (@classes) {
+ # Strip namespaces:
+ $class =~ s/^.*:://;
# if ($class =~ m/::/) {
# $class =~ s,::,/,g;
# }
- my $class_header = fixPaths("$out_basedir/$out_subdir/$lib/$class",
- $current_dir) . " ";
- $pri_install_classes .= $class_header
- unless($pri_install_classes =~ $class_header);
- }
- $pri_install_files.= "$pri_install_iheader ";;
+ my $class_header = fixPaths("$out_basedir/mw/$lib/$class",
+ $current_dir) . " ";
+ $pri_install_classes .= $class_header
+ unless($pri_install_classes =~ $class_header);
}
+ $pri_install_files.= "$pri_install_iheader ";;
}
- else {
- my $pri_install_iheader = fixPaths($iheader, $current_dir);
- $pri_install_pfiles.= "$pri_install_iheader ";;
- }
}
- print "header created for $iheader ($header_copies)\n" if($header_copies > 0 && !$quiet);
+ else {
+ my $pri_install_iheader = fixPaths($iheader, $current_dir);
+ $pri_install_pfiles.= "$pri_install_iheader ";;
+ }
+ print "header created for $iheader ($header_copies)\n" if($header_copies > 0);
}
}
}
@@ -906,59 +777,57 @@ foreach my $lib (@modules_to_sync) {
# close the master include:
$master_contents .= "#endif\n";
- unless($showonly) {
- my @master_includes;
- push @master_includes, "$out_basedir/$out_subdir/$lib/$lib";
- push @master_includes, "$out_basedir/$out_subdir/phonon_compat/Phonon/Phonon" if ($lib eq "phonon");
- foreach my $master_include (@master_includes) {
- #generate the "master" include file
- my @tmp = split(/;/,$modules{$lib});
- $pri_install_files .= fixPaths($master_include, $tmp[0]) . " "; #get the master file installed too
- if($master_include && -e $master_include) {
- open MASTERINCLUDE, "<$master_include";
- local $/;
- binmode MASTERINCLUDE;
- my $oldmaster = <MASTERINCLUDE>;
- close MASTERINCLUDE;
- $oldmaster =~ s/\r//g; # remove \r's , so comparison is ok on all platforms
- $master_include = 0 if($oldmaster eq $master_contents);
- }
- if($master_include && $master_contents) {
- my $master_dir = dirname($master_include);
- mkpath $master_dir, !$quiet;
- print "header (master) created for $lib\n" unless $quiet;
- open MASTERINCLUDE, ">$master_include";
- print MASTERINCLUDE $master_contents;
- close MASTERINCLUDE;
- }
- }
-
- #handle the headers.pri for each module
- my $headers_pri_contents = "";
- $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n";
- $headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
- $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
- my $headers_pri_file = "$out_basedir/$out_subdir/$lib/headers.pri";
- if(-e $headers_pri_file) {
- open HEADERS_PRI_FILE, "<$headers_pri_file";
+ my @master_includes;
+ push @master_includes, "$out_basedir/mw/$lib/$lib";
+ push @master_includes, "$out_basedir/mw/phonon_compat/Phonon/Phonon" if ($lib eq "phonon");
+ foreach my $master_include (@master_includes) {
+ #generate the "master" include file
+ my @tmp = split(/;/,$modules{$lib});
+ $pri_install_files .= fixPaths($master_include, $tmp[0]) . " "; #get the master file installed too
+ if($master_include && -e $master_include) {
+ open MASTERINCLUDE, "<$master_include";
local $/;
- binmode HEADERS_PRI_FILE;
- my $old_headers_pri_contents = <HEADERS_PRI_FILE>;
- close HEADERS_PRI_FILE;
- $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms
- $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents);
+ binmode MASTERINCLUDE;
+ my $oldmaster = <MASTERINCLUDE>;
+ close MASTERINCLUDE;
+ $oldmaster =~ s/\r//g; # remove \r's , so comparison is ok on all platforms
+ $master_include = 0 if($oldmaster eq $master_contents);
}
- if($headers_pri_file && $master_contents) {
- my $headers_pri_dir = dirname($headers_pri_file);
- mkpath $headers_pri_dir, !$quiet;
- print "headers.pri file created for $lib\n" unless $quiet;
- open HEADERS_PRI_FILE, ">$headers_pri_file";
- print HEADERS_PRI_FILE $headers_pri_contents;
- close HEADERS_PRI_FILE;
+ if($master_include && $master_contents) {
+ my $master_dir = dirname($master_include);
+ mkpath $master_dir;
+ print "header (master) created for $lib\n";
+ open MASTERINCLUDE, ">$master_include";
+ print MASTERINCLUDE $master_contents;
+ close MASTERINCLUDE;
}
}
+
+ #handle the headers.pri for each module
+ my $headers_pri_contents = "";
+ $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n";
+ $headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
+ $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
+ my $headers_pri_file = "$out_basedir/mw/$lib/headers.pri";
+ if(-e $headers_pri_file) {
+ open HEADERS_PRI_FILE, "<$headers_pri_file";
+ local $/;
+ binmode HEADERS_PRI_FILE;
+ my $old_headers_pri_contents = <HEADERS_PRI_FILE>;
+ close HEADERS_PRI_FILE;
+ $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms
+ $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents);
+ }
+ if($headers_pri_file && $master_contents) {
+ my $headers_pri_dir = dirname($headers_pri_file);
+ mkpath $headers_pri_dir;
+ print "headers.pri file created for $lib\n";
+ open HEADERS_PRI_FILE, ">$headers_pri_file";
+ print HEADERS_PRI_FILE $headers_pri_contents;
+ close HEADERS_PRI_FILE;
+ }
}
-unless($showonly || !$create_uic_class_map) {
+unless(!$create_uic_class_map) {
my $class_lib_map = "$out_basedir/src/tools/uic/qclass_lib_map.h";
if(-e $class_lib_map) {
open CLASS_LIB_MAP, "<$class_lib_map";
@@ -971,7 +840,7 @@ unless($showonly || !$create_uic_class_map) {
}
if($class_lib_map) {
my $class_lib_map_dir = dirname($class_lib_map);
- mkpath $class_lib_map_dir, !$quiet;
+ mkpath $class_lib_map_dir;
open CLASS_LIB_MAP, ">$class_lib_map";
print CLASS_LIB_MAP $class_lib_map_contents;
close CLASS_LIB_MAP;
@@ -1054,7 +923,7 @@ if($check_includes) {
}
if($include) {
for my $trylib (keys(%modules)) {
- if(-e "$out_basedir/$out_subdir/$trylib/$include") {
+ if(-e "$out_basedir/mw/$trylib/$include") {
print "WARNING: $iheader includes $include when it should include $trylib/$include\n";
}
}
diff --git a/config.profiles/symbian/package_definition.xml b/config.profiles/symbian/package_definition.xml
index f0c6652..1c3c1d3 100644
--- a/config.profiles/symbian/package_definition.xml
+++ b/config.profiles/symbian/package_definition.xml
@@ -5,7 +5,7 @@
<package id="qt" name="Qt" levels="tool mw app">
<collection id="qtconf" name="Qt Config" level="tool">
<component id="qt_deviceconfiguration" name="Qt Device Configuration" class="config tool" filter="s60,qt_tools" introduced="^2">
- <unit bldFile="src/config.profiles/symbian"/>
+ <unit bldFile="config.profiles/symbian"/>
</component>
</collection>
<collection id="qt_info" name="Qt Info" level="mw">
@@ -16,7 +16,7 @@
<collection id="qtlocalization" name="Qt Localization" level="app">
<component id="qtlocalization_build" name="Qt localization Build" introduced="^2" filter="s60">
- <unit bldFile="src/config.profiles/symbian/translations_symbian" qt:proFile="translations.pro"/>
+ <unit bldFile="config.profiles/symbian/translations_symbian" qt:proFile="translations.pro"/>
</component>
</collection>
diff --git a/config.profiles/symbian/qtconfig.flm b/config.profiles/symbian/qtconfig.flm
index 03f860f..93410f0 100644
--- a/config.profiles/symbian/qtconfig.flm
+++ b/config.profiles/symbian/qtconfig.flm
@@ -60,7 +60,7 @@ $(SOURCEDIR)/qmake$(DOTEXE): $(EXTENSION_ROOT)/$(QT_ROOT)/$(CONFIGURE_APP)
$(call endrule,qtconf)
$(call startrule,headerexport) \
cd $(EXTENSION_ROOT)/$(QT_ROOT)/config.profiles/symbian && \
- perl headerexport -base-dir $(EXTENSION_ROOT)/$(QT_ROOT) -copy -oneway -outdir $(EPOCROOT)/epoc32/include/ -outsubdir mw
+ perl headerexport -base-dir $(EXTENSION_ROOT)/$(QT_ROOT) -outdir $(EPOCROOT)/epoc32/include/
$(call endrule,headerexport)
$(call startrule,mkspecexport) \
$(GNUCP) -R $(EXTENSION_ROOT)/$(QT_ROOT)/mkspecs $(MKSPECDIR)
diff --git a/config.profiles/symbian/translations/qt_fr_symbian.ts b/config.profiles/symbian/translations/qt_fr_symbian.ts
index c0b0699..e10f963 100644
--- a/config.profiles/symbian/translations/qt_fr_symbian.ts
+++ b/config.profiles/symbian/translations/qt_fr_symbian.ts
@@ -2660,8 +2660,8 @@ Voulez-vous quand même le supprimer ?</translation>
<translation>&lt;h3&gt;Présentation de Qt&lt;/h3&gt;&lt;p&gt;Ce programme utilise Qt version %1.&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation>&lt;p&gt;Qt est une boîte à outils C++ pour le développement d’applications multiplateformes.&lt;/p&gt;&lt;p&gt;Qt fournit une portabilité source unique pour MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux et les principales variantes commerciales d’Unix. Qt est également disponible pour appareils intégrés tels que Qt pour Embedded Linux et Qt pour Windows CE.&lt;/p&gt;&lt;p&gt;Il existe trois options de licence différentes conçues pour s’adapter aux besoins d’utilisateurs variés.&lt;/p&gt;&lt;p&gt;Qt concédée sous notre contrat de licence commerciale est destinée au développement de logiciels propriétaires/commerciaux dont vous ne souhaitez pas partager le code source avec des tiers ou qui ne peuvent se conformer aux termes de la LGPL GNU version 2.1 ou GPL GNU version 3.0.&lt;/p&gt;&lt;p&gt;Qt concédée sous la LGPL GNU version 2.1 est destinée au développement d’applications Qt (propriétaires ou source libre) à condition que vous vous conformiez aux conditions générales de la LGPL GNU version 2.1.&lt;/p&gt;&lt;p&gt;Qt concédée sous la licence publique générale GNU version 3.0 est destinée au développement d’applications Qt lorsque vous souhaitez utiliser ces applications avec d’autres logiciels soumis aux termes de la GPL GNU version 3.0 ou lorsque vous acceptez les termes de la GPL GNU version 3.0.&lt;/p&gt;&lt;p&gt;Veuillez consulter&lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; pour un aperçu des concessions de licences Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation et/ou ses filiales.&lt;/p&gt;&lt;p&gt;Qt est un produit Nokia. Voir &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; pour de plus amples informations.&lt;/p&gt;</translation>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;Qt est une boîte à outils C++ pour le développement d’applications multiplateformes.&lt;/p&gt;&lt;p&gt;Qt fournit une portabilité source unique pour MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux et les principales variantes commerciales d’Unix. Qt est également disponible pour appareils intégrés tels que Qt pour Embedded Linux et Qt pour Windows CE.&lt;/p&gt;&lt;p&gt;Il existe trois options de licence différentes conçues pour s’adapter aux besoins d’utilisateurs variés.&lt;/p&gt;&lt;p&gt;Qt concédée sous notre contrat de licence commerciale est destinée au développement de logiciels propriétaires/commerciaux dont vous ne souhaitez pas partager le code source avec des tiers ou qui ne peuvent se conformer aux termes de la LGPL GNU version 2.1 ou GPL GNU version 3.0.&lt;/p&gt;&lt;p&gt;Qt concédée sous la LGPL GNU version 2.1 est destinée au développement d’applications Qt (propriétaires ou source libre) à condition que vous vous conformiez aux conditions générales de la LGPL GNU version 2.1.&lt;/p&gt;&lt;p&gt;Qt concédée sous la licence publique générale GNU version 3.0 est destinée au développement d’applications Qt lorsque vous souhaitez utiliser ces applications avec d’autres logiciels soumis aux termes de la GPL GNU version 3.0 ou lorsque vous acceptez les termes de la GPL GNU version 3.0.&lt;/p&gt;&lt;p&gt;Veuillez consulter&lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; pour un aperçu des concessions de licences Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation et/ou ses filiales.&lt;/p&gt;&lt;p&gt;Qt est un produit Nokia. Voir &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; pour de plus amples informations.&lt;/p&gt;</translation>
</message>
<message>
<source>About Qt</source>
diff --git a/config.profiles/symbian/translations/qt_pl_symbian.ts b/config.profiles/symbian/translations/qt_pl_symbian.ts
index 4208c55..e3902ae 100644
--- a/config.profiles/symbian/translations/qt_pl_symbian.ts
+++ b/config.profiles/symbian/translations/qt_pl_symbian.ts
@@ -2664,8 +2664,8 @@ Czy na pewno chcesz go skasować?</translation>
<translation>&lt;h3&gt;Informacje o Qt&lt;/h3&gt;&lt;p&gt; Ten program używa Qt w wersji %1.&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation>&lt;p&gt;Qt jest zestawem narzędzi programistycznych dedykowanym dla języka C++. Służy on do opracowywania aplikacji międzyplatformowych.&lt;/p&gt;&lt;p&gt;Qt umożliwia jednoźródłowe przenoszenie między systemami MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux i wszystkimi głównymi wersjami komercyjnymi systemu Unix. Środowisko Qt jest dostępne dla urządzeń wbudowanych opartych na systemie Linux ( Qt dla wbudowanego systemu Linux) oraz Windows CE.&lt;/p&gt;&lt;p&gt;Zestaw Qt jest dostępny w trzech różnych opcjach licencjonowania stworzonych w celu zadowolenia naszych różnych użytkowników.&lt;/p&gt;&lt;p&gt;Qt podlegający licencji zgodnie z naszą komercyjną umową licencyjną jest odpowiedni do opracowywania oprogramowań własnościowych/komercyjnych, dzięki czemu kod źródłowy nie jest udostępniany osobom trzecim. W przeciwnym razie zestaw Qt jest niezgodny z warunkami licencji GNU LGPL w wersji 2.1 lub GNU GPL w wersji 3.0.&lt;/p&gt;&lt;p&gt;Środowisko Qt objęte licencją GNU LGPL w wersji 2.1 nadaje się do tworzenia aplikacji Qt (własnościowych lub oprogramowań otwartych) tylko wtedy, gdy przestrzegane są warunki licencji GNU LGPL w wersji 2.1.&lt;/p&gt;&lt;p&gt;Qt objęty Powszechną Licencją Publiczną GNU w wersji 3.0 jest odpowiedni do opracowywania aplikacji QT, aby móc korzystać z aplikacji w połączeniu z oprogramowaniem podlegającym warunkom licencji GNU GPL w wersji 3.0 lub aby przestrzegać warunków licencji GNU GPL w wersji 3.0.&lt;/p&gt;&lt;p&gt;Więcej informacji na temat licencji Qt można znaleźć na stronie &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation i/lub oddziały firmy.&lt;/p&gt;&lt;p&gt;Qt jest produktem firmy Nokia. Dodatkowe informacje znajdują się na stronie &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; &lt;/p&gt;</translation>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;Qt jest zestawem narzędzi programistycznych dedykowanym dla języka C++. Służy on do opracowywania aplikacji międzyplatformowych.&lt;/p&gt;&lt;p&gt;Qt umożliwia jednoźródłowe przenoszenie między systemami MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux i wszystkimi głównymi wersjami komercyjnymi systemu Unix. Środowisko Qt jest dostępne dla urządzeń wbudowanych opartych na systemie Linux ( Qt dla wbudowanego systemu Linux) oraz Windows CE.&lt;/p&gt;&lt;p&gt;Zestaw Qt jest dostępny w trzech różnych opcjach licencjonowania stworzonych w celu zadowolenia naszych różnych użytkowników.&lt;/p&gt;&lt;p&gt;Qt podlegający licencji zgodnie z naszą komercyjną umową licencyjną jest odpowiedni do opracowywania oprogramowań własnościowych/komercyjnych, dzięki czemu kod źródłowy nie jest udostępniany osobom trzecim. W przeciwnym razie zestaw Qt jest niezgodny z warunkami licencji GNU LGPL w wersji 2.1 lub GNU GPL w wersji 3.0.&lt;/p&gt;&lt;p&gt;Środowisko Qt objęte licencją GNU LGPL w wersji 2.1 nadaje się do tworzenia aplikacji Qt (własnościowych lub oprogramowań otwartych) tylko wtedy, gdy przestrzegane są warunki licencji GNU LGPL w wersji 2.1.&lt;/p&gt;&lt;p&gt;Qt objęty Powszechną Licencją Publiczną GNU w wersji 3.0 jest odpowiedni do opracowywania aplikacji QT, aby móc korzystać z aplikacji w połączeniu z oprogramowaniem podlegającym warunkom licencji GNU GPL w wersji 3.0 lub aby przestrzegać warunków licencji GNU GPL w wersji 3.0.&lt;/p&gt;&lt;p&gt;Więcej informacji na temat licencji Qt można znaleźć na stronie &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation i/lub oddziały firmy.&lt;/p&gt;&lt;p&gt;Qt jest produktem firmy Nokia. Dodatkowe informacje znajdują się na stronie &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; &lt;/p&gt;</translation>
</message>
<message>
<source>About Qt</source>
diff --git a/config.profiles/symbian/translations/qt_ru_symbian.ts b/config.profiles/symbian/translations/qt_ru_symbian.ts
index b7e69cb..08b201e 100644
--- a/config.profiles/symbian/translations/qt_ru_symbian.ts
+++ b/config.profiles/symbian/translations/qt_ru_symbian.ts
@@ -2661,8 +2661,8 @@ Do you want to delete it anyway?</source>
<translation>&lt;h3&gt;О Qt&lt;/h3&gt;&lt;p&gt;Данная программа использует Qt версии %1.&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation>&lt;p&gt;Qt - это инструментарий для разработки кроссплатформенных приложений на C++.&lt;/p&gt;&lt;p&gt;Qt предоставляет совместимость на уровне исходных текстов между MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux и всеми популярными коммерческими вариантами Unix. Также Qt доступна для встраиваемых устройств в виде Qt для Embedded Linux и Qt для Windows CE.&lt;/p&gt;&lt;p&gt;Qt доступна под тремя различными лицензиями, разработанными для удовлетворения различных требований.&lt;/p&gt;&lt;p&gt;Qt под нашей коммерческой лицензией предназначена для развития проприетарного/коммерческого программного обеспечения, когда Вы не желаете предоставлять исходные тексты третьим сторонам, или в случае невозможности принятия условий лицензий GNU LGPL версии 2.1 или GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU LGPL версии 2.1 предназначена для разработки программного обеспечения с открытыми исходными текстами или коммерческого программного обеспечения при соблюдении условий лицензии GNU LGPL версии 2.1.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU General Public License версии 3.0 предназначена для разработки программных приложений в тех случаях, когда Вы хотели бы использовать такие приложения в сочетании с программным обеспечением на условиях лицензии GNU GPL с версии 3.0 или если Вы готовы соблюдать условия лицензии GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Обратитесь к &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; для обзора лицензий Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Корпорация Nokia и/или её дочерние подразделения.&lt;/p&gt;&lt;p&gt;Qt - продукт компании Nokia. Обратитесь к &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; для получения дополнительной информации.&lt;/p&gt;</translation>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;Qt - это инструментарий для разработки кроссплатформенных приложений на C++.&lt;/p&gt;&lt;p&gt;Qt предоставляет совместимость на уровне исходных текстов между MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux и всеми популярными коммерческими вариантами Unix. Также Qt доступна для встраиваемых устройств в виде Qt для Embedded Linux и Qt для Windows CE.&lt;/p&gt;&lt;p&gt;Qt доступна под тремя различными лицензиями, разработанными для удовлетворения различных требований.&lt;/p&gt;&lt;p&gt;Qt под нашей коммерческой лицензией предназначена для развития проприетарного/коммерческого программного обеспечения, когда Вы не желаете предоставлять исходные тексты третьим сторонам, или в случае невозможности принятия условий лицензий GNU LGPL версии 2.1 или GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU LGPL версии 2.1 предназначена для разработки программного обеспечения с открытыми исходными текстами или коммерческого программного обеспечения при соблюдении условий лицензии GNU LGPL версии 2.1.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU General Public License версии 3.0 предназначена для разработки программных приложений в тех случаях, когда Вы хотели бы использовать такие приложения в сочетании с программным обеспечением на условиях лицензии GNU GPL с версии 3.0 или если Вы готовы соблюдать условия лицензии GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Обратитесь к &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; для обзора лицензий Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Корпорация Nokia и/или её дочерние подразделения.&lt;/p&gt;&lt;p&gt;Qt - продукт компании Nokia. Обратитесь к &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; для получения дополнительной информации.&lt;/p&gt;</translation>
</message>
<message>
<source>About Qt</source>
diff --git a/config.profiles/symbian/translations/qt_zh_cn_symbian.ts b/config.profiles/symbian/translations/qt_zh_cn_symbian.ts
index b1b9941..91ac2af 100644
--- a/config.profiles/symbian/translations/qt_zh_cn_symbian.ts
+++ b/config.profiles/symbian/translations/qt_zh_cn_symbian.ts
@@ -2662,7 +2662,7 @@ Do you want to delete it anyway?</source>
<translation>&lt;h3&gt;关于Qt&lt;/h3&gt;&lt;p&gt;此程序使用Qt版本%1。&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
<translation>&lt;p&gt;Qt是一个C++工具箱,用于跨平台应用程序开发。&lt;/p&gt;&lt;p&gt;Qt具有单一源跨可移植性,可跨越MS&amp;nbsp;Windows、Mac&amp;nbsp;OS&amp;nbsp;X、Linux和所有主要的商业Unix类平台进行移植。Qt还适用于嵌入式设备,如Qt for Embedded Linux和Qt for Windows CE。&lt;/p&gt;&lt;p&gt;Qt有三种不同许可方式,以满足各种用户需求。&lt;/p&gt;&lt;p&gt;假如您要开发专利/商业软件,但不希望与第三方共享任何源代码,或者无法符合GNU LGPL版本2.1或GNU GPL版本3.0的条款,则按照我们的商业许可证协议授权的Qt非常适用。&lt;/p&gt;&lt;p&gt;假如您能够符合GNU LGPL版本2.1的条款和条件,则按照GNU LGPL版本2.1授权的Qt非常适合开发Qt应用程序(专有或开放源码)。&lt;/p&gt;&lt;p&gt;假如在开发Qt应用程序过程中,您希望这类应用程序能与遵循GNU GPL版本3.0的软件合用,或者您愿意符合GNU GPL版本3.0条款,则按照GNU通用公共许可证版本3.0授权的Qt非常适用。&lt;/p&gt;&lt;p&gt;请参阅&lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt;了解Qt授权概况。&lt;/p&gt;&lt;p&gt;版权所有 (C) 2010 诺基亚公司和/或附属公司。&lt;/p&gt;&lt;p&gt;Qt是一款诺基亚产品。请参阅&lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt;了解详情。&lt;/p&gt;</translation>
</message>
<message>
diff --git a/config.profiles/symbian/translations/qt_zh_tw_symbian.ts b/config.profiles/symbian/translations/qt_zh_tw_symbian.ts
index 3b1fb51..c9eb563 100644
--- a/config.profiles/symbian/translations/qt_zh_tw_symbian.ts
+++ b/config.profiles/symbian/translations/qt_zh_tw_symbian.ts
@@ -2649,8 +2649,8 @@ Do you want to delete it anyway?</source>
<translation>&lt;h3&gt;關於Qt&lt;/h3&gt;&lt;p&gt;本程式使用Qt %1版。&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation>&lt;p&gt;Qt是一套應用於跨平台應用程式開發的C++工具集。&lt;/p&gt;&lt;p&gt;Qt提供橫跨MS&amp;nbsp;Windows、Mac&amp;nbsp;OS&amp;nbsp;X、Linux及各主要商業Unix系統的單一來源移植能力。Qt也提供適用於嵌入式裝置的版本,例如Qt for Embedded Linux和Qt for Windows CE。&lt;/p&gt;&lt;p&gt;針對不同使用者的需求,Qt有三種不同授權方式。&lt;/p&gt;&lt;p&gt;商業授權合約下的Qt授權適用於專利/商業軟體的開發,在這種情況中,您可能不想與第三方分享任何原始碼或無法遵從GNU LGPL 2.1版或GNU GPL 3.0版的條款。&lt;/p&gt;&lt;p&gt;GNU LGPL 2.1版下的Qt授權適用於開發Qt應用程式(專利或開放原始碼),您必須遵從GNU LGPL 2.1版的條款與條件。&lt;/p&gt;&lt;p&gt;GNU GPL 3.0版下的Qt授權適用於開發Qt應用程式,在這種情況中,您希望將此應用程式搭配基於GNU GPL 3.0版開發的軟體一起使用,或您樂意遵從GNU GPL 3.0版的條款。&lt;/p&gt;&lt;p&gt;請參閱&lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt;,此頁面對於Qt授權會有概略的介紹。&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 諾基亞公司及/或其子公司。&lt;/p&gt;&lt;p&gt;Qt是一項諾基亞產品。如需詳細資訊,請參閱&lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt;。&lt;/p&gt;</translation>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;Qt是一套應用於跨平台應用程式開發的C++工具集。&lt;/p&gt;&lt;p&gt;Qt提供橫跨MS&amp;nbsp;Windows、Mac&amp;nbsp;OS&amp;nbsp;X、Linux及各主要商業Unix系統的單一來源移植能力。Qt也提供適用於嵌入式裝置的版本,例如Qt for Embedded Linux和Qt for Windows CE。&lt;/p&gt;&lt;p&gt;針對不同使用者的需求,Qt有三種不同授權方式。&lt;/p&gt;&lt;p&gt;商業授權合約下的Qt授權適用於專利/商業軟體的開發,在這種情況中,您可能不想與第三方分享任何原始碼或無法遵從GNU LGPL 2.1版或GNU GPL 3.0版的條款。&lt;/p&gt;&lt;p&gt;GNU LGPL 2.1版下的Qt授權適用於開發Qt應用程式(專利或開放原始碼),您必須遵從GNU LGPL 2.1版的條款與條件。&lt;/p&gt;&lt;p&gt;GNU GPL 3.0版下的Qt授權適用於開發Qt應用程式,在這種情況中,您希望將此應用程式搭配基於GNU GPL 3.0版開發的軟體一起使用,或您樂意遵從GNU GPL 3.0版的條款。&lt;/p&gt;&lt;p&gt;請參閱&lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt;,此頁面對於Qt授權會有概略的介紹。&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 諾基亞公司及/或其子公司。&lt;/p&gt;&lt;p&gt;Qt是一項諾基亞產品。如需詳細資訊,請參閱&lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt;。&lt;/p&gt;</translation>
</message>
<message>
<source>About Qt</source>
diff --git a/config.tests/mac/coreservices/coreservices.mm b/config.tests/mac/coreservices/coreservices.mm
index 0091e49..c70802c 100644
--- a/config.tests/mac/coreservices/coreservices.mm
+++ b/config.tests/mac/coreservices/coreservices.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/config.tests/unix/opengldesktop/opengldesktop.cpp b/config.tests/unix/opengldesktop/opengldesktop.cpp
index 969767c..a3d8548 100644
--- a/config.tests/unix/opengldesktop/opengldesktop.cpp
+++ b/config.tests/unix/opengldesktop/opengldesktop.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/configure b/configure
index db17827..09ab545 100755
--- a/configure
+++ b/configure
@@ -728,6 +728,11 @@ if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
fi
+if [ -f "$relpath/src/gui/embedded/qscreenintegrityfb_qws.cpp" ]; then
+ CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} integrity"
+ CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} integrity"
+ CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} integrityfb"
+fi
CFG_ARCH=
CFG_HOST_ARCH=
@@ -6702,6 +6707,8 @@ if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto"
if [ $? != "0" ]; then
CFG_JAVASCRIPTCORE_JIT=no
fi
+ elif [ "$XPLATFORM" = "symbian-gcce" ]; then
+ CFG_JAVASCRIPTCORE_JIT=no
fi
fi
@@ -7407,11 +7414,11 @@ EOF
canBuildWebKit="no"
canBuildQtConcurrent="no"
;;
- symbian/*-gcce)
+ symbian-gcce)
canBuildWebKit="no"
canBuildQtConcurrent="no"
;;
- symbian/*-armcc)
+ symbian-armcc)
canBuildQtConcurrent="no"
;;
esac
@@ -7474,7 +7481,7 @@ else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
fi
-if [ "$CFG_WEBKIT" = "auto" ]; then
+if [ "$CFG_WEBKIT" != "no" ]; then
CFG_WEBKIT="$canBuildWebKit"
fi
diff --git a/demos/browser/networkaccessmanager.cpp b/demos/browser/networkaccessmanager.cpp
index 9e717bb..c63c0eb 100644
--- a/demos/browser/networkaccessmanager.cpp
+++ b/demos/browser/networkaccessmanager.cpp
@@ -64,7 +64,7 @@
NetworkAccessManager::NetworkAccessManager(QObject *parent)
: QNetworkAccessManager(parent),
requestFinishedCount(0), requestFinishedFromCacheCount(0), requestFinishedPipelinedCount(0),
- requestFinishedSecureCount(0)
+ requestFinishedSecureCount(0), requestFinishedDownloadBufferCount(0)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -106,14 +106,19 @@ void NetworkAccessManager::requestFinished(QNetworkReply *reply)
if (reply->attribute(QNetworkRequest::ConnectionEncryptedAttribute).toBool() == true)
requestFinishedSecureCount++;
+ if (reply->attribute(QNetworkRequest::DownloadBufferAttribute).isValid() == true)
+ requestFinishedDownloadBufferCount++;
+
if (requestFinishedCount % 10)
return;
double pctCached = (double(requestFinishedFromCacheCount) * 100.0/ double(requestFinishedCount));
double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount));
double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount));
+ double pctDownloadBuffer = (double(requestFinishedDownloadBufferCount) * 100.0/ double(requestFinishedCount));
+
#ifdef QT_DEBUG
- qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS]", requestFinishedCount, pctCached, pctPipelined, pctSecure);
+ qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS] [%3.2f%% Zerocopy]", requestFinishedCount, pctCached, pctPipelined, pctSecure, pctDownloadBuffer);
#endif
}
diff --git a/demos/browser/networkaccessmanager.h b/demos/browser/networkaccessmanager.h
index 76fc198..d6e6ede 100644
--- a/demos/browser/networkaccessmanager.h
+++ b/demos/browser/networkaccessmanager.h
@@ -60,6 +60,7 @@ private:
qint64 requestFinishedFromCacheCount;
qint64 requestFinishedPipelinedCount;
qint64 requestFinishedSecureCount;
+ qint64 requestFinishedDownloadBufferCount;
public slots:
void loadSettings();
diff --git a/dist/changes-4.7.2 b/dist/changes-4.7.2
index 17a066f..c7e0089 100644
--- a/dist/changes-4.7.2
+++ b/dist/changes-4.7.2
@@ -16,35 +16,48 @@ Qt Bug Tracker: http://bugreports.qt.nokia.com
Merge Request: http://qt.gitorious.org
****************************************************************************
-* General *
-****************************************************************************
-
-New features
-------------
-
- - SomeClass, SomeOtherClass
- * New classes for foo, bar and baz
-
-Optimizations
--------------
-
- - Optimized foo in QSomeClass
- * See list of Important Behavior Changes below
-
-
-****************************************************************************
* Library *
****************************************************************************
QtCore
------
+ - QMutex
+ * [QTBUG-16115] Fixed deadlock when calling tryLock repeatedly.
- QStateMachine
- * [QTBUG-14491] Fix compilation on AIX 5.3 with gcc.
+ * [QTBUG-14491] Fixed compilation on AIX 5.3 with gcc.
+ - QThread
+ * [QTBUG-15378] QThread::exec returaed immediately if QThread::exit had
+ been called when event loop was not running.
QtGui
-----
+ - Painting
+ * [QTBUG-14907] Fix OpenVG painting artifacts after restoreState().
+ * [QTBUG-15320] QPainter::drawRect crashed when drawing a null QRectF
+ with OpenGL.
+ * [QTBUG-15693] Prevent crash in drawhelper code when the cpu has MMXEXT
+ but no SSE.
+ - QDoubleValidator
+ * [QTBUG-14935] With some locales, QDoubleValidator would not accept "C"
+ locale valid numbers.
+ - QFileDialog
+ * [QTBUG-17298] QFileDialog::getOpenFileNames didn't show any file.
+ - QGraphicsView
+ * [QTBUG-16063] Fix precision loss when querying micro focus rectangle
+ in QGraphicsView.
+ - QPainterPath
+ * [QTBUG-16377] Prevent QPainterPath::connectPath() returning incorrect
+ path, which caused OpenGL paint engine to crash.
+ - QTableWidget
+ * [QTBUG-15973] Resizinag a QTableWidget column where a cell contains a
+ QProgressBar made it crash.
+ - QTextDocument
+ * [QTBUG-15777] Fxied crash in QTextDocument::markContentsDirty.
+ - QTextLayout
+ * [QTBUG-15823] Fixed crash in QTextLayout when drawing full width
+ selection spanning multiple QTextLine's.
- QWidget
* [QTMOBILITY-645] Send WinIdChange event when winId is set to zero.
The window handle of a native widget may be set to zero in two
@@ -52,27 +65,32 @@ QtGui
widget destruction. Previously, no WinIdChange event was sent in
either of these cases; now, it is sent in both cases.
-QtDBus
-------
-
- - foo
- * bar
-
QtNetwork
---------
- - foo
- * bar
+ - Bearer Management
+ * [QTBUG-15276] Fixed possible crash when parsing new connection.
+ - QUrl
+ * [QTBUG-16425] QUrl::setUrl() did not call detach().
-QtOpenGL
---------
+QtQuick
+-------
- - foo
- * bar
+ - [QTBUG-14374] Fixed broken alignment of rich text.
+ - [QTBUG-14727] QML Text element did not play nice with transformations.
+ - [QTBUG-14761] Fixed memory leak in QDeclarativeComponent.
+ - [QTBUG-14830] Fixed crash when adjusting width inside onWidthChanged.
+ - [QTBUG-15710] Ensure header is considered when positioning content with
+ snapping.
+ - [QTBUG-16365] When using a PathView with a VisualDataModel which in turn
+ used a Tree model (DirModel, for example), nothing was shown.
+ - [QTBUG-16769] QML BorderImage failed if .sci file contained a URL.
QtScript
--------
+ - General
+ * [QTBUG-17166] Fix ScopeChainNode memory leak in JavaScriptCore.
- QScriptContext
* [QTBUG-17137] Fix crash when generating backtrace involving a
built-in (ECMA) function.
@@ -94,56 +112,55 @@ QtScript
QtSql
-----
- - foo
- * bar
-
-QtXml
------
-
- - foo
- * bar
-
-Qt Plugins
-----------
-
- - foo
- * bar
-
-Third party components
-----------------------
-
- - Updated foo to version 2.3.9.
-
- - Updated bar to the latest version from baz.org.
+ - [QTBUG-14132] Fix errors in Oracle (xe) stored procedures with bind
+ variables.
+ - [QTBUG-14831] Fix regression in dynamic sorting of a QSortFilterProxyModel
+ on a QSqlTableModel with OnManualSubmit.
+ - [QTBUG-17076] Fix plugins/sqldrivers/oci compile error when using
+ QT_NAMESPACE.
****************************************************************************
* Platform Specific Changes *
****************************************************************************
-Qt for Unix (X11 and Mac OS X)
-------------------------------
-
- -
-
Qt for Linux/X11
----------------
- -
+ - [QTBUG-15008] Fix broken prefix setting in configure when EPOCROOT shell
+ variable is set.
Qt for Windows
--------------
- -
+ - QtQuick
+ * [QTBUG-16885] QDeclarativeEngine::addImportPath() did not work if the
+ drive letter is in lowercase.
+ * [QTBUG-17360] Make sure $QTDIR/plugins/qmldebugging/tcpserver.dll is
+ found in windows release builds.
Qt for Mac OS X
---------------
- -
+ - [QTBUG-13772] Returning form fullscreen mode causes assertion failure.
+ - [QTBUG-14023] Added missing plugins to debug-libs package.
+ - [QTBUG-14420] Switching from an application with undocked widgets hid the
+ application.
+ - [QTBUG-15638] Fixed incorrect QComboBox drop-down menu Z-ordering.
+ - [QTBUG-15666] Fixed crash when closing QFontDialog::getFont() dialog before
+ its event loop finished.
+ - [QTBUG-16279] Fixed deadlock in QSyntaxHighlighter::highlightBlock.
Qt for Symbian
--------------
+ - Multimedia
+ * [QTBUG-17040] Prevent menu and native title pane area popping up when
+ setting fullscreen mode off during video playback.
+ - Packaging changes
+ * [QTBUG-17399] Remove sqlite3 from Qt SIS for S60 3.2 and 5.0 to allow
+ Nokia Content Signing, which doesn't permit sis files to have other
+ sis files embedded inside.
- Paging changes
* [QT-3503] Remove PAGED keyword from all Qt-based binaries for
MMP-based build systems (abld, SBSv2 (a.k.a. Raptor)).
@@ -159,65 +176,92 @@ Qt for Symbian
appropriate types of paging rather than being forced by the binary
(which may be deployed to several different devices with different
characteristics).
-
- Phonon MMF backend
* [QTBUG-11436] Added a MediaObject property which allows the client to
specify which Internet Access Point should be used for streaming.
-
- - QNetworkProxyFactory
- * [QTBUG-13857] Added systemProxyForQuery() for Symbian, allowing
- network proxies configured on the device to be used by applications.
-
- QApplication
- * [QTBUG-15915] Fix crash when creating more than one QApplication in single test case.
-
+ * [QTBUG-15915] Fix crash when creating more than one QApplication in single
+ test case.
+ * [QTBUG-16065] QApplication object with QApplication::GuiServer type caused
+ crash on Symbian devices.
- QDesktopWidget
* [QTBUG-16095] Resize event for QDesktopWidget was sent too early.
-
- - QFileDialog
- * [QTBUG-16204] Fix using QFileDialog statics in Symbian.
-
- QDialog
* [QTBUG-16277] Fix fullscreen/Maximized dialog misplacement in Symbian.
-
- - QSystemSemaphore
- * [QTBUG-16615] Fix QSystemSemaphore handle management issues in Symbian.
-
+ * [QTBUG-16110] QMessageBox softkeys were dimmed when application returned
+ to foreground.
+ - QEventDispatcherSymbian
+ * [QTBUG-16380] Fix leaking of RTimer handles.
+ - QFileDialog
+ * [QTBUG-16204] Fix using QFileDialog statics in Symbian.
+ - QFontDatabase
+ * [QTBUG-16514] Avoid collision of application fonts.
+ - QGraphicsView
+ * [QTBUG-16932] Fix rendering errors on QGraphicsView with OpenVG engine.
- QLineEdit
* [QTBUG-16238] Fix one character displacement for cursor in line edits.
-
- - QtScript
- * [QTBUG-16685] Fix crash in JavaScript stack allocator.
- * [QTBUG-15847] Add compiler optimizations.
- * [QTBUG-14293] Enhanced JavaScript heap allocator.
-
- qmake & mkspecs
* [QT-4193] Only add ICON for application projects in symbianpkgrules.pri
- * [QTBUG-13159] Allow pkg_prerules and pkg_postrules to be targeted to separate files.
- * [QTBUG-13367] Make default application deployment removable & added .flags modifier
- support for DEPLOYMENT items in Symbian.
+ * [QTBUG-13159] Allow pkg_prerules and pkg_postrules to be targeted to separate
+ files.
+ * [QTBUG-13367] Make default application deployment removable & added .flags
+ modifier support for DEPLOYMENT items in Symbian.
* [QTBUG-14280] Implement support for DEPLOYMENT.display_name in Symbian.
* [QTBUG-13917] Localize .loc and .pkg content based on TRANSLATIONS.
- * [QTBUG-15159] Use include(original mkspec) instead of copying of mkspec to default.
+ * [QTBUG-15159] Use include(original mkspec) instead of copying of mkspec to
+ default.
* [QTBUG-15393] Resolve EPOCROOT in qt.conf using same logic as in .pro.
* [QTBUG-15501] Fix symbian-mmp.conf include path.
- * [QTBUG-15539] Use parent class function to generate Makefile headers in Symbian.
- * [QTBUG-14472] Add NetworkServices capability automatically for network apps
+ * [QTBUG-15539] Use parent class function to generate Makefile headers.
+ * [QTBUG-14472] Add NetworkServices capability automatically for network apps.
* [QTBUG-14736] Add libinfix support for QML plugins in Symbian.
- * [QT-4375] Fix incorrect file name case for OpenGL libraries in symbian.conf.
- * [QTBUG-16172] Use relative include instead of absolute in default qmake.conf.
+ * [QT-4375] Fix incorrect file name case for OpenGL libraries in
+ symbian.conf.
+ * [QTBUG-16172] Use relative include instead of absolute in default
+ qmake.conf.
* [QTBUG-16221] Fix libinfixed usage in Symbian when def files are used.
* [QTBUG-16261] Fix infinite loop in qmake when reading malformed .ts files.
* [QTBUG-16298] Ignore static_and_shared in Symbian builds.
+ * [QTBUG-16477] Fix compile error when QT_NO_BEARERMANAGEMENT is defined.
* [QTBUG-13769] Generate freeze targets in Symbian.
- * [QTBUG-16691] Remove toolcheck from generic clean targets for symbian-sbsv2.
- * [QT-4476] Fixed UTF-8 application names in device application menu in Symbian.
+ * [QTBUG-16691] Remove toolcheck from generic clean targets for
+ symbian-sbsv2.
+ * [QT-4476] Fixed UTF-8 application names in device application menu.
* [QTBUG-16753] Improved QMAKE_POST_LINK support in symbian-sbsv2.
- * [QTBUG-16881] Fix QMAKE_POST_LINK in Symbian for targets with special characters.
- * [QTBUG-16888] No longer replace dash and dot in TARGET with underscore in Symbian.
+ * [QTBUG-16881] Fix QMAKE_POST_LINK for targets with special characters.
+ * [QTBUG-16888] No longer replace dash and dot in TARGET with underscore.
+ * [QTBUG-17187] Ensure that package generated against Symbian^3 SDK has no
+ Symbian^1 platforms as dependencies.
* Fix partial upgrade package UID for libinfixed Qt.
* Cleaned up sis_targets.prf.
-
+ - QNetworkProxyFactory
+ * [QTBUG-13857] Added systemProxyForQuery() for Symbian, allowing
+ network proxies configured on the device to be used by applications.
+ - QPaintEngine
+ * [QTBUG-16008] Fixed broken constant alpha blending on ARMV6.
+ * [QTBUG-16240] Fix blurry text in word-wrapped, center-aligned text items
+ with OpenVG.
+ - QSystemSemaphore
+ * [QTBUG-16615] Fix QSystemSemaphore handle management issues in Symbian.
+ - qtmain.lib
+ * [QTBUG-14735] Use qtmain.lib to provide entry point for all applications.
+ - QtQuick
+ * [QTBUG-15405] QML Plugins were not loaded when installed on different
+ drives.
+ - QtScript
+ * [QTBUG-14293] Enhanced JavaScript heap allocator.
+ * [QTBUG-15800] Creating QScriptEngine on the heap caused app crash.
+ * [QTBUG-15847] Add compiler optimizations.
+ * [QTBUG-16685] Fix crash in JavaScript stack allocator.
+ - QWidget
+ * [QTBUG-16578] In cases where the widget was created from the event loop
+ instead of main(), the middle three softkeys would not get the right
+ visibility and would leave a "hole" in the application where one could
+ see what was beneath it.
+ * [QT-4416, QTBUG-17288] On devices which lack support for transparency
+ in EGL surfaces, setting Qt::WA_TranslucentBackground on a widget
+ whose windowType() is Qt::Window causes that widget to be rendered
+ using the raster graphics system.
- Tool scripts
* [QTBUG-13886] Disallow patching capabilities of executables.
* [QTBUG-13891] Add Location as self signable capability in patch_capabilities.pl.
@@ -225,49 +269,10 @@ Qt for Symbian
* Fix epocroot handling in createpackage.pl script.
* Unify epocroot usage in createpackage and patch_capabilities scripts.
- - qtmain.lib
- * [QTBUG-14735] Use qtmain.lib to provide entry point for all Symbian applications.
-
- - QWidget
- * [QT-4416, QTBUG-17288] On devices which lack support for transparency
- in EGL surfaces, setting Qt::WA_TranslucentBackground on a widget
- whose windowType() is Qt::Window causes that widget to be rendered
- using the raster graphics system.
-
-Qt for Embedded Linux
----------------------
-
- -
-
-DirectFB
---------
-
- -
-
-Qt for Windows CE
------------------
-
- -
-
****************************************************************************
* Tools *
****************************************************************************
- - Designer
- * foo
-
- - qdoc3
- * bar
-
- - Linguist
- * baz
-
- qmake
* [QTBUG-14357] Make qmake to pass all UTF-8 characters unchanged through parser.
-****************************************************************************
-* Important Behavior Changes *
-****************************************************************************
-
- -
-
diff --git a/dist/changes-4.7.3 b/dist/changes-4.7.3
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dist/changes-4.7.3
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 316fe6b..f2ca0fd 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -68,9 +68,11 @@ the component. This function can take one or two arguments:
\o The first is the parent for the new item. Since graphical items will not appear on the scene without a parent, it is
recommended that you set the parent this way. However, if you wish to set the parent later you can safely pass \c null to
this function.
-\o The second is optional and is a script which assigns values to the item's properties during creation. This avoids warnings
- when certain properties have been bound to before they have been set by the code. Additionally, there are small performance
- benefits when instantiating objects in this way.
+\o The second is optional and is a map of property-value items that define initial any property values for the item.
+ Property values specified by this argument are applied to the object before its creation is finalized, avoiding
+ binding errors that may occur if particular properties must be initialized to enable other property bindings.
+ when certain properties have been bound to before they have been set by the code. Additionally, there are small
+ performance benefits when compared to defining property values and bindings after the object is created.
\endlist
Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 466b940..e2d9350 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -76,7 +76,7 @@ To see the QML elements listed by functional area, see the
\o \l {FocusScope} - Element that mediate keyboard focus changes
\o \l {Flickable} - Provides a surface that can be "flicked"
\o \l {Flipable} - Provides a surface that produces "flipping" effects
-\o \l {GestureArea} - Enables simple gesture handling
+\o \l {PinchArea} - Enables simple pinch gesture handling
\endlist
\section1 Positioners and Repeater
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index a287533..80b6e72 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -51,7 +51,7 @@ to either instantiating an object instance, or assigning a property a value.
QML relies heavily on Qt's meta object system and can only instantiate classes
that derive from QObject. For visual element types, this will usually mean a subclass
of QDeclarativeItem; for models used with the view elements, a subclass of QAbstractItemModel;
-and for abitrary objects with properties, a direct subclass of QObject.
+and for arbitrary objects with properties, a direct subclass of QObject.
The QML engine has no intrinsic knowledge of any class types. Instead the
programmer must register the C++ types with their corresponding QML names.
@@ -522,7 +522,7 @@ The \c {invite()} method is similarly available if it is declared as a slot.
\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
-The QML snippet shown above applies a property value source to the \c announcment property.
+The QML snippet shown above applies a property value source to the \c announcement property.
A property value source generates a value for a property that changes over time.
Property value sources are most commonly used to do animation. Rather than
@@ -562,7 +562,7 @@ assignment fails does the engine call the \l {QDeclarativePropertyValueSource::}
the type to also be used in contexts other than just as a value source.
\l {Extending QML - Property Value Source Example} shows the complete code used
-implement the \c HappyBirthdaySong property value source.
+to implement the \c HappyBirthdaySong property value source.
\section1 Property Binding
diff --git a/doc/src/declarative/qmlinuse.qdoc b/doc/src/declarative/qmlinuse.qdoc
index 7380ef5..131be1b 100644
--- a/doc/src/declarative/qmlinuse.qdoc
+++ b/doc/src/declarative/qmlinuse.qdoc
@@ -207,7 +207,7 @@
<li><a href="qml-flipable.html">Flipable Element</a> - The Flipable item provides a surface that can be flipped or reflected.</li>
<li><a href="qml-focuspanel.html">FocusPanel Element</a> - The FocusPanel item explicitly creates a focus panel.</li>
<li><a href="qml-focusscope.html">FocusScope Element</a> - The FocusScope object explicitly creates a focus scope for focus management.</li>
- <li><a href="qml-gesturearea.html">GestureArea Element</a> - The GestureArea item enables simple gesture handling.</li>
+ <li><a href="qml-pincharea.html">PinchArea Element</a> - The PinchArea item enables simple pinch gesture handling.</li>
<li><a href="qml-keynavigation.html">KeyNavigation Element</a> - The KeyNavigation attached property supports key navigation by arrow keys.</li>
<li><a href="qml-keys.html">Keys Element</a> - The Keys attached property provides key handling to Items.</li>
<li><a href="qml-mousearea.html">MouseArea Element</a> - The MouseArea item enables simple mouse handling.</li>
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index f4359f9..1a8ebd7 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -31,20 +31,33 @@
\section1 Qt 4.7.3 includes QtQuick 1.1
-QtQuick 1.1 is a minor feature update.
+QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.
\section2 PinchArea
PinchArea provides support for the common two finger pinch gesture.
+\section2 LayoutMirroring
+
+\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.
+
+\section2 Anchors
+
+Added the following property:
+\list
+\o \l {Item::}{anchors.mirrored}
+\endlist
+
\section2 Text
Added the following properties:
\list
-\o lineSpacing
-\o lineCount
-\o maximumLineCount
-\o truncated
+\o \l {Text::}{lineHeight}
+\o \l {Text::}{lineHeightMode}
+\o \l {Text::}{lineCount}
+\o \l {Text::}{maximumLineCount}
+\o \l {Text::}{truncated}
+\o \l {Text::}{effectiveHorizontalAlignment}
\endlist
horizontalAlignment now accepts Text.AlignJustify alignment mode.
@@ -53,85 +66,107 @@ horizontalAlignment now accepts Text.AlignJustify alignment mode.
Added the following properties, methods and signal handlers:
\list
-\o canPaste
-\o lineCount
-\o deselect()
-\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word
-\o onLinkActivated(string link)
+\o \l {TextEdit::}{canPaste}
+\o \l {TextEdit::}{lineCount}
+\o \l {TextEdit::}{inputMethodComposing}
+\o \l {TextEdit::}{mouseSelectionMode}
+\o \l {TextEdit::}{effectiveHorizontalAlignment}
+\o \l {TextEdit::}{deselect()}
+\o \l {TextEdit::}{isRightToLeft()}
+\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
+\o \l {TextEdit::}{onLinkActivated}
\endlist
\section2 TextInput
Added the following properties and methods:
\list
-\o canPaste
-\o deselect()
-\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word
+\o \l {TextInput::}{canPaste}
+\o \l {TextInput::}{inputMethodComposing}
+\o \l {TextInput::}{mouseSelectionMode}
+\o \l {TextInput::}{effectiveHorizontalAlignment}
+\o \l {TextInput::}{deselect()}
+\o \l {TextInput::}{isRightToLeft()}
+\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
\endlist
\section2 Image, BorderImage and AnimatedImage
Added the following properties:
\list
-\o cache
-\o mirror
+\o \l{Image::}{cache}
+\o \l{Image::}{mirror}
\endlist
\section2 Item
Added the following properties:
\list
-\o implicitWidth and implicitHeight
+\o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight}
\endlist
\section2 Flickable
Added the following methods:
\list
-\o resizeContent(qreal w, qreal h, QPointF center)
-\o returnToBounds()
+\o \l{Flickable::}{resizeContent()}
+\o \l{Flickable::}{returnToBounds()}
+\endlist
+
+\section2 MouseArea
+
+Added the following property:
+\list
+\o \l{MouseArea::}{preventStealing}
\endlist
\section2 ListView and GridView
-Added the following methods:
+Added the following properties and methods:
\list
-\o positionViewAtBeginning()
-\o positionViewAtEnd()
+\o \l{ListView::}{layoutDirection}
+\o \l{ListView::}{effectiveLayoutDirection}
+\o \l{ListView::}{positionViewAtBeginning()}
+\o \l{ListView::}{positionViewAtEnd()}
\endlist
-\section2 Flow, Grid, Row
+\section2 Flow, Grid and Row
Added the following properties:
\list
-\o layoutDirection
+\o \l{Flow::}{layoutDirection}
+\o \l{Flow::}{effectiveLayoutDirection}
\endlist
\section2 Repeater
Added the following methods and signal handlers:
\list
-\o onItemAdded()
-\o onItemRemoved()
-\o itemAt(int index)
+\o \l{Repeater::}{onItemAdded}
+\o \l{Repeater::}{onItemRemoved}
+\o \l{Repeater::}{itemAt()}
\endlist
\section2 Component
-The createObject() method now accepts a map of initial property values for the created object.
+\list
+\o The \l{Component::}{createObject()} method now accepts a map of initial property values for
+the created object.
+\endlist
\section2 Qt
-Added the following properties and methods:
\list
-\o application.layoutDirection
-\o application.active
+\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application
+properties.
\endlist
\section2 Other changes
\list
-\o Functions can be assigned to properties from JavaScript to create property bindings
+\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript}
+to create property bindings.
+\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
\endlist
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index c3a044f..1c5d903 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -247,8 +247,7 @@
Normally, variables are used to contain whitespace-separated lists
of values. However, it is sometimes necessary to specify values containing
- spaces. These must be quoted by using the
- \l{qmake Function Reference#quote-string}{quote()} function in the following way:
+ spaces. These must be quoted by using double quotes:
\snippet doc/src/snippets/qmake/quoting.pro 0
@@ -256,9 +255,7 @@
the variable. A similar approach is used to deal with paths that contain
spaces, particularly when defining the
\l{qmake Variable Reference#INCLUDEPATH}{INCLUDEPATH} and
- \l{qmake Variable Reference#LIBS}{LIBS} variables for the Windows platform.
- In cases like these, the \l{qmake Function Reference#quote(string)}{quote()}
- function can be used in the following way:
+ \l{qmake Variable Reference#LIBS}{LIBS} variables for the Windows platform:
\snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces
@@ -1650,8 +1647,7 @@
\section1 INCLUDEPATH
This variable specifies the #include directories which should be
- searched when compiling the project. Use ';' or a space as the
- directory separator.
+ searched when compiling the project.
For example:
@@ -1659,9 +1655,7 @@
To specify a path containing spaces, quote the path using the technique
mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files}
- document. For example, paths with spaces can be specified on Windows
- and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()}
- function in the following way:
+ document.
\snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces
@@ -1723,9 +1717,7 @@
To specify a path containing spaces, quote the path using the technique
mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files}
- document. For example, paths with spaces can be specified on Windows
- and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()}
- function in the following way:
+ document.
\snippet doc/src/snippets/qmake/spaces.pro quoting library paths with spaces
@@ -1901,8 +1893,17 @@
\target PWD
\section1 PWD
- This variable contains the full path leading to the directory where
- the \l {qmake}{ \c qmake} project file (project.pro) is located.
+ The \c PWD variable specifies the full path leading to the directory
+ containing the current file being parsed. This can be useful
+ to refer to files within the source tree when writing project files to
+ support shadow builds.
+
+ See also \l{#_PRO_FILE_PWD_}{_PRO_FILE_PWD_}.
+
+ \note IN_PWD is an alias for PWD.
+
+ \note Function calls have no effect on the value of PWD. PWD will refer to
+ the path of the calling file.
\target OUT_PWD
\section1 OUT_PWD
@@ -3399,6 +3400,19 @@
\tableofcontents{2}
+ \section1 packagesExist(packages)
+
+ Uses the PKGCONFIG mechanism to determine whether or not the given packages
+ exist at the time of project parsing.
+
+ This can be useful to optionally enable or disable features. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 157
+
+ And then, in the code:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 158
+
\section1 basename(variablename)
Returns the basename of the file specified. For example:
@@ -3592,10 +3606,7 @@
\section1 quote(string)
Converts a whole \e string into a single entity and returns the result.
- Newlines, carriage returns, and tabs can be specified in the string
- with \\n \\r and \\t. The return value does not contain either single
- or double quotation marks unless you explicitly include them yourself,
- but will be placed into a single entry (for literal expansion).
+ This is just a fancy way of enclosing the string into double quotes.
\section1 replace(string, old_string, new_string)
diff --git a/doc/src/examples/multicastreceiver.qdoc b/doc/src/examples/multicastreceiver.qdoc
index 9c4dda4..776c5fa 100644
--- a/doc/src/examples/multicastreceiver.qdoc
+++ b/doc/src/examples/multicastreceiver.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/examples/multicastsender.qdoc b/doc/src/examples/multicastsender.qdoc
index be5fb6a..bfb91a6 100644
--- a/doc/src/examples/multicastsender.qdoc
+++ b/doc/src/examples/multicastsender.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/examples/wheel.qdoc b/doc/src/examples/wheel.qdoc
index 992aba6..995ff87 100644
--- a/doc/src/examples/wheel.qdoc
+++ b/doc/src/examples/wheel.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index c906f84..6d0256e 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -874,9 +874,10 @@ If the installation fails, please make sure that there is
no previously installed version of Qt on the phone.
Qt requires some dependent packages to be installed on the device,
-they are shipped in the Symbian SDK and can be installed using the
-runonphone tool as well.
-The packages can be found in the EPOCROOT at the following locations;
+which can be installed using the runonphone tool as well. One is
+the \c{sqlite3.sis}, which is included in the Qt distribution, while
+the others are shipped with the Symbian SDK. The required packages
+can be found from the following locations:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 50
@@ -1274,10 +1275,18 @@ We hope you will enjoy using Qt.
in this release.
\endlist
- Running Qt on real device requires the Open C to be installed on the device.
- The Open C installation packages are embedded into \c{qt_installer.sis}, which is included in
- Qt for Symbian binary package. If you are building Qt from scratch, you can find the
- required packages in the Symbian SDK where you installed Open C/C++:
+ Running Qt on real device requires the Open C and sqlite3 to be installed on the device.
+ These installation packages are embedded into \c{qt_installer.sis}, which is included in
+ Qt for Symbian binary package.
+
+ If you are building Qt from scratch, you can find the sqlite3 package from
+ under your Qt installation:
+
+ \list
+ \o \c{src\s60installs\sqlite3.sis}
+ \endlist
+
+ The Open C packages you can find in the Symbian SDK where you installed Open C/C++:
\list
\o \c{nokia_plugin\openc\s60opencsis\pips_s60_<version>.sis}
\o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_<version>.sis}
diff --git a/doc/src/images/roaming-states.png b/doc/src/images/roaming-states.png
new file mode 100644
index 0000000..bc61cac
--- /dev/null
+++ b/doc/src/images/roaming-states.png
Binary files differ
diff --git a/doc/src/platforms/platform-notes-rtos.qdoc b/doc/src/platforms/platform-notes-rtos.qdoc
index 776f510..be63063 100644
--- a/doc/src/platforms/platform-notes-rtos.qdoc
+++ b/doc/src/platforms/platform-notes-rtos.qdoc
@@ -245,3 +245,112 @@
some regressions were spotted in QDateTime computation around year 0 and year 1970,
which have been tracked back to faulty time zone data on some QNX versions.
*/
+
+/*!
+ \page platform-notes-integrity.html
+ \title Platform Notes - INTEGRITY
+ \contentspage Platform Notes
+ \target INTEGRITY
+
+ \note INTEGRITY is a community supported platform. See the
+ \l{Supported Platforms} page for more information.
+
+ This page contains information about the Qt for INTEGRITY port. More
+ information about the combinations of platforms and compilers supported
+ by Qt can be found on the \l{Supported Platforms} page.
+
+ Note that Qt for INTEGRITY is currently based on \l{Qt for Embedded Linux},
+ which contains its own windowing system.
+
+ Qt for INTEGRITY contains experimental screen and input drivers based on the
+ gh_FB Framebuffer API for graphics, a Connection-based mouse and keyboard
+ support. For information about these drivers, please refer to Green Hills
+ Software standard support.
+
+ \tableofcontents
+
+ \section1 Supported Versions
+
+ Qt has been tested on INTEGRITY 10 on various PowerPC, ARM and x86 targets.
+ On some platforms a native graphics FrameBuffer driver is available and has
+ then been used for testing. On all other platforms, the default FrameBuffer
+ VNC driver is used.
+
+ \section1 Limitations
+
+ Some of Qt's functionality is currently not available on INTEGRITY:
+
+ \table
+ \header \o Function \o Notes
+ \row \o QProcess
+ \o Not implemented. Volunteers welcome.
+ \row \o QSharedMemory
+ \o Not available - INTEGRITY doesn't support SYSV style shared memory.
+ \row \o QSystemSemaphore
+ \o Not available - INTEGRITY doesn't support SYSV style system semaphores.
+ \row \o QWS Multi Process
+ \o QT_NO_QWS_MULTIPROCESS is always on due to missing shared memory support.
+ \row \o Phonon
+ \o There is no standard audio backend.
+ \row \o Qt3Support
+ \o The Qt3Support library is not available on INTEGRITY.
+ \row \o QtScript
+ \o Not available - INTEGRITY's mmap() doesn't support allocating memory.
+ \endtable
+
+ \section1 Build Instructions
+
+ Qt for INTEGRITY can be built on either a Linux or Windows (with cygwin) host.
+ In both cases, a standard installation of INTEGRITY is required, with the
+ addition of the FrameBuffer API.
+
+ Example configure line for cross-compiling Qt for INTEGRITY for an
+ ARM INTEGRITY target:
+
+ \code
+ ./configure --hostprefix=$PWD -embedded integrity -xplatform unsupported/qws/integrity-arm-cxarm -static -qt-kbd-integrity -qt-mouse-integrity -no-mouse-linuxtp -no-mouse-pc -no-kbd-tty -qt-gfx-integrityfb -no-qt3support -no-gfx-linuxfb -no-glib -no-openssl -no-largefile -little-endian -arch integrity -prefix / -opensource -no-feature-QWS_MULTIPROCESS -no-feature-SHAREDMEMORY -no-feature-PROCESS -no-feature-SYSTEMSEMAPHORE -no-feature-PRINTER -no-feature-QWS_QPF2 -no-scripttools
+ \endcode
+
+ \list
+ \o \c{--hostprefix=$PWD} - specifies the current directory as the base source for Qt
+ \o \c{-arch integrity} - sets the architecture to INTEGRITY (for atomic operations)
+ \o \c{-embedded integrity} - builds the embedded version of Qt and sets the architecture to INTEGRITY
+ \o \c{-xplatform unsupported/qws/integrity-arm-cxarm} - selects the arm-cxarm mkspec for INTEGRITY
+ \o \c{-static} - specifies a static build of Qt
+ \o \c{-no-gfx-linuxfb}, \c{-no-mouse-linuxtp}, \c{-no-mouse-pc} and \c{-no-kbd-tty} are Linux specific and won't work on INTEGRITY
+ \o \c{-no-qt3support} - required since the Qt3 support classes are not supported on INTEGRITY
+ \o \c{-no-exceptions} - reduces the size of the library by disabling exception support
+ \o \c{-no-openssl} - disable support for OpenSSL
+ \o \c{-no-glib} - disable support for unavailable Glib
+ \o \c{-no-largefile} - disable support for large (> 2TB) files
+ \o \c{-no-scripttools} - disable support for QtScript tools
+ \o \c{-qt-gfx-integrity} - enables the experimental gh_FB based display driver
+ \o \c{-qt-mouse-integrity} - enables the experimental Connection-based mouse driver
+ \o \c{-qt-kbd-integrity} - enables the experimental Connection-based keyboard driver
+ \endlist
+
+ The above script will generate MULTI .gpj Project files, not Makefiles. The
+ main benefit of using these project files is automatic dependency checking,
+ but this also provides an organization known to INTEGRITY customers.
+ For Qt libraries, the top-level file is projects.gpj.
+
+ \section1 General Notes
+
+ \list
+ \o Before you run the above configure line, you may want to modify the values
+ of INTEGRITY_DIR and INTEGRITY_BSP in unsupported/qws/integrity-arm-cxarm/qmake.conf.
+ If you do not do this, you will have to modify the resulting generated projects.gpj
+
+ \o GIF support is currently not enabled.
+
+ \o Default .int files are generated. You may want to modify the amount of heap assigned
+ to each example by modifying the HeapSize declaration in the specific example .int file.
+
+ \o Some of the tools, examples and demos do not compile due to dependencies on QProcess
+ or other classes that are not available on INTEGRITY.
+
+ \endlist
+
+ \section1 Platform Regressions
+
+*/
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc
index aac6bb0..113ad86 100644
--- a/doc/src/platforms/platform-notes.qdoc
+++ b/doc/src/platforms/platform-notes.qdoc
@@ -602,6 +602,69 @@
problem, it probably is a good idea to turn off precompiled headers.
Also, consider filing a bug report with Apple so that they can
improve support for this feature.
+
+ \section2 Attributes
+ The following lists a set of useful attributes that can be used to tweak applications
+ on Mac:
+
+ Qt::AA_MacPluginApplication, Qt::AA_DontUseNativeMenuBar, Qt::AA_MacDontSwapCtrlAndMeta
+ Qt::WA_MacNoClickThrough, Qt::WA_MacOpaqueSizeGrip, Qt::WA_MacShowFocusRect,
+ Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, Qt::WA_MacMiniSize, Qt::WA_MacVariableSize,
+ Qt::WA_MacBrushedMetal, Qt::WA_MacAlwaysShowToolWindow, Qt::WA_MacFrameworkScaled,
+ Qt::WA_MacNoShadow, Qt::Sheet, Qt::Drawer, Qt::MacWindowToolBarButtonHint,
+ QMainWindow::unifiedTitleAndToolBarOnMac
+
+ \section2 Mixing Qt with native code
+ Two classes are awailable for either adding native Cocoa views/controls
+ inside a Qt application, or the opposite, embedding Qt into a native
+ Cocoa application:
+
+ QMacCocoaViewContainer, QMacNativeWidget
+
+ \section3 Using native Cocoa panels
+ Launching native Cocoa panels from within a Qt application can sometimes
+ be problematic. The reason is that Qt's event dispatcher is more flexible
+ than what Cocoa offers, and lets the user spin the event dispatcher (and
+ running QEventLoop::exec) without having to think about whether or not modal
+ dialogs are showing on screen (which is a difference to Cocoa). Therefore
+ we need to do special bookkeeping in Qt to handle this correctly, which
+ unfortunately make mixing in native panels hard. The best way at the moment
+ to do this, is to follow the pattern below, where we post the call to the
+ function with native code rather than calling it directly. Then we now that
+ Qt has cleanly updated any pending event loop recursions before the native
+ panel is shown:
+
+ \code
+ #include <QtGui>
+
+ class NativeProxyObject : public QObject
+ {
+ Q_OBJECT
+ public slots:
+ void execNativeDialogLater()
+ {
+ QMetaObject::invokeMethod(this, "execNativeDialogNow", Qt::QueuedConnection);
+ }
+
+ void execNativeDialogNow()
+ {
+ NSRunAlertPanel(@"A Native dialog", @"", @"OK", @"", @"");
+ }
+
+ };
+
+ #include "main.moc"
+
+ int main(int argc, char **argv){
+ QApplication app(argc, argv);
+ NativeProxyObject proxy;
+ QPushButton button("Show native dialog");
+ QObject::connect(&button, SIGNAL(clicked()), &proxy, SLOT(execNativeDialogLater()));
+ button.show();
+ return app.exec();
+ }
+
+ \endcode
*/
/*!
@@ -735,9 +798,9 @@
\row \o QtCore
\o \c AllFiles when \l{http://developer.symbian.org/wiki/index.php/Capabilities_%28Symbian_Signed%29/AllFiles_Capability}{accessing specific areas.}
\row \o QtDeclarative
- \o \c NetworkServices is automatically added for this module.
+ \o \c NetworkServices is automatically added for this module if no capabilities are explicitly specified.
\row \o QtNetwork
- \o \c NetworkServices is automatically added for this module.
+ \o \c NetworkServices is automatically added for this module if no capabilities are explicitly specified.
\row \o QtNetwork
\o \c ReadUserData is required to include all the phone's SSL certificates in the system's default CA certificate list
(for example those added by the user or stored in the SIM card),
@@ -745,7 +808,7 @@
\row \o QtMultiMedia
\o \c UserEnvironment if QAudioInput is used.
\row \o QtWebkit
- \o \c NetworkServices is automatically added for this module.
+ \o \c NetworkServices is automatically added for this module if no capabilities are explicitly specified.
\endtable
\note Some modules rely on other modules. E.g. QtWebkit and QtDeclarative
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index cf204b5..5aaa2b0 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -328,9 +328,10 @@ runonphone -s myapp.sis myapp.exe
//! [49]
//! [50]
-nokia_plugin/openc/s60opencsis/openc_ssl_s60_1_6_ss.sis
-nokia_plugin/openc/s60opencsis/pips_s60_1_6_ss.sis
-nokia_plugin/opencpp/s60opencppsis/stdcpp_s60_1_6_ss.sis
+src/s60installs/sqlite3.sis
+$EPOCROOT/nokia_plugin/openc/s60opencsis/openc_ssl_s60_1_6_ss.sis
+$EPOCROOT/nokia_plugin/openc/s60opencsis/pips_s60_1_6_ss.sis
+$EPOCROOT/nokia_plugin/opencpp/s60opencppsis/stdcpp_s60_1_6_ss.sis
//! [50]
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index f6ac4f8..a35a3d9 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -1029,3 +1029,15 @@ DEPLOYMENT += dep_note
//! [156]
DEPLOYMENT.display_name = My Qt App
//! [156]
+
+//! [157]
+packagesExist(sqlite3 QtNetwork QtDeclarative) {
+ DEFINES += USE_FANCY_UI
+}
+//! [157]
+
+//! [158]
+#ifdef USE_FANCY_UI
+ // Use the fancy UI, as we have extra packages available
+#endif
+//! [158]
diff --git a/doc/src/snippets/declarative/application.qml b/doc/src/snippets/declarative/application.qml
index 06f83f2..fa8cf0b 100644
--- a/doc/src/snippets/declarative/application.qml
+++ b/doc/src/snippets/declarative/application.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
index cf59777..7364139 100644
--- a/doc/src/snippets/declarative/componentCreation.js
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -32,13 +32,10 @@ function createSpriteObjects() {
//![finishCreation]
function finishCreation() {
if (component.status == Component.Ready) {
- sprite = component.createObject(appWindow);
+ sprite = component.createObject(appWindow, {"x": 100, "y": 100});
if (sprite == null) {
// Error Handling
- } else {
- sprite.x = 100;
- sprite.y = 100;
- // ...
+ console.log("Error creating object");
}
} else if (component.status == Component.Error) {
// Error Handling
diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml
index 42ee3da..e6a6fcf 100644
--- a/doc/src/snippets/declarative/focus/focusColumn.qml
+++ b/doc/src/snippets/declarative/focus/focusColumn.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/snippets/declarative/layoutmirroring.qml b/doc/src/snippets/declarative/layoutmirroring.qml
new file mode 100644
index 0000000..23eecd6
--- /dev/null
+++ b/doc/src/snippets/declarative/layoutmirroring.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.1
+
+Rectangle {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ width: 240; height: 50
+ Row {
+ anchors { left: parent.left; margins: 5 }
+ y: 5; spacing: 5
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "red"
+ opacity: (5-index) / 5
+ width: 40; height: 40
+ Text {
+ text: index+1
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml
index b885137..aa1246d 100644
--- a/doc/src/snippets/declarative/states/statechangescript.qml
+++ b/doc/src/snippets/declarative/states/statechangescript.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 1.0
Item {
//! [state and transition]
diff --git a/doc/src/snippets/declarative/webview/webview.qml b/doc/src/snippets/declarative/webview/webview.qml
index c1cef33..dac8010 100644
--- a/doc/src/snippets/declarative/webview/webview.qml
+++ b/doc/src/snippets/declarative/webview/webview.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/snippets/qmake/spaces.pro b/doc/src/snippets/qmake/spaces.pro
index 544ef05..614d4c5 100644
--- a/doc/src/snippets/qmake/spaces.pro
+++ b/doc/src/snippets/qmake/spaces.pro
@@ -1,9 +1,9 @@
#! [quoting library paths with spaces]
-win32:LIBS += $$quote(C:/mylibs/extra libs/extra.lib)
-unix:LIBS += $$quote(-L/home/user/extra libs) -lextra
+win32:LIBS += "C:/mylibs/extra libs/extra.lib"
+unix:LIBS += "-L/home/user/extra libs" -lextra
#! [quoting library paths with spaces]
#! [quoting include paths with spaces]
-win32:INCLUDEPATH += $$quote(C:/mylibs/extra headers)
-unix:INCLUDEPATH += $$quote(/home/user/extra headers)
+win32:INCLUDEPATH += "C:/mylibs/extra headers"
+unix:INCLUDEPATH += "/home/user/extra headers"
#! [quoting include paths with spaces]
diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 9cb1fef..935db25 100644
--- a/examples/declarative/keyinteraction/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -91,7 +91,7 @@ Rectangle {
MouseArea {
anchors.fill: parent; anchors.margins: -10
- onClicked: window.state = "contextMenuOpen"
+ onClicked: contextMenu.focus = true
}
}
diff --git a/examples/declarative/positioners/layoutdirection/layoutdirection.qml b/examples/declarative/positioners/layoutdirection/layoutdirection.qml
index 3e23b15..448eb16 100644
--- a/examples/declarative/positioners/layoutdirection/layoutdirection.qml
+++ b/examples/declarative/positioners/layoutdirection/layoutdirection.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -41,10 +41,13 @@
import QtQuick 1.1
Rectangle {
+ property bool mirror
+ property int direction: Qt.application.layoutDirection
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
width: column.width + 100
height: column.height + 100
- property int direction: Qt.application.layoutDirection
Column {
id: column
@@ -133,6 +136,23 @@ Rectangle {
anchors.fill: parent
}
}
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Text {
+ text: mirror ? "Mirrored" : "Normal"
+ color: "white"
+ font.pixelSize: 16
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ id: mouseArea2
+ onClicked: {
+ mirror = !mirror;
+ }
+ anchors.fill: parent
+ }
+ }
}
Component {
diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml
index a2f81ff..cf5278d 100644
--- a/examples/declarative/touchinteraction/pincharea/flickresize.qml
+++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -54,14 +54,21 @@ Rectangle {
PinchArea {
width: Math.max(flick.contentWidth, flick.width)
height: Math.max(flick.contentHeight, flick.height)
+
+ property real initialWidth
+ property real initialHeight
+ onPinchStarted: {
+ initialWidth = flick.contentWidth
+ initialHeight = flick.contentHeight
+ }
+
onPinchUpdated: {
// adjust content pos due to drag
flick.contentX += pinch.previousCenter.x - pinch.center.x
flick.contentY += pinch.previousCenter.y - pinch.center.y
// resize content
- var scale = 1.0 + pinch.scale - pinch.previousScale
- flick.resizeContent(flick.contentWidth * scale, flick.contentHeight * scale, pinch.center)
+ flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
}
onPinchFinished: {
diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro
index 53601f4..12f08b9 100644
--- a/examples/itemviews/chart/chart.pro
+++ b/examples/itemviews/chart/chart.pro
@@ -4,7 +4,7 @@ RESOURCES = chart.qrc
SOURCES = main.cpp \
mainwindow.cpp \
pieview.cpp
-unix:!mac:!symbian:!vxworks:LIBS+= -lm
+unix:!mac:!symbian:!vxworks:!integrity:LIBS+= -lm
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
diff --git a/examples/network/multicastreceiver/main.cpp b/examples/network/multicastreceiver/main.cpp
index 8483271..0411631 100644
--- a/examples/network/multicastreceiver/main.cpp
+++ b/examples/network/multicastreceiver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastreceiver/receiver.cpp b/examples/network/multicastreceiver/receiver.cpp
index 073fdce..77446b9 100644
--- a/examples/network/multicastreceiver/receiver.cpp
+++ b/examples/network/multicastreceiver/receiver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastreceiver/receiver.h b/examples/network/multicastreceiver/receiver.h
index e226028..fd1a673 100644
--- a/examples/network/multicastreceiver/receiver.h
+++ b/examples/network/multicastreceiver/receiver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/main.cpp b/examples/network/multicastsender/main.cpp
index 9309322..56e35c9 100644
--- a/examples/network/multicastsender/main.cpp
+++ b/examples/network/multicastsender/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/sender.cpp b/examples/network/multicastsender/sender.cpp
index 7fa9750..aab94aa 100644
--- a/examples/network/multicastsender/sender.cpp
+++ b/examples/network/multicastsender/sender.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/sender.h b/examples/network/multicastsender/sender.h
index f119883..75ce4c9 100644
--- a/examples/network/multicastsender/sender.h
+++ b/examples/network/multicastsender/sender.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/opengl/pbuffers/cube.cpp b/examples/opengl/pbuffers/cube.cpp
index 5bd35e1..631595a 100644
--- a/examples/opengl/pbuffers/cube.cpp
+++ b/examples/opengl/pbuffers/cube.cpp
@@ -46,7 +46,7 @@
static const qreal FACE_SIZE = 0.4;
-static const qreal speeds[] = { 1.8f, 2.4f, 3.6f };
+static const qreal speeds[] = { 3.8f, 4.4f, 5.6f };
static const qreal amplitudes[] = { 2.0f, 2.5f, 3.0f };
static inline void qSetColor(float colorVec[], QColor c)
@@ -197,7 +197,8 @@ Tile *TileBuilder::newTile(const QVector3D &loc) const
Cube::Cube(const QVector3D &loc)
: Tile(loc)
, rot(0.0f)
- , r(0), a(0)
+ , r(0)
+ , animGroup(0)
{
}
@@ -234,8 +235,8 @@ void Cube::setRotation(qreal r)
void Cube::removeBounce()
{
- delete a;
- a = 0;
+ delete animGroup;
+ animGroup = 0;
delete r;
r = 0;
}
@@ -247,8 +248,8 @@ void Cube::startAnimation()
r->start();
r->setCurrentTime(startx);
}
- if (a)
- a->start();
+ if (animGroup)
+ animGroup->start();
if (rtn)
rtn->start();
}
@@ -259,8 +260,8 @@ void Cube::setAnimationPaused(bool paused)
{
if (r)
r->pause();
- if (a)
- a->pause();
+ if (animGroup)
+ animGroup->pause();
if (rtn)
rtn->pause();
}
@@ -268,8 +269,8 @@ void Cube::setAnimationPaused(bool paused)
{
if (r)
r->resume();
- if (a)
- a->resume();
+ if (animGroup)
+ animGroup->resume();
if (rtn)
rtn->resume();
}
@@ -312,13 +313,29 @@ Cube *CubeBuilder::newCube(const QVector3D &loc) const
c->r->setDuration(d * 4.0f);
c->r->setLoopCount(-1);
c->r->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
+
+ c->animGroup = new QSequentialAnimationGroup(c);
+
// Animate movement from bottom to top
- c->a = new QPropertyAnimation(c, "altitude");
- c->a->setEndValue(loc.y());
- c->a->setStartValue(loc.y() + amplitudes[ix]);
- c->a->setDuration(d / speeds[ix]);
- c->a->setLoopCount(-1);
- c->a->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
+ QPropertyAnimation *a_up = new QPropertyAnimation(c, "altitude", c->animGroup);
+ a_up->setEndValue(loc.y());
+ a_up->setStartValue(loc.y() + amplitudes[ix]);
+ a_up->setDuration(d / speeds[ix]);
+ a_up->setLoopCount(1);
+ a_up->setEasingCurve(QEasingCurve(QEasingCurve::InQuad));
+
+ // Animate movement from top to bottom
+ QPropertyAnimation *a_down = new QPropertyAnimation(c, "altitude", c->animGroup);
+ a_down->setEndValue(loc.y() + amplitudes[ix]);
+ a_down->setStartValue(loc.y());
+ a_down->setDuration(d / speeds[ix]);
+ a_down->setLoopCount(1);
+ a_down->setEasingCurve(QEasingCurve(QEasingCurve::OutQuad));
+
+ c->animGroup->addAnimation(a_up);
+ c->animGroup->addAnimation(a_down);
+ c->animGroup->setLoopCount(-1);
+
// Animate rotation
c->rtn = new QPropertyAnimation(c, "rotation");
c->rtn->setStartValue(c->rot);
diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h
index 2577e76..5c985a3 100644
--- a/examples/opengl/pbuffers/cube.h
+++ b/examples/opengl/pbuffers/cube.h
@@ -43,6 +43,7 @@
#include <QtOpenGL/qgl.h>
#include <QtCore/qvector.h>
+#include <QtCore/qsequentialanimationgroup.h>
#include <QtGui/qmatrix4x4.h>
#include <QtGui/qvector3d.h>
#include <QtGui/qvector2d.h>
@@ -130,8 +131,8 @@ signals:
private:
qreal rot;
QPropertyAnimation *r;
- QPropertyAnimation *a;
QPropertyAnimation *rtn;
+ QSequentialAnimationGroup *animGroup;
qreal startx;
friend class CubeBuilder;
};
diff --git a/examples/opengl/pbuffers/glwidget.cpp b/examples/opengl/pbuffers/glwidget.cpp
index 930cbc8..f6f89e5 100644
--- a/examples/opengl/pbuffers/glwidget.cpp
+++ b/examples/opengl/pbuffers/glwidget.cpp
@@ -135,7 +135,7 @@ void GLWidget::initializeGeometry()
CubeBuilder cBuilder(geom, 0.5);
cBuilder.setColor(QColor(255, 255, 255, 212));
// build the 3 bouncing, spinning cubes
- for (int i = 0; i < 3; ++i)
+ for (int i = 3; i > 0; --i)
cubes.append(cBuilder.newCube(QVector3D((float)(i-1), -1.5f, 5 - i)));
// build the spinning cube which goes in the dynamic texture
diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro
index 1f42b41..d096fa6 100644
--- a/examples/painting/painterpaths/painterpaths.pro
+++ b/examples/painting/painterpaths/painterpaths.pro
@@ -3,7 +3,7 @@ HEADERS = renderarea.h \
SOURCES = main.cpp \
renderarea.cpp \
window.cpp
-unix:!mac:!symbian:!vxworks:LIBS += -lm
+unix:!mac:!symbian:!vxworks:!integrity:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/painting/painterpaths
diff --git a/examples/scroller/graphicsview/main.cpp b/examples/scroller/graphicsview/main.cpp
index 77d00f0..6378f91 100644
--- a/examples/scroller/graphicsview/main.cpp
+++ b/examples/scroller/graphicsview/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/plot/main.cpp b/examples/scroller/plot/main.cpp
index 1e7db64..a98abfc 100644
--- a/examples/scroller/plot/main.cpp
+++ b/examples/scroller/plot/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/plot/plotwidget.cpp b/examples/scroller/plot/plotwidget.cpp
index a03f613..c47f107 100644
--- a/examples/scroller/plot/plotwidget.cpp
+++ b/examples/scroller/plot/plotwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/plot/plotwidget.h b/examples/scroller/plot/plotwidget.h
index c96ceac..dc886d8 100644
--- a/examples/scroller/plot/plotwidget.h
+++ b/examples/scroller/plot/plotwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/plot/settingswidget.cpp b/examples/scroller/plot/settingswidget.cpp
index 1929eb6..792d8d0 100644
--- a/examples/scroller/plot/settingswidget.cpp
+++ b/examples/scroller/plot/settingswidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/plot/settingswidget.h b/examples/scroller/plot/settingswidget.h
index 13edbf4..e0ffb4a 100644
--- a/examples/scroller/plot/settingswidget.h
+++ b/examples/scroller/plot/settingswidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/wheel/main.cpp b/examples/scroller/wheel/main.cpp
index 203c930..22bae5c 100644
--- a/examples/scroller/wheel/main.cpp
+++ b/examples/scroller/wheel/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/wheel/wheelwidget.cpp b/examples/scroller/wheel/wheelwidget.cpp
index 0449f53..54daca3 100644
--- a/examples/scroller/wheel/wheelwidget.cpp
+++ b/examples/scroller/wheel/wheelwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/scroller/wheel/wheelwidget.h b/examples/scroller/wheel/wheelwidget.h
index 8f49169..1e41c02 100644
--- a/examples/scroller/wheel/wheelwidget.h
+++ b/examples/scroller/wheel/wheelwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro
index ecbec56..2db886b 100644
--- a/examples/threads/mandelbrot/mandelbrot.pro
+++ b/examples/threads/mandelbrot/mandelbrot.pro
@@ -4,7 +4,7 @@ SOURCES = main.cpp \
mandelbrotwidget.cpp \
renderthread.cpp
-unix:!mac:!symbian:!vxworks:LIBS += -lm
+unix:!mac:!symbian:!vxworks:!integrity:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
diff --git a/mkspecs/common/armcc.conf b/mkspecs/common/armcc.conf
index 2c765bc..4f178d7 100644
--- a/mkspecs/common/armcc.conf
+++ b/mkspecs/common/armcc.conf
@@ -37,5 +37,6 @@ QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_THREAD +=
QMAKE_AR = armar --create
+QMAKE_LIB = armar --create
QMAKE_RANLIB =
diff --git a/mkspecs/common/mac/qplatformdefs.h b/mkspecs/common/mac/qplatformdefs.h
index 5d1f99a..114a1a3 100644
--- a/mkspecs/common/mac/qplatformdefs.h
+++ b/mkspecs/common/mac/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index 899f8c2..b248117 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -2,7 +2,11 @@
# qmake configuration for makefile based symbian
#
-MAKEFILE_GENERATOR = SYMBIAN_UNIX
+contains(QMAKE_HOST.os,Windows) {
+ MAKEFILE_GENERATOR = SYMBIAN_MINGW
+} else {
+ MAKEFILE_GENERATOR = SYMBIAN_UNIX
+}
include(symbian.conf)
@@ -24,10 +28,18 @@ CONFIG *= no_plugin_name_prefix
QMAKE_PREFIX_STATICLIB =
QMAKE_SYMBIAN_SHLIB = 1
+QMAKE_LINK_OBJECT_SCRIPT = objects
+
is_using_gnupoc {
- DEFINES *= __PRODUCT_INCLUDE__=\"<$${EPOCROOT}epoc32/include/variant/symbian_os.hrh>\"
-} else {
- DEFINES *= __PRODUCT_INCLUDE__=\"<$${EPOCROOT}epoc32/include/variant/Symbian_OS.hrh>\"
+ DEFINES *= __QT_PRODUCT_INCLUDE_IS_LOWERCASE__
+}
+QMAKE_SYMBIAN_INCLUDES = $$IN_PWD/symbianincludes.h
+symbian-armcc {
+ QMAKE_CFLAGS += --preinclude $$QMAKE_SYMBIAN_INCLUDES
+ QMAKE_CXXFLAGS += --preinclude $$QMAKE_SYMBIAN_INCLUDES
+} else:symbian-gcce {
+ QMAKE_CFLAGS += -include $$QMAKE_SYMBIAN_INCLUDES
+ QMAKE_CXXFLAGS += -include $$QMAKE_SYMBIAN_INCLUDES
}
DEFINES *= \
__SYMBIAN32__ \
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 3644bc6..e3813a4 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -118,11 +118,11 @@ contains(QMAKE_HOST.os,Windows) {
}
QMAKE_IDL = midl
-QMAKE_LIB = ar -ru
-QMAKE_RC = windres
QMAKE_ZIP = zip -r -9
QMAKE_UNZIP = unzip -o
+QMAKE_WRITE_DEFAULT_RC = 1
+
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
@@ -230,16 +230,41 @@ defineReplace(symbianRemoveSpecialCharacters) {
# Determines translations that are Symbian supported
defineTest(matchSymbianLanguages) {
+ # Qt language codes for which we need to parse .ts file
SYMBIAN_MATCHED_LANGUAGES =
+ # List of translation files for matched languages
SYMBIAN_MATCHED_TRANSLATIONS =
+ # List of Qt language codes for which we have no mapped Symbian code but we have a fallback code
+ # and therefore need to generate a mapping for in localize_deployment.prf.
+ # The fallback code means plain language code for languages that have both language and country codes.
+ # E.g. the fallback code for language "zh_CN" would be "zh".
+ SYMBIAN_UNMAPPED_LANGUAGES =
+ # List of handled Qt language codes to avoid duplicate Symbian language codes in case both
+ # unmapped language+country combination and its fallback code, or multiple unmapped language+country
+ # combinations that have same fallback code are included.
+ HANDLED_LANGUAGES =
# Cannot parse .ts file for language here, so detect it from filename.
# Allow two and three character language and country codes.
for(translation, TRANSLATIONS) {
language = $$replace(translation, "^(.*/)?[^/]+_(([^_]{2,3}_)?[^_]{2,3})\\.ts$", \\2)
- contains(SYMBIAN_SUPPORTED_LANGUAGES, $$language) {
- SYMBIAN_MATCHED_LANGUAGES += $$language
- SYMBIAN_MATCHED_TRANSLATIONS += $$translation
+ !contains(HANDLED_LANGUAGES, $$language) {
+ HANDLED_LANGUAGES += $$language
+ contains(SYMBIAN_SUPPORTED_LANGUAGES, $$language) {
+ SYMBIAN_MATCHED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_TRANSLATIONS += $$_PRO_FILE_PWD_/$$translation
+ } else {
+ # No direct mapping for specified language found. Check if a fallback language code can be used.
+ strippedLanguage = $$replace(language, "_.*$",)
+ contains(SYMBIAN_SUPPORTED_LANGUAGES, $$strippedLanguage):!contains(HANDLED_LANGUAGES, $$strippedLanguage) {
+ HANDLED_LANGUAGES += $$strippedLanguage
+ SYMBIAN_UNMAPPED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_TRANSLATIONS += $$translation
+ SYMBIAN_LANGUAGE_FALLBACK.$$language = $$strippedLanguage
+ export(SYMBIAN_LANGUAGE_FALLBACK.$$language)
+ }
+ }
}
}
@@ -247,6 +272,7 @@ defineTest(matchSymbianLanguages) {
export(SYMBIAN_MATCHED_LANGUAGES)
export(SYMBIAN_MATCHED_TRANSLATIONS)
+ export(SYMBIAN_UNMAPPED_LANGUAGES)
}
# Symbian pkg files that define multiple languages require a language specific string to be
diff --git a/mkspecs/common/symbian/symbianincludes.h b/mkspecs/common/symbian/symbianincludes.h
new file mode 100644
index 0000000..5d7f488
--- /dev/null
+++ b/mkspecs/common/symbian/symbianincludes.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the mkspecs 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 __PRODUCT_INCLUDE__
+# ifdef __QT_PRODUCT_INCLUDE_IS_LOWERCASE__
+# define __PRODUCT_INCLUDE__ <variant/symbian_os.hrh>
+# else
+# define __PRODUCT_INCLUDE__ <variant/Symbian_OS.hrh>
+# endif
+#endif
+
+#ifndef __QT_SYMBIAN_RESOURCE__
+# if defined(__ARMCC__) || defined(__CC_ARM)
+# ifdef __QT_RVCT_HEADER_IS_2_2__
+# include <rvct2_2.h>
+# else
+# include <rvct.h>
+# endif
+# endif
+#endif
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index 9fb9f10..3f93220 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -83,8 +83,8 @@ breakpad {
win32:PROJECTPATH ~= s,/,\\,
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)
- QMAKE_POST_LINK += $$quote($${QT_BREAKPAD_ROOT_PATH}$${DIR_SEPARATOR}qtbreakpadsymbols \"$$DEBUGFILENAME\" \"$$PROJECTPATH\")
- !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$quote($$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$QMAKE_STRIP \"$$DEBUGFILENAME\")
+ QMAKE_POST_LINK = $$QMAKE_POST_LINK$$quote($${QT_BREAKPAD_ROOT_PATH}$${QMAKE_DIR_SEP}qtbreakpadsymbols \"$$DEBUGFILENAME\" \"$$PROJECTPATH\")
+ !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP \"$$DEBUGFILENAME\")
unset(TARGET_BASEPATH)
unset(SYMBOLFILENAME)
diff --git a/mkspecs/features/link_pkgconfig.prf b/mkspecs/features/link_pkgconfig.prf
index d70e5de..a3dbd1f 100644
--- a/mkspecs/features/link_pkgconfig.prf
+++ b/mkspecs/features/link_pkgconfig.prf
@@ -1,7 +1,12 @@
# handle pkg-config files
-isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config
+isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config # keep consistent with qt_functions.prf too!
+
for(PKGCONFIG_LIB, $$list($$unique(PKGCONFIG))) {
+ # don't proceed if the .pro asks for a package we don't have!
+ !packagesExist($$PKGCONFIG_LIB):error("Package $$PKGCONFIG_LIB not found")
+
QMAKE_CXXFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB)
QMAKE_CFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB)
LIBS += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB)
}
+
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 964e13b..5baf7ce 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -46,22 +46,27 @@ defineTest(qtAddLibrary) {
}
}
symbian {
- isEqual(LIB_NAME, QtGui) {
+ isEqual(LIB_NAME, QtCore) {
+ #workaround for dependency from f32file.h on e32svr.h which has moved location in symbian3
+ contains(SYMBIAN_VERSION, Symbian3) {
+ INCLUDEPATH *= $$OS_LAYER_SYSTEMINCLUDE
+ }
+ } else:isEqual(LIB_NAME, QtGui) {
# Needed for #include <QtGui> because qs60mainapplication.h includes aknapp.h
INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
} else:isEqual(LIB_NAME, QtWebKit) {
# Needed for because relative inclusion problem in toolchain
INCLUDEPATH *= $$QMAKE_INCDIR_QT/QtXmlPatterns
INCLUDEPATH *= $$QMAKE_INCDIR_QT/QtNetwork
- TARGET.CAPABILITY *= NetworkServices
+ isEmpty(TARGET.CAPABILITY): TARGET.CAPABILITY = NetworkServices
isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
} else:isEqual(LIB_NAME, QtXmlPatterns) {
# Needed for #include <QtXmlPatterns/QtXmlPatterns> because relative inclusion problem in toolchain
INCLUDEPATH *= $$QMAKE_INCDIR_QT/QtNetwork
} else:isEqual(LIB_NAME, QtNetwork) {
- TARGET.CAPABILITY *= NetworkServices
+ isEmpty(TARGET.CAPABILITY): TARGET.CAPABILITY = NetworkServices
} else:isEqual(LIB_NAME, QtDeclarative) {
- TARGET.CAPABILITY *= NetworkServices
+ isEmpty(TARGET.CAPABILITY): TARGET.CAPABILITY = NetworkServices
isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
export(TARGET.EPOCHEAPSIZE)
@@ -103,3 +108,17 @@ defineTest(qtPrepareTool) {
}
export($$1)
}
+
+defineTest(packagesExist) {
+ # this can't be done in global scope here because qt_functions is loaded
+ # before the .pro is parsed, so if the .pro set PKG_CONFIG, we wouldn't know it
+ # yet. oops.
+ isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config # keep consistent with link_pkgconfig.prf! too
+
+ for(package, ARGS) {
+ !system($$PKG_CONFIG --exists $$package):return(false)
+ }
+
+ return(true)
+}
+
diff --git a/mkspecs/features/symbian/localize_deployment.prf b/mkspecs/features/symbian/localize_deployment.prf
index 26a254b..185c713 100644
--- a/mkspecs/features/symbian/localize_deployment.prf
+++ b/mkspecs/features/symbian/localize_deployment.prf
@@ -101,6 +101,15 @@ isEmpty(SYMBIAN_MATCHED_LANGUAGES) {
matchSymbianLanguages()
}
+# If there are translations that do not have Symbian language code defined for that exact
+# language + country combination, but have Symbian language code defined for just the language,
+# map the language + country combination to the same value as the plain language.
+for(language, SYMBIAN_UNMAPPED_LANGUAGES) {
+ languageVar = SYMBIAN_LANG.$${language}
+ fallbackLanguageVar = SYMBIAN_LANG.$$eval(SYMBIAN_LANGUAGE_FALLBACK.$$language)
+ $$languageVar = $$eval($$fallbackLanguageVar)
+}
+
!isEmpty(SYMBIAN_MATCHED_TRANSLATIONS) {
# Generate dependencies to .ts files for pkg files
template_pkg_target.depends += $$SYMBIAN_MATCHED_TRANSLATIONS
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 9288583..28046b4 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -1,6 +1,11 @@
symbian-armcc {
QMAKE_CFLAGS += $$QMAKE_CFLAGS.ARMCC
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.ARMCC
+ # This is to prevent inclusion of the shipped RVCT headers, which are often in the
+ # environment variable RVCTxxINC by default. -J prevents the searching of that location,
+ # but needs a path, so just specify somewhere guaranteed not to contain header files.
+ QMAKE_CFLAGS += -J$${EPOCROOT}epoc32/ignore_this_path
+ QMAKE_CXXFLAGS += -J$${EPOCROOT}epoc32/ignore_this_path
} else:symbian-gcce {
QMAKE_CFLAGS += $$QMAKE_CFLAGS.GCCE
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.GCCE
@@ -51,7 +56,7 @@ defineReplace(processSymbianLibrary) {
}
# This part turn "-llibc" into "libc.dso", and moves -L entries to QMAKE_LIBDIR.
-libsToProcess = LIBS QMAKE_LIBS
+libsToProcess = LIBS LIBS_PRIVATE QMAKE_LIBS
for(libToProcess, libsToProcess) {
qt_libraries = $$split($$libToProcess, " ")
eval($$libToProcess =)
@@ -90,8 +95,8 @@ count(splitVersion, 0) {
} else {
count(splitVersion, 3) {
hexVersion = $$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 0))\"")
- hexPart2 = $$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 1))\"")"
- hexPart2 = $$hexPart2$$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 2))\"")"
+ hexPart2 = $$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 1))\"")
+ hexPart2 = $$hexPart2$$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 2))\"")
decVersion = $$system("perl -e \"printf (\\\"%1d\\\", 0x$$hexVersion)\"").
hexVersion = $$hexVersion$$hexPart2
decVersion = $$decVersion$$system("perl -e \"printf (\\\"%d\\\", 0x$$hexPart2)\"")
@@ -235,13 +240,9 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
}
# Symbian resource files
-symbian-armcc: {
- SYMBIAN_RVCT22INC=$$(RVCT22INC)
- !isEmpty(SYMBIAN_RVCT22INC):symbian_resources_INCLUDES = -I$${SYMBIAN_RVCT22INC}
-}
-symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I")
-symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I")
+symbian_resources_INCLUDES = $$join(INCLUDEPATH, " -I", "-I")
symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D")
+symbian_resources_DEFINES += -D__QT_SYMBIAN_RESOURCE__
symbian_resources_RCC_DIR = $$replace(RCC_DIR, "/$", "")
symbian_resources_INCLUDES += "-I$$symbian_resources_RCC_DIR"
@@ -256,6 +257,7 @@ for(symbian_resource, SYMBIAN_RESOURCES) {
symbianresources.input = SYMBIAN_RESOURCES
symbianresources.output = $$symbian_resources_RCC_DIR/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsg
symbianresources.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
${QMAKE_FILE_NAME} \
@@ -271,46 +273,79 @@ symbianresources.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += symbianresources
+# This section generates the rsg and rsc files for symbian.
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
- # Make our own extra target in order to get dependencies for generated
- # files right. This also avoids the warning about files not found.
- symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- symbianGenResource.commands = cpp -nostdinc -undef \
- $$symbian_resources_INCLUDES \
- $$symbian_resources_DEFINES \
- $${baseTarget}.rss \
- > $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- && rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- -o$${symbianDestdir}/$${baseTarget}.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
- -i$${baseTarget}.rss
- silent:symbianGenResource.commands = @echo rcomp $${baseTarget}.rss && $$symbianGenResource.commands
- symbianGenResource.depends = $${baseTarget}.rss
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
- QMAKE_DISTCLEAN += $${baseTarget}.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
-
- symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- symbianGenRegResource.commands = cpp -nostdinc -undef \
- $$symbian_resources_INCLUDES \
- $$symbian_resources_DEFINES \
- $${baseTarget}_reg.rss \
- > $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- && rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
- -i$${baseTarget}_reg.rss
- silent:symbianGenRegResource.commands = @echo rcomp $${baseTarget}_reg.rss && $$symbianGenRegResource.commands
- symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
- QMAKE_DISTCLEAN += $${baseTarget}_reg.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}_reg.rsc
+ # Look for extra languages for the resources, and then generate a target for each one.
+ localize_deployment:symbianGenResourceLanguages = $$SYMBIAN_MATCHED_LANGUAGES default
+ else:symbianGenResourceLanguages = default
+ for(language, symbianGenResourceLanguages) {
+ # Special languages get their language number appended to the filename.
+ contains(language, default) {
+ symbianGenResource_DEFINES = $$symbian_resources_DEFINES
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}.rsc
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ } else {
+ languageNo = $$eval(SYMBIAN_LANG.$$language)
+ symbianGenResource_DEFINES = $$symbian_resources_DEFINES -DLANGUAGE_$${languageNo}
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_$${languageNo}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}.r$${languageNo}
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_$${languageNo}.rsg
+ }
+
+ # Make our own extra target in order to get dependencies for generated
+ # files right. This also avoids the warning about files not found.
+ eval(symbianGenResource_$${language}.target = $$rsg)
+ eval(symbianGenResource_$${language}.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
+ $$symbian_resources_INCLUDES \
+ $$symbianGenResource_DEFINES \
+ $${baseTarget}.rss \
+ > $$rpp \
+ && rcomp -u -m045,046,047 \
+ -s$$rpp \
+ -o$$rsc \
+ -h$$rsg \
+ -i$${baseTarget}.rss)
+ silent:eval(symbianGenResource_$${language}.commands = @echo rcomp $${baseTarget}.rss && $$eval(symbianGenResource_$${language}.commands))
+ eval(symbianGenResource_$${language}.depends = $${baseTarget}.rss)
+ PRE_TARGETDEPS += $$rsg
+ QMAKE_CLEAN += $$rsg $$rpp
+ QMAKE_DISTCLEAN += $$rsc
+
+ QMAKE_EXTRA_TARGETS += symbianGenResource_$${language}
+
+ # Note that we depend on the base rsg file, even if dealing with a specific language.
+ # hence we don't use $$rsg on the next line.
+ eval(symbianGenRegResource_$${language}.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg)
+ contains(language, default) {
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}_reg.rsc
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ } else {
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg_$${languageNo}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}_reg.r$${languageNo}
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg_$${languageNo}.rsg
+ }
+ eval(symbianGenRegResource_$${language}.target = $$rsg)
+ eval(symbianGenRegResource_$${language}.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
+ $$symbian_resources_INCLUDES \
+ $$symbianGenResource_DEFINES \
+ $${baseTarget}_reg.rss \
+ > $$rpp \
+ && rcomp -u -m045,046,047 \
+ -s$$rpp \
+ -o$$rsc \
+ -h$$rsg \
+ -i$${baseTarget}_reg.rss)
+ silent:eval(symbianGenRegResource_$${language}.commands = @echo rcomp $${baseTarget}_reg.rss && $$eval(symbianGenRegResource_$${language}.commands))
+ PRE_TARGETDEPS += $$rsg
+ QMAKE_CLEAN += $$rsg $$rpp
+ QMAKE_DISTCLEAN += $$rsc
+
+ QMAKE_EXTRA_TARGETS += symbianGenRegResource_$${language}
+ }
# Trick to get qmake to create the RCC_DIR for us.
symbianRccDirCreation.input = SOURCES
@@ -318,14 +353,15 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
symbianRccDirCreation.output = $${symbian_resources_RCC_DIR}/symbian_resource_dummy
symbianRccDirCreation.CONFIG = no_link combine
- QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
- QMAKE_DISTCLEAN += $${baseTarget}.loc
+ QMAKE_DISTCLEAN += $${baseTarget}.rss \
+ $${baseTarget}_reg.rss \
+ $${baseTarget}.loc
}
# Generated pkg files
-QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
-QMAKE_DISTCLEAN += $${baseTarget}_installer.pkg
-QMAKE_DISTCLEAN += $${baseTarget}_stub.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg \
+ $${baseTarget}_installer.pkg \
+ $${baseTarget}_stub.pkg
diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf
index c647bae..14c4c38 100644
--- a/mkspecs/features/unix/gdb_dwarf_index.prf
+++ b/mkspecs/features/unix/gdb_dwarf_index.prf
@@ -1,7 +1,7 @@
!CONFIG(separate_debug_info):CONFIG(debug, debug|release):!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) {
QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && \
- test \$\$(gdb --version | sed -e \'s,[^(]*(GDB).\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \
+ test \$\$(gdb --version | sed -e \'s,[^(]*(GDB)[^)]\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \
gdb --nx --batch --quiet -ex \'set confirm off\' -ex \'save gdb-index .\' -ex quit \'$(TARGET)\' && \
test -f $(TARGET).gdb-index && \
$$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' && \
diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf
index 69c9d1d..013668d 100644
--- a/mkspecs/features/win32/embed_manifest_dll.prf
+++ b/mkspecs/features/win32/embed_manifest_dll.prf
@@ -7,6 +7,6 @@
NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths
QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\\n\\t))$$QMAKE_POST_LINK
+ QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2)$$QMAKE_POST_LINK
QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
}
diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf
index 44aadfa..872949e 100644
--- a/mkspecs/features/win32/embed_manifest_exe.prf
+++ b/mkspecs/features/win32/embed_manifest_exe.prf
@@ -7,6 +7,6 @@ if(win32-msvc2005*|win32-msvc2008*|win32-msvc2010*):!equals(TEMPLATE_PREFIX, "vc
NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths
QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\\n\\t))$$QMAKE_POST_LINK
+ QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1)$$QMAKE_POST_LINK
QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
}
diff --git a/mkspecs/qws/linux-nacl-g++/qplatformdefs.h b/mkspecs/qws/linux-nacl-g++/qplatformdefs.h
index 01b26d9..9ea192f 100644
--- a/mkspecs/qws/linux-nacl-g++/qplatformdefs.h
+++ b/mkspecs/qws/linux-nacl-g++/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/qws/macx-nacl-g++/qplatformdefs.h b/mkspecs/qws/macx-nacl-g++/qplatformdefs.h
index 01b26d9..9ea192f 100644
--- a/mkspecs/qws/macx-nacl-g++/qplatformdefs.h
+++ b/mkspecs/qws/macx-nacl-g++/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/symbian-armcc/qmake.conf b/mkspecs/symbian-armcc/qmake.conf
index be6af39..77a1966 100644
--- a/mkspecs/symbian-armcc/qmake.conf
+++ b/mkspecs/symbian-armcc/qmake.conf
@@ -53,10 +53,7 @@ INCLUDEPATH = $${EPOCROOT}epoc32/include \
exists($${EPOCROOT}epoc32/include/rvct2_2) {
INCLUDEPATH += $${EPOCROOT}epoc32/include/rvct2_2
- QMAKE_CFLAGS += --preinclude rvct2_2.h
- QMAKE_CXXFLAGS += --preinclude rvct2_2.h
+ DEFINES *= __QT_RVCT_HEADER_IS_2_2__
} else {
INCLUDEPATH += $${EPOCROOT}epoc32/include/rvct
- QMAKE_CFLAGS += --preinclude rvct.h
- QMAKE_CXXFLAGS += --preinclude rvct.h
}
diff --git a/mkspecs/symbian-armcc/qplatformdefs.h b/mkspecs/symbian-armcc/qplatformdefs.h
index 6f084d3..0eb74ca 100644
--- a/mkspecs/symbian-armcc/qplatformdefs.h
+++ b/mkspecs/symbian-armcc/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/symbian-gcce/qmake.conf b/mkspecs/symbian-gcce/qmake.conf
index 9eee43d..f550751a 100644
--- a/mkspecs/symbian-gcce/qmake.conf
+++ b/mkspecs/symbian-gcce/qmake.conf
@@ -54,7 +54,7 @@ DEFINES += __GCCE__ \
UNICODE
QMAKE_LFLAGS_APP += --entry=_E32Startup -u _E32Startup
-QMAKE_LFLAGS_SHLIB += -shared --default-symver --entry _E32Dll -u _E32Dll
+QMAKE_LFLAGS_SHLIB += -shared --default-symver --entry=_E32Dll -u _E32Dll
QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
gcceExtraFlags = --include=$${EPOCROOT}epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -msoft-float -T script
@@ -72,16 +72,16 @@ QMAKE_LFLAGS += --target1-abs \
QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/udeb/
# g++ knows the path to the gcc-shipped-libs, ld doesn't. So cache the full path in the generate Makefile
-QMAKE_GCC_SEARCH_DIRS =$$system($$QMAKE_CXX -print-search-dirs)
-for(line, QMAKE_GCC_SEARCH_DIRS) {
- contains(line, "libraries:") {
- foundIt="1"
- } else {
- contains(foundIt, "1") {
- QMAKE_LFLAGS += $$replace(line, "[=:]", " -L")
- }
- }
+QMAKE_GCC_SEARCH_DIRS = $$system($$QMAKE_CXX -print-search-dirs)
+QMAKE_GCC_SEARCH_DIRS = "$$join(QMAKE_GCC_SEARCH_DIRS, " ")"
+QMAKE_GCC_SEARCH_DIRS = $$replace(QMAKE_GCC_SEARCH_DIRS, ".*libraries: *", "")
+QMAKE_GCC_SEARCH_DIRS = $$replace(QMAKE_GCC_SEARCH_DIRS, "=", "")
+contains(QMAKE_HOST.os,Windows) {
+ QMAKE_GCC_SEARCH_DIRS = $$split(QMAKE_GCC_SEARCH_DIRS, ;)
+} else {
+ QMAKE_GCC_SEARCH_DIRS = $$split(QMAKE_GCC_SEARCH_DIRS, :)
}
+for(line, QMAKE_GCC_SEARCH_DIRS):QMAKE_LIBDIR += $$line
QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib
diff --git a/mkspecs/symbian-gcce/qplatformdefs.h b/mkspecs/symbian-gcce/qplatformdefs.h
index 8549347..9d95a37 100644
--- a/mkspecs/symbian-gcce/qplatformdefs.h
+++ b/mkspecs/symbian-gcce/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm
new file mode 100644
index 0000000..c9a88fc
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm
@@ -0,0 +1,18 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Nokia Corporation (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+
+SINGLETON:=$(call sanitise,QMAKE_CLEAN_SINGLETON_$(EXTENSION_ROOT))
+
+ifeq ($($(SINGLETON)),)
+# Prevent duplicate targets from being created
+$(SINGLETON):=1
+$(eval $(call GenerateStandardCleanTarget,$(wildcard $(patsubst "%",%,$(CLEAN_FILES)))))
+endif
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
index 39ab0f0..8791a47 100644
--- a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
@@ -33,5 +33,6 @@ ifeq ($($(SINGLETON)),)
$(eval $(call qmake_emulator_deployment, $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_TARGET)), $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_SOURCE))))
$(call makepath,$(dir $(DEPLOY_TARGET)))
$(eval $(call GenerateStandardCleanTarget,$(CLEAN_TARGET),''))
+$(eval $(call whatmacro,$(CLEAN_TARGET)))
endif
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qt.xml b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
index ddd8d55..f2f32ee 100644
--- a/mkspecs/symbian-sbsv2/flm/qt/qt.xml
+++ b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
@@ -38,4 +38,9 @@
<interface name="qt.qmake_store_build" extends="Symbian.UserFLM"
flm="qmake_store_build.flm">
</interface>
+
+ <interface name="qt.qmake_clean" extends="Symbian.UserFLM"
+ flm="qmake_clean.flm">
+ <param name='CLEAN_FILES' />
+ </interface>
</build>
diff --git a/mkspecs/unsupported/integrity-ghs/qmake.conf b/mkspecs/unsupported/integrity-ghs/qmake.conf
new file mode 100644
index 0000000..822d6bb
--- /dev/null
+++ b/mkspecs/unsupported/integrity-ghs/qmake.conf
@@ -0,0 +1,72 @@
+#
+# qmake configuration for integrity-ghs
+#
+
+MAKEFILE_GENERATOR = GBUILD
+#MAKEFILE_GENERATOR = UNIX
+TEMPLATE = app
+CONFIG += qt warn_on release integrity unix
+QT += core gui network
+
+QMAKE_CFLAGS = -bsp $$INTEGRITY_BSP -os_dir $__OS_DIR
+QMAKE_CFLAGS += --diag_suppress=1,228,236,381,611,997
+QMAKE_CFLAGS_WARN_ON =
+QMAKE_CFLAGS_WARN_OFF = -w
+QMAKE_CFLAGS_RELEASE = -g -Ospeed -Olink --signed_fields --no_commons
+QMAKE_CFLAGS_DEBUG = -g --no_commons --signed_fields
+QMAKE_CFLAGS_SHLIB =
+QMAKE_CFLAGS_THREAD = -D_REENTRANT
+
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS --no_implicit_include --link_once_templates
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+
+QMAKE_INCDIR =
+QMAKE_LIBDIR =
+QMAKE_INCDIR_X11 =
+QMAKE_LIBDIR_X11 =
+QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
+QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
+QMAKE_INCDIR_OPENGL =
+QMAKE_LIBDIR_OPENGL =
+QMAKE_INCDIR_QTOPIA = $(QPEDIR)/include
+QMAKE_LIBDIR_QTOPIA = $(QPEDIR)/lib
+
+QMAKE_LFLAGS = -lposix -livfs -lnet -lsocket -lfbdev -ldl
+QMAKE_LFLAGS_RELEASE = -g -Ospeed -Olink --no_commons -non_shared --link_once_templates
+QMAKE_LFLAGS_DEBUG = -g --no_commons
+QMAKE_LFLAGS_SHLIB =
+QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
+QMAKE_LFLAGS_SONAME =
+QMAKE_LFLAGS_THREAD =
+QMAKE_LFLAGS_RPATH =
+
+QMAKE_LIBS =
+QMAKE_LIBS_DYNLOAD = -ldl
+QMAKE_LIBS_X11 =
+QMAKE_LIBS_X11SM =
+QMAKE_LIBS_QTOPIA =
+QMAKE_LIBS_THREAD =
+
+QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
+QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
+
+QMAKE_AR = ar cqs
+QMAKE_RANLIB =
+
+QMAKE_TAR = tar -cf
+QMAKE_GZIP = gzip -9f
+
+QMAKE_COPY = cp -f
+QMAKE_MOVE = mv -f
+QMAKE_DEL_FILE = rm -f
+QMAKE_DEL_DIR = rmdir
+QMAKE_CHK_DIR_EXISTS = test -d
+QMAKE_MKDIR = mkdir -p
+load(qt_config)
+
diff --git a/mkspecs/unsupported/integrity-ghs/qplatformdefs.h b/mkspecs/unsupported/integrity-ghs/qplatformdefs.h
new file mode 100644
index 0000000..adfb374
--- /dev/null
+++ b/mkspecs/unsupported/integrity-ghs/qplatformdefs.h
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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$
+**
+****************************************************************************/
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
+
+#include <unistd.h>
+
+// We are hot - unistd.h should have turned on the specific APIs we requested
+
+#include <pthread.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
+#include <signal.h>
+#include <dlfcn.h>
+#include <limits.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <netinet/in.h>
+#ifndef QT_NO_IPV6IFNAME
+#include <net/if.h>
+#endif
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_STATBUF struct stat64
+#define QT_STATBUF4TSTAT struct stat64
+#define QT_STAT ::stat64
+#define QT_FSTAT ::fstat64
+#define QT_LSTAT ::lstat64
+#define QT_OPEN ::open64
+#define QT_TRUNCATE ::truncate64
+#define QT_FTRUNCATE ::ftruncate64
+#define QT_LSEEK ::lseek64
+#else
+#define QT_STATBUF struct stat
+#define QT_STATBUF4TSTAT struct stat
+#define QT_STAT ::stat
+#define QT_FSTAT ::fstat
+#define QT_LSTAT ::lstat
+#define QT_OPEN ::open
+#define QT_TRUNCATE ::truncate
+#define QT_FTRUNCATE ::ftruncate
+#define QT_LSEEK ::lseek
+#endif
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_FOPEN ::fopen64
+#define QT_FSEEK ::fseeko64
+#define QT_FTELL ::ftello64
+#define QT_FGETPOS ::fgetpos64
+#define QT_FSETPOS ::fsetpos64
+#define QT_FPOS_T fpos64_t
+#define QT_OFF_T off64_t
+#else
+#define QT_FOPEN ::fopen
+#define QT_FSEEK ::fseek
+#define QT_FTELL ::ftell
+#define QT_FGETPOS ::fgetpos
+#define QT_FSETPOS ::fsetpos
+#define QT_FPOS_T fpos_t
+#define QT_OFF_T long
+#endif
+
+#define QT_STAT_REG S_IFREG
+#define QT_STAT_DIR S_IFDIR
+#define QT_STAT_MASK S_IFMT
+#define QT_STAT_LNK S_IFLNK
+#define QT_SOCKET_CONNECT ::connect
+#define QT_SOCKET_BIND ::bind
+#define QT_FILENO fileno
+#ifndef QT_CLOSE
+#define QT_CLOSE ::close
+#endif
+#ifndef QT_READ
+#define QT_READ ::read
+#endif
+#ifndef QT_WRITE
+#define QT_WRITE ::write
+#endif
+#define QT_ACCESS ::access
+#define QT_GETCWD ::getcwd
+#define QT_CHDIR ::chdir
+#define QT_MKDIR ::mkdir
+#define QT_RMDIR ::rmdir
+#define QT_OPEN_RDONLY O_RDONLY
+#define QT_OPEN_WRONLY O_WRONLY
+#define QT_OPEN_RDWR O_RDWR
+#define QT_OPEN_CREAT O_CREAT
+#define QT_OPEN_TRUNC O_TRUNC
+#define QT_OPEN_APPEND O_APPEND
+
+#define QT_SIGNAL_RETTYPE void
+#define QT_SIGNAL_ARGS int
+#define QT_SIGNAL_IGNORE SIG_IGN
+
+#define QT_MMAP ::mmap
+
+// Directory iteration
+#define QT_DIR DIR
+
+#define QT_OPENDIR ::opendir
+#define QT_CLOSEDIR ::closedir
+
+
+#if defined(QT_LARGEFILE_SUPPORT) \
+ && defined(QT_USE_XOPEN_LFS_EXTENSIONS) \
+ && !defined(QT_NO_READDIR64)
+# define QT_DIRENT struct dirent64
+# define QT_READDIR ::readdir64
+# define QT_READDIR_R ::readdir64_r
+#else
+# define QT_DIRENT struct dirent
+# define QT_READDIR ::readdir
+# define QT_READDIR_R ::readdir_r
+#endif
+
+#define QT_SOCKLEN_T socklen_t
+
+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+#define QT_SNPRINTF ::snprintf
+#define QT_VSNPRINTF ::vsnprintf
+#endif
+
+#ifndef MAXNAMLEN
+# define MAXNAMLEN NAME_MAX
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef NSIG
+# define NSIG _SIGMAX
+#endif
+
+#ifndef MAP_ANON
+# define MAP_ANON 0
+#endif
+
+typedef void (*sighandler_t)(int);
+
+#ifndef QT_NO_MMAP
+# define QT_NO_MMAP
+#endif
+
+#ifndef QT_NO_SHAREDMEMORY
+# define QT_NO_SHAREDMEMORY
+#endif
+
+#ifndef QT_NO_SYSTEMSEMAPHORE
+# define QT_NO_SYSTEMSEMAPHORE
+#endif
+
diff --git a/mkspecs/unsupported/linux-armcc/qmake.conf b/mkspecs/unsupported/linux-armcc/qmake.conf
new file mode 100644
index 0000000..77891c3
--- /dev/null
+++ b/mkspecs/unsupported/linux-armcc/qmake.conf
@@ -0,0 +1,32 @@
+#
+# qmake configuration for linux-armcc
+#
+
+MAKEFILE_GENERATOR = UNIX
+TARGET_PLATFORM = unix
+TEMPLATE = app
+CONFIG += qt warn_on release incremental link_prl armcc_linker
+QT += core gui
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../../common/linux.conf)
+include(../../common/armcc.conf)
+load(qt_config)
+
+# use armcc for linking since armlink doesn't understand the arm_linux_config_file option
+QMAKE_LINK = armcc
+QMAKE_LINK_SHLIB = armcc
+QMAKE_LINK_C = armcc
+QMAKE_LINK_C_SHLIB = armcc
+
+QMAKE_LFLAGS_SHLIB += --apcs=/fpic --shared
+QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
+
+QMAKE_LIBS += libstdc++.so librt.so
+
+CONFIG -= rvct_linker
+
+QMAKE_CFLAGS += --gnu --arm_linux --dllimport_runtime --thumb --cpu Cortex-A9 --arm_linux_config_file="$(HOME)/qt_rvct_config" --arm-linux-paths --apcs=/interwork --visibility_inlines_hidden --diag_suppress 1300,2523
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --cpp
+
+QMAKE_LFLAGS += --diag_suppress 6331,6780,6439 --arm_linux_config_file="$(HOME)/qt_rvct_config" --arm-linux-paths
diff --git a/mkspecs/unsupported/linux-armcc/qplatformdefs.h b/mkspecs/unsupported/linux-armcc/qplatformdefs.h
new file mode 100644
index 0000000..31927a6
--- /dev/null
+++ b/mkspecs/unsupported/linux-armcc/qplatformdefs.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the qmake spec 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 QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
+
+// 1) need to reset default environment if _BSD_SOURCE is defined
+// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
+// 3) it seems older glibc need this to include the X/Open stuff
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#include <unistd.h>
+
+
+// We are hot - unistd.h should have turned on the specific APIs we requested
+
+#include <features.h>
+#include <pthread.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/ipc.h>
+#include <sys/time.h>
+#include <sys/shm.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <netinet/in.h>
+#ifndef QT_NO_IPV6IFNAME
+#include <net/if.h>
+#endif
+
+#define QT_USE_XOPEN_LFS_EXTENSIONS
+#include "../../common/posix/qplatformdefs.h"
+
+#undef QT_SOCKLEN_T
+
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+#define QT_SOCKLEN_T socklen_t
+#else
+#define QT_SOCKLEN_T int
+#endif
+
+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+#define QT_SNPRINTF ::snprintf
+#define QT_VSNPRINTF ::vsnprintf
+#endif
+
+#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/unsupported/linux-clang/qplatformdefs.h b/mkspecs/unsupported/linux-clang/qplatformdefs.h
index 2dd7b80..f4f27f3 100644
--- a/mkspecs/unsupported/linux-clang/qplatformdefs.h
+++ b/mkspecs/unsupported/linux-clang/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/unsupported/macx-clang/qplatformdefs.h b/mkspecs/unsupported/macx-clang/qplatformdefs.h
index 72f3ac7..eea6495 100644
--- a/mkspecs/unsupported/macx-clang/qplatformdefs.h
+++ b/mkspecs/unsupported/macx-clang/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/mkspecs/unsupported/qws/integrity-arm-cxarm/qmake.conf b/mkspecs/unsupported/qws/integrity-arm-cxarm/qmake.conf
new file mode 100644
index 0000000..acaf3c2
--- /dev/null
+++ b/mkspecs/unsupported/qws/integrity-arm-cxarm/qmake.conf
@@ -0,0 +1,12 @@
+#
+# qmake configuration for integrity-ghs
+#
+
+INTEGRITY_DIR = /enter/your/path/to/INTEGRITY
+INTEGRITY_BSP = enter_your_bsp_name_here
+QMAKE_CC = ccintarm
+QMAKE_CXX = cxintarm
+QMAKE_LINK = cxintarm
+QMAKE_LINK_SHLIB = cxintarm
+include(../../integrity-ghs/qmake.conf)
+
diff --git a/mkspecs/unsupported/qws/integrity-arm-cxarm/qplatformdefs.h b/mkspecs/unsupported/qws/integrity-arm-cxarm/qplatformdefs.h
new file mode 100644
index 0000000..e19f8dd
--- /dev/null
+++ b/mkspecs/unsupported/qws/integrity-arm-cxarm/qplatformdefs.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** 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 qmake spec 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 "../../integrity-ghs/qplatformdefs.h"
diff --git a/mkspecs/unsupported/qws/integrity-ppc-cxppc/qmake.conf b/mkspecs/unsupported/qws/integrity-ppc-cxppc/qmake.conf
new file mode 100644
index 0000000..829e6d3
--- /dev/null
+++ b/mkspecs/unsupported/qws/integrity-ppc-cxppc/qmake.conf
@@ -0,0 +1,12 @@
+#
+# qmake configuration for integrity-ghs
+#
+
+INTEGRITY_DIR = /enter/your/path/to/INTEGRITY
+INTEGRITY_BSP = enter_your_bsp_name_here
+QMAKE_CC = ccintppc
+QMAKE_CXX = cxintppc
+QMAKE_LINK = cxintppc
+QMAKE_LINK_SHLIB = cxintppc
+include(../../integrity-ghs/qmake.conf)
+
diff --git a/mkspecs/unsupported/qws/integrity-ppc-cxppc/qplatformdefs.h b/mkspecs/unsupported/qws/integrity-ppc-cxppc/qplatformdefs.h
new file mode 100644
index 0000000..e19f8dd
--- /dev/null
+++ b/mkspecs/unsupported/qws/integrity-ppc-cxppc/qplatformdefs.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** 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 qmake spec 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 "../../integrity-ghs/qplatformdefs.h"
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 65ae590..da65727 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -62,6 +62,8 @@ QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT= object_script
+QMAKE_PREFIX_STATICLIB = lib
+QMAKE_EXTENSION_STATICLIB = a
QMAKE_LIBS =
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index a24076e..fd502e0 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -11,7 +11,7 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o \
symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o \
- symbiancommon.o registry.o epocroot.o
+ symbiancommon.o registry.o epocroot.o gbuild.o
#qt code
QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
@@ -38,6 +38,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp \
generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
generaters/symbian/symbiancommon.cpp \
+ generators/integrity/gbuild.cpp \
$(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
@@ -68,7 +69,8 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/src/corelib/kernel/qsystemerror.cpp \
$(QTSRCS)
-CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian \
+CPPFLAGS = -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 \
+ -Igenerators/mac -Igenerators/symbian -Igenerators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/tools/shared \
@@ -318,6 +320,9 @@ registry.o: $(SOURCE_PATH)/tools/shared/windows/registry.cpp
epocroot.o: $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
+gbuild.o: generators/integrity/gbuild.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/integrity/gbuild.cpp
+
projectgenerator.o: generators/projectgenerator.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/projectgenerator.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 4d29537..0ab2932 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -31,7 +31,7 @@ CFLAGS_EXTRA = /MP
CFLAGS_BARE = -c -Fo./ \
-W3 -nologo -O2 \
$(CFLAGS_EXTRA) \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \
+ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian -Igenerators\integrity \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
-I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
@@ -62,7 +62,8 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw
makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \
msvc_objectmodel.obj msbuild_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \
- symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj
+ symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj \
+ gbuild.obj
!IFDEF QMAKE_OPENSOURCE_EDITION
CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
@@ -169,6 +170,9 @@ qmake_pch.obj:
{$(SOURCE_PATH)\qmake\generators\symbian}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
+{$(SOURCE_PATH)\qmake\generators\integrity}.cpp{}.obj::
+ $(CXX) $(CXXFLAGS) $<
+
{$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 59ac8c2..0707a3a 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -15,7 +15,7 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
- -Igenerators/symbian \
+ -Igenerators/symbian -Igenerators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
@@ -39,7 +39,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \
msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \
- symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o
+ symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -311,6 +311,9 @@ registry.o: $(SOURCE_PATH)/tools/shared/windows/registry.cpp
epocroot.o: $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
+gbuild.o: $(SOURCE_PATH)/qmake/generators/integrity/gbuild.cpp
+ $(CXX) $(CXXFLAGS) generators/integrity/gbuild.cpp
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index a84b3f6..c3537e3 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -15,7 +15,7 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
- -Igenerators/symbian \
+ -Igenerators/symbian -Igenerators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
@@ -39,7 +39,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \
msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \
- symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o
+ symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -310,6 +310,10 @@ registry.o: $(SOURCE_PATH)/tools/shared/windows/registry.cpp
epocroot.o: $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp
+gbuild.o: $(SOURCE_PATH)/qmake/generators/integrity/gbuild.cpp
+ $(CXX) $(CXXFLAGS) generators/integrity/gbuild.cpp
+
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp
new file mode 100644
index 0000000..17bd8f0
--- /dev/null
+++ b/qmake/generators/integrity/gbuild.cpp
@@ -0,0 +1,442 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 "gbuild.h"
+#include "option.h"
+#include "meta.h"
+#include <qdir.h>
+#include <qregexp.h>
+#include <qcryptographichash.h>
+#include <qdebug.h>
+#include <stdlib.h>
+#include <time.h>
+#ifdef Q_OS_UNIX
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+unsigned int dllbase = 0x01000000;
+#define DLLOFFSET 0x600000
+
+GBuildMakefileGenerator::GBuildMakefileGenerator() : MakefileGenerator()
+{
+ nativebins << "moc" << "rcc" << "uic" << "bootstrap";
+}
+
+bool
+GBuildMakefileGenerator::write()
+{
+ QStringList tmp;
+ QString filename(Option::output.fileName());
+ QString pathtoremove(qmake_getpwd());
+ QString relpath(pathtoremove);
+ QString strtarget(project->first("TARGET"));
+ bool isnativebin = nativebins.contains(strtarget);
+ relpath.replace(Option::output_dir, "");
+
+ /* correct output for non-prl, non-recursive case */
+ QString outname(qmake_getpwd());
+ outname += QDir::separator();
+ outname += fileInfo(Option::output.fileName()).baseName();
+ outname += projectSuffix();
+ Option::output.close();
+ Option::output.setFileName(outname);
+ MakefileGenerator::openOutput(Option::output, QString());
+
+ if (strtarget != fileInfo(project->projectFile()).baseName()) {
+ QString gpjname(strtarget);
+ QString outputName(qmake_getpwd());
+ outputName += QDir::separator();
+ outputName += fileInfo(project->projectFile()).baseName();
+ outputName += projectSuffix();
+ QFile f(outputName);
+ f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ QTextStream t(&f);
+ t << "#!gbuild\n";
+ t << "[Project]\n";
+ t << gpjname << projectSuffix() << "\n";
+ if ((project->first("TEMPLATE") == "lib")
+ && project->isActiveConfig("shared"))
+ t << gpjname << "_shared" << projectSuffix() << "\n";
+ t.flush();
+ gpjname += projectSuffix();
+ Option::output.close();
+ Option::output.setFileName(gpjname);
+ MakefileGenerator::openOutput(Option::output, QString());
+ }
+
+ if ((project->first("TEMPLATE") == "app")
+ && (!isnativebin)) {
+ QTextStream t(&Option::output);
+ QString intname(strtarget);
+ intname += ".int";
+ /* this is for bulding an INTEGRITY application.
+ * generate the .int integrate file and the .gpj INTEGRITY Application
+ * project file, then go on with regular files */
+ t << "#!gbuild" << "\n";
+ t << "[INTEGRITY Application]" << "\n";
+ t << "\t:binDirRelative=.\n";
+ t << "\t-o " << strtarget << "\n";
+ t << intname << "\n";
+ t << strtarget << "_app" << projectSuffix() << "\n";
+ t.flush();
+
+ /* generate integrate file */
+ QFile f(intname);
+ f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ QTextStream ti(&f);
+ ti << "# This is a file automatically generated by qmake" << "\n";
+ ti << "# Modifications will be lost next time you run qmake" << "\n";
+ ti << "Kernel" << "\n";
+ ti << "\tFilename\tDynamicDownload" << "\n";
+ ti << "EndKernel" << "\n" << "\n";
+ ti << "AddressSpace" << "\n";
+ ti << "\tName\t" << strtarget << "\n";
+ ti << "\tFilename\t" << strtarget << "_app" << "\n";
+ ti << "\tMemoryPoolSize\t0x100000" << "\n";
+ ti << "\tLanguage\tC++" << "\n";
+ /* FIXME : heap size is huge to be big enough for every example
+ * it should probably be tailored for each example, btu there is no
+ * good way to guess that */
+ ti << "\tHeapSize\t0x00D00000" << "\n";
+ ti << "\tTask\tInitial" << "\n";
+ ti << "\t\tStackSize\t0x30000" << "\n";
+ ti << "\tEndTask" << "\n";
+ ti << "EndAddressSpace" << "\n";
+ ti.flush();
+
+ /* change current project file to <projectname>_app.gpj and continue
+ * generation */
+ filename.insert(filename.lastIndexOf("."), "_app");
+ Option::output.close();
+ Option::output.setFileName(filename);
+ MakefileGenerator::openOutput(Option::output, QString());
+ } else if ((project->first("TEMPLATE") == "lib")
+ && project->isActiveConfig("shared")) {
+ QString gpjname(strtarget);
+ gpjname += "_shared";
+ gpjname += projectSuffix();
+ QFile f(gpjname);
+ f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ QTextStream t(&f);
+ t << "#!gbuild\n"
+ "[Program]\n"
+ "\t-A libINTEGRITY.so\n"
+ "\t-A libc.so\n"
+ "\t-A libscxx.so\n"
+ "\t-A libQtCore.so\n"
+ "\t-e __ghsbegin_text\n"
+ "\t-startfile=-\n"
+ "\t:syslibraries=-\n"
+ "\t-Onolink\n";
+ t << "\t-o lib" << strtarget << ".so\n";
+ t << "\t-l" << strtarget << "\n";
+ t << "\t-extractall=-l" << strtarget << "\n";
+ t << "\t:outputDir=work/" << filename.section(QDir::separator(), 0, -1).remove(".gpj") << "\n";
+ t << strtarget << "_shared.ld\n";
+ t << "$(__OS_DIR)/intlib/sharedobjbssinit.c\n";
+ t.flush();
+
+ QFile fl(strtarget + "_shared.ld");
+ fl.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ QTextStream tl(&fl);
+ tl << "CONSTANTS {\n"
+ " __INTEGRITY_MinPageAlign = 16K\n"
+ " __INTEGRITY_MaxPageAlign = 16K\n"
+ " __INTEGRITY_LibCBaseAddress = \n";
+ tl << dllbase << "\n";
+ tl << "}\n"
+ "-sec\n"
+ "{\n"
+ " .picbase __INTEGRITY_LibCBaseAddress :\n"
+ " .text :\n"
+ " .syscall :\n"
+ " .intercall :\n"
+ " .interfunc :\n"
+ " .secinfo :\n"
+ " .rodata align(16) :\n"
+ " .fixaddr :\n"
+ " .fixtype :\n"
+ " .rombeg :\n"
+ " .textchecksum :\n"
+ " // The above sections may be large. Leave a bigger gap for large pages.\n"
+ " .pidbase align(__INTEGRITY_MaxPageAlign) :\n"
+ " .sdabase :\n"
+ " .data :\n"
+ " .toc :\n"
+ " .opd :\n"
+ " .datachecksum :\n"
+ " .bss align(__INTEGRITY_MinPageAlign) :\n"
+ " .heap :\n"
+ "}\n";
+ tl.flush();
+ dllbase += DLLOFFSET;
+ }
+
+ warn_msg(WarnParser, Option::output.fileName().toAscii());
+ QTextStream t(&Option::output);
+ QString primaryTarget(project->values("QMAKE_CXX").at(0));
+
+ pathtoremove += QDir::separator();
+ filename.remove(qmake_getpwd());
+
+ //HEADER
+ t << "#!gbuild" << "\n";
+
+ /* find the architecture out of the compiler name */
+ if (filename.endsWith("projects.gpj")) {
+ primaryTarget.remove(0, 5);
+ t << "macro QT_BUILD_DIR=%expand_path(.)\n";
+ t << "macro __OS_DIR=" << project->values("INTEGRITY_DIR").first() << "\n";
+ t << "primaryTarget=" << primaryTarget << "_integrity.tgt" << "\n";
+ t << "customization=util/integrity/qt.bod\n";
+ }
+ /* project type */
+ if (project->first("TEMPLATE") == "app") {
+ t << "[Program]" << "\n";
+ if (isnativebin) {
+ t << "\t:binDir=bin\n";
+ t << "\t-o " << strtarget << "\n";
+ } else {
+ t << "\t:binDirRelative=.\n";
+ t << "\t-o " << strtarget << "_app\n";
+ }
+ } else if (project->first("TEMPLATE") == "lib") {
+ t << "[Library]" << "\n";
+ t << "\t:binDir=lib" << "\n";
+ t << "\t-o lib" << strtarget << ".a" << "\n";
+ } else if (project->first("TEMPLATE") == "subdirs")
+ t << "[Project]" << "\n";
+ else
+ t << project->first("TEMPLATE") << "\n";
+
+ /* compilations options */
+ t << "\t:sourceDir=." << "\n";
+
+ t << "\t:outputDir=work" << relpath << "\n";
+ if (filename.endsWith("projects.gpj")) {
+ t << "\t:sourceDir=work\n";
+ t << "\t-Iwork\n";
+ t << "\t-Llib\n";
+ t << "\t";
+ QStringList &l = project->values("QMAKE_CXXFLAGS");
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it).startsWith("-"))
+ t << "\n" << "\t" << (*it);
+ else
+ t << " " << (*it);
+ }
+ t << "\n";
+ }
+ t << "\n";
+
+ t << varGlue("DEFINES", "\t-D", "\n\t-D", "\n");
+
+ t << "\t-I.\n\t-I" << specdir() << "\n";
+ t << varGlue("INCLUDEPATH", "\t-I", "\n\t-I", "\n");
+ t << "\t--cxx_include_directory .\n\t--cxx_include_directory " << specdir() << "\n";
+ t << varGlue("INCLUDEPATH", "\t--cxx_include_directory ", "\n\t--cxx_include_directory ", "\n");
+
+ if (project->first("TEMPLATE") == "app") {
+ /* include linker flags if it's an application */
+ QString src[] = { "QMAKE_LFLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LIBDIR_FLAGS", "QMAKE_LIBS", "LIBS", QString() };
+ for (int i = 0; !src[i].isNull(); i++) {
+ /* skip target libraries for native tools */
+ if (isnativebin && (i == 0))
+ continue;
+ t << "\t";
+ QStringList &l = project->values(src[i]);
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it).startsWith("-"))
+ t << "\n" << "\t" << (*it);
+ else
+ t << " " << (*it);
+ }
+ t << "\n";
+ }
+ }
+
+ /* first subdirectories/subprojects */
+ {
+ QStringList &l = project->values("SUBDIRS");
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ QString gpjname((*it));
+ /* avoid native tools */
+ if (nativebins.contains(gpjname.section("_", -1)))
+ continue;
+ if (!project->first((*it) + ".subdir").isEmpty())
+ gpjname = project->first((*it) + ".subdir");
+ else
+ gpjname.replace("_", QDir::separator());
+ gpjname += QDir::separator() + gpjname.section(QDir::separator(), -1);
+ gpjname += projectSuffix();
+ /* make relative */
+ if (!project->values("QT_SOURCE_TREE").isEmpty()) {
+ gpjname.replace(project->values("QT_SOURCE_TREE").first() + QDir::separator(), "");
+ }
+ t << gpjname << "\n";
+ }
+ }
+
+ {
+ QStringList &l = project->values("RESOURCES");
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ QString tmpstr((*it).replace(pathtoremove, ""));
+ t << tmpstr << "\t[Qt Resource]\n";
+ tmpstr = tmpstr.section(".", -2, -1).section(QDir::separator(), -1);
+ tmpstr.remove(".qrc");
+ t << "\t-name " << tmpstr << "\n";
+ tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "qrc_");
+ tmpstr.append(".cpp");
+ t << "\t-o work/" << tmpstr << "\n";
+ }
+ }
+ {
+ QStringList &l = project->values("FORMS");
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ QString tmpstr((*it).replace(pathtoremove, ""));
+ t << tmpstr << "\t[Qt Dialog]\n";
+ tmpstr = tmpstr.section(".", 0, 0).section(QDir::separator(), -1);
+ tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "ui_");
+ tmpstr.remove(".ui");
+ tmpstr.append(".h");
+ t << "\t-o work/" << tmpstr << "\n";
+ }
+ }
+
+ /* source files for this project */
+ QString src[] = { "HEADERS", "SOURCES", QString() };
+ for (int i = 0; !src[i].isNull(); i++) {
+ QStringList &l = project->values(src[i]);
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it).isEmpty())
+ continue;
+ /* native tools aren't preprocessed */
+ if (!isnativebin)
+ t << writeOne((*it), pathtoremove);
+ else
+ t << (*it).remove(pathtoremove) << "\n";
+ }
+ }
+ t << "\n";
+
+ {
+ QStringList &l = project->values("GENERATED_SOURCES");
+ for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ t << "work/" << (*it).section(QDir::separator(), -1) << "\n";
+ }
+ }
+
+ return true;
+}
+
+QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove)
+{
+ QString s("");
+ s += filename.remove(pathtoremove);
+ if (filename.endsWith(Option::h_ext.first())) {
+ QString corename(filename.section(QDir::separator(), -1));
+ corename.remove(Option::h_ext.first());
+ corename.append(Option::cpp_ext.first());
+ corename.prepend(Option::h_moc_mod);
+ s += "\t[MOC/Qt Header]\n";
+ s += "\t-o ";
+ s += "work/";
+ s += corename;
+ s += "\n";
+ } else if (filename.section(QDir::separator(), -1).startsWith("qrc_")) {
+ QString tmpstr(filename.section("/", -1).section(".", 0, -1).remove("qrc_").remove(".cpp"));
+ s += "\n\t:depends=";
+ s += tmpstr;
+ s += ".qrc";
+ s += "\n";
+ } else if (filename.endsWith(Option::cpp_ext.first())) {
+ QString tmpstr(filename.section("/", -1));
+// QString moctool(project->values("QMAKE_MOC").first());
+ QString filepath(pathtoremove);
+ if (!project->values("QT_SOURCE_TREE").isEmpty()) {
+ filepath.remove(project->values("QT_SOURCE_TREE").first());
+ filepath.remove(0, 1);
+ }
+// if (!project->values("QT_BUILD_TREE").isEmpty()) {
+// moctool.remove(project->values("QT_BUILD_TREE").first());
+// moctool.remove(0, 1);
+// }
+ s += "\n\t:preexecShellSafe='${QT_BUILD_DIR}/bin/moc ";
+// s += moctool;
+// s += " ";
+ s += varGlue("DEFINES", "-D", " -D", " ");
+ s += varGlue("INCLUDEPATH", "-I", " -I", " ");
+ s += filepath;
+ s += filename;
+ s += " -o ";
+ tmpstr.replace(Option::cpp_ext.first(), Option::cpp_moc_ext);
+ s += "work/";
+ s += tmpstr;
+ s += "\n";
+ } else
+ s += "\n";
+ return s;
+}
+
+bool
+GBuildMakefileGenerator::openOutput(QFile &file, const QString &build) const
+{
+ debug_msg(1, "file is %s", file.fileName().toLatin1().constData());
+ QFileInfo fi(file);
+ if (fi.filePath().isEmpty())
+ file.setFileName(qmake_getpwd() + QDir::separator() + file.fileName());
+ if (!file.fileName().endsWith(projectSuffix())) {
+ QString outputName(file.fileName());
+ outputName += QDir::separator();
+ outputName += fileInfo(project->projectFile()).baseName();
+ outputName += projectSuffix();
+ warn_msg(WarnParser, outputName.toAscii());
+ file.setFileName(outputName);
+ }
+ debug_msg(1, "file is %s", file.fileName().toLatin1().constData());
+ bool ret = MakefileGenerator::openOutput(file, QString());
+ return ret;
+}
+
+QT_END_NAMESPACE
diff --git a/qmake/generators/integrity/gbuild.h b/qmake/generators/integrity/gbuild.h
new file mode 100644
index 0000000..6b5b1a0
--- /dev/null
+++ b/qmake/generators/integrity/gbuild.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 GBUILD_H
+#define GBUILD_H
+
+#include "makefile.h"
+
+QT_BEGIN_NAMESPACE
+
+class GBuildMakefileGenerator : public MakefileGenerator
+{
+ virtual bool write();
+
+ QString projectSuffix() const { return QString(".gpj"); };
+ QString writeOne(QString filename, QString pathtoremove = "");
+
+public:
+ GBuildMakefileGenerator();
+ ~GBuildMakefileGenerator();
+
+ virtual bool supportsMetaBuild() { return false; }
+ virtual bool openOutput(QFile &, const QString &) const;
+protected:
+ bool doPrecompiledHeaders() const { return false; }
+ virtual bool doDepends() const { return true; }
+ QStringList nativebins;
+
+};
+
+inline GBuildMakefileGenerator::~GBuildMakefileGenerator()
+{ }
+
+QT_END_NAMESPACE
+
+#endif // GBUILD_H
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index f0ab435..a3fba6a 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -138,12 +138,12 @@ BuildsMetaMakefileGenerator::init()
Build *build = new Build;
build->name = name;
build->makefile = createMakefileGenerator(project, false);
- if (build->makefile){
+ if (build->makefile){
makefiles += build;
- }else {
- delete build;
- return false;
- }
+ }else {
+ delete build;
+ return false;
+ }
}
return true;
}
@@ -179,7 +179,7 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd)
using_stdout = true;
} else {
if(Option::output.fileName().isEmpty() &&
- Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
+ Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
Option::output.setFileName(project->first("QMAKE_MAKEFILE"));
Option::output_dir = oldpwd;
QString build_name = build->name;
@@ -306,7 +306,7 @@ SubdirsMetaMakefileGenerator::init()
&& project->isRecursive());
if(recurse) {
QString old_output_dir = Option::output_dir;
- QString old_output = Option::output.fileName();
+ QString old_output = Option::output.fileName();
QString oldpwd = qmake_getpwd();
QString thispwd = oldpwd;
if(!thispwd.endsWith('/'))
@@ -387,7 +387,7 @@ SubdirsMetaMakefileGenerator::init()
self->input_dir = qmake_getpwd();
self->output_dir = Option::output_dir;
if(!recurse || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
- self->output_file = Option::output.fileName();
+ self->output_file = Option::output.fileName();
self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
self->makefile->init();
subs.append(self);
@@ -420,10 +420,10 @@ SubdirsMetaMakefileGenerator::write(const QString &oldpwd)
writepwd = oldpwd;
if(!(ret = subs.at(i)->makefile->write(writepwd)))
break;
- //restore because I'm paranoid
+ //restore because I'm paranoid
qmake_setpwd(pwd);
- Option::output.setFileName(output_name);
- Option::output_dir = output_dir;
+ Option::output.setFileName(output_name);
+ Option::output_dir = output_dir;
}
return ret;
}
@@ -448,6 +448,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "symmake_abld.h"
#include "symmake_sbsv2.h"
#include "symbian_makefile.h"
+#include "gbuild.h"
QT_END_INCLUDE_NAMESPACE
MakefileGenerator *
@@ -489,6 +490,10 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
mkfile = new SymbianSbsv2MakefileGenerator;
} else if(gen == "SYMBIAN_UNIX") {
mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>;
+ } else if(gen == "SYMBIAN_MINGW") {
+ mkfile = new SymbianMakefileTemplate<MingwMakefileGenerator>;
+ } else if(gen == "GBUILD") {
+ mkfile = new GBuildMakefileGenerator;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
}
@@ -545,7 +550,7 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen,
} else if (gen == "PROJECTBUILDER" || gen == "XCODE") {
*host_mode = Option::HOST_MACX_MODE;
*target_mode = Option::TARG_MACX_MODE;
- } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") {
+ } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX" || gen == "SYMBIAN_MINGW") {
#if defined(Q_OS_MAC)
*host_mode = Option::HOST_MACX_MODE;
#elif defined(Q_OS_UNIX)
@@ -554,6 +559,9 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen,
*host_mode = Option::HOST_WIN_MODE;
#endif
*target_mode = Option::TARG_SYMBIAN_MODE;
+ } else if (gen == "GBUILD") {
+ *host_mode = Option::HOST_UNIX_MODE;
+ *target_mode = Option::TARG_INTEGRITY_MODE;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
return false;
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 46b8cf5..32b465b 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -394,8 +394,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile,
t << manufacturerStr << endl;
}
- // ### FIXME: remove epocBuild check once makefile based mkspecs support localized resource generation
- if (epocBuild && symbianLocalizationList.size()) {
+ if (symbianLocalizationList.size()) {
// Add localized resources to DEPLOYMENT if default resource deployment is done
addLocalizedResourcesToDeployment("default_resource_deployment.files", symbianLocalizationList);
addLocalizedResourcesToDeployment("default_reg_deployment.files", symbianLocalizationList);
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 9eccd46..0fdef86 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -721,6 +721,21 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << "END" << endl;
t << endl;
+ // Handle QMAKE_CLEAN
+ QStringList cleanFiles = project->values("QMAKE_CLEAN");
+ if (!cleanFiles.isEmpty()) {
+ QStringList absoluteCleanFiles;
+ foreach (QString cleanFile, cleanFiles) {
+ QFileInfo fi(cleanFile);
+ QString fileName = QLatin1String("\"");
+ fileName.append(fi.absoluteFilePath());
+ fileName.append(QLatin1String("\""));
+ absoluteCleanFiles << fileName;
+ }
+ t << "START EXTENSION qt/qmake_clean" << endl;
+ t << "OPTION CLEAN_FILES " << absoluteCleanFiles.join(" ") << endl;
+ t << "END" << endl;
+ }
t << endl;
}
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 29d85f7..e659e62 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -148,6 +148,8 @@ UnixMakefileGenerator::init()
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + libdirs[i];
if (project->isActiveConfig("rvct_linker")) {
project->values("QMAKE_LIBDIR_FLAGS") += "--userlibpath " + escapeFilePath(libdirs[i]);
+ } else if (project->isActiveConfig("armcc_linker")) {
+ project->values("QMAKE_LIBDIR_FLAGS") += "-L--userlibpath=" + escapeFilePath(libdirs[i]);
} else {
project->values("QMAKE_LIBDIR_FLAGS") += "-L" + escapeFilePath(libdirs[i]);
}
@@ -486,7 +488,7 @@ UnixMakefileGenerator::findLibraries()
} else if(opt.startsWith("-l")) {
if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) {
(*it) = opt.mid(2);
- } else if (project->isActiveConfig("rvct_linker")) {
+ } else if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) {
(*it) = "lib" + opt.mid(2) + ".so";
} else {
stub = opt.mid(2);
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d7145b4..5ea13f4 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -536,7 +536,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t"
<< "-$(MOVE) $(TARGET) " << destdir;
if(!project->isEmpty("QMAKE_POST_LINK"))
- t << "\n\t" << var("QMAKE_POST_LINK") << "\n\t";
+ t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "\n\t"
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index a450f04..2639332 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -202,8 +202,31 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
}
}
+void createRvctObjectScriptFile(const QString &fileName, const QStringList &objList)
+{
+ QString filePath = Option::output_dir + QDir::separator() + fileName;
+ QFile file(filePath);
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ QTextStream t(&file);
+ for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ if (QDir::isRelativePath(*it))
+ t << "./" << *it << endl;
+ else
+ t << *it << endl;
+ }
+ t.flush();
+ file.close();
+ }
+}
+
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
+ if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(";") << endl;
+ t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(";") << endl;
+ t << "\n\n";
+ }
+
writeStandardParts(t);
if (!preCompHeaderOut.isEmpty()) {
@@ -270,7 +293,7 @@ void MingwMakefileGenerator::init()
if(configs.indexOf("qt") == -1)
configs.append("qt");
- if(project->isActiveConfig("dll")) {
+ if(project->isActiveConfig("dll") && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) {
QString destDir = "";
if(!project->first("DESTDIR").isEmpty())
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
@@ -279,7 +302,7 @@ void MingwMakefileGenerator::init()
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
}
- if(!project->values("DEF_FILE").isEmpty())
+ if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
project->values("QMAKE_LFLAGS").append(QString("-Wl,") + project->first("DEF_FILE"));
MakefileGenerator::init();
@@ -315,12 +338,9 @@ void MingwMakefileGenerator::init()
void MingwMakefileGenerator::fixTargetExt()
{
if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- project->values("TARGET_EXT").append(".a");
project->values("QMAKE_LFLAGS").append("-static");
- project->values("TARGET").first() = "lib" + project->first("TARGET");
- } else {
- Win32MakefileGenerator::fixTargetExt();
}
+ Win32MakefileGenerator::fixTargetExt();
}
void MingwMakefileGenerator::writeIncPart(QTextStream &t)
@@ -348,17 +368,28 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
t << "LIBS = ";
if(!project->values("QMAKE_LIBDIR").isEmpty())
writeLibDirPart(t);
- t << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' '
- << var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl;
+ if (project->isActiveConfig("rvct_linker")) {
+ t << var("QMAKE_LIBS") << ' '
+ << var("QMAKE_LIBS_PRIVATE") << endl;
+ } else {
+ t << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' '
+ << var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl;
+ }
}
}
void MingwMakefileGenerator::writeLibDirPart(QTextStream &t)
{
QStringList libDirs = project->values("QMAKE_LIBDIR");
- for (int i = 0; i < libDirs.size(); ++i)
+ QString libArg = QString::fromLatin1("-L");
+ if (project->isActiveConfig("rvct_linker"))
+ libArg = QString::fromLatin1("--userlibpath ");
+ for (int i = 0; i < libDirs.size(); ++i) {
libDirs[i].remove("\"");
- t << valGlue(libDirs,"-L"+quote,quote+" -L" +quote,quote) << " ";
+ if (libDirs[i].endsWith("\\"))
+ libDirs[i].chop(1);
+ }
+ t << valGlue(libDirs, libArg+quote, quote+" "+libArg+quote, quote) << " ";
}
void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
@@ -370,20 +401,33 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
- createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
- // Strip off any options since the ar commands will be read from file.
- QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
- if (ar_cmd.isEmpty())
- ar_cmd = "ar";
- objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
+ QString ar_cmd = project->values("QMAKE_LIB").join(" ");
+ if (ar_cmd.isEmpty())
+ ar_cmd = "armar --create";
+ objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + ar_script_file;
+ } else {
+ // Strip off any options since the ar commands will be read from file.
+ QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
+ if (ar_cmd.isEmpty())
+ ar_cmd = "ar";
+ createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
+ objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ }
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
- createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = ld_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = QString::fromLatin1("--via ") + ld_script_file;
+ } else {
+ createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = ld_script_file;
+ }
}
Win32MakefileGenerator::writeObjectsPart(t);
}
diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h
index 007b48b..5bc9c7b 100644
--- a/qmake/generators/win32/mingw_make.h
+++ b/qmake/generators/win32/mingw_make.h
@@ -54,17 +54,17 @@ public:
protected:
QString escapeDependencyPath(const QString &path) const;
QString getLibTarget();
+ bool writeMakefile(QTextStream &);
+ void init();
private:
bool isWindowsShell() const;
void writeMingwParts(QTextStream &);
void writeIncPart(QTextStream &t);
void writeLibsPart(QTextStream &t);
void writeLibDirPart(QTextStream &t);
- bool writeMakefile(QTextStream &);
void writeObjectsPart(QTextStream &t);
void writeBuildRulesPart(QTextStream &t);
void writeRcFilePart(QTextStream &t);
- void init();
void processPrlVariable(const QString &var, const QStringList &l);
QStringList &findDependencies(const QString &file);
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index e0a370c..c85533b 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -314,7 +314,8 @@ void Win32MakefileGenerator::processVars()
// TARGET_VERSION_EXT will be used to add a version number onto the target name
if (project->values("TARGET_VERSION_EXT").isEmpty()
- && !project->values("VER_MAJ").isEmpty())
+ && !project->values("VER_MAJ").isEmpty()
+ && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
project->values("TARGET_VERSION_EXT").append(project->values("VER_MAJ").first());
if(project->isEmpty("QMAKE_COPY_FILE"))
@@ -342,16 +343,43 @@ void Win32MakefileGenerator::processVars()
if(!(*libDir_it).isEmpty())
(*libDir_it) = Option::fixPathToTargetOS((*libDir_it), false, false);
}
+
+ if (project->values("TEMPLATE").contains("app")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_APP");
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_APP");
+ } else if (project->values("TEMPLATE").contains("lib") && project->isActiveConfig("dll")) {
+ if(!project->isActiveConfig("plugin") || !project->isActiveConfig("plugin_no_share_shlib_cflags")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_SHLIB");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_SHLIB");
+ }
+ if (project->isActiveConfig("plugin")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_PLUGIN");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_PLUGIN");
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_PLUGIN");
+ } else {
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SHLIB");
+ }
+ }
}
void Win32MakefileGenerator::fixTargetExt()
{
- if (!project->values("QMAKE_APP_FLAG").isEmpty())
+ if (project->isEmpty("QMAKE_EXTENSION_STATICLIB"))
+ project->values("QMAKE_EXTENSION_STATICLIB").append("lib");
+ if (project->isEmpty("QMAKE_EXTENSION_SHLIB"))
+ project->values("QMAKE_EXTENSION_SHLIB").append("dll");
+
+ if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("TARGET_EXT").append(".exe");
- else if (project->isActiveConfig("shared"))
- project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + ".dll");
- else
- project->values("TARGET_EXT").append(".lib");
+ } else if (project->isActiveConfig("shared")) {
+ project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "."
+ + project->first("QMAKE_EXTENSION_SHLIB"));
+ project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET");
+ } else {
+ project->values("TARGET_EXT").append("." + project->first("QMAKE_EXTENSION_STATICLIB"));
+ project->values("TARGET").first() = project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET");
+ }
}
void Win32MakefileGenerator::processRcFileVar()
@@ -673,10 +701,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
QStringList dlldirs = project->values("DLLDESTDIR");
for (QStringList::Iterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
- t << "\n\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " << Option::fixPathToTargetOS(*dlldir, false);
+ t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " << Option::fixPathToTargetOS(*dlldir, false) << endl;
}
}
- t << endl << endl;
+ t << endl;
writeRcFilePart(t);
diff --git a/qmake/option.cpp b/qmake/option.cpp
index fcbf5fa..1354281 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -260,6 +260,8 @@ Option::parseCommandLine(int argc, char **argv, int skip)
Option::host_mode = HOST_WIN_MODE;
Option::target_mode = TARG_WIN_MODE;
Option::target_mode_overridden = true;
+ } else if(opt == "integrity") {
+ Option::target_mode = TARG_INTEGRITY_MODE;
} else if(opt == "d") {
Option::debug_level++;
} else if(opt == "version" || opt == "v" || opt == "-version") {
diff --git a/qmake/option.h b/qmake/option.h
index 23be12f..e3ddc9a 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -156,7 +156,7 @@ struct Option
enum HOST_MODE { HOST_UNKNOWN_MODE, HOST_UNIX_MODE, HOST_WIN_MODE, HOST_MACX_MODE };
static HOST_MODE host_mode;
enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE,
- TARG_SYMBIAN_MODE };
+ TARG_SYMBIAN_MODE, TARG_INTEGRITY_MODE };
static TARG_MODE target_mode;
static bool target_mode_overridden;
static QString user_template, user_template_prefix;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
index b3c229e..d8027ff 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
@@ -1168,8 +1168,17 @@ DEFINE_STUB_FUNCTION(int, timeout_check)
globalData->exception = createInterruptedExecutionException(globalData);
VM_THROW_EXCEPTION_AT_END();
}
-
- CHECK_FOR_EXCEPTION_AT_END();
+#ifdef QT_BUILD_SCRIPT_LIB
+ else {
+ // It's possible that the call to QtScript's implementation of
+ // TimeoutChecker::didTimeOut() caused an error to be thrown.
+ // In that case, didTimeOut() should still return false, since
+ // we don't want the interrupted-exception to override the
+ // user-thrown error. But we need to check for exception here,
+ // otherwise JSC would continue normal execution.
+ CHECK_FOR_EXCEPTION_AT_END();
+ }
+#endif
return timeoutChecker->ticksUntilNextCheck();
}
diff --git a/src/3rdparty/phonon/qt7/videowidget.mm b/src/3rdparty/phonon/qt7/videowidget.mm
index c281e16..0600268 100644
--- a/src/3rdparty/phonon/qt7/videowidget.mm
+++ b/src/3rdparty/phonon/qt7/videowidget.mm
@@ -446,10 +446,12 @@ public:
void setDrawFrameRect(const QRect &rect)
{
- m_movieLayer.frame.origin.x = rect.x();
- m_movieLayer.frame.origin.y = rect.y();
- m_movieLayer.frame.size.width = rect.width();
- m_movieLayer.frame.size.height = rect.height();
+ CGRect frame = m_movieLayer.frame;
+ frame.origin.x = rect.x();
+ frame.origin.y = rect.y();
+ frame.size.width = rect.width();
+ frame.size.height = rect.height();
+ m_movieLayer.frame = frame;
}
#else // QT_MAC_USE_COCOA == false
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index e82ec4c..2de6961 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -15,7 +15,7 @@ symbian: {
webkitlibs.path = /sys/bin
vendorinfo = \
"; Localised Vendor name" \
- "%{\"Nokia, Qt\"}" \
+ "%{\"Nokia\"}" \
" " \
"; Unique Vendor name" \
":\"Nokia, Qt\"" \
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
index 63d9e55..2c0bf6d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
@@ -22,9 +22,9 @@
#include <QtCore/qglobal.h>
-#define QTWEBKIT_VERSION_STR "2.0.1"
+#define QTWEBKIT_VERSION_STR "2.0.2"
// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt.
-#define QTWEBKIT_VERSION 0x020001
+#define QTWEBKIT_VERSION 0x020002
// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt.
#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index b98617f..07754a7 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -1,5 +1,5 @@
-QT_WEBKIT_VERSION = 4.7.2
+QT_WEBKIT_VERSION = 4.7.3
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 7
-QT_WEBKIT_PATCH_VERSION = 2
+QT_WEBKIT_PATCH_VERSION = 3
QT_CONFIG += webkit
diff --git a/src/3rdparty/zlib/zlib.h b/src/3rdparty/zlib/zlib.h
index 9e5b467..bdb9a3d 100644
--- a/src/3rdparty/zlib/zlib.h
+++ b/src/3rdparty/zlib/zlib.h
@@ -1171,7 +1171,7 @@ ZEXTERN int Q_ZEXPORT gzgetc OF((gzFile file));
or -1 in case of end of file or error.
*/
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+ZEXTERN int Q_ZEXPORT gzungetc OF((int c, gzFile file));
/*
Push one character back onto the stream to be read again later.
Only one character of push-back is allowed. gzungetc() returns the
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 7c16f7e..2d5cfab 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -404,6 +404,8 @@ void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d)
The default animation system is driven by a timer that fires at regular intervals.
In some scenarios, it is better to drive the animation based on other synchronization
mechanisms, such as the vertical refresh rate of the screen.
+
+ \internal
*/
QAnimationDriver::QAnimationDriver(QObject *parent)
@@ -420,6 +422,8 @@ QAnimationDriver::QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent)
/*!
Advances the animation based on the current time. This function should
be continuously called by the driver while the animation is running.
+
+ \internal
*/
void QAnimationDriver::advance()
{
@@ -434,6 +438,8 @@ void QAnimationDriver::advance()
/*!
Installs this animation driver. The animation driver is thread local and
will only apply for the thread its installed in.
+
+ \internal
*/
void QAnimationDriver::install()
{
@@ -471,6 +477,8 @@ void QAnimationDriver::stop()
This function is called by the animation framework to notify the driver
that it should start running.
+
+ \internal
*/
/*!
@@ -478,6 +486,8 @@ void QAnimationDriver::stop()
This function is called by the animation framework to notify the driver
that it should stop running.
+
+ \internal
*/
/*!
@@ -491,6 +501,7 @@ QDefaultAnimationDriver::QDefaultAnimationDriver(QUnifiedTimer *timer)
void QDefaultAnimationDriver::timerEvent(QTimerEvent *e)
{
Q_ASSERT(e->timerId() == m_timer.timerId());
+ Q_UNUSED(e); // if the assertions are disabled
advance();
}
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 957b9d5..0900870 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -140,7 +140,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
- QAnimationDriver(QObject *parent);
+ QAnimationDriver(QObject *parent = 0);
void advance();
void install();
@@ -148,8 +148,8 @@ public:
bool isRunning() const;
protected:
- virtual void started() = 0;
- virtual void stopped() = 0;
+ virtual void started() {};
+ virtual void stopped() {};
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0);
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 971069f..cd23e5e 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -12,6 +12,8 @@ symbian:HEADERS += arch/qatomic_symbian.h \
vxworks:HEADERS += arch/qatomic_vxworks.h
+integrity:HEADERS += arch/qatomic_integrity.h
+
!wince*:!win32:!mac:!symbian:HEADERS += arch/qatomic_alpha.h \
arch/qatomic_avr32.h \
arch/qatomic_ia64.h \
diff --git a/src/corelib/arch/integrity/arch.pri b/src/corelib/arch/integrity/arch.pri
new file mode 100644
index 0000000..2c4196e
--- /dev/null
+++ b/src/corelib/arch/integrity/arch.pri
@@ -0,0 +1,3 @@
+#
+# INTEGRITY RTOS architecture
+#
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
index f32aec7..3da833a 100644
--- a/src/corelib/arch/qatomic_arch.h
+++ b/src/corelib/arch/qatomic_arch.h
@@ -46,7 +46,9 @@ QT_BEGIN_HEADER
#include "QtCore/qglobal.h"
-#if defined(QT_ARCH_VXWORKS)
+#if defined(QT_ARCH_INTEGRITY)
+# include "QtCore/qatomic_integrity.h"
+#elif defined(QT_ARCH_VXWORKS)
# include "QtCore/qatomic_vxworks.h"
#elif defined(QT_ARCH_ALPHA)
# include "QtCore/qatomic_alpha.h"
diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h
index f0f2f9a..ac8fe96 100644
--- a/src/corelib/arch/qatomic_armv5.h
+++ b/src/corelib/arch/qatomic_armv5.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -107,7 +107,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
// kernel places a restartable cmpxchg implementation at a fixed address
extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr);
-extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, void *newval, volatile void *ptr);
+extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, const void *newval, volatile void *ptr);
#define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast<qt_atomic_eabi_cmpxchg_int_t *>(0xffff0fc0))
#define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast<qt_atomic_eabi_cmpxchg_ptr_t *>(0xffff0fc0))
diff --git a/src/corelib/arch/qatomic_armv7.h b/src/corelib/arch/qatomic_armv7.h
index a95c4ea..b35866b 100644
--- a/src/corelib/arch/qatomic_armv7.h
+++ b/src/corelib/arch/qatomic_armv7.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/arch/qatomic_integrity.h b/src/corelib/arch/qatomic_integrity.h
new file mode 100644
index 0000000..6563903
--- /dev/null
+++ b/src/corelib/arch/qatomic_integrity.h
@@ -0,0 +1,289 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QATOMIC_INTEGRITY_H
+#define QATOMIC_INTEGRITY_H
+
+#include <INTEGRITY.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+#define qt_i2addr(a) reinterpret_cast<Address *>(const_cast<int *>(a))
+#define qt_p2addr(a) reinterpret_cast<Address *>(const_cast<void *>(a))
+#define qt_addr(a) reinterpret_cast<Address>(a)
+
+
+#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isReferenceCountingNative()
+{ return false; }
+inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
+{ return false; }
+
+#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isTestAndSetNative()
+{ return true; }
+inline bool QBasicAtomicInt::isTestAndSetWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isFetchAndStoreNative()
+{ return true; }
+inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isFetchAndAddNative()
+{ return true; }
+inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
+{ return true; }
+
+// Reference counting
+
+inline bool QBasicAtomicInt::ref()
+{
+ int oldval;
+ AtomicModify(qt_i2addr(&_q_value), qt_i2addr(&oldval), 0, 1);
+ return _q_value != -1;
+}
+
+inline bool QBasicAtomicInt::deref()
+{
+ int oldval;
+ AtomicModify(qt_i2addr(&_q_value), qt_i2addr(&oldval), 0, -1U);
+ return _q_value != 0;
+}
+
+// Test and set for integers
+
+inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
+{
+ return TestAndSet(qt_i2addr(&_q_value), expectedValue, newValue) == Success;
+}
+
+inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+// Fetch and store for integers
+
+inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ int old_val;
+ do {
+ old_val = _q_value;
+ } while (TestAndSet(qt_i2addr(&_q_value), old_val, newValue) != Success);
+ return old_val;
+}
+
+inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+// Fetch and add for integers
+
+inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
+{
+ int old_val;
+ do {
+ old_val = _q_value;
+ } while (TestAndSet(qt_i2addr(&_q_value), old_val, old_val + valueToAdd) != Success);
+ return old_val;
+}
+
+inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+// Test and set for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
+{
+ return TestAndSet((Address*)&_q_value, qt_addr(expectedValue), qt_addr(newValue)) == Success;
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+// Fetch and store for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
+{
+ Address old_val;
+ do {
+ old_val = *reinterpret_cast<Address *>(const_cast<T *>(newValue));
+ } while (TestAndSet(reinterpret_cast<Address *>(const_cast<T **>(&_q_value)), old_val, qt_addr(newValue)) != Success);
+ return reinterpret_cast<T *>(old_val);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+// Fetch and add for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
+{
+ AtomicModify(qt_p2addr(&_q_value), qt_addr(_q_value), qt_addr(_q_value) + valueToAdd * sizeof(T));
+ return _q_value;
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QATOMIC_INTEGRITY_H
+
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 93ed5ed..3c3d39e 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -64,7 +64,7 @@
#ifndef QT_NO_CODECS
# include "qtsciicodec_p.h"
# include "qisciicodec_p.h"
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no iconv(3) support, must build all codecs into the library
# include "../../plugins/codecs/cn/qgb18030codec.h"
@@ -772,7 +772,7 @@ static void setup()
# endif // Q_WS_X11
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no asian codecs when bootstrapping, sorry
(void)new QGb18030Codec;
@@ -805,7 +805,7 @@ static void setup()
(void)new QLatin1Codec;
(void)new QUtf8Codec;
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// QIconvCodec depends on the UTF-16 codec, so it needs to be created last
(void) new QIconvCodec();
diff --git a/src/corelib/concurrent/qfutureinterface.cpp b/src/corelib/concurrent/qfutureinterface.cpp
index 6256944..627d0c7 100644
--- a/src/corelib/concurrent/qfutureinterface.cpp
+++ b/src/corelib/concurrent/qfutureinterface.cpp
@@ -421,9 +421,11 @@ bool QFutureInterfaceBase::referenceCountIsOne() const
QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState)
: refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0),
- state(initialState), progressTimeStarted(false), pendingResults(0),
+ state(initialState), pendingResults(0),
manualProgress(false), m_expectedResultCount(0), runnable(0)
-{ }
+{
+ progressTime.invalidate();
+}
int QFutureInterfaceBasePrivate::internal_resultCount() const
{
@@ -455,12 +457,11 @@ bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
m_progressValue = progress;
m_progressText = progressText;
- if (progressTimeStarted == true && m_progressValue != m_progressMaximum) // make sure the first and last steps are emitted.
+ if (progressTime.isValid() && m_progressValue != m_progressMaximum) // make sure the first and last steps are emitted.
if (progressTime.elapsed() < (1000 / MaxProgressEmitsPerSecond))
return false;
progressTime.start();
- progressTimeStarted = true;
return true;
}
diff --git a/src/corelib/concurrent/qfutureinterface_p.h b/src/corelib/concurrent/qfutureinterface_p.h
index 7f93c75..538947e 100644
--- a/src/corelib/concurrent/qfutureinterface_p.h
+++ b/src/corelib/concurrent/qfutureinterface_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include <QtCore/qdatetime.h>
+#include <QtCore/qelapsedtimer.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qlist.h>
#include <QtCore/qwaitcondition.h>
@@ -137,8 +137,7 @@ public:
int m_progressMinimum;
int m_progressMaximum;
QFutureInterfaceBase::State state;
- QTime progressTime;
- bool progressTimeStarted;
+ QElapsedTimer progressTime;
QWaitCondition pausedWaitCondition;
int pendingResults;
QtConcurrent::ResultStoreBase m_results;
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 8eae391..83caa96 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -23,7 +23,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux*:!static:!symbian-armcc:!symbian-gcce {
+linux*:!static:!symbian-gcce:!*-armcc* {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/corelib/global/qconfig-minimal-system-dependencies.h b/src/corelib/global/qconfig-minimal-system-dependencies.h
index 63319b9..a44391c 100644
--- a/src/corelib/global/qconfig-minimal-system-dependencies.h
+++ b/src/corelib/global/qconfig-minimal-system-dependencies.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index fb39ee5..d7f8846 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1174,6 +1174,7 @@ bool qSharedBuild()
\value MV_10_4 Mac OS X 10.4
\value MV_10_5 Mac OS X 10.5
\value MV_10_6 Mac OS X 10.6
+ \value MV_10_7 Mac OS X 10.7
\value MV_Unknown An unknown and currently unsupported platform
\value MV_CHEETAH Apple codename for MV_10_0
@@ -1183,6 +1184,7 @@ bool qSharedBuild()
\value MV_TIGER Apple codename for MV_10_4
\value MV_LEOPARD Apple codename for MV_10_5
\value MV_SNOWLEOPARD Apple codename for MV_10_6
+ \value MV_LION Apple codename for MV_10_7
\sa WinVersion, SymbianVersion
*/
@@ -1738,7 +1740,7 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
if (winver)
return winver;
winver = QSysInfo::WV_NT;
- OSVERSIONINFOW osver;
+ OSVERSIONINFO osver;
osver.dwOSVersionInfoSize = sizeof(osver);
GetVersionEx(&osver);
#ifdef Q_OS_WINCE
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 2a41b9e..cf44b49 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -322,7 +322,10 @@ namespace QT_NAMESPACE {}
# if !defined(MAC_OS_X_VERSION_10_6)
# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
# endif
-# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
+# if !defined(MAC_OS_X_VERSION_10_7)
+# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
+# endif
+# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7)
# warning "This version of Mac OS X is unsupported"
# endif
#endif
@@ -369,7 +372,20 @@ namespace QT_NAMESPACE {}
*/
#if defined(__ghs)
-# define Q_OUTOFLINE_TEMPLATE inline
+# define Q_OUTOFLINE_TEMPLATE inline
+
+/* the following are necessary because the GHS C++ name mangling relies on __*/
+# define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
+ static const int AFUNC ## _init_variable_ = AFUNC();
+# define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
+# define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
+ class AFUNC ## _dest_class_ { \
+ public: \
+ inline AFUNC ## _dest_class_() { } \
+ inline ~ AFUNC ## _dest_class_() { AFUNC(); } \
+ } AFUNC ## _dest_instance_;
+# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
+
#endif
/* Symantec C++ is now Digital Mars */
@@ -448,6 +464,9 @@ namespace QT_NAMESPACE {}
# if __TARGET_ARCH_ARM >= 6
# define QT_HAVE_ARMV6
# endif
+/* work-around for missing compiler intrinsics */
+# define __is_empty(X) false
+# define __is_pod(X) false
#elif defined(__GNUC__)
# define Q_CC_GNU
# define Q_C_CALLBACKS
@@ -457,7 +476,6 @@ namespace QT_NAMESPACE {}
# if defined(__INTEL_COMPILER)
/* Intel C++ also masquerades as GCC 3.2.0 */
# define Q_CC_INTEL
-# define Q_NO_TEMPLATE_FRIENDS
# endif
# if defined(__clang__)
/* Clang also masquerades as GCC 4.2.1 */
@@ -760,6 +778,24 @@ namespace QT_NAMESPACE {}
# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
#endif
+#ifdef Q_CC_INTEL
+# if __INTEL_COMPILER < 1200
+# define Q_NO_TEMPLATE_FRIENDS
+# endif
+# if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)
+# if __INTEL_COMPILER >= 1100
+# define Q_COMPILER_RVALUE_REFS
+# define Q_COMPILER_EXTERN_TEMPLATES
+# elif __INTEL_COMPILER >= 1200
+# define Q_COMPILER_VARIADIC_TEMPLATES
+# define Q_COMPILER_AUTO_TYPE
+# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
+# define Q_COMPILER_CLASS_ENUM
+# define Q_COMPILER_LAMBDA
+# endif
+# endif
+#endif
+
#ifndef Q_PACKED
# define Q_PACKED
# undef Q_NO_PACKED_REFERENCE
@@ -1199,6 +1235,11 @@ class QDataStream;
#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
+#if defined(Q_OS_LINUX) && defined(Q_CC_RVCT)
+# define Q_DECL_EXPORT __attribute__((visibility("default")))
+# define Q_DECL_IMPORT __attribute__((visibility("default")))
+#endif
+
#ifndef Q_DECL_EXPORT
# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
# define Q_DECL_EXPORT __declspec(dllexport)
@@ -1420,7 +1461,7 @@ class QDataStream;
# define Q_AUTOTEST_EXPORT
#endif
-inline void qt_noop() {}
+inline void qt_noop(void) {}
/* These wrap try/catch so we can switch off exceptions later.
@@ -1533,6 +1574,7 @@ public:
MV_10_4 = 0x0006,
MV_10_5 = 0x0007,
MV_10_6 = 0x0008,
+ MV_10_7 = 0x0009,
/* codenames */
MV_CHEETAH = MV_10_0,
@@ -1541,7 +1583,8 @@ public:
MV_PANTHER = MV_10_3,
MV_TIGER = MV_10_4,
MV_LEOPARD = MV_10_5,
- MV_SNOWLEOPARD = MV_10_6
+ MV_SNOWLEOPARD = MV_10_6,
+ MV_LION = MV_10_7
};
static const MacVersion MacintoshVersion;
#endif
@@ -1790,32 +1833,32 @@ public:
inline ~QGlobalStatic() { pointer = 0; }
};
-#define Q_GLOBAL_STATIC(TYPE, NAME) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME; \
- static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC(TYPE, NAME) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME ARGS; \
- static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable ARGS; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME; \
- static QGlobalStatic<TYPE > global_##NAME(0); \
- if (!global_##NAME.pointer) { \
- TYPE *x = global_##NAME.pointer = &this_##NAME; \
- INITIALIZER; \
- } \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(0); \
+ if (!thisGlobalStatic.pointer) { \
+ TYPE *x = thisGlobalStatic.pointer = &thisVariable; \
+ INITIALIZER; \
+ } \
+ return thisGlobalStatic.pointer; \
}
#else
@@ -1850,50 +1893,50 @@ public:
}
};
-#define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \
- static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false }
-
-#define Q_GLOBAL_STATIC(TYPE, NAME) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC(TYPE, NAME) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ TYPE *x = new TYPE; \
+ if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \
+ delete x; \
+ else \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ } \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE ARGS; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ TYPE *x = new TYPE ARGS; \
+ if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \
+ delete x; \
+ else \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ } \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- QScopedPointer<TYPE > x(new TYPE); \
- INITIALIZER; \
- if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- x.take(); \
- } \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ QScopedPointer<TYPE > x(new TYPE); \
+ INITIALIZER; \
+ if (thisGlobalStatic.pointer.testAndSetOrdered(0, x.data())) { \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ x.take(); \
+ } \
+ } \
+ return thisGlobalStatic.pointer; \
}
#endif
@@ -2461,9 +2504,17 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
# define QT_SYMBIAN_SUPPORTS_SGIMAGE
#endif
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef SYMBIAN_GRAPHICS_SET_SURFACE_TRANSPARENCY_AVAILABLE
# define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
#endif
+
+#ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE
+# define Q_SYMBIAN_TRANSITION_EFFECTS
+#endif
+#endif
+
+#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
+#define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS
#endif
//Symbian does not support data imports from a DLL
diff --git a/src/corelib/global/qnaclunimplemented.cpp b/src/corelib/global/qnaclunimplemented.cpp
index 1a89b8df..5116d80 100644
--- a/src/corelib/global/qnaclunimplemented.cpp
+++ b/src/corelib/global/qnaclunimplemented.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/global/qnaclunimplemented.h b/src/corelib/global/qnaclunimplemented.h
index 2d3d426..09c6c49 100644
--- a/src/corelib/global/qnaclunimplemented.h
+++ b/src/corelib/global/qnaclunimplemented.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 1b22c77..f015ed0 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -543,7 +543,8 @@ public:
AA_DontUseNativeMenuBar = 6,
AA_MacDontSwapCtrlAndMeta = 7,
AA_S60DontConstructApplicationPanes = 8,
- AA_X11InitThreads = 9,
+ AA_S60DisablePartialScreenInputMode = 9,
+ AA_X11InitThreads = 10,
// Add new attributes before this line
AA_AttributeCount
@@ -577,7 +578,8 @@ public:
PreferDither = 0x00000040,
AvoidDither = 0x00000080,
- NoOpaqueDetection = 0x00000100
+ NoOpaqueDetection = 0x00000100,
+ NoFormatConversion = 0x00000200
};
Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag)
@@ -1626,6 +1628,7 @@ public:
AccessibleDescriptionRole = 12,
// More general purpose
SizeHintRole = 13,
+ InitialSortOrderRole = 14,
// Internal UiLib roles. Start worrying when public roles go that high.
DisplayPropertyRole = 27,
DecorationPropertyRole = 28,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 0a02328..bc15514 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -156,11 +156,17 @@
whole lifetime. This attribute must be set before QApplication is
constructed.
+ \omitvalue AA_S60DisablePartialScreenInputMode By default in Symbian^3,
+ a separate editing window is opened on top of an application. This is exactly
+ like editing on previous versions of Symbian behave. When this attribute
+ is true, a virtual keyboard window is shown on top of application and it
+ is ensured that the focused text widget is visible. This is only supported in
+ Symbian^3. (internal)
+
\value AA_X11InitThreads Calls XInitThreads() as part of the QApplication
construction in order to make Xlib calls thread-safe. This
attribute must be set before QApplication is constructed.
-
\omitvalue AA_AttributeCount
*/
@@ -737,6 +743,10 @@
until a non-opaque pixel is found, or if you want the pixmap to
retain an alpha channel for some other reason. If the image has no
alpha channel this flag has no effect.
+
+ \omitvalue NoFormatConversion Don't do any format conversions on the image.
+ Can be useful when converting a QImage to a QPixmap for a one-time
+ rendering operation for example.
*/
/*! \enum Qt::GUIStyle
@@ -2689,19 +2699,22 @@
Roles describing appearance and meta data (with associated types):
- \value FontRole The font used for items rendered with the default
- delegate. (QFont)
- \value TextAlignmentRole The alignment of the text for items rendered with the
- default delegate. (Qt::AlignmentFlag)
- \value BackgroundRole The background brush used for items rendered with
- the default delegate. (QBrush)
- \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead.
- \value ForegroundRole The foreground brush (text color, typically)
- used for items rendered with the default delegate.
- (QBrush)
- \value TextColorRole This role is obsolete. Use ForegroundRole instead.
- \value CheckStateRole This role is used to obtain the checked state of
- an item. (Qt::CheckState)
+ \value FontRole The font used for items rendered with the default
+ delegate. (QFont)
+ \value TextAlignmentRole The alignment of the text for items rendered with the
+ default delegate. (Qt::AlignmentFlag)
+ \value BackgroundRole The background brush used for items rendered with
+ the default delegate. (QBrush)
+ \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead.
+ \value ForegroundRole The foreground brush (text color, typically)
+ used for items rendered with the default delegate.
+ (QBrush)
+ \value TextColorRole This role is obsolete. Use ForegroundRole instead.
+ \value CheckStateRole This role is used to obtain the checked state of
+ an item. (Qt::CheckState)
+ \value InitialSortOrderRole This role is used to obtain the initial sort order
+ of a header view section. (Qt::SortOrder). This
+ role was introduced in Qt 4.8.
Accessibility roles (with associated types):
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 4d4ae21..2b61192 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -113,3 +113,7 @@ win32 {
LIBS += -lplatformenv
}
}
+integrity {
+ SOURCES += io/qfsfileengine_unix.cpp \
+ io/qfsfileengine_iterator_unix.cpp
+}
diff --git a/src/corelib/io/qdir_p.h b/src/corelib/io/qdir_p.h
index 5f97c1f..7f77a84 100644
--- a/src/corelib/io/qdir_p.h
+++ b/src/corelib/io/qdir_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index 9446ebb..00c33bd 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -168,7 +168,7 @@ static bool _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry &ent
const QStringList &paths = QDir::searchPaths(filePath.left(prefixSeparator));
for (int i = 0; i < paths.count(); i++) {
- entry = QFileSystemEntry(paths.at(i) % QLatin1Char('/') % filePath.mid(prefixSeparator + 1));
+ entry = QFileSystemEntry(QDir::cleanPath(paths.at(i) % QLatin1Char('/') % filePath.mid(prefixSeparator + 1)));
// Recurse!
if (_q_resolveEntryAndCreateLegacyEngine_recursive(entry, data, engine, true))
return true;
diff --git a/src/corelib/io/qfilesystemengine_mac.cpp b/src/corelib/io/qfilesystemengine_mac.cpp
index 30d7fa5..1c0056b 100644
--- a/src/corelib/io/qfilesystemengine_mac.cpp
+++ b/src/corelib/io/qfilesystemengine_mac.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index a3ec0ab..d6033e6 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemengine_symbian.cpp b/src/corelib/io/qfilesystemengine_symbian.cpp
index 84c3aa1..41a550a 100644
--- a/src/corelib/io/qfilesystemengine_symbian.cpp
+++ b/src/corelib/io/qfilesystemengine_symbian.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 6acd811..1becea5 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -174,8 +174,9 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
if (entry.isEmpty() || entry.isRoot())
return entry;
-#ifdef __UCLIBC__
- return QFileSystemEntry::slowCanonicalName(entry);
+#if !defined(Q_OS_MAC) && _POSIX_VERSION < 200809L
+ // realpath(X,0) is not supported
+ return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
#else
char *ret = 0;
# if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
@@ -533,8 +534,7 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
{
Q_UNUSED(source);
Q_UNUSED(target);
- // # we can implement this using sendfile(2)
- //when this function returns false, block copy is used in QFile which sets the error code.
+ error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented
return false;
}
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 19c94e5..82c6eba 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index d4c6d0a..ccbb10d 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystementry_p.h b/src/corelib/io/qfilesystementry_p.h
index 2ce0a83..d4d16d0 100644
--- a/src/corelib/io/qfilesystementry_p.h
+++ b/src/corelib/io/qfilesystementry_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemiterator_p.h b/src/corelib/io/qfilesystemiterator_p.h
index 66f4b1e..2dc4a9f 100644
--- a/src/corelib/io/qfilesystemiterator_p.h
+++ b/src/corelib/io/qfilesystemiterator_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemiterator_symbian.cpp b/src/corelib/io/qfilesystemiterator_symbian.cpp
index e316526..23c726a 100644
--- a/src/corelib/io/qfilesystemiterator_symbian.cpp
+++ b/src/corelib/io/qfilesystemiterator_symbian.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index 00ccd41..3efdd9e 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp
index b5fce12..0e94130 100644
--- a/src/corelib/io/qfilesystemiterator_win.cpp
+++ b/src/corelib/io/qfilesystemiterator_win.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index 7f75b05..f7f1fa1 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 62e7c9f..6c03b32 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1029,7 +1029,11 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
if (openMode & QIODevice::ReadOnly) access |= PROT_READ;
if (openMode & QIODevice::WriteOnly) access |= PROT_WRITE;
+#if defined(Q_OS_INTEGRITY)
+ int pageSize = sysconf(_SC_PAGESIZE);
+#else
int pageSize = getpagesize();
+#endif
int extra = offset % pageSize;
if (quint64(size + extra) > quint64((size_t)-1)) {
@@ -1079,6 +1083,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
+#if !defined(Q_OS_INTEGRITY)
Q_Q(QFSFileEngine);
if (!maps.contains(ptr)) {
q->setError(QFile::PermissionsError, qt_error_string(EACCES));
@@ -1093,6 +1098,9 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
}
maps.remove(ptr);
return true;
+#else
+ return false;
+#endif
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 235f671..71cf92d 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -153,6 +153,7 @@ void QNonContiguousByteDevice::disableReset()
resetDisabled = true;
}
+// FIXME we should scrap this whole implementation and instead change the ByteArrayImpl to be able to cope with sub-arrays?
QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(QBuffer *b) : QNonContiguousByteDevice()
{
buffer = b;
@@ -244,7 +245,7 @@ qint64 QNonContiguousByteDeviceByteArrayImpl::size()
return byteArray->size();
}
-QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb)
+QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb)
: QNonContiguousByteDevice(), currentPosition(0)
{
ringBuffer = rb;
@@ -355,6 +356,11 @@ bool QNonContiguousByteDeviceIoDeviceImpl::advanceReadPointer(qint64 amount)
// normal advancement
currentReadBufferPosition += amount;
+ if (size() == -1)
+ emit readProgress(totalAdvancements, totalAdvancements);
+ else
+ emit readProgress(totalAdvancements, size());
+
// advancing over that what has actually been read before
if (currentReadBufferPosition > currentReadBufferAmount) {
qint64 i = currentReadBufferPosition - currentReadBufferAmount;
@@ -370,10 +376,6 @@ bool QNonContiguousByteDeviceIoDeviceImpl::advanceReadPointer(qint64 amount)
currentReadBufferAmount = 0;
}
- if (size() == -1)
- emit readProgress(totalAdvancements, totalAdvancements);
- else
- emit readProgress(totalAdvancements, size());
return true;
}
@@ -505,7 +507,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *dev
\internal
*/
-QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QRingBuffer *ringBuffer)
+QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer<QRingBuffer> ringBuffer)
{
return new QNonContiguousByteDeviceRingBufferImpl(ringBuffer);
}
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index ff946ed..5e0b1bb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qbuffer.h>
#include <QtCore/qiodevice.h>
+#include <QtCore/QSharedPointer>
#include "private/qringbuffer_p.h"
QT_BEGIN_NAMESPACE
@@ -70,6 +71,7 @@ public:
virtual bool atEnd() = 0;
virtual bool reset() = 0;
void disableReset();
+ bool isResetDisabled() { return resetDisabled; }
virtual qint64 size() = 0;
virtual ~QNonContiguousByteDevice();
@@ -89,7 +91,7 @@ class Q_CORE_EXPORT QNonContiguousByteDeviceFactory
public:
static QNonContiguousByteDevice* create(QIODevice *device);
static QNonContiguousByteDevice* create(QByteArray *byteArray);
- static QNonContiguousByteDevice* create(QRingBuffer *ringBuffer);
+ static QNonContiguousByteDevice* create(QSharedPointer<QRingBuffer> ringBuffer);
static QIODevice* wrap(QNonContiguousByteDevice* byteDevice);
};
@@ -114,7 +116,7 @@ protected:
class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice
{
public:
- QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb);
+ QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb);
~QNonContiguousByteDeviceRingBufferImpl();
const char* readPointer(qint64 maximumLength, qint64 &len);
bool advanceReadPointer(qint64 amount);
@@ -122,13 +124,14 @@ public:
bool reset();
qint64 size();
protected:
- QRingBuffer* ringBuffer;
+ QSharedPointer<QRingBuffer> ringBuffer;
qint64 currentPosition;
};
class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice
{
+ Q_OBJECT
public:
QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d);
~QNonContiguousByteDeviceIoDeviceImpl();
@@ -150,6 +153,7 @@ protected:
class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice
{
+ Q_OBJECT
public:
QNonContiguousByteDeviceBufferImpl(QBuffer *b);
~QNonContiguousByteDeviceBufferImpl();
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index f9f5362..ba61bda 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -645,7 +645,7 @@ void QProcessPrivate::startProcess()
if (childPid < 0) {
// Cleanup, report error and return
#if defined (QPROCESS_DEBUG)
- qDebug("qt_fork failed: %s", qt_error_string(lastForkErrno));
+ qDebug("qt_fork failed: %s", qPrintable(qt_error_string(lastForkErrno)));
#endif
processManager()->unlock();
q->setProcessState(QProcess::NotRunning);
@@ -849,7 +849,7 @@ qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
qDebug("QProcessPrivate::writeToStdin(%p \"%s\", %lld) == %lld",
data, qt_prettyDebug(data, maxlen, 16).constData(), maxlen, written);
if (written == -1)
- qDebug("QProcessPrivate::writeToStdin(), failed to write (%s)", qt_error_string(errno));
+ qDebug("QProcessPrivate::writeToStdin(), failed to write (%s)", qPrintable(qt_error_string(errno)));
#endif
// If the O_NONBLOCK flag is set and If some data can be written without blocking
// the process, write() will transfer what it can and return the number of bytes written.
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 2a9d8ee..0435256 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && ! defined (Q_OS_NACL)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined (Q_OS_NACL) && !defined(Q_OS_INTEGRITY)
#define QT_USE_MMAP
#endif
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 93818d1..c3a6721 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -139,3 +139,19 @@ vxworks {
kernel/qfunctions_vxworks.h
}
+
+integrity {
+ SOURCES += \
+ kernel/qcore_unix.cpp \
+ kernel/qcrashhandler.cpp \
+ kernel/qsharedmemory_unix.cpp \
+ kernel/qsystemsemaphore_unix.cpp \
+ kernel/qeventdispatcher_unix.cpp
+ HEADERS += \
+ kernel/qcore_unix_p.h \
+ kernel/qcrashhandler_p.h \
+ kernel/qeventdispatcher_unix_p.h
+
+ contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
+}
+
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
index 3ef71e0..5b48689 100644
--- a/src/corelib/kernel/qcore_symbian_p.h
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -158,6 +158,22 @@ Q_CORE_EXPORT RFs& qt_s60GetRFs();
// Defined in qlocale_symbian.cpp.
Q_CORE_EXPORT QByteArray qt_symbianLocaleName(int code);
+template <typename R>
+struct QScopedPointerRCloser
+{
+ static inline void cleanup(R *rPointer)
+ {
+ // Enforce a complete type.
+ // If you get a compile error here, read the section on forward declared
+ // classes in the QScopedPointer documentation.
+ typedef char IsIncompleteType[ sizeof(R) ? 1 : -1 ];
+ (void) sizeof(IsIncompleteType);
+
+ if (rPointer)
+ rPointer->Close();
+ }
+};
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/kernel/qcrashhandler.cpp b/src/corelib/kernel/qcrashhandler.cpp
index 59f3796..fbdbac0 100644
--- a/src/corelib/kernel/qcrashhandler.cpp
+++ b/src/corelib/kernel/qcrashhandler.cpp
@@ -339,6 +339,9 @@ static void print_backtrace(FILE *outb)
"EOF\n",
globalProgName, (int)getpid()))
return;
+#elif defined(Q_OS_INTEGRITY)
+ /* abort */
+ CheckSuccess(Failure);
#else /* All other platforms */
/*
* TODO: SCO/UnixWare 7 must be something like (not tested)
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 25c02c4..dceb51d 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -116,7 +116,7 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
// do nothing.
#elif defined(Q_OS_INTEGRITY)
// INTEGRITY doesn't like a "select" on pipes, so use socketpair instead
- if (socketpair(AF_INET, SOCK_STREAM, PF_INET, thread_pipe) == -1) {
+ if (socketpair(AF_INET, SOCK_STREAM, 0, thread_pipe) == -1) {
perror("QEventDispatcherUNIXPrivate(): Unable to create socket pair");
pipefail = true;
} else {
@@ -343,7 +343,7 @@ timeval QTimerInfoList::updateCurrentTime()
return (currentTime = qt_gettime());
}
-#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC)) || defined(QT_BOOTSTRAPPED)
+#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED)
template <>
timeval qAbs(const timeval &t)
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 3d8352e..6badb6a 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -532,10 +532,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
}
} else if (d->sendPostedEventsWindowsTimerId == 0
- && localSerialNumber != d->lastSerialNumber
- // if this message IS the one that triggers sendPostedEvents(), no need to post it again
- && (msg->hwnd != d->internalHwnd
- || msg->message != WM_QT_SENDPOSTEDEVENTS)) {
+ && localSerialNumber != d->lastSerialNumber) {
// start a special timer to continue delivering posted events while
// there are still input and timer messages in the message queue
d->sendPostedEventsWindowsTimerId = SetTimer(d->internalHwnd,
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index e78f86a..d213b0e 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -175,6 +175,8 @@ bool QEventLoop::processEvents(ProcessEventsFlags flags)
int QEventLoop::exec(ProcessEventsFlags flags)
{
Q_D(QEventLoop);
+ //we need to protect from race condition with QThread::exit
+ QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread))->mutex);
if (d->threadData->quitNow)
return -1;
@@ -186,6 +188,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
d->exit = false;
++d->threadData->loopLevel;
d->threadData->eventLoops.push(this);
+ locker.unlock();
// remove posted quit events when entering a new event loop
QCoreApplication *app = QCoreApplication::instance();
@@ -205,6 +208,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
"reimplement QApplication::notify() and catch all exceptions there.\n");
// copied from below
+ locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
Q_ASSERT_X(eventLoop == this, "QEventLoop::exec()", "internal error");
Q_UNUSED(eventLoop); // --release warning
@@ -216,6 +220,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
#endif
// copied above
+ locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
Q_ASSERT_X(eventLoop == this, "QEventLoop::exec()", "internal error");
Q_UNUSED(eventLoop); // --release warning
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5a7ee2f..0ad73f5 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -370,18 +370,18 @@ template <class T>
inline T qobject_cast(QObject *object)
{
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
+ reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
#endif
- return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
+ return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object));
}
template <class T>
inline T qobject_cast(const QObject *object)
{
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
+ reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
#endif
- return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
+ return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object));
}
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp
index 953ed95..3381afa 100644
--- a/src/corelib/kernel/qsystemerror.cpp
+++ b/src/corelib/kernel/qsystemerror.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h
index c2a13a8..e96e85a 100644
--- a/src/corelib/kernel/qsystemerror_p.h
+++ b/src/corelib/kernel/qsystemerror_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index d72c1ab..daa5dc6 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -56,7 +56,7 @@
#include "qhash.h"
#include "qtranslator_p.h"
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
#define QT_USE_MMAP
#include "private/qcore_unix_p.h"
#endif
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index 50b005d..eb7a7f7 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -28,4 +28,8 @@ unix {
SOURCES += plugin/qlibrary_unix.cpp
}
+integrity {
+ SOURCES += plugin/qlibrary_unix.cpp
+}
+
LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD
diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp
index c60b3d5..fc5b0d9 100644
--- a/src/corelib/plugin/qelfparser_p.cpp
+++ b/src/corelib/plugin/qelfparser_p.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/plugin/qelfparser_p.h b/src/corelib/plugin/qelfparser_p.h
index 8087da5..163d2c1 100644
--- a/src/corelib/plugin/qelfparser_p.h
+++ b/src/corelib/plugin/qelfparser_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 1be32ad..c0b947a 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -155,9 +155,11 @@ void QFactoryLoader::update()
continue;
}
QObject *instance = library->instance();
- if (!instance)
+ if (!instance) {
+ library->release();
// ignore plugins that have a valid signature but cannot be loaded.
continue;
+ }
QFactoryInterface *factory = qobject_cast<QFactoryInterface*>(instance);
if (instance && factory && instance->qt_metacast(d->iid))
keys = factory->keys();
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index dfe4aae..5f75195 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -163,6 +163,7 @@ class QMutexData
~QMutexData();
};
+#ifdef QT_NO_DEBUG
inline void QMutex::unlockInline()
{
if (d->recursive) {
@@ -189,7 +190,13 @@ inline void QMutex::lockInline()
lockInternal();
}
}
-
+#else // QT_NO_DEBUG
+//in debug we do not use inline calls in order to allow debugging tools
+// to hook the mutex locking functions.
+inline void QMutex::unlockInline() { unlock(); }
+inline bool QMutex::tryLockInline() { return tryLock(); }
+inline void QMutex::lockInline() { lock(); }
+#endif // QT_NO_DEBUG
#else // QT_NO_THREAD
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 9a2dbec..36e07c0 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -209,8 +209,6 @@ public:
bool canWait;
QVector<void *> tls;
- QMutex mutex;
-
# ifdef Q_OS_SYMBIAN
RThread symbian_thread_handle;
# endif
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 0766447..811a193 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -54,6 +54,11 @@
#include <private/qeventdispatcher_unix_p.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <hal.h>
+#include <hal_data.h>
+#endif
+
#include "qthreadstorage.h"
#include "qthread_p.h"
@@ -63,6 +68,12 @@
#include <sched.h>
#include <errno.h>
+// You only find these enumerations on Symbian^3 onwards, so we need to provide our own
+// to remain compatible with older releases. They won't be called by pre-Sym^3 SDKs.
+
+// HALData::ENumCpus
+#define QT_HALData_ENumCpus 119
+
#ifdef Q_OS_BSD4
#include <sys/sysctl.h>
#endif
@@ -110,6 +121,17 @@ QT_BEGIN_NAMESPACE
enum { ThreadPriorityResetFlag = 0x80000000 };
+#if defined(Q_OS_LINUX) && defined(__GLIBC__) && (defined(Q_CC_GNU) || defined(Q_CC_INTEL))
+#define HAVE_TLS
+#endif
+#if defined(Q_CC_XLC) || defined (Q_CC_SUN)
+#define HAVE_TLS
+#endif
+
+#ifdef HAVE_TLS
+static __thread QThreadData *currentThreadData = 0;
+#endif
+
static pthread_once_t current_thread_data_once = PTHREAD_ONCE_INIT;
static pthread_key_t current_thread_data_key;
@@ -157,7 +179,9 @@ Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key)
// that pthread has, so pthread_setspecific is also used.
static QThreadData *get_thread_data()
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ return currentThreadData;
+#elif defined Q_OS_SYMBIAN
return reinterpret_cast<QThreadData *>(Dll::Tls());
#else
pthread_once(&current_thread_data_once, create_current_thread_data_key);
@@ -167,7 +191,9 @@ static QThreadData *get_thread_data()
static void set_thread_data(QThreadData *data)
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ currentThreadData = data;
+#elif defined Q_OS_SYMBIAN
qt_symbian_throwIfError(Dll::SetTls(data));
#endif
pthread_once(&current_thread_data_once, create_current_thread_data_key);
@@ -176,7 +202,9 @@ static void set_thread_data(QThreadData *data)
static void clear_thread_data()
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ currentThreadData = 0;
+#elif defined Q_OS_SYMBIAN
Dll::FreeTls();
#endif
pthread_setspecific(current_thread_data_key, 0);
@@ -310,7 +338,10 @@ void *QThreadPrivate::start(void *arg)
set_thread_data(data);
data->ref();
- data->quitNow = false;
+ {
+ QMutexLocker locker(&thr->d_func()->mutex);
+ data->quitNow = thr->d_func()->exited;
+ }
// ### TODO: allow the user to create a custom event dispatcher
createEventDispatcher(data);
@@ -431,8 +462,20 @@ int QThread::idealThreadCount()
// as of aug 2008 Integrity only supports one single core CPU
cores = 1;
#elif defined(Q_OS_SYMBIAN)
- // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
- cores = 1;
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) {
+ TInt inumcpus;
+ TInt err;
+ err = HAL::Get((HALData::TAttribute)QT_HALData_ENumCpus, inumcpus);
+ if (err != KErrNone) {
+ cores = 1;
+ } else if ( inumcpus <= 0 ) {
+ cores = 1;
+ } else {
+ cores = inumcpus;
+ }
+ } else {
+ cores = 1;
+ }
#elif defined(Q_OS_VXWORKS)
// VxWorks
# if defined(QT_VXWORKS_HAS_CPUSET)
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index cb2d1a9..6b7932b 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -298,7 +298,10 @@ unsigned int __stdcall QThreadPrivate::start(void *arg)
QThread::setTerminationEnabled(false);
- data->quitNow = false;
+ {
+ QMutexLocker locker(&thr->d_func()->mutex);
+ data->quitNow = thr->d_func()->exited;
+ }
// ### TODO: allow the user to create a custom event dispatcher
createEventDispatcher(data);
diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri
index 03f661d..90583bb 100644
--- a/src/corelib/thread/thread.pri
+++ b/src/corelib/thread/thread.pri
@@ -31,3 +31,7 @@ unix:SOURCES += thread/qmutex_unix.cpp \
win32:SOURCES += thread/qmutex_win.cpp \
thread/qthread_win.cpp \
thread/qwaitcondition_win.cpp
+
+integrity:SOURCES += thread/qmutex_unix.cpp \
+ thread/qthread_unix.cpp \
+ thread/qwaitcondition_unix.cpp
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index c003214..a903007 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -677,7 +677,7 @@ bool QChar::isSymbol() const
\since 4.7
Returns true if the UCS-4-encoded character specified by \a ucs4
- is the high part of a utf16 surrogate
+ is the low part of a utf16 surrogate
(ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
*/
@@ -686,7 +686,7 @@ bool QChar::isSymbol() const
\since 4.7
Returns true if the UCS-4-encoded character specified by \a ucs4
- can be splited to the high and low parts of a utf16 surrogate
+ can be split into the high and low parts of a utf16 surrogate
(ie. if its code point is greater than or equals to 0x10000).
*/
diff --git a/src/corelib/tools/qscopedvaluerollback.cpp b/src/corelib/tools/qscopedvaluerollback.cpp
new file mode 100644
index 0000000..8933efc
--- /dev/null
+++ b/src/corelib/tools/qscopedvaluerollback.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "qscopedvaluerollback.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QScopedValueRollback
+ \brief The QScopedValueRollback resets a variable to its previous value on destruction
+ \since 4.8
+ \ingroup misc
+
+ The QScopedAssignment class can be used to revert state when an
+ exception is thrown without needing to write try-catch blocks.
+
+ It can also be used to manage variables that are temporarily set,
+ such as reentrancy guards. By using this class, the variable will
+ be reset whether the function is exited normally, exited early by
+ a return statement, or exited by an exception.
+
+ The template can only be instantiated with a type that supports assignment.
+
+ \sa QScopedPointer
+*/
+
+/*!
+ \fn QScopedValueRollback::QScopedValueRollback(T &var)
+
+ Stores the previous value of var internally, for revert on destruction.
+*/
+
+/*!
+ \fn QScopedValueRollback::~QScopedValueRollback()
+
+ Assigns the previous value to the managed variable.
+ This is the value at construction time, or at the last call to commit()
+*/
+
+/*!
+ \fn void QScopedValueRollback::commit()
+
+ Updates the previous value of the managed variable to its current value.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h
new file mode 100644
index 0000000..e874428
--- /dev/null
+++ b/src/corelib/tools/qscopedvaluerollback.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 QSCOPEDVALUEROLLBACK_H
+#define QSCOPEDVALUEROLLBACK_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+QT_MODULE(Core)
+
+template <typename T>
+class QScopedValueRollback
+{
+public:
+ QScopedValueRollback(T &var) :
+ varRef(var)
+ {
+ oldValue = varRef;
+ }
+
+ ~QScopedValueRollback()
+ {
+ varRef = oldValue;
+ }
+
+ void commit()
+ {
+ oldValue = varRef;
+ }
+
+private:
+ T& varRef;
+ T oldValue;
+
+ Q_DISABLE_COPY(QScopedValueRollback)
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QSCOPEDVALUEROLLBACK_H
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 1bdba2c..1494373 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -114,6 +114,7 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
+ QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = 0; }
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
@@ -197,7 +198,8 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
+ inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = 0; }
+ inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 03bb32d..fb1b466 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -29,6 +29,9 @@ HEADERS += \
tools/qrect.h \
tools/qregexp.h \
tools/qringbuffer_p.h \
+ tools/qscopedpointer.h \
+ tools/qscopedpointer_p.h \
+ tools/qscopedvaluerollback.h \
tools/qshareddata.h \
tools/qsharedpointer.h \
tools/qsharedpointer_impl.h \
@@ -45,9 +48,7 @@ HEADERS += \
tools/qelapsedtimer.h \
tools/qunicodetables_p.h \
tools/qvarlengtharray.h \
- tools/qvector.h \
- tools/qscopedpointer.h \
- tools/qscopedpointer_p.h
+ tools/qvector.h
SOURCES += \
@@ -87,6 +88,7 @@ symbian:SOURCES+=tools/qlocale_symbian.cpp
else:symbian:SOURCES += tools/qelapsedtimer_symbian.cpp
else:unix:SOURCES += tools/qelapsedtimer_unix.cpp
else:win32:SOURCES += tools/qelapsedtimer_win.cpp
+else:integrity:SOURCES += tools/qelapsedtimer_unix.cpp
else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib):include($$PWD/../../3rdparty/zlib.pri)
diff --git a/src/dbus/qdbusdemarshaller.cpp b/src/dbus/qdbusdemarshaller.cpp
index 3882edb..6638263 100644
--- a/src/dbus/qdbusdemarshaller.cpp
+++ b/src/dbus/qdbusdemarshaller.cpp
@@ -176,10 +176,10 @@ QDBusArgument::ElementType QDBusDemarshaller::currentType()
case DBUS_TYPE_INVALID:
return QDBusArgument::UnknownType;
- default:
- qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
- q_dbus_message_iter_get_arg_type(&iterator),
- q_dbus_message_iter_get_arg_type(&iterator));
+// default:
+// qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
+// q_dbus_message_iter_get_arg_type(&iterator),
+// q_dbus_message_iter_get_arg_type(&iterator));
}
return QDBusArgument::UnknownType;
}
@@ -232,10 +232,15 @@ QVariant QDBusDemarshaller::toVariantInternal()
return QVariant::fromValue(duplicate());
default:
- qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
- q_dbus_message_iter_get_arg_type(&iterator),
- q_dbus_message_iter_get_arg_type(&iterator));
- return QVariant();
+// qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
+// q_dbus_message_iter_get_arg_type(&iterator),
+// q_dbus_message_iter_get_arg_type(&iterator));
+ char *ptr = 0;
+ ptr += q_dbus_message_iter_get_arg_type(&iterator);
+ q_dbus_message_iter_next(&iterator);
+
+ // I hope you never dereference this pointer!
+ return QVariant::fromValue<void *>(ptr);
break;
};
}
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 6683505..df8bc1d 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -193,14 +193,19 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
QByteArray typeName = annotations.value(annotationName).toLatin1();
// verify that it's a valid one
- if (typeName.isEmpty())
- return result; // invalid
-
- type = QVariant::nameToType(typeName);
- if (type == QVariant::UserType)
- type = QMetaType::type(typeName);
- if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type))
- return result; // unknown type is invalid too
+ if (!typeName.isEmpty()) {
+ // type name found
+ type = QVariant::nameToType(typeName);
+ if (type == QVariant::UserType)
+ type = QMetaType::type(typeName);
+ }
+
+ if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type)) {
+ // type is still unknown or doesn't match back to the signature that it
+ // was expected to, so synthesize a fake type
+ type = QMetaType::VoidStar;
+ typeName = "QDBusRawType<0x" + signature.toHex() + ">*";
+ }
result.name = typeName;
} else if (type == QVariant::Invalid) {
diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp
index 1b99ced..3feedde 100644
--- a/src/dbus/qdbusxmlparser.cpp
+++ b/src/dbus/qdbusxmlparser.cpp
@@ -52,6 +52,13 @@
#ifndef QT_NO_DBUS
+//#define QDBUS_PARSER_DEBUG
+#ifdef QDBUS_PARSER_DEBUG
+# define qDBusParserError qWarning
+#else
+# define qDBusParserError if (true) {} else qDebug
+#endif
+
QT_BEGIN_NAMESPACE
static QDBusIntrospection::Annotations
@@ -69,8 +76,8 @@ parseAnnotations(const QDomElement& elem)
value = ann.attribute(QLatin1String("value"));
if (!QDBusUtil::isValidInterfaceName(name)) {
- qWarning("Invalid D-BUS annotation '%s' found while parsing introspection",
- qPrintable(name));
+ qDBusParserError("Invalid D-BUS annotation '%s' found while parsing introspection",
+ qPrintable(name));
continue;
}
@@ -99,9 +106,8 @@ parseArgs(const QDomElement& elem, const QLatin1String& direction, bool acceptEm
argData.name = arg.attribute(QLatin1String("name")); // can be empty
argData.type = arg.attribute(QLatin1String("type"));
if (!QDBusUtil::isValidSingleSignature(argData.type)) {
- qWarning("Invalid D-BUS type signature '%s' found while parsing introspection",
- qPrintable(argData.type));
- continue;
+ qDBusParserError("Invalid D-BUS type signature '%s' found while parsing introspection",
+ qPrintable(argData.type));
}
retval << argData;
@@ -141,8 +147,8 @@ QDBusXmlParser::interfaces() const
if (iface.isNull())
continue; // for whatever reason
if (!QDBusUtil::isValidInterfaceName(ifaceName)) {
- qWarning("Invalid D-BUS interface name '%s' found while parsing introspection",
- qPrintable(ifaceName));
+ qDBusParserError("Invalid D-BUS interface name '%s' found while parsing introspection",
+ qPrintable(ifaceName));
continue;
}
@@ -166,8 +172,8 @@ QDBusXmlParser::interfaces() const
if (method.isNull())
continue;
if (!QDBusUtil::isValidMemberName(methodName)) {
- qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(methodName), qPrintable(ifaceName));
+ qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+ qPrintable(methodName), qPrintable(ifaceName));
continue;
}
@@ -192,8 +198,8 @@ QDBusXmlParser::interfaces() const
if (signal.isNull())
continue;
if (!QDBusUtil::isValidMemberName(signalName)) {
- qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(signalName), qPrintable(ifaceName));
+ qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+ qPrintable(signalName), qPrintable(ifaceName));
continue;
}
@@ -217,8 +223,8 @@ QDBusXmlParser::interfaces() const
if (property.isNull())
continue;
if (!QDBusUtil::isValidMemberName(propertyName)) {
- qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(propertyName), qPrintable(ifaceName));
+ qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+ qPrintable(propertyName), qPrintable(ifaceName));
continue;
}
@@ -231,10 +237,9 @@ QDBusXmlParser::interfaces() const
if (!QDBusUtil::isValidSingleSignature(propertyData.type)) {
// cannot be!
- qWarning("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
- qPrintable(propertyData.type), qPrintable(ifaceName),
- qPrintable(propertyName));
- continue;
+ qDBusParserError("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
+ qPrintable(propertyData.type), qPrintable(ifaceName),
+ qPrintable(propertyName));
}
QString access = property.attribute(QLatin1String("access"));
@@ -245,9 +250,9 @@ QDBusXmlParser::interfaces() const
else if (access == QLatin1String("readwrite"))
propertyData.access = QDBusIntrospection::Property::ReadWrite;
else {
- qWarning("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection",
- qPrintable(access), qPrintable(ifaceName),
- qPrintable(propertyName));
+ qDBusParserError("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection",
+ qPrintable(access), qPrintable(ifaceName),
+ qPrintable(propertyName));
continue; // invalid one!
}
@@ -286,8 +291,8 @@ QDBusXmlParser::object() const
if (obj.isNull())
continue; // for whatever reason
if (!QDBusUtil::isValidObjectPath(m_path + QLatin1Char('/') + objName)) {
- qWarning("Invalid D-BUS object path '%s/%s' found while parsing introspection",
- qPrintable(m_path), qPrintable(objName));
+ qDBusParserError("Invalid D-BUS object path '%s/%s' found while parsing introspection",
+ qPrintable(m_path), qPrintable(objName));
continue;
}
@@ -301,8 +306,8 @@ QDBusXmlParser::object() const
if (iface.isNull())
continue;
if (!QDBusUtil::isValidInterfaceName(ifaceName)) {
- qWarning("Invalid D-BUS interface name '%s' found while parsing introspection",
- qPrintable(ifaceName));
+ qDBusParserError("Invalid D-BUS interface name '%s' found while parsing introspection",
+ qPrintable(ifaceName));
continue;
}
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index a269984..1581675 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -118,7 +118,7 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
QStringList pluginCandidates;
const QStringList paths = QCoreApplication::libraryPaths();
foreach (const QString &libPath, paths) {
- const QDir dir(libPath + QLatin1String("/qmldebugging"));
+ const QDir dir(libPath + QLatin1String("/qmltooling"));
if (dir.exists()) {
QStringList plugins(dir.entryList(QDir::Files));
foreach (const QString &pluginPath, plugins) {
diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/declarative/debugger/qdeclarativedebugserver_p.h
index ec3e60f..68ea4d8 100644
--- a/src/declarative/debugger/qdeclarativedebugserver_p.h
+++ b/src/declarative/debugger/qdeclarativedebugserver_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h
index 631da74..0c2bdb4 100644
--- a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h
+++ b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/declarative/debugger/qdeclarativedebugservice_p.h
index 1730d11..5e30350 100644
--- a/src/declarative/debugger/qdeclarativedebugservice_p.h
+++ b/src/declarative/debugger/qdeclarativedebugservice_p.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeDebugServicePrivate;
-class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugService : public QObject
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugService : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeDebugService)
diff --git a/src/declarative/debugger/qdeclarativedebugservice_p_p.h b/src/declarative/debugger/qdeclarativedebugservice_p_p.h
index d2c8dda..d0423f7 100644
--- a/src/declarative/debugger/qdeclarativedebugservice_p_p.h
+++ b/src/declarative/debugger/qdeclarativedebugservice_p_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index 444bbd4..5ff6d2c 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -175,16 +175,19 @@ QDeclarativeAnchors::~QDeclarativeAnchors()
void QDeclarativeAnchorsPrivate::fillChanged()
{
+ Q_Q(QDeclarativeAnchors);
if (!fill || !isItemComplete())
return;
if (updatingFill < 2) {
++updatingFill;
+ qreal horizontalMargin = q->mirrored() ? rightMargin : leftMargin;
+
if (fill == item->parentItem()) { //child-parent
- setItemPos(QPointF(leftMargin, topMargin));
+ setItemPos(QPointF(horizontalMargin, topMargin));
} else if (fill->parentItem() == item->parentItem()) { //siblings
- setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin));
+ setItemPos(QPointF(fill->x()+horizontalMargin, fill->y()+topMargin));
}
QGraphicsItemPrivate *fillPrivate = QGraphicsItemPrivate::get(fill);
setItemSize(QSizeF(fillPrivate->width()-leftMargin-rightMargin, fillPrivate->height()-topMargin-bottomMargin));
@@ -199,18 +202,21 @@ void QDeclarativeAnchorsPrivate::fillChanged()
void QDeclarativeAnchorsPrivate::centerInChanged()
{
+ Q_Q(QDeclarativeAnchors);
if (!centerIn || fill || !isItemComplete())
return;
if (updatingCenterIn < 2) {
++updatingCenterIn;
+
+ qreal effectiveHCenterOffset = q->mirrored() ? -hCenterOffset : hCenterOffset;
if (centerIn == item->parentItem()) {
- QPointF p(hcenter(item->parentItem()) - hcenter(item) + hCenterOffset,
+ QPointF p(hcenter(item->parentItem()) - hcenter(item) + effectiveHCenterOffset,
vcenter(item->parentItem()) - vcenter(item) + vCenterOffset);
setItemPos(p);
} else if (centerIn->parentItem() == item->parentItem()) {
- QPointF p(centerIn->x() + hcenter(centerIn) - hcenter(item) + hCenterOffset,
+ QPointF p(centerIn->x() + hcenter(centerIn) - hcenter(item) + effectiveHCenterOffset,
centerIn->y() + vcenter(centerIn) - vcenter(item) + vCenterOffset);
setItemPos(p);
}
@@ -311,6 +317,13 @@ void QDeclarativeAnchors::componentComplete()
d->componentComplete = true;
}
+bool QDeclarativeAnchors::mirrored()
+{
+ Q_D(QDeclarativeAnchors);
+ QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(d->item);
+ return itemPrivate->isDeclarativeItem ? static_cast<QDeclarativeItemPrivate *>(itemPrivate)->effectiveLayoutMirror : false;
+}
+
void QDeclarativeAnchorsPrivate::setItemHeight(qreal v)
{
updatingMe = true;
@@ -570,58 +583,94 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors()
}
}
+inline QDeclarativeAnchorLine::AnchorLine reverseAnchorLine(QDeclarativeAnchorLine::AnchorLine anchorLine) {
+ if (anchorLine == QDeclarativeAnchorLine::Left) {
+ return QDeclarativeAnchorLine::Right;
+ } else if (anchorLine == QDeclarativeAnchorLine::Right) {
+ return QDeclarativeAnchorLine::Left;
+ } else {
+ return anchorLine;
+ }
+}
+
void QDeclarativeAnchorsPrivate::updateHorizontalAnchors()
{
+ Q_Q(QDeclarativeAnchors);
if (fill || centerIn || !isItemComplete())
return;
- if (updatingHorizontalAnchor < 2) {
+ if (updatingHorizontalAnchor < 3) {
++updatingHorizontalAnchor;
+ qreal effectiveRightMargin, effectiveLeftMargin, effectiveHorizontalCenterOffset;
+ QDeclarativeAnchorLine effectiveLeft, effectiveRight, effectiveHorizontalCenter;
+ QDeclarativeAnchors::Anchor effectiveLeftAnchor, effectiveRightAnchor;
+ if (q->mirrored()) {
+ effectiveLeftAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveLeft.item = right.item;
+ effectiveLeft.anchorLine = reverseAnchorLine(right.anchorLine);
+ effectiveRight.item = left.item;
+ effectiveRight.anchorLine = reverseAnchorLine(left.anchorLine);
+ effectiveHorizontalCenter.item = hCenter.item;
+ effectiveHorizontalCenter.anchorLine = reverseAnchorLine(hCenter.anchorLine);
+ effectiveLeftMargin = rightMargin;
+ effectiveRightMargin = leftMargin;
+ effectiveHorizontalCenterOffset = -hCenterOffset;
+ } else {
+ effectiveLeftAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveLeft = left;
+ effectiveRight = right;
+ effectiveHorizontalCenter = hCenter;
+ effectiveLeftMargin = leftMargin;
+ effectiveRightMargin = rightMargin;
+ effectiveHorizontalCenterOffset = hCenterOffset;
+ }
+
QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item);
- if (usedAnchors & QDeclarativeAnchors::LeftAnchor) {
+ if (usedAnchors & effectiveLeftAnchor) {
//Handle stretching
bool invalid = true;
qreal width = 0.0;
- if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
- invalid = calcStretch(left, right, leftMargin, -rightMargin, QDeclarativeAnchorLine::Left, width);
+ if (usedAnchors & effectiveRightAnchor) {
+ invalid = calcStretch(effectiveLeft, effectiveRight, effectiveLeftMargin, -effectiveRightMargin, QDeclarativeAnchorLine::Left, width);
} else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
- invalid = calcStretch(left, hCenter, leftMargin, hCenterOffset, QDeclarativeAnchorLine::Left, width);
+ invalid = calcStretch(effectiveLeft, effectiveHorizontalCenter, effectiveLeftMargin, effectiveHorizontalCenterOffset, QDeclarativeAnchorLine::Left, width);
width *= 2;
}
if (!invalid)
setItemWidth(width);
//Handle left
- if (left.item == item->parentItem()) {
- setItemX(adjustedPosition(left.item, left.anchorLine) + leftMargin);
- } else if (left.item->parentItem() == item->parentItem()) {
- setItemX(position(left.item, left.anchorLine) + leftMargin);
+ if (effectiveLeft.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
+ } else if (effectiveLeft.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
}
- } else if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
+ } else if (usedAnchors & effectiveRightAnchor) {
//Handle stretching (left + right case is handled in updateLeftAnchor)
if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
qreal width = 0.0;
- bool invalid = calcStretch(hCenter, right, hCenterOffset, -rightMargin,
+ bool invalid = calcStretch(effectiveHorizontalCenter, effectiveRight, effectiveHorizontalCenterOffset, -effectiveRightMargin,
QDeclarativeAnchorLine::Left, width);
if (!invalid)
setItemWidth(width*2);
}
//Handle right
- if (right.item == item->parentItem()) {
- setItemX(adjustedPosition(right.item, right.anchorLine) - itemPrivate->width() - rightMargin);
- } else if (right.item->parentItem() == item->parentItem()) {
- setItemX(position(right.item, right.anchorLine) - itemPrivate->width() - rightMargin);
+ if (effectiveRight.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
+ } else if (effectiveRight.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
}
} else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
//Handle hCenter
- if (hCenter.item == item->parentItem()) {
- setItemX(adjustedPosition(hCenter.item, hCenter.anchorLine) - hcenter(item) + hCenterOffset);
- } else if (hCenter.item->parentItem() == item->parentItem()) {
- setItemX(position(hCenter.item, hCenter.anchorLine) - hcenter(item) + hCenterOffset);
+ if (effectiveHorizontalCenter.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
+ } else if (effectiveHorizontalCenter.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
}
}
-
--updatingHorizontalAnchor;
} else {
// ### Make this certain :)
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
index d2c0a89..388d6b9 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -79,6 +79,7 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchors : public QObject
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
+ Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged REVISION 1)
public:
QDeclarativeAnchors(QObject *parent=0);
@@ -163,6 +164,8 @@ public:
void classBegin();
void componentComplete();
+ bool mirrored();
+
Q_SIGNALS:
void leftChanged();
void rightChanged();
@@ -181,9 +184,11 @@ Q_SIGNALS:
void verticalCenterOffsetChanged();
void horizontalCenterOffsetChanged();
void baselineOffsetChanged();
+ Q_REVISION(1) void mirroredChanged();
private:
friend class QDeclarativeItem;
+ friend class QDeclarativeItemPrivate;
friend class QDeclarativeGraphicsWidget;
Q_DISABLE_COPY(QDeclarativeAnchors)
Q_DECLARE_PRIVATE(QDeclarativeAnchors)
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
index c4508e0..d8d2f15 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -133,6 +133,7 @@ public:
bool checkVAnchorValid(QDeclarativeAnchorLine anchor) const;
bool calcStretch(const QDeclarativeAnchorLine &edge1, const QDeclarativeAnchorLine &edge2, qreal offset1, qreal offset2, QDeclarativeAnchorLine::AnchorLine line, qreal &stretch);
+ bool isMirrored() const;
void updateHorizontalAnchors();
void updateVerticalAnchors();
void fillChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index 016b87d..8cc8165 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -231,9 +231,18 @@ void QDeclarativeAnimatedImage::load()
{
Q_D(QDeclarativeAnimatedImage);
+ QDeclarativeImageBase::Status oldStatus = d->status;
+ qreal oldProgress = d->progress;
+
if (d->url.isEmpty()) {
delete d->_movie;
+ d->setPixmap(QPixmap());
+ d->progress = 0;
d->status = Null;
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
} else {
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
@@ -245,7 +254,8 @@ void QDeclarativeAnimatedImage::load()
delete d->_movie;
d->_movie = 0;
d->status = Error;
- emit statusChanged(d->status);
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
return;
}
connect(d->_movie, SIGNAL(stateChanged(QMovie::MovieState)),
@@ -262,20 +272,25 @@ void QDeclarativeAnimatedImage::load()
d->setPixmap(d->_movie->currentPixmap());
d->status = Ready;
d->progress = 1.0;
- emit statusChanged(d->status);
- emit sourceChanged(d->url);
- emit progressChanged(d->progress);
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
return;
}
#endif
d->status = Loading;
+ d->progress = 0;
+ emit statusChanged(d->status);
+ emit progressChanged(d->progress);
QNetworkRequest req(d->url);
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
d->reply = qmlEngine(this)->networkAccessManager()->get(req);
QObject::connect(d->reply, SIGNAL(finished()),
this, SLOT(movieRequestFinished()));
+ QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
}
- emit statusChanged(d->status);
}
#define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION 16
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index c03c624..8f37e90 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -149,6 +149,20 @@ QT_BEGIN_NAMESPACE
\sa Image, AnimatedImage
*/
+/*!
+ \qmlproperty bool BorderImage::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent)
: QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent)
{
@@ -200,6 +214,15 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
*/
/*!
+ \qmlproperty bool BorderImage::cache
+ \since Quick 1.1
+
+ Specifies whether the image should be cached. The default value is
+ true. Setting \a cache to false is useful when dealing with large images,
+ to make sure that they aren't cached at the expense of small 'ui element' images.
+*/
+
+/*!
\qmlproperty bool BorderImage::mirror
\since Quick 1.1
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 2a16d21..1e2b70c 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -53,6 +53,10 @@ QT_BEGIN_NAMESPACE
// before we perform a flick.
static const int FlickThreshold = 20;
+// RetainGrabVelocity is the maxmimum instantaneous velocity that
+// will ensure the Flickable retains the grab on consecutive flicks.
+static const int RetainGrabVelocity = 15;
+
QDeclarativeFlickableVisibleArea::QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent)
: QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
, m_yPosition(0.), m_heightRatio(0.)
@@ -139,7 +143,7 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
, stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
, deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100)
, delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600)
- , vTime(0), visibleArea(0)
+ , fixupMode(Normal), vTime(0), visibleArea(0)
, flickableDirection(QDeclarativeFlickable::AutoFlickDirection)
, boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds)
{
@@ -215,6 +219,7 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal
{
Q_Q(QDeclarativeFlickable);
qreal maxDistance = -1;
+ data.fixingUp = false;
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
// -ve velocity means list is moving up
if (velocity > 0) {
@@ -284,24 +289,45 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
if (data.move.value() > minExtent || maxExtent > minExtent) {
timeline.reset(data.move);
if (data.move.value() != minExtent) {
- if (fixupDuration) {
- qreal dist = minExtent - data.move;
- timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
- timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
- } else {
+ switch (fixupMode) {
+ case Immediate:
timeline.set(data.move, minExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = minExtent - data.move;
+ timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
}
}
} else if (data.move.value() < maxExtent) {
timeline.reset(data.move);
- if (fixupDuration) {
- qreal dist = maxExtent - data.move;
- timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
- timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
- } else {
+ switch (fixupMode) {
+ case Immediate:
timeline.set(data.move, maxExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = maxExtent - data.move;
+ timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
}
}
+ fixupMode = Normal;
vTime = timeline.time();
}
@@ -672,7 +698,8 @@ void QDeclarativeFlickable::setFlickableDirection(FlickableDirection direction)
void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_Q(QDeclarativeFlickable);
- if (interactive && timeline.isActive() && (qAbs(hData.velocity) > 10 || qAbs(vData.velocity) > 10))
+ if (interactive && timeline.isActive()
+ && (qAbs(hData.smoothVelocity.value()) > RetainGrabVelocity || qAbs(vData.smoothVelocity.value()) > RetainGrabVelocity))
stealMouse = true; // If we've been flicked then steal the click.
else
stealMouse = false;
@@ -683,6 +710,12 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
vData.velocity = 0;
hData.dragStartOffset = 0;
vData.dragStartOffset = 0;
+ hData.dragMinBound = q->minXExtent();
+ vData.dragMinBound = q->minYExtent();
+ hData.dragMaxBound = q->maxXExtent();
+ vData.dragMaxBound = q->maxYExtent();
+ hData.fixingUp = false;
+ vData.fixingUp = false;
lastPos = QPoint();
QDeclarativeItemPrivate::start(lastPosTime);
pressPos = event->pos();
@@ -711,8 +744,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (!vMoved)
vData.dragStartOffset = dy;
qreal newY = dy + vData.pressPos - vData.dragStartOffset;
- const qreal minY = q->minYExtent();
- const qreal maxY = q->maxYExtent();
+ const qreal minY = vData.dragMinBound;
+ const qreal maxY = vData.dragMaxBound;
if (newY > minY)
newY = minY + (newY - minY) / 2;
if (newY < maxY && maxY - minY <= 0)
@@ -743,8 +776,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (!hMoved)
hData.dragStartOffset = dx;
qreal newX = dx + hData.pressPos - hData.dragStartOffset;
- const qreal minX = q->minXExtent();
- const qreal maxX = q->maxXExtent();
+ const qreal minX = hData.dragMinBound;
+ const qreal maxX = hData.dragMaxBound;
if (newX > minX)
newX = minX + (newX - minX) / 2;
if (newX < maxX && maxX - minX <= 0)
@@ -840,7 +873,8 @@ void QDeclarativeFlickable::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeFlickable);
if (d->interactive) {
- d->handleMousePressEvent(event);
+ if (!d->pressed)
+ d->handleMousePressEvent(event);
event->accept();
} else {
QDeclarativeItem::mousePressEvent(event);
@@ -905,11 +939,27 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
}
}
+bool QDeclarativeFlickablePrivate::isOutermostPressDelay() const
+{
+ Q_Q(const QDeclarativeFlickable);
+ QDeclarativeItem *item = q->parentItem();
+ while (item) {
+ QDeclarativeFlickable *flick = qobject_cast<QDeclarativeFlickable*>(item);
+ if (flick && flick->pressDelay() > 0 && flick->isInteractive())
+ return false;
+ item = item->parentItem();
+ }
+
+ return true;
+}
+
void QDeclarativeFlickablePrivate::captureDelayedPress(QGraphicsSceneMouseEvent *event)
{
Q_Q(QDeclarativeFlickable);
if (!q->scene() || pressDelay <= 0)
return;
+ if (!isOutermostPressDelay())
+ return;
delayedPressTarget = q->scene()->mouseGrabberItem();
delayedPressEvent = new QGraphicsSceneMouseEvent(event->type());
delayedPressEvent->setAccepted(false);
@@ -965,9 +1015,10 @@ void QDeclarativeFlickable::timerEvent(QTimerEvent *event)
if (scene()->mouseGrabberItem() == d->delayedPressTarget)
d->delayedPressTarget->ungrabMouse();
//Use the event handler that will take care of finding the proper item to propagate the event
- QApplication::sendEvent(scene(), d->delayedPressEvent);
+ QApplication::postEvent(scene(), d->delayedPressEvent);
+ } else {
+ delete d->delayedPressEvent;
}
- delete d->delayedPressEvent;
d->delayedPressEvent = 0;
}
}
@@ -1042,10 +1093,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
}
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupX();
- d->fixupDuration = oldDuration;
}
}
if (newGeometry.height() != oldGeometry.height()) {
@@ -1057,10 +1106,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
}
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupY();
- d->fixupDuration = oldDuration;
}
}
@@ -1214,10 +1261,11 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
d->contentItem->setWidth(w);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupX();
+ } else if (!d->pressed && d->hData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
d->fixupX();
- d->fixupDuration = oldDuration;
}
emit contentWidthChanged();
d->updateBeginningEnd();
@@ -1241,10 +1289,11 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
d->contentItem->setHeight(h);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupY();
+ } else if (!d->pressed && d->vData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
d->fixupY();
- d->fixupDuration = oldDuration;
}
emit contentHeightChanged();
d->updateBeginningEnd();
@@ -1253,11 +1302,10 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
/*!
\qmlmethod Flickable::resizeContent(real width, real height, QPointF center)
\preliminary
+ \since Quick 1.1
Resizes the content to \a width x \a height about \a center.
- \bold {This method was added in QtQuick 1.1.}
-
This does not scale the contents of the Flickable - it only resizes the \l contentWidth
and \l contentHeight.
@@ -1289,11 +1337,10 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center)
/*!
\qmlmethod Flickable::returnToBounds()
\preliminary
+ \since Quick 1.1
Ensures the content is within legal bounds.
- \bold {This method was added in QtQuick 1.1.}
-
This may be called to ensure that the content is within legal bounds
after manually positioning the content.
*/
@@ -1338,6 +1385,22 @@ bool QDeclarativeFlickable::yflick() const
return d->flickableDirection & QDeclarativeFlickable::VerticalFlick;
}
+bool QDeclarativeFlickable::sceneEvent(QEvent *event)
+{
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ Q_D(QDeclarativeFlickable);
+ if (d->pressed) {
+ // if our mouse grab has been removed (probably by another Flickable),
+ // fix our state
+ d->pressed = false;
+ d->stealMouse = false;
+ setKeepMouseGrab(false);
+ }
+ }
+ return rv;
+}
+
bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeFlickable);
@@ -1365,7 +1428,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
d->handleMouseMoveEvent(&mouseEvent);
break;
case QEvent::GraphicsSceneMousePress:
- if (d->delayedPressEvent)
+ if (d->pressed) // we are already pressed - this is a delayed replay
return false;
d->handleMousePressEvent(&mouseEvent);
@@ -1384,6 +1447,8 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
// We send the release
scene()->sendEvent(s->mouseGrabberItem(), event);
// And the event has been consumed
+ d->stealMouse = false;
+ d->pressed = false;
return true;
}
d->handleMouseReleaseEvent(&mouseEvent);
@@ -1406,6 +1471,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
d->stealMouse = false;
d->pressed = false;
}
+
return false;
}
@@ -1504,6 +1570,9 @@ bool QDeclarativeFlickable::isFlickingVertically() const
If the flickable is dragged/flicked before the delay times out
the press event will not be delivered. If the button is released
within the timeout, both the press and release will be delivered.
+
+ Note that for nested Flickables with pressDelay set, the pressDelay of
+ inner Flickables is overridden by the outermost Flickable.
*/
int QDeclarativeFlickable::pressDelay() const
{
@@ -1596,6 +1665,7 @@ void QDeclarativeFlickable::movementXEnding()
emit movementEnded();
}
}
+ d->hData.fixingUp = false;
}
void QDeclarativeFlickable::movementYEnding()
@@ -1618,6 +1688,7 @@ void QDeclarativeFlickable::movementYEnding()
emit movementEnded();
}
}
+ d->vData.fixingUp = false;
}
void QDeclarativeFlickablePrivate::updateVelocity()
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index 4fde1d5..a14cc1c 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -204,6 +204,7 @@ protected:
virtual void viewportMoved();
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
+ bool sceneEvent(QEvent *event);
bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
bool xflick() const;
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index 5ad6ff6..38a5eb3 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -94,17 +94,21 @@ public:
struct AxisData {
AxisData(QDeclarativeFlickablePrivate *fp, void (QDeclarativeFlickablePrivate::*func)(qreal))
: move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true)
+ , fixingUp(false)
{}
QDeclarativeTimeLineValueProxy<QDeclarativeFlickablePrivate> move;
qreal viewSize;
qreal pressPos;
qreal dragStartOffset;
+ qreal dragMinBound;
+ qreal dragMaxBound;
qreal velocity;
qreal flickTarget;
QDeclarativeFlickablePrivate::Velocity smoothVelocity;
bool atEnd : 1;
bool atBeginning : 1;
+ bool fixingUp : 1;
};
void flickX(qreal velocity);
@@ -118,6 +122,7 @@ public:
void updateBeginningEnd();
+ bool isOutermostPressDelay() const;
void captureDelayedPress(QGraphicsSceneMouseEvent *event);
void clearDelayedPress();
@@ -160,6 +165,9 @@ public:
int pressDelay;
int fixupDuration;
+ enum FixupMode { Normal, Immediate, ExtentChanged };
+ FixupMode fixupMode;
+
static void fixupY_callback(void *);
static void fixupX_callback(void *);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 694130b..5c2f781 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -68,21 +68,62 @@ public:
}
~FxGridItem() {}
- qreal rowPos() const { return (view->flow() == QDeclarativeGridView::LeftToRight ? item->y() : item->x()); }
- qreal colPos() const { return (view->flow() == QDeclarativeGridView::LeftToRight ? item->x() : item->y()); }
+ qreal rowPos() const {
+ qreal rowPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ rowPos = item->y();
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ rowPos = -view->cellWidth()-item->x();
+ else
+ rowPos = item->x();
+ }
+ return rowPos;
+ }
+ qreal colPos() const {
+ qreal colPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ int colSize = view->cellWidth();
+ int columns = view->width()/colSize;
+ colPos = colSize * (columns-1) - item->x();
+ } else {
+ colPos = item->x();
+ }
+ } else {
+ colPos = item->y();
+ }
+
+ return colPos;
+ }
+
qreal endRowPos() const {
- return view->flow() == QDeclarativeGridView::LeftToRight
- ? item->y() + view->cellHeight() - 1
- : item->x() + view->cellWidth() - 1;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ return item->y() + view->cellHeight() - 1;
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ return -item->x() - 1;
+ else
+ return item->x() + view->cellWidth() - 1;
+ }
}
void setPosition(qreal col, qreal row) {
- if (view->flow() == QDeclarativeGridView::LeftToRight) {
- item->setPos(QPointF(col, row));
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ int columns = view->width()/view->cellWidth();
+ item->setPos(QPointF((view->cellWidth() * (columns-1) - col), row));
+ } else {
+ item->setPos(QPointF(-view->cellWidth()-row, col));
+ }
} else {
- item->setPos(QPointF(row, col));
+ if (view->flow() == QDeclarativeGridView::LeftToRight)
+ item->setPos(QPointF(col, row));
+ else
+ item->setPos(QPointF(row, col));
}
+
}
- bool contains(int x, int y) const {
+ bool contains(qreal x, qreal y) const {
return (x >= item->x() && x < item->x() + view->cellWidth() &&
y >= item->y() && y < item->y() + view->cellHeight());
}
@@ -101,10 +142,12 @@ class QDeclarativeGridViewPrivate : public QDeclarativeFlickablePrivate
public:
QDeclarativeGridViewPrivate()
- : currentItem(0), flow(QDeclarativeGridView::LeftToRight)
+ : currentItem(0), layoutDirection(Qt::LeftToRight), flow(QDeclarativeGridView::LeftToRight)
, visibleIndex(0) , currentIndex(-1)
, cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1), itemCount(0)
- , highlightRangeStart(0), highlightRangeEnd(0), highlightRange(QDeclarativeGridView::NoHighlightRange)
+ , highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
+ , highlightRange(QDeclarativeGridView::NoHighlightRange)
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
, highlightMoveDuration(150)
@@ -144,35 +187,71 @@ public:
return 0;
}
+ bool isRightToLeftTopToBottom() const {
+ Q_Q(const QDeclarativeGridView);
+ return flow == QDeclarativeGridView::TopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
+ void regenerate() {
+ Q_Q(QDeclarativeGridView);
+ if (q->isComponentComplete()) {
+ clear();
+ updateGrid();
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeGridView);
+ regenerate();
+ emit q->effectiveLayoutDirectionChanged();
+ }
+
qreal position() const {
Q_Q(const QDeclarativeGridView);
return flow == QDeclarativeGridView::LeftToRight ? q->contentY() : q->contentX();
}
void setPosition(qreal pos) {
Q_Q(QDeclarativeGridView);
- if (flow == QDeclarativeGridView::LeftToRight)
+ if (flow == QDeclarativeGridView::LeftToRight) {
q->QDeclarativeFlickable::setContentY(pos);
- else
- q->QDeclarativeFlickable::setContentX(pos);
+ q->QDeclarativeFlickable::setContentX(0);
+ } else {
+ if (q->effectiveLayoutDirection() == Qt::LeftToRight)
+ q->QDeclarativeFlickable::setContentX(pos);
+ else
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ q->QDeclarativeFlickable::setContentY(0);
+ }
}
int size() const {
Q_Q(const QDeclarativeGridView);
return flow == QDeclarativeGridView::LeftToRight ? q->height() : q->width();
}
- qreal startPosition() const {
+ qreal originPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty())
pos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
return pos;
}
- qreal endPosition() const {
+ qreal lastPosition() const {
qreal pos = 0;
if (model && model->count())
pos = rowPosAt(model->count() - 1) + rowSize();
return pos;
}
+ qreal startPosition() const {
+ return isRightToLeftTopToBottom() ? -lastPosition()+1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeftTopToBottom() ? -originPosition()+1 : lastPosition();
+
+ }
+
bool isValid() const {
return model && model->count() && model->isValid();
}
@@ -227,7 +306,7 @@ public:
}
FxGridItem *firstVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeftTopToBottom() ? -position()-size() : position();
for (int i = 0; i < visibleItems.count(); ++i) {
FxGridItem *item = visibleItems.at(i);
if (item->index != -1 && item->endRowPos() > pos)
@@ -237,15 +316,12 @@ public:
}
int lastVisibleIndex() const {
- int lastIndex = -1;
- for (int i = visibleItems.count()-1; i >= 0; --i) {
- FxGridItem *gridItem = visibleItems.at(i);
- if (gridItem->index != -1) {
- lastIndex = gridItem->index;
- break;
- }
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index != -1)
+ return item->index;
}
- return lastIndex;
+ return -1;
}
// Map a model index to visibleItems list index.
@@ -271,8 +347,15 @@ public:
pos += rowSize()/2;
snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
snapPos = pos - fmodf(pos - snapPos, qreal(rowSize()));
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
- qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ qreal maxExtent;
+ qreal minExtent;
+ if (isRightToLeftTopToBottom()) {
+ maxExtent = q->minXExtent();
+ minExtent = q->maxXExtent();
+ } else {
+ maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ }
if (snapPos > maxExtent)
snapPos = maxExtent;
if (snapPos < minExtent)
@@ -363,6 +446,7 @@ public:
QList<FxGridItem*> visibleItems;
QHash<QDeclarativeItem*,int> unrequestedItems;
FxGridItem *currentItem;
+ Qt::LayoutDirection layoutDirection;
QDeclarativeGridView::Flow flow;
int visibleIndex;
int currentIndex;
@@ -373,6 +457,8 @@ public:
int itemCount;
qreal highlightRangeStart;
qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
QDeclarativeGridView::HighlightRangeMode highlightRange;
QDeclarativeComponent *highlightComponent;
FxGridItem *highlight;
@@ -554,7 +640,7 @@ void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
if (!lazyRelease || !changed || deferredRelease) { // avoid destroying items in the same frame that we create
while (visibleItems.count() > 1
&& (item = visibleItems.first())
- && item->endRowPos() < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
+ && item->rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
if (item->attached->delayRemove())
break;
// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
@@ -596,12 +682,14 @@ void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
void QDeclarativeGridViewPrivate::updateGrid()
{
Q_Q(QDeclarativeGridView);
+
columns = (int)qMax((flow == QDeclarativeGridView::LeftToRight ? q->width() : q->height()) / colSize(), qreal(1.));
if (isValid()) {
if (flow == QDeclarativeGridView::LeftToRight)
q->setContentHeight(endPosition() - startPosition());
else
- q->setContentWidth(endPosition() - startPosition());
+ q->setContentWidth(lastPosition() - originPosition());
+ setPosition(0);
}
}
@@ -669,10 +757,14 @@ void QDeclarativeGridViewPrivate::updateUnrequestedPositions()
{
QHash<QDeclarativeItem*,int>::const_iterator it;
for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it) {
+ QDeclarativeItem *item = it.key();
if (flow == QDeclarativeGridView::LeftToRight) {
- it.key()->setPos(QPointF(colPosAt(*it), rowPosAt(*it)));
+ item->setPos(QPointF(colPosAt(*it), rowPosAt(*it)));
} else {
- it.key()->setPos(QPointF(rowPosAt(*it), colPosAt(*it)));
+ if (isRightToLeftTopToBottom())
+ item->setPos(QPointF(-rowPosAt(*it)-item->width(), colPosAt(*it)));
+ else
+ item->setPos(QPointF(rowPosAt(*it), colPosAt(*it)));
}
}
}
@@ -837,23 +929,30 @@ void QDeclarativeGridViewPrivate::updateFooter()
}
}
if (footer) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = footer->item->width()-cellWidth;
+ } else {
+ rowOffset = 0;
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = footer->item->width()-cellWidth;
+ }
if (visibleItems.count()) {
- qreal endPos = endPosition();
+ qreal endPos = lastPosition();
if (lastVisibleIndex() == model->count()-1) {
- footer->setPosition(0, endPos);
+ footer->setPosition(colOffset, endPos + rowOffset);
} else {
- qreal visiblePos = position() + q->height();
- if (endPos <= visiblePos || footer->endRowPos() < endPos)
- footer->setPosition(0, endPos);
+ qreal visiblePos = isRightToLeftTopToBottom() ? -position() : position() + size();
+ if (endPos <= visiblePos || footer->endRowPos() < endPos + rowOffset)
+ footer->setPosition(colOffset, endPos + rowOffset);
}
} else {
qreal endPos = 0;
if (header) {
- endPos += flow == QDeclarativeGridView::LeftToRight
- ? header->item->height()
- : header->item->width();
+ endPos += flow == QDeclarativeGridView::LeftToRight ? header->item->height() : header->item->width();
}
- footer->setPosition(0, endPos);
+ footer->setPosition(colOffset, endPos);
}
}
}
@@ -883,16 +982,27 @@ void QDeclarativeGridViewPrivate::updateHeader()
}
}
if (header) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = -cellWidth;
+ } else {
+ rowOffset = -headerSize();
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = header->item->width()-cellWidth;
+ }
if (visibleItems.count()) {
- qreal startPos = startPosition();
+ qreal startPos = originPosition();
if (visibleIndex == 0) {
- header->setPosition(0, startPos - headerSize());
+ header->setPosition(colOffset, startPos + rowOffset);
} else {
- if (position() <= startPos || header->rowPos() > startPos - headerSize())
- header->setPosition(0, startPos - headerSize());
+ qreal tempPos = isRightToLeftTopToBottom() ? -position()-size() : position();
+ qreal headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
+ if (tempPos <= startPos || headerPos > startPos + rowOffset)
+ header->setPosition(colOffset, startPos + rowOffset);
}
} else {
- header->setPosition(0, 0);
+ header->setPosition(colOffset, 0);
}
}
}
@@ -912,76 +1022,107 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
|| (flow == QDeclarativeGridView::LeftToRight && &data == &hData))
return;
- int oldDuration = fixupDuration;
- fixupDuration = moveReason == Mouse ? fixupDuration : 0;
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeftTopToBottom()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size()-highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
if (snapMode != QDeclarativeGridView::NoSnap) {
- FxGridItem *topItem = snapItemAt(position()+highlightRangeStart);
- FxGridItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
+ qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position();
+ FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
+ FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
- qreal topPos = qMin(topItem->rowPos() - highlightRangeStart, -maxExtent);
- qreal bottomPos = qMax(bottomItem->rowPos() - highlightRangeEnd, -minExtent);
+ qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent);
+ qreal bottomPos = qMax(bottomItem->rowPos() - highlightEnd, -minExtent);
pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
} else if (topItem) {
- if (topItem->index == 0 && header && position()+highlightRangeStart < header->rowPos()+headerSize()/2)
- pos = header->rowPos() - highlightRangeStart;
- else
- pos = qMax(qMin(topItem->rowPos() - highlightRangeStart, -maxExtent), -minExtent);
+ qreal headerPos = 0;
+ if (header)
+ headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
+ if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2) {
+ pos = isRightToLeftTopToBottom() ? - headerPos + highlightStart - size() : headerPos - highlightStart;
+ } else {
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-topItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->rowPos() - highlightStart, -maxExtent), -minExtent);
+ }
} else if (bottomItem) {
- pos = qMax(qMin(bottomItem->rowPos() - highlightRangeStart, -maxExtent), -minExtent);
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-bottomItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(bottomItem->rowPos() - highlightStart, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
- fixupDuration = oldDuration;
return;
}
if (currentItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
updateHighlight();
qreal currPos = currentItem->rowPos();
- if (pos < currPos + rowSize() - highlightRangeEnd)
- pos = currPos + rowSize() - highlightRangeEnd;
- if (pos > currPos - highlightRangeStart)
- pos = currPos - highlightRangeStart;
+ if (isRightToLeftTopToBottom())
+ pos = -pos-size(); // Transform Pos if required
+ if (pos < currPos + rowSize() - highlightEnd)
+ pos = currPos + rowSize() - highlightEnd;
+ if (pos > currPos - highlightStart)
+ pos = currPos - highlightStart;
+ if (isRightToLeftTopToBottom())
+ pos = -pos-size(); // Untransform
}
-
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -pos);
+ }
vTime = timeline.time();
}
} else if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
if (currentItem) {
updateHighlight();
qreal pos = currentItem->rowPos();
- qreal viewPos = position();
- if (viewPos < pos + rowSize() - highlightRangeEnd)
- viewPos = pos + rowSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
-
+ if (viewPos < pos + rowSize() - highlightEnd)
+ viewPos = pos + rowSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeftTopToBottom())
+ viewPos = -viewPos-size();
timeline.reset(data.move);
if (viewPos != position()) {
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -viewPos);
+ }
}
vTime = timeline.time();
}
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
- fixupDuration = oldDuration;
+ fixupMode = Normal;
}
void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
{
Q_Q(QDeclarativeGridView);
+ data.fixingUp = false;
moveReason = Mouse;
if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
&& snapMode == QDeclarativeGridView::NoSnap) {
@@ -989,12 +1130,14 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
return;
}
qreal maxDistance = 0;
- // -ve velocity means list is moving up
+ qreal dataValue = isRightToLeftTopToBottom() ? -data.move.value()+size() : data.move.value();
+ // -ve velocity means list is moving up/left
if (velocity > 0) {
if (data.move.value() < minExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- if (FxGridItem *item = firstVisibleItem())
- maxDistance = qAbs(item->rowPos() + data.move.value());
+ if (FxGridItem *item = firstVisibleItem()) {
+ maxDistance = qAbs(item->rowPos() + dataValue);
+ }
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1004,8 +1147,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
if (data.move.value() > maxExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- qreal pos = snapPosAt(-data.move.value()) + rowSize();
- maxDistance = qAbs(pos + data.move.value());
+ qreal pos = snapPosAt(-dataValue) + (isRightToLeftTopToBottom() ? 0 : rowSize());
+ maxDistance = qAbs(pos + dataValue);
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1013,7 +1156,10 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
}
+
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+ qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+
if (maxDistance > 0 || overShoot) {
// This mode requires the grid to stop exactly on a row boundary.
qreal v = velocity;
@@ -1032,7 +1178,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
dist = qMin(dist, maxDistance);
if (v > 0)
dist = -dist;
- data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
+ qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ data.flickTarget = isRightToLeftTopToBottom() ? -data.flickTarget+size() : data.flickTarget;
qreal adjDist = -data.flickTarget + data.move.value();
if (qAbs(adjDist) > qAbs(dist)) {
// Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
@@ -1224,6 +1372,13 @@ QVariant QDeclarativeGridView::model() const
return d->modelVariant;
}
+// For internal use
+int QDeclarativeGridView::modelCount() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->model->count();
+}
+
void QDeclarativeGridView::setModel(const QVariant &model)
{
Q_D(QDeclarativeGridView);
@@ -1549,6 +1704,7 @@ qreal QDeclarativeGridView::preferredHighlightBegin() const
void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
{
Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = true;
if (d->highlightRangeStart == start)
return;
d->highlightRangeStart = start;
@@ -1556,6 +1712,16 @@ void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
emit preferredHighlightBeginChanged();
}
+void QDeclarativeGridView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
qreal QDeclarativeGridView::preferredHighlightEnd() const
{
Q_D(const QDeclarativeGridView);
@@ -1565,6 +1731,7 @@ qreal QDeclarativeGridView::preferredHighlightEnd() const
void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
{
Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = true;
if (d->highlightRangeEnd == end)
return;
d->highlightRangeEnd = end;
@@ -1572,6 +1739,16 @@ void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
emit preferredHighlightEndChanged();
}
+void QDeclarativeGridView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
QDeclarativeGridView::HighlightRangeMode QDeclarativeGridView::highlightRangeMode() const
{
Q_D(const QDeclarativeGridView);
@@ -1588,6 +1765,60 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
emit highlightRangeModeChanged();
}
+/*!
+ \qmlproperty enumeration GridView::layoutDirection
+ This property holds the layout direction of the grid.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out starting in the top, left corner. The flow is
+ dependent on the \l GridView::flow property.
+ \o Qt.RightToLeft - Items will be laid out starting in the top, right corner. The flow is dependent
+ on the \l GridView:flow property.
+ \endlist
+
+ \bold Note: If GridView::flow is set to GridView.LeftToRight, this is not to be confused if
+ GridView::layoutDirection is set to Qt.RightToLeft. The GridView.LeftToRight flow value simply
+ indicates that the flow is horizontal.
+*/
+
+Qt::LayoutDirection QDeclarativeGridView::layoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeGridView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration GridView::effectiveLayoutDirection
+ This property holds the effective layout direction of the grid.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid will be mirrored. However, the
+ property \l {GridView::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa GridView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
/*!
\qmlproperty enumeration GridView::flow
@@ -1620,10 +1851,7 @@ void QDeclarativeGridView::setFlow(Flow flow)
}
setContentX(0);
setContentY(0);
- d->clear();
- d->updateGrid();
- refill();
- d->updateCurrent(d->currentIndex);
+ d->regenerate();
emit flowChanged();
}
}
@@ -1890,11 +2118,23 @@ void QDeclarativeGridView::viewportMoved()
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
// reposition highlight
qreal pos = d->highlight->rowPos();
- qreal viewPos = d->position();
- if (pos > viewPos + d->highlightRangeEnd - d->rowSize())
- pos = viewPos + d->highlightRangeEnd - d->rowSize();
- if (pos < viewPos + d->highlightRangeStart)
- pos = viewPos + d->highlightRangeStart;
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ viewPos = -d->position()-d->size();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ viewPos = d->position();
+ }
+ if (pos > viewPos + highlightEnd - d->rowSize())
+ pos = viewPos + highlightEnd - d->rowSize();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
+
d->highlight->setPosition(d->highlight->colPos(), qRound(pos));
// update current index
@@ -1956,11 +2196,27 @@ qreal QDeclarativeGridView::minXExtent() const
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::minXExtent();
qreal extent = -d->startPosition();
- if (d->header && d->visibleItems.count())
- extent += d->header->item->width();
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem;
+ if (d->isRightToLeftTopToBottom()) {
+ endPositionFirstItem = d->rowPosAt(d->model->count()-1);
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer && d->visibleItems.count())
+ extent += d->footer->item->width();
+ } else {
+ endPositionFirstItem = d->rowPosAt(0)+d->rowSize();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ extent += d->header->item->width();
+ }
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- extent += d->highlightRangeStart;
- extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd));
+ extent += highlightStart;
+ extent = qMax(extent, -(endPositionFirstItem - highlightEnd));
}
return extent;
}
@@ -1971,17 +2227,38 @@ qreal QDeclarativeGridView::maxXExtent() const
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::maxXExtent();
qreal extent;
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition;
+ if (d->isRightToLeftTopToBottom()){
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->model && d->model->count())
+ lastItemPosition = d->rowPosAt(d->model->count()-1);
+ }
if (!d->model || !d->model->count()) {
extent = 0;
- } if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart);
- if (d->highlightRangeEnd != d->highlightRangeStart)
- extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart)
+ extent = d->isRightToLeftTopToBottom()
+ ? qMax(extent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(extent, -(d->endPosition() - highlightEnd + 1));
} else {
extent = -(d->endPosition() - width());
}
- if (d->footer)
- extent -= d->footer->item->width();
+ if (d->isRightToLeftTopToBottom()) {
+ if (d->header)
+ extent -= d->header->item->width();
+ } else {
+ if (d->footer)
+ extent -= d->footer->item->width();
+ }
+
const qreal minX = minXExtent();
if (extent > minX)
extent = minX;
@@ -2094,15 +2371,30 @@ void QDeclarativeGridView::moveCurrentIndexLeft()
const int count = d->model ? d->model->count() : 0;
if (!count)
return;
- if (d->flow == QDeclarativeGridView::LeftToRight) {
- if (currentIndex() > 0 || d->wrap) {
- int index = currentIndex() - 1;
- setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
}
} else {
- if (currentIndex() >= d->columns || d->wrap) {
- int index = currentIndex() - d->columns;
- setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex() + d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
}
}
}
@@ -2122,15 +2414,30 @@ void QDeclarativeGridView::moveCurrentIndexRight()
const int count = d->model ? d->model->count() : 0;
if (!count)
return;
- if (d->flow == QDeclarativeGridView::LeftToRight) {
- if (currentIndex() < count - 1 || d->wrap) {
- int index = currentIndex() + 1;
- setCurrentIndex((index >= 0 && index < count) ? index : 0);
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex()+d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
}
} else {
- if (currentIndex() < count - d->columns || d->wrap) {
- int index = currentIndex()+d->columns;
- setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
}
}
}
@@ -2147,16 +2454,24 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (layoutScheduled)
layout();
- qreal pos = position();
+ qreal pos = isRightToLeftTopToBottom() ? -position() - size() : position();
FxGridItem *item = visibleItem(idx);
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ qreal maxExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
+
if (!item) {
int itemPos = rowPosAt(idx);
// save the currently visible items in case any of them end up visible again
QList<FxGridItem*> oldVisible = visibleItems;
visibleItems.clear();
visibleIndex = idx - idx % columns;
- maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
setPosition(qMin(qreal(itemPos), maxExtent));
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
@@ -2197,8 +2512,13 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (itemPos < pos)
pos = itemPos;
}
+
pos = qMin(pos, maxExtent);
- qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ qreal minExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ minExtent = -q->minYExtent();
+ else
+ minExtent = isRightToLeftTopToBottom() ? q->maxXExtent()-size() : -q->minXExtent();
pos = qMax(pos, minExtent);
moveReason = QDeclarativeGridViewPrivate::Other;
q->cancelFlick();
@@ -2250,6 +2570,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod GridView::positionViewAtBeginning()
\qmlmethod GridView::positionViewAtEnd()
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
@@ -2294,7 +2615,7 @@ void QDeclarativeGridView::positionViewAtEnd()
\bold Note: methods should only be called after the Component has completed.
*/
-int QDeclarativeGridView::indexAt(int x, int y) const
+int QDeclarativeGridView::indexAt(qreal x, qreal y) const
{
Q_D(const QDeclarativeGridView);
for (int i = 0; i < d->visibleItems.count(); ++i) {
@@ -2337,32 +2658,43 @@ void QDeclarativeGridView::trackedPositionChanged()
return;
if (d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
const qreal trackedPos = d->trackedItem->rowPos();
- const qreal viewPos = d->position();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
qreal pos = viewPos;
if (d->haveHighlightRange) {
if (d->highlightRange == StrictlyEnforceRange) {
- if (trackedPos > pos + d->highlightRangeEnd - d->rowSize())
- pos = trackedPos - d->highlightRangeEnd + d->rowSize();
- if (trackedPos < pos + d->highlightRangeStart)
- pos = trackedPos - d->highlightRangeStart;
+ if (trackedPos > pos + highlightEnd - d->rowSize())
+ pos = trackedPos - highlightEnd + d->rowSize();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
} else {
- if (trackedPos < d->startPosition() + d->highlightRangeStart) {
+ if (trackedPos < d->startPosition() + highlightStart) {
pos = d->startPosition();
- } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + d->highlightRangeEnd) {
+ } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + highlightEnd) {
pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
- if (trackedPos < viewPos + d->highlightRangeStart) {
- pos = trackedPos - d->highlightRangeStart;
- } else if (trackedPos > viewPos + d->highlightRangeEnd - d->rowSize()) {
- pos = trackedPos - d->highlightRangeEnd + d->rowSize();
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - d->rowSize()) {
+ pos = trackedPos - highlightEnd + d->rowSize();
}
}
}
} else {
if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
- pos = d->currentItem->rowPos() < trackedPos ? trackedPos : d->currentItem->rowPos();
+ pos = qMax(trackedPos, d->currentItem->rowPos());
} else if (d->trackedItem->endRowPos() >= viewPos + d->size()
&& d->currentItem->endRowPos() >= viewPos + d->size()) {
if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) {
@@ -2430,7 +2762,8 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
modelIndex = d->visibleIndex;
}
- int to = d->buffer+d->position()+d->size()-1;
+ qreal tempPos = d->isRightToLeftTopToBottom() ? -d->position()-d->size()+d->width()+1 : d->position();
+ int to = d->buffer+tempPos+d->size()-1;
int colPos = 0;
int rowPos = 0;
if (d->visibleItems.count()) {
@@ -2448,10 +2781,7 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
}
}
} else if (d->itemCount == 0 && d->header) {
- if (d->flow == QDeclarativeGridView::LeftToRight)
- rowPos = d->headerSize();
- else
- colPos = d->headerSize();
+ rowPos = d->headerSize();
}
// Update the indexes of the following visible items.
@@ -2508,6 +2838,8 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
d->updateCurrent(0);
}
emit currentIndexChanged();
+ } else if (d->itemCount == 0 && d->currentIndex == -1) {
+ setCurrentIndex(0);
}
// everything is in order now - emit add() signal
@@ -2756,7 +3088,10 @@ void QDeclarativeGridView::animStopped()
void QDeclarativeGridView::refill()
{
Q_D(QDeclarativeGridView);
- d->refill(d->position(), d->position()+d->size()-1);
+ if (d->isRightToLeftTopToBottom())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index 248b9ef..4d99a14 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -69,11 +69,13 @@ class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem)
Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
- Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
- Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
@@ -95,6 +97,7 @@ public:
~QDeclarativeGridView();
QVariant model() const;
+ int modelCount() const;
void setModel(const QVariant &);
QDeclarativeComponent *delegate() const;
@@ -122,9 +125,15 @@ public:
qreal preferredHighlightBegin() const;
void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
qreal preferredHighlightEnd() const;
void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
enum Flow { LeftToRight, TopToBottom };
Flow flow() const;
@@ -158,7 +167,7 @@ public:
enum PositionMode { Beginning, Center, End, Visible, Contain };
Q_INVOKABLE void positionViewAtIndex(int index, int mode);
- Q_INVOKABLE int indexAt(int x, int y) const;
+ Q_INVOKABLE int indexAt(qreal x, qreal y) const;
Q_INVOKABLE Q_REVISION(1) void positionViewAtBeginning();
Q_INVOKABLE Q_REVISION(1) void positionViewAtEnd();
@@ -184,6 +193,8 @@ Q_SIGNALS:
void modelChanged();
void delegateChanged();
void flowChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
void keyNavigationWrapsChanged();
void cacheBufferChanged();
void snapModeChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index ffef61b..9cf1e78 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#include "private/qdeclarativeitem_p.h"
#include "qdeclarativeitem.h"
#include "private/qdeclarativeevents_p_p.h"
#include <private/qdeclarativeengine_p.h>
#include <private/qgraphicsitem_p.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <qdeclarativeengine.h>
#include <qdeclarativeopenmetaobject_p.h>
@@ -615,19 +615,28 @@ void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post)
return;
}
+ bool mirror = false;
switch(event->key()) {
- case Qt::Key_Left:
- if (d->left) {
- setFocusNavigation(d->left, "left");
+ case Qt::Key_Left: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* leftItem = mirror ? d->right : d->left;
+ if (leftItem) {
+ setFocusNavigation(leftItem, mirror ? "right" : "left");
event->accept();
}
break;
- case Qt::Key_Right:
- if (d->right) {
- setFocusNavigation(d->right, "right");
+ }
+ case Qt::Key_Right: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* rightItem = mirror ? d->left : d->right;
+ if (rightItem) {
+ setFocusNavigation(rightItem, mirror ? "left" : "right");
event->accept();
}
break;
+ }
case Qt::Key_Up:
if (d->up) {
setFocusNavigation(d->up, "up");
@@ -669,16 +678,19 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
return;
}
+ bool mirror = false;
switch(event->key()) {
case Qt::Key_Left:
- if (d->left) {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->right : d->left)
event->accept();
- }
break;
case Qt::Key_Right:
- if (d->right) {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->left : d->right)
event->accept();
- }
break;
case Qt::Key_Up:
if (d->up) {
@@ -731,6 +743,152 @@ void QDeclarativeKeyNavigationAttached::setFocusNavigation(QDeclarativeItem *cur
}
/*!
+ \qmlclass LayoutMirroring QDeclarativeLayoutMirroringAttached
+ \since QtQuick 1.1
+ \ingroup qml-utility-elements
+ \brief The LayoutMirroring is used for mirroring the Qt Quick application layouts.
+
+ LayoutMirroring \l enabled property can be used to horizontally mirror \l {anchor-layout}{Item anchors},
+ \l{Using QML Positioner and Repeater Items}{Positioner} elements and QML views like \l {GridView}{GridView}
+ and horizontal \l {ListView}{ListView}. Mirroring is a visual change, left anchors will become
+ right anchors and left-to-right positioner will instead position child items from right to left.
+ By default setting the \l enabled property to true only affects the item in question. You can set property
+ LayoutDirection \l childrenInherit to true if you want the item children also inherit the mirror setting.
+ If no attached property has been defined, mirroring is disabled.
+
+ The following example shows mirroring in action. When \l enabled is set to true, left anchor
+ becomes right, and \l {Row}{Row} starts positioning items in a reverse order:
+
+ \snippet doc/src/snippets/declarative/layoutmirroring.qml 0
+
+ Layout mirroring is useful when you need to support both left-to-right and right-to-left
+ layout versions of your application that target different language areas. Inheritance saves
+ you from having to mirror the layouts manually for each layout item in your application. Keep
+ in mind however that the mirroring does not affect the positioning done by modifying Item's x
+ co-ordinate directly, so even with the mirroring enabled you will often need to do some layout
+ fixes to support the other reading direction. Also, there are cases where you need to disable
+ mirroring of individual child items, either because mirroring is not the wanted behavior or
+ because the item already implements mirroring in some custom way.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::enabled
+
+ Setting this property to true mirrors item's layout horizontally, whether the layout is done
+ using \l {anchor-layout}{anchors}, \l{Using QML Positioner and Repeater Items}{Positioners}
+ or as a QML view \l {GridView}{GridView} or \l {ListView}{ListView}.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::childrenInherit
+
+ This property can be set to true if you want the item children
+ to inherit the item's mirror setting.
+*/
+
+QDeclarativeLayoutMirroringAttached::QDeclarativeLayoutMirroringAttached(QObject *parent) : QObject(parent), itemPrivate(0)
+{
+ if (QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent)) {
+ itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->attachedLayoutDirection = this;
+ } else
+ qmlInfo(parent) << tr("LayoutDirection attached property only works with Items");
+}
+
+QDeclarativeLayoutMirroringAttached * QDeclarativeLayoutMirroringAttached::qmlAttachedProperties(QObject *object)
+{
+ return new QDeclarativeLayoutMirroringAttached(object);
+}
+
+bool QDeclarativeLayoutMirroringAttached::enabled() const
+{
+ return itemPrivate ? itemPrivate->effectiveLayoutMirror : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setEnabled(bool enabled)
+{
+ if (!itemPrivate)
+ return;
+
+ itemPrivate->isMirrorImplicit = false;
+ if (enabled != itemPrivate->effectiveLayoutMirror) {
+ itemPrivate->setLayoutMirror(enabled);
+ if (itemPrivate->inheritMirrorFromItem)
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+void QDeclarativeLayoutMirroringAttached::resetEnabled()
+{
+ if (itemPrivate && !itemPrivate->isMirrorImplicit) {
+ itemPrivate->isMirrorImplicit = true;
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+bool QDeclarativeLayoutMirroringAttached::childrenInherit() const
+{
+ return itemPrivate ? itemPrivate->inheritMirrorFromItem : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setChildrenInherit(bool childrenInherit) {
+ if (itemPrivate && childrenInherit != itemPrivate->inheritMirrorFromItem) {
+ itemPrivate->inheritMirrorFromItem = childrenInherit;
+ itemPrivate->resolveLayoutMirror();
+ childrenInheritChanged();
+ }
+}
+
+void QDeclarativeItemPrivate::resolveLayoutMirror()
+{
+ Q_Q(QDeclarativeItem);
+ if (QDeclarativeItem *parentItem = q->parentItem()) {
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parentItem);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
+ } else {
+ setImplicitLayoutMirror(isMirrorImplicit ? false : effectiveLayoutMirror, inheritMirrorFromItem);
+ }
+}
+
+void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool mirror, bool inherit)
+{
+ inherit = inherit || inheritMirrorFromItem;
+ if (!isMirrorImplicit && inheritMirrorFromItem)
+ mirror = effectiveLayoutMirror;
+ if (mirror == inheritedLayoutMirror && inherit == inheritMirrorFromParent)
+ return;
+
+ inheritMirrorFromParent = inherit;
+ inheritedLayoutMirror = inheritMirrorFromParent ? mirror : false;
+
+ if (isMirrorImplicit)
+ setLayoutMirror(inherit ? inheritedLayoutMirror : false);
+ for (int i = 0; i < children.count(); ++i) {
+ if (QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i))) {
+ QDeclarativeItemPrivate *childPrivate = QDeclarativeItemPrivate::get(child);
+ childPrivate->setImplicitLayoutMirror(inheritedLayoutMirror, inheritMirrorFromParent);
+ }
+ }
+}
+
+void QDeclarativeItemPrivate::setLayoutMirror(bool mirror)
+{
+ if (mirror != effectiveLayoutMirror) {
+ effectiveLayoutMirror = mirror;
+ if (_anchors) {
+ _anchors->d_func()->fillChanged();
+ _anchors->d_func()->centerInChanged();
+ _anchors->d_func()->updateHorizontalAnchors();
+ emit _anchors->mirroredChanged();
+ }
+ mirrorChange();
+ if (attachedLayoutDirection) {
+ emit attachedLayoutDirection->enabledChanged();
+ }
+ }
+}
+
+/*!
\qmlclass Keys QDeclarativeKeysAttached
\ingroup qml-basic-interaction-elements
\since 4.7
@@ -1397,6 +1555,11 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
\endqml
See the \l {Keys}{Keys} attached property for detailed documentation.
+
+ \section1 Layout Mirroring
+
+ Item layouts can be mirrored using \l {LayoutMirroring}{LayoutMirroring} attached property.
+
*/
/*!
@@ -2154,6 +2317,8 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
\qmlproperty real Item::anchors.verticalCenterOffset
\qmlproperty real Item::anchors.baselineOffset
+ \qmlproperty bool Item::anchors.mirrored
+
Anchors provide a way to position an item by specifying its
relationship with other items.
@@ -2211,6 +2376,8 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
To clear an anchor value, set it to \c undefined.
+ \c anchors.mirrored returns true it the layout has been \l {LayoutMirroring}{mirrored}.
+
\note You can only anchor an item to siblings or a parent.
For more information see \l {anchor-layout}{Anchor Layouts}.
@@ -2812,6 +2979,7 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
Q_D(QDeclarativeItem);
switch (change) {
case ItemParentHasChanged:
+ d->resolveLayoutMirror();
emit parentChanged(parentItem());
d->parentNotifier.notify();
break;
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 4303c0a..dae581c 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE
class QNetworkReply;
class QDeclarativeItemKeyFilter;
+class QDeclarativeLayoutMirroringAttached;
//### merge into private?
class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener
@@ -125,8 +126,10 @@ public:
_stateGroup(0), origin(QDeclarativeItem::Center),
widthValid(false), heightValid(false),
componentComplete(true), keepMouse(false),
- smooth(false), transformOriginDirty(true), doneEventPreHandler(false), keyHandler(0),
- mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), hadSubFocusItem(false)
+ smooth(false), transformOriginDirty(true), doneEventPreHandler(false),
+ inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
+ inheritMirrorFromParent(false), inheritMirrorFromItem(false), keyHandler(0),
+ mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), attachedLayoutDirection(0), hadSubFocusItem(false)
{
QGraphicsItemPrivate::acceptedMouseButtons = 0;
isDeclarativeItem = 1;
@@ -134,7 +137,6 @@ public:
QGraphicsItem::ItemHasNoContents
| QGraphicsItem::ItemIsFocusable
| QGraphicsItem::ItemNegativeZStacksBehindParent);
-
}
void init(QDeclarativeItem *parent)
@@ -143,11 +145,17 @@ public:
if (parent) {
QDeclarative_setParent_noEvent(q, parent);
q->setParentItem(parent);
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parent);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
}
baselineOffset.invalidate();
mouseSetsFocus = false;
}
+ bool isMirrored() const {
+ return effectiveLayoutMirror;
+ }
+
// Private Properties
qreal width() const;
void setWidth(qreal);
@@ -162,6 +170,10 @@ public:
virtual void implicitWidthChanged();
virtual void implicitHeightChanged();
+ void resolveLayoutMirror();
+ void setImplicitLayoutMirror(bool mirror, bool inherit);
+ void setLayoutMirror(bool mirror);
+
QDeclarativeListProperty<QObject> data();
QDeclarativeListProperty<QObject> resources();
@@ -272,6 +284,11 @@ public:
bool smooth:1;
bool transformOriginDirty : 1;
bool doneEventPreHandler : 1;
+ bool inheritedLayoutMirror:1;
+ bool effectiveLayoutMirror:1;
+ bool isMirrorImplicit:1;
+ bool inheritMirrorFromParent:1;
+ bool inheritMirrorFromItem:1;
QDeclarativeItemKeyFilter *keyHandler;
@@ -280,6 +297,8 @@ public:
qreal mImplicitWidth;
qreal mImplicitHeight;
+ QDeclarativeLayoutMirroringAttached* attachedLayoutDirection;
+
bool hadSubFocusItem;
QPointF computeTransformOrigin() const;
@@ -326,6 +345,8 @@ public:
virtual void focusChanged(bool);
+ virtual void mirrorChange() {};
+
static qint64 consistentTime;
static void setConsistentTime(qint64 t);
static void start(QElapsedTimer &);
@@ -423,6 +444,31 @@ private:
void setFocusNavigation(QDeclarativeItem *currentItem, const char *dir);
};
+class QDeclarativeLayoutMirroringAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged)
+
+public:
+ explicit QDeclarativeLayoutMirroringAttached(QObject *parent = 0);
+
+ bool enabled() const;
+ void setEnabled(bool);
+ void resetEnabled();
+
+ bool childrenInherit() const;
+ void setChildrenInherit(bool);
+
+ static QDeclarativeLayoutMirroringAttached *qmlAttachedProperties(QObject *);
+Q_SIGNALS:
+ void enabledChanged();
+ void childrenInheritChanged();
+private:
+ friend class QDeclarativeItemPrivate;
+ QDeclarativeItemPrivate *itemPrivate;
+};
+
class QDeclarativeKeysAttachedPrivate : public QObjectPrivate
{
public:
@@ -572,5 +618,7 @@ QML_DECLARE_TYPE(QDeclarativeKeysAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
QML_DECLARE_TYPE(QDeclarativeKeyNavigationAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeLayoutMirroringAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeLayoutMirroringAttached, QML_HAS_ATTACHED_PROPERTIES)
#endif // QDECLARATIVEITEM_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index bc4a2d0..c4a9030 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -180,6 +180,7 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativePinch>("QtQuick",1,1,"Pinch");
qmlRegisterType<QDeclarativePinchEvent>();
qmlRegisterType<QDeclarativeItem,1>("QtQuick",1,1,"Item");
+ qmlRegisterType<QDeclarativeMouseArea,1>("QtQuick",1,1,"MouseArea");
qmlRegisterType<QDeclarativeFlickable,1>("QtQuick",1,1,"Flickable");
qmlRegisterType<QDeclarativeListView,1>("QtQuick",1,1,"ListView");
qmlRegisterType<QDeclarativeGridView,1>("QtQuick",1,1,"GridView");
@@ -197,6 +198,7 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterRevision<QDeclarativeImplicitSizeItem,1>("QtQuick",1,1);
qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,0>("QtQuick",1,0);
qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,1>("QtQuick",1,1);
+ qmlRegisterUncreatableType<QDeclarativeLayoutMirroringAttached>("QtQuick",1,1,"LayoutMirroring", QDeclarativeLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties"));
#ifndef QT_NO_IMPORT_QT47_QML
#ifdef QT_NO_MOVIE
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index a60a4aa..2c23a1b 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -100,13 +100,21 @@ public:
}
~FxListItem() {}
qreal position() const {
- if (section)
- return (view->orientation() == QDeclarativeListView::Vertical ? section->y() : section->x());
- else
- return (view->orientation() == QDeclarativeListView::Vertical ? item->y() : item->x());
+ if (section) {
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return section->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -section->width()-section->x() : section->x());
+ } else {
+ return itemPosition();
+ }
}
+
qreal itemPosition() const {
- return (view->orientation() == QDeclarativeListView::Vertical ? item->y() : item->x());
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return item->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -item->width()-item->x() : item->x());
}
qreal size() const {
if (section)
@@ -123,9 +131,13 @@ public:
return 0.0;
}
qreal endPosition() const {
- return (view->orientation() == QDeclarativeListView::Vertical
- ? item->y() + (item->height() >= 1.0 ? item->height() : 1)
- : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
+ if (view->orientation() == QDeclarativeListView::Vertical) {
+ return item->y() + (item->height() >= 1.0 ? item->height() : 1) - 1;
+ } else {
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft
+ ? -item->width()-item->x() + (item->width() >= 1.0 ? item->width() : 1)
+ : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
+ }
}
void setPosition(qreal pos) {
if (view->orientation() == QDeclarativeListView::Vertical) {
@@ -135,11 +147,19 @@ public:
}
item->setY(pos);
} else {
- if (section) {
- section->setX(pos);
- pos += section->width();
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (section) {
+ section->setX(-section->width()-pos);
+ pos += section->width();
+ }
+ item->setX(-item->width()-pos);
+ } else {
+ if (section) {
+ section->setX(pos);
+ pos += section->width();
+ }
+ item->setX(pos);
}
- item->setX(pos);
}
}
void setSize(qreal size) {
@@ -148,7 +168,7 @@ public:
else
item->setWidth(size);
}
- bool contains(int x, int y) const {
+ bool contains(qreal x, qreal y) const {
return (x >= item->x() && x < item->x() + item->width() &&
y >= item->y() && y < item->y() + item->height());
}
@@ -168,10 +188,11 @@ class QDeclarativeListViewPrivate : public QDeclarativeFlickablePrivate
public:
QDeclarativeListViewPrivate()
- : currentItem(0), orient(QDeclarativeListView::Vertical)
+ : currentItem(0), orient(QDeclarativeListView::Vertical), layoutDirection(Qt::LeftToRight)
, visiblePos(0), visibleIndex(0)
, averageSize(100.0), currentIndex(-1), requestedIndex(-1)
, itemCount(0), highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightPosAnimator(0), highlightSizeAnimator(0)
, sectionCriteria(0), spacing(0.0)
@@ -204,7 +225,7 @@ public:
}
FxListItem *firstVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeft() ? -position()-size() : position();
for (int i = 0; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
if (item->index != -1 && item->endPosition() > pos)
@@ -214,7 +235,7 @@ public:
}
FxListItem *nextVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeft() ? -position()-size() : position();
bool foundFirst = false;
for (int i = 0; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
@@ -228,23 +249,85 @@ public:
return 0;
}
+ // Returns the item before modelIndex, if created.
+ // May return an item marked for removal.
+ FxListItem *itemBefore(int modelIndex) const {
+ if (modelIndex < visibleIndex)
+ return 0;
+ int idx = 1;
+ int lastIndex = -1;
+ while (idx < visibleItems.count()) {
+ FxListItem *item = visibleItems.at(idx);
+ if (item->index != -1)
+ lastIndex = item->index;
+ if (item->index == modelIndex)
+ return visibleItems.at(idx-1);
+ ++idx;
+ }
+ if (lastIndex == modelIndex-1)
+ return visibleItems.last();
+ return 0;
+ }
+
+ void regenerate() {
+ Q_Q(QDeclarativeListView);
+ if (q->isComponentComplete()) {
+ if (header) {
+ if (q->scene())
+ q->scene()->removeItem(header->item);
+ header->item->deleteLater();
+ delete header;
+ header = 0;
+ }
+ if (footer) {
+ if (q->scene())
+ q->scene()->removeItem(footer->item);
+ footer->item->deleteLater();
+ delete footer;
+ footer = 0;
+ }
+ updateHeader();
+ updateFooter();
+ clear();
+ setPosition(0);
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeListView);
+ regenerate();
+ emit q->effectiveLayoutDirectionChanged();
+ }
+
+ bool isRightToLeft() const {
+ Q_Q(const QDeclarativeListView);
+ return orient == QDeclarativeListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
qreal position() const {
Q_Q(const QDeclarativeListView);
return orient == QDeclarativeListView::Vertical ? q->contentY() : q->contentX();
}
+
void setPosition(qreal pos) {
Q_Q(QDeclarativeListView);
- if (orient == QDeclarativeListView::Vertical)
+ if (orient == QDeclarativeListView::Vertical) {
q->QDeclarativeFlickable::setContentY(pos);
- else
- q->QDeclarativeFlickable::setContentX(pos);
+ } else {
+ if (isRightToLeft())
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ else
+ q->QDeclarativeFlickable::setContentX(pos);
+ }
}
qreal size() const {
Q_Q(const QDeclarativeListView);
return orient == QDeclarativeListView::Vertical ? q->height() : q->width();
}
- qreal startPosition() const {
+ qreal originPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty()) {
pos = (*visibleItems.constBegin())->position();
@@ -254,7 +337,7 @@ public:
return pos;
}
- qreal endPosition() const {
+ qreal lastPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty()) {
int invisibleCount = visibleItems.count() - visibleIndex;
@@ -271,6 +354,14 @@ public:
return pos;
}
+ qreal startPosition() const {
+ return isRightToLeft() ? -lastPosition()-1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeft() ? -originPosition()-1 : lastPosition();
+ }
+
qreal positionAt(int modelIndex) const {
if (FxListItem *item = visibleItem(modelIndex))
return item->position();
@@ -292,6 +383,7 @@ public:
else
idx = visibleItems.at(idx)->index;
int count = modelIndex - idx - 1;
+
return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing) + 1;
}
}
@@ -348,7 +440,7 @@ public:
} else if (pos > endPos)
return endPos + qRound((pos - endPos) / averageSize) * averageSize;
}
- return qRound((pos - startPosition()) / averageSize) * averageSize + startPosition();
+ return qRound((pos - originPosition()) / averageSize) * averageSize + originPosition();
}
FxListItem *snapItemAt(qreal pos) {
@@ -464,6 +556,7 @@ public:
QHash<QDeclarativeItem*,int> unrequestedItems;
FxListItem *currentItem;
QDeclarativeListView::Orientation orient;
+ Qt::LayoutDirection layoutDirection;
qreal visiblePos;
int visibleIndex;
qreal averageSize;
@@ -472,6 +565,8 @@ public:
int itemCount;
qreal highlightRangeStart;
qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
QDeclarativeComponent *highlightComponent;
FxListItem *highlight;
FxListItem *trackedItem;
@@ -561,7 +656,7 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
listItem->attached->m_section = sectionCriteria->sectionString(propValue);
if (modelIndex > 0) {
- if (FxListItem *item = visibleItem(modelIndex-1))
+ if (FxListItem *item = itemBefore(modelIndex))
listItem->attached->m_prevSection = item->attached->section();
else
listItem->attached->m_prevSection = sectionAt(modelIndex-1);
@@ -649,7 +744,6 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
if (visibleItems.at(i)->index != -1)
modelIndex = visibleItems.at(i)->index + 1;
}
-
bool changed = false;
FxListItem *item = 0;
qreal pos = itemEnd + 1;
@@ -795,8 +889,12 @@ void QDeclarativeListViewPrivate::updateUnrequestedPositions()
if (item->y() + item->height() > pos && item->y() < pos + q->height())
item->setY(positionAt(*it));
} else {
- if (item->x() + item->width() > pos && item->x() < pos + q->width())
- item->setX(positionAt(*it));
+ if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
+ if (isRightToLeft())
+ item->setX(-positionAt(*it)-item->width());
+ else
+ item->setX(positionAt(*it));
+ }
}
}
}
@@ -887,7 +985,9 @@ void QDeclarativeListViewPrivate::updateHighlight()
createHighlight();
if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
// auto-update highlight
- highlightPosAnimator->to = currentItem->itemPosition();
+ highlightPosAnimator->to = isRightToLeft()
+ ? -currentItem->itemPosition()-currentItem->itemSize()
+ : currentItem->itemPosition();
highlightSizeAnimator->to = currentItem->itemSize();
if (orient == QDeclarativeListView::Vertical) {
if (highlight->item->width() == 0)
@@ -922,7 +1022,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem)
} else {
QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
- QObject *nobj = sectionCriteria->delegate()->create(context);
+ QObject *nobj = sectionCriteria->delegate()->beginCreate(context);
if (nobj) {
QDeclarative_setParent_noEvent(context, nobj);
listItem->section = qobject_cast<QDeclarativeItem *>(nobj);
@@ -936,6 +1036,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem)
} else {
delete context;
}
+ sectionCriteria->delegate()->completeCreate();
}
listItem->setPosition(pos);
} else {
@@ -969,18 +1070,18 @@ void QDeclarativeListViewPrivate::updateSections()
QDeclarativeListViewAttached *prevAtt = 0;
int idx = -1;
for (int i = 0; i < visibleItems.count(); ++i) {
+ QDeclarativeListViewAttached *attached = visibleItems.at(i)->attached;
+ attached->setPrevSection(prevSection);
if (visibleItems.at(i)->index != -1) {
- QDeclarativeListViewAttached *attached = visibleItems.at(i)->attached;
- attached->setPrevSection(prevSection);
QString propValue = model->stringValue(visibleItems.at(i)->index, sectionCriteria->property());
attached->setSection(sectionCriteria->sectionString(propValue));
- if (prevAtt)
- prevAtt->setNextSection(attached->section());
- createSection(visibleItems.at(i));
- prevSection = attached->section();
- prevAtt = attached;
idx = visibleItems.at(i)->index;
}
+ createSection(visibleItems.at(i));
+ if (prevAtt)
+ prevAtt->setNextSection(attached->section());
+ prevSection = attached->section();
+ prevAtt = attached;
}
if (prevAtt) {
if (idx > 0 && idx < model->count()-1)
@@ -1104,7 +1205,7 @@ void QDeclarativeListViewPrivate::updateFooter()
}
if (footer) {
if (visibleItems.count()) {
- qreal endPos = endPosition() + 1;
+ qreal endPos = lastPosition() + 1;
if (lastVisibleIndex() == model->count()-1) {
footer->setPosition(endPos);
} else {
@@ -1144,7 +1245,7 @@ void QDeclarativeListViewPrivate::updateHeader()
}
if (header) {
if (visibleItems.count()) {
- qreal startPos = startPosition();
+ qreal startPos = originPosition();
if (visibleIndex == 0) {
header->setPosition(startPos - header->size());
} else {
@@ -1177,56 +1278,83 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
return;
correctFlick = false;
- int oldDuration = fixupDuration;
- fixupDuration = moveReason == Mouse ? fixupDuration : 0;
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size() - highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size() - highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange
+ && moveReason != QDeclarativeListViewPrivate::SetIndex) {
updateHighlight();
qreal pos = currentItem->itemPosition();
- qreal viewPos = position();
- if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
- viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
+ if (viewPos < pos + currentItem->itemSize() - highlightEnd)
+ viewPos = pos + currentItem->itemSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeft())
+ viewPos = -viewPos-size();
timeline.reset(data.move);
if (viewPos != position()) {
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -viewPos);
+ }
}
vTime = timeline.time();
- } else if (snapMode != QDeclarativeListView::NoSnap) {
- FxListItem *topItem = snapItemAt(position()+highlightRangeStart);
- FxListItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
+ } else if (snapMode != QDeclarativeListView::NoSnap && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ qreal tempPosition = isRightToLeft() ? -position()-size() : position();
+ FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
+ FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
- if (topItem) {
- if (topItem->index == 0 && header && position()+highlightRangeStart < header->position()+header->size()/2)
- pos = header->position() - highlightRangeStart;
+ bool isInBounds = -position() > maxExtent && -position() < minExtent;
+ if (topItem && isInBounds) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2) {
+ pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
+ } else {
+ if (isRightToLeft())
+ pos = qMax(qMin(-topItem->position() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->position() - highlightStart, -maxExtent), -minExtent);
+ }
+ } else if (bottomItem && isInBounds) {
+ if (isRightToLeft())
+ pos = qMax(qMin(-bottomItem->position() + highlightStart - size(), -maxExtent), -minExtent);
else
- pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
- } else if (bottomItem) {
- pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->position() - highlightStart, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
- fixupDuration = oldDuration;
return;
}
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -pos);
+ }
vTime = timeline.time();
}
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
- fixupDuration = oldDuration;
+ fixupMode = Normal;
}
void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
@@ -1234,6 +1362,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
{
Q_Q(QDeclarativeListView);
+ data.fixingUp = false;
moveReason = Mouse;
if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) {
correctFlick = true;
@@ -1241,12 +1370,13 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
return;
}
qreal maxDistance = 0;
+ qreal dataValue = isRightToLeft() ? -data.move.value()+size() : data.move.value();
// -ve velocity means list is moving up/left
if (velocity > 0) {
if (data.move.value() < minExtent) {
if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = firstVisibleItem())
- maxDistance = qAbs(item->position() + data.move.value());
+ if (FxListItem *item = isRightToLeft() ? nextVisibleItem() : firstVisibleItem())
+ maxDistance = qAbs(item->position() + dataValue);
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1256,8 +1386,8 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
if (data.move.value() > maxExtent) {
if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = nextVisibleItem())
- maxDistance = qAbs(item->position() + data.move.value());
+ if (FxListItem *item = isRightToLeft() ? firstVisibleItem() : nextVisibleItem())
+ maxDistance = qAbs(item->position() + dataValue);
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1265,7 +1395,10 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (snapMode == QDeclarativeListView::NoSnap && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
}
+
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+ qreal highlightStart = isRightToLeft() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+
if (maxDistance > 0 || overShoot) {
// These modes require the list to stop exactly on an item boundary.
// The initial flick will estimate the boundary to stop on.
@@ -1290,7 +1423,9 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (v > 0)
dist = -dist;
if ((maxDistance > 0.0 && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) {
- data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
+ qreal distTemp = isRightToLeft() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ data.flickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
if (overShoot) {
if (data.flickTarget >= minExtent) {
overshootDist = overShootDistance(v, vSize);
@@ -1323,6 +1458,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
data.flickTarget -= overshootDist;
}
}
+
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
@@ -1342,8 +1478,11 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
// reevaluate the target boundary.
qreal newtarget = data.flickTarget;
- if (snapMode != QDeclarativeListView::NoSnap || highlightRange == QDeclarativeListView::StrictlyEnforceRange)
- newtarget = -snapPosAt(-(data.flickTarget - highlightRangeStart)) + highlightRangeStart;
+ if (snapMode != QDeclarativeListView::NoSnap || highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ qreal tempFlickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
+ newtarget = -snapPosAt(-(tempFlickTarget - highlightStart)) + highlightStart;
+ newtarget = isRightToLeft() ? -newtarget+size() : newtarget;
+ }
if (velocity < 0 && newtarget <= maxExtent)
newtarget = maxExtent - overshootDist;
else if (velocity > 0 && newtarget >= minExtent)
@@ -1361,6 +1500,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
fixup(data, minExtent, maxExtent);
return;
}
+
timeline.reset(data.move);
timeline.accelDistance(data.move, v, -dist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
@@ -1859,6 +1999,7 @@ qreal QDeclarativeListView::preferredHighlightBegin() const
void QDeclarativeListView::setPreferredHighlightBegin(qreal start)
{
Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = true;
if (d->highlightRangeStart == start)
return;
d->highlightRangeStart = start;
@@ -1866,6 +2007,16 @@ void QDeclarativeListView::setPreferredHighlightBegin(qreal start)
emit preferredHighlightBeginChanged();
}
+void QDeclarativeListView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
qreal QDeclarativeListView::preferredHighlightEnd() const
{
Q_D(const QDeclarativeListView);
@@ -1875,6 +2026,7 @@ qreal QDeclarativeListView::preferredHighlightEnd() const
void QDeclarativeListView::setPreferredHighlightEnd(qreal end)
{
Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = true;
if (d->highlightRangeEnd == end)
return;
d->highlightRangeEnd = end;
@@ -1882,6 +2034,16 @@ void QDeclarativeListView::setPreferredHighlightEnd(qreal end)
emit preferredHighlightEndChanged();
}
+void QDeclarativeListView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
QDeclarativeListView::HighlightRangeMode QDeclarativeListView::highlightRangeMode() const
{
Q_D(const QDeclarativeListView);
@@ -1960,15 +2122,63 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
setContentHeight(-1);
setFlickableDirection(HorizontalFlick);
}
- d->clear();
- d->setPosition(0);
- refill();
+ d->regenerate();
emit orientationChanged();
- d->updateCurrent(d->currentIndex);
}
}
/*!
+ \qmlproperty enumeration ListView::layoutDirection
+ This property holds the layout direction of the horizontal list.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out from left to right.
+ \o Qt.RightToLeft - Items will be laid out from right to let.
+ \endlist
+
+ \sa ListView::effectiveLayoutDirection
+*/
+
+Qt::LayoutDirection QDeclarativeListView::layoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeListView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeListView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration ListView::effectiveLayoutDirection
+ This property holds the effective layout direction of the horizontal list.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the horizontal list will be mirrored. However, the
+ property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
+
+/*!
\qmlproperty bool ListView::keyNavigationWraps
This property holds whether the list wraps key navigation.
@@ -2339,11 +2549,23 @@ void QDeclarativeListView::viewportMoved()
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
// reposition highlight
qreal pos = d->highlight->position();
- qreal viewPos = d->position();
- if (pos > viewPos + d->highlightRangeEnd - d->highlight->size())
- pos = viewPos + d->highlightRangeEnd - d->highlight->size();
- if (pos < viewPos + d->highlightRangeStart)
- pos = viewPos + d->highlightRangeStart;
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
+ if (pos > viewPos + highlightEnd - d->highlight->size())
+ pos = viewPos + highlightEnd - d->highlight->size();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
d->highlightPosAnimator->stop();
d->highlight->setPosition(qRound(pos));
@@ -2381,13 +2603,15 @@ void QDeclarativeListView::viewportMoved()
if ((minX - d->hData.move.value() < width()/2 || d->hData.flickTarget - d->hData.move.value() < width()/2)
&& minX != d->hData.flickTarget)
d->flickX(-d->hData.smoothVelocity.value());
- d->bufferMode = QDeclarativeListViewPrivate::BufferBefore;
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferAfter : QDeclarativeListViewPrivate::BufferBefore;
} else if (d->hData.velocity < 0) {
const qreal maxX = maxXExtent();
if ((d->hData.move.value() - maxX < width()/2 || d->hData.move.value() - d->hData.flickTarget < width()/2)
&& maxX != d->hData.flickTarget)
d->flickX(-d->hData.smoothVelocity.value());
- d->bufferMode = QDeclarativeListViewPrivate::BufferAfter;
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferBefore : QDeclarativeListViewPrivate::BufferAfter;
}
}
d->inFlickCorrection = false;
@@ -2425,7 +2649,8 @@ qreal QDeclarativeListView::maxYExtent() const
return height();
if (d->maxExtentDirty) {
if (!d->model || !d->model->count()) {
- d->maxExtent = 0;
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += height();
} else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
if (d->highlightRangeEnd != d->highlightRangeStart)
@@ -2450,11 +2675,34 @@ qreal QDeclarativeListView::minXExtent() const
return QDeclarativeFlickable::minXExtent();
if (d->minExtentDirty) {
d->minExtent = -d->startPosition();
- if (d->header)
- d->minExtent += d->header->size();
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem = 0;
+ if (d->isRightToLeft()) {
+ if (d->model && d->model->count())
+ endPositionFirstItem = d->positionAt(d->model->count()-1);
+ else if (d->header)
+ d->minExtent += d->header->size();
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer)
+ d->minExtent += d->footer->size();
+ qreal maxX = maxXExtent();
+ if (d->minExtent < maxX)
+ d->minExtent = maxX;
+ } else {
+ endPositionFirstItem = d->endPositionAt(0);
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ d->minExtent += d->header->size();
+ }
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- d->minExtent += d->highlightRangeStart;
- d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1));
+ d->minExtent += highlightStart;
+ d->minExtent = qMax(d->minExtent, -(endPositionFirstItem - highlightEnd + 1));
}
d->minExtentDirty = false;
}
@@ -2468,23 +2716,46 @@ qreal QDeclarativeListView::maxXExtent() const
if (d->orient == QDeclarativeListView::Vertical)
return width();
if (d->maxExtentDirty) {
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition = 0;
+ d->maxExtent = 0;
+ if (d->isRightToLeft()) {
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->model && d->model->count())
+ lastItemPosition = d->positionAt(d->model->count()-1);
+ }
if (!d->model || !d->model->count()) {
- d->maxExtent = 0;
+ if (!d->isRightToLeft())
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += width();
} else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
- if (d->highlightRangeEnd != d->highlightRangeStart)
- d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ d->maxExtent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart) {
+ d->maxExtent = d->isRightToLeft()
+ ? qMax(d->maxExtent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(d->maxExtent, -(d->endPosition() - highlightEnd + 1));
+ }
} else {
d->maxExtent = -(d->endPosition() - width() + 1);
}
- if (d->footer)
- d->maxExtent -= d->footer->size();
- qreal minX = minXExtent();
- if (d->maxExtent > minX)
- d->maxExtent = minX;
+ if (d->isRightToLeft()) {
+ if (d->header && d->visibleItems.count())
+ d->maxExtent -= d->header->size();
+ } else {
+ if (d->footer)
+ d->maxExtent -= d->footer->size();
+ qreal minX = minXExtent();
+ if (d->maxExtent > minX)
+ d->maxExtent = minX;
+ }
d->maxExtentDirty = false;
}
-
return d->maxExtent;
}
@@ -2496,7 +2767,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
return;
if (d->model && d->model->count() && d->interactive) {
- if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Left)
+ if ((!d->isRightToLeft() && event->key() == Qt::Key_Left)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right)
|| (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Up)) {
if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) {
decrementCurrentIndex();
@@ -2506,7 +2778,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
event->accept();
return;
}
- } else if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Right)
+ } else if ((!d->isRightToLeft() && event->key() == Qt::Key_Right)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left)
|| (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) {
incrementCurrentIndex();
@@ -2528,6 +2801,11 @@ void QDeclarativeListView::geometryChanged(const QRectF &newGeometry,
Q_D(QDeclarativeListView);
d->maxExtentDirty = true;
d->minExtentDirty = true;
+ if (d->isRightToLeft() && d->orient == Qt::Horizontal) {
+ // maintain position relative to the right edge
+ int dx = newGeometry.width() - oldGeometry.width();
+ setContentX(contentX() - dx);
+ }
QDeclarativeFlickable::geometryChanged(newGeometry, oldGeometry);
}
@@ -2583,9 +2861,14 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
if (layoutScheduled)
layout();
- qreal pos = position();
+ qreal pos = isRightToLeft() ? -position() - size() : position();
FxListItem *item = visibleItem(idx);
- qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent();
+ qreal maxExtent;
+ if (orient == QDeclarativeListView::Vertical)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeft() ? q->minXExtent()-size(): -q->maxXExtent();
+
if (!item) {
int itemPos = positionAt(idx);
// save the currently visible items in case any of them end up visible again
@@ -2628,7 +2911,12 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
pos = itemPos;
}
pos = qMin(pos, maxExtent);
- qreal minExtent = orient == QDeclarativeListView::Vertical ? -q->minYExtent() : -q->minXExtent();
+ qreal minExtent;
+ if (orient == QDeclarativeListView::Vertical) {
+ minExtent = -q->minYExtent();
+ } else {
+ minExtent = isRightToLeft() ? q->maxXExtent()-size(): -q->minXExtent();
+ }
pos = qMax(pos, minExtent);
moveReason = QDeclarativeListViewPrivate::Other;
q->cancelFlick();
@@ -2688,6 +2976,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod ListView::positionViewAtBeginning()
\qmlmethod ListView::positionViewAtEnd()
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
@@ -2732,7 +3021,7 @@ void QDeclarativeListView::positionViewAtEnd()
\bold Note: methods should only be called after the Component has completed.
*/
-int QDeclarativeListView::indexAt(int x, int y) const
+int QDeclarativeListView::indexAt(qreal x, qreal y) const
{
Q_D(const QDeclarativeListView);
for (int i = 0; i < d->visibleItems.count(); ++i) {
@@ -2777,13 +3066,18 @@ void QDeclarativeListView::updateSections()
roles << d->sectionCriteria->property().toUtf8();
d->model->setWatchedRoles(roles);
d->updateSections();
+ if (d->itemCount)
+ d->layout();
}
}
void QDeclarativeListView::refill()
{
Q_D(QDeclarativeListView);
- d->refill(d->position(), d->position()+d->size()-1);
+ if (d->isRightToLeft())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
}
void QDeclarativeListView::trackedPositionChanged()
@@ -2798,26 +3092,37 @@ void QDeclarativeListView::trackedPositionChanged()
trackedPos -= d->currentItem->sectionSize();
trackedSize += d->currentItem->sectionSize();
}
- const qreal viewPos = d->position();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
qreal pos = viewPos;
if (d->haveHighlightRange) {
if (d->highlightRange == StrictlyEnforceRange) {
- if (trackedPos > pos + d->highlightRangeEnd - d->trackedItem->size())
- pos = trackedPos - d->highlightRangeEnd + d->trackedItem->size();
- if (trackedPos < pos + d->highlightRangeStart)
- pos = trackedPos - d->highlightRangeStart;
+ if (trackedPos > pos + highlightEnd - d->trackedItem->size())
+ pos = trackedPos - highlightEnd + d->trackedItem->size();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
} else {
- if (trackedPos < d->startPosition() + d->highlightRangeStart) {
+ if (trackedPos < d->startPosition() + highlightStart) {
pos = d->startPosition();
- } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + d->highlightRangeEnd) {
+ } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + highlightEnd) {
pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
- if (trackedPos < viewPos + d->highlightRangeStart) {
- pos = trackedPos - d->highlightRangeStart;
- } else if (trackedPos > viewPos + d->highlightRangeEnd - trackedSize) {
- pos = trackedPos - d->highlightRangeEnd + trackedSize;
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - trackedSize) {
+ pos = trackedPos - highlightEnd + trackedSize;
}
}
}
@@ -2854,7 +3159,9 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
d->updateUnrequestedIndexes();
d->moveReason = QDeclarativeListViewPrivate::Other;
+ qreal tempPos = d->isRightToLeft() ? -d->position()-d->size() : d->position();
int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
+
if (index < 0) {
int i = d->visibleItems.count() - 1;
while (i > 0 && d->visibleItems.at(i)->index == -1)
@@ -2863,7 +3170,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
// there are no visible items except items marked for removal
index = d->visibleItems.count();
} else if (d->visibleItems.at(i)->index + 1 == modelIndex
- && d->visibleItems.at(i)->endPosition() < d->buffer+d->position()+d->size()-1) {
+ && d->visibleItems.at(i)->endPosition() < d->buffer+tempPos+d->size()-1) {
// Special case of appending an item to the model.
index = d->visibleItems.count();
} else {
@@ -2908,7 +3215,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
// Insert items before the visible item.
int insertionIdx = index;
int i = 0;
- int from = d->position() - d->buffer;
+ int from = tempPos - d->buffer;
for (i = count-1; i >= 0 && pos > from; --i) {
if (!addedVisible) {
d->scheduleLayout();
@@ -2938,7 +3245,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
}
} else {
int i = 0;
- int to = d->buffer+d->position()+d->size()-1;
+ int to = d->buffer+tempPos+d->size()-1;
for (i = 0; i < count && pos <= to; ++i) {
if (!addedVisible) {
d->scheduleLayout();
@@ -3096,6 +3403,7 @@ void QDeclarativeListView::destroyRemoved()
}
// Correct the positioning of the items
+ d->updateSections();
d->layout();
}
@@ -3213,11 +3521,8 @@ void QDeclarativeListView::itemsChanged(int, int)
void QDeclarativeListView::modelReset()
{
Q_D(QDeclarativeListView);
- d->clear();
- d->setPosition(0);
- refill();
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
- d->updateCurrent(d->currentIndex);
+ d->regenerate();
if (d->highlight && d->currentItem) {
if (d->autoHighlight)
d->highlight->setPosition(d->currentItem->position());
@@ -3233,10 +3538,14 @@ void QDeclarativeListView::createdItem(int index, QDeclarativeItem *item)
if (d->requestedIndex != index) {
item->setParentItem(contentItem());
d->unrequestedItems.insert(item, index);
- if (d->orient == QDeclarativeListView::Vertical)
+ if (d->orient == QDeclarativeListView::Vertical) {
item->setY(d->positionAt(index));
- else
- item->setX(d->positionAt(index));
+ } else {
+ if (d->isRightToLeft())
+ item->setX(-d->positionAt(index)-item->width());
+ else
+ item->setX(d->positionAt(index));
+ }
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index 10fbf10..3b12225 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -107,12 +107,14 @@ class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable
Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged)
Q_PROPERTY(int highlightResizeDuration READ highlightResizeDuration WRITE setHighlightResizeDuration NOTIFY highlightResizeDurationChanged)
- Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
- Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(QDeclarativeViewSection *section READ sectionCriteria CONSTANT)
@@ -158,9 +160,11 @@ public:
qreal preferredHighlightBegin() const;
void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
qreal preferredHighlightEnd() const;
void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
qreal spacing() const;
void setSpacing(qreal spacing);
@@ -169,6 +173,10 @@ public:
Orientation orientation() const;
void setOrientation(Orientation);
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
bool isWrapEnabled() const;
void setWrapEnabled(bool);
@@ -208,7 +216,7 @@ public:
enum PositionMode { Beginning, Center, End, Visible, Contain };
Q_INVOKABLE void positionViewAtIndex(int index, int mode);
- Q_INVOKABLE int indexAt(int x, int y) const;
+ Q_INVOKABLE int indexAt(qreal x, qreal y) const;
Q_INVOKABLE Q_REVISION(1) void positionViewAtBeginning();
Q_INVOKABLE Q_REVISION(1) void positionViewAtEnd();
@@ -220,6 +228,8 @@ Q_SIGNALS:
void countChanged();
void spacingChanged();
void orientationChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
void currentIndexChanged();
void currentSectionChanged();
void highlightMoveSpeedChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index ffbae3f..da11b00 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -314,6 +314,8 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
+
+ \sa onCanceled()
*/
/*!
@@ -414,6 +416,40 @@ void QDeclarativeMouseArea::setEnabled(bool a)
emit enabledChanged();
}
}
+
+/*!
+ \qmlproperty bool MouseArea::preventStealing
+ \since Quick 1.1
+ This property holds whether the mouse events may be stolen from this
+ MouseArea.
+
+ If a MouseArea is placed within an item that filters child mouse
+ events, such as Flickable, the mouse
+ events may be stolen from the MouseArea if a gesture is recognized
+ by the parent element, e.g. a flick gesture. If preventStealing is
+ set to true, no element will steal the mouse events.
+
+ Note that setting preventStealing to true once an element has started
+ stealing events will have no effect until the next press event.
+
+ By default this property is false.
+*/
+bool QDeclarativeMouseArea::preventStealing() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->preventStealing;
+}
+
+void QDeclarativeMouseArea::setPreventStealing(bool prevent)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (prevent != d->preventStealing) {
+ d->preventStealing = prevent;
+ setKeepMouseGrab(d->preventStealing && d->absorb);
+ emit preventStealingChanged();
+ }
+}
+
/*!
\qmlproperty MouseButtons MouseArea::pressedButtons
This property holds the mouse buttons currently pressed.
@@ -441,7 +477,7 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeMouseArea);
d->moved = false;
- d->stealMouse = false;
+ d->stealMouse = d->preventStealing;
if (!d->absorb)
QDeclarativeItem::mousePressEvent(event);
else {
@@ -458,7 +494,7 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
// we should only start timer if pressAndHold is connected to.
if (d->isPressAndHoldConnected())
d->pressAndHoldTimer.start(PressAndHoldDelay, this);
- setKeepMouseGrab(false);
+ setKeepMouseGrab(d->stealMouse);
event->setAccepted(setPressed(true));
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 937ac78..985f27e 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -129,6 +129,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ???
+ Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1)
public:
QDeclarativeMouseArea(QDeclarativeItem *parent=0);
@@ -153,6 +154,9 @@ public:
QDeclarativeDrag *drag();
+ bool preventStealing() const;
+ void setPreventStealing(bool prevent);
+
Q_SIGNALS:
void hoveredChanged();
void pressedChanged();
@@ -161,6 +165,7 @@ Q_SIGNALS:
void hoverEnabledChanged();
void positionChanged(QDeclarativeMouseEvent *mouse);
void mousePositionChanged(QDeclarativeMouseEvent *mouse);
+ Q_REVISION(1) void preventStealingChanged();
void pressed(QDeclarativeMouseEvent *mouse);
void pressAndHold(QDeclarativeMouseEvent *mouse);
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 2a327af..67694fb 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -68,7 +68,7 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
public:
QDeclarativeMouseAreaPrivate()
: absorb(true), hovered(false), pressed(false), longPress(false),
- moved(false), stealMouse(false), doubleClick(false), drag(0)
+ moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
{
}
@@ -110,6 +110,7 @@ public:
bool dragY : 1;
bool stealMouse : 1;
bool doubleClick : 1;
+ bool preventStealing : 1;
QDeclarativeDrag *drag;
QPointF startScene;
qreal startX;
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea.cpp b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
index eae83f6..b09cb72 100644
--- a/src/declarative/graphicsitems/qdeclarativepincharea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -300,9 +300,8 @@ void QDeclarativePinchArea::updatePinch()
d->stealMouse = false;
setKeepMouseGrab(false);
d->inPinch = false;
- const qreal rotationAngle = d->pinchStartAngle - d->pinchLastAngle;
QPointF pinchCenter = mapFromScene(d->sceneLastCenter);
- QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, rotationAngle);
+ QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, d->pinchRotation);
pe.setStartCenter(d->pinchStartCenter);
pe.setPreviousCenter(pinchCenter);
pe.setPreviousAngle(d->pinchLastAngle);
@@ -349,6 +348,7 @@ void QDeclarativePinchArea::updatePinch()
d->pinchStartAngle = angle;
d->pinchLastScale = 1.0;
d->pinchLastAngle = angle;
+ d->pinchRotation = 0.0;
d->lastPoint1 = d->touchPoints.at(0).pos();
d->lastPoint2 = d->touchPoints.at(1).pos();
QDeclarativePinchEvent pe(d->pinchStartCenter, 1.0, angle, 0.0);
@@ -380,11 +380,14 @@ void QDeclarativePinchArea::updatePinch()
}
} else if (d->pinchStartDist > 0) {
qreal scale = dist / d->pinchStartDist;
- qreal rotationAngle = d->pinchStartAngle - angle;
- if (rotationAngle > 180)
- rotationAngle -= 360;
+ qreal da = d->pinchLastAngle - angle;
+ if (da > 180)
+ da -= 360;
+ else if (da < -180)
+ da += 360;
+ d->pinchRotation += da;
QPointF pinchCenter = mapFromScene(sceneCenter);
- QDeclarativePinchEvent pe(pinchCenter, scale, angle, rotationAngle);
+ QDeclarativePinchEvent pe(pinchCenter, scale, angle, d->pinchRotation);
pe.setStartCenter(d->pinchStartCenter);
pe.setPreviousCenter(mapFromScene(d->sceneLastCenter));
pe.setPreviousAngle(d->pinchLastAngle);
@@ -422,7 +425,7 @@ void QDeclarativePinchArea::updatePinch()
}
if (d->pinchStartRotation >= pinch()->minimumRotation()
&& d->pinchStartRotation <= pinch()->maximumRotation()) {
- qreal r = rotationAngle + d->pinchStartRotation;
+ qreal r = d->pinchRotation + d->pinchStartRotation;
r = qMin(qMax(pinch()->minimumRotation(),r), pinch()->maximumRotation());
pinch()->target()->setRotation(r);
}
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p.h
index 6d04708..5d06db0 100644
--- a/src/declarative/graphicsitems/qdeclarativepincharea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepincharea_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
index 5641e35..2769987 100644
--- a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -68,7 +68,9 @@ class QDeclarativePinchAreaPrivate : public QDeclarativeItemPrivate
public:
QDeclarativePinchAreaPrivate()
: absorb(true), stealMouse(false), inPinch(false)
- , pinchRejected(false), pinch(0), pinchStartDist(0)
+ , pinchRejected(false), pinch(0), pinchStartDist(0), pinchStartScale(1.0)
+ , pinchLastScale(1.0), pinchStartRotation(0.0), pinchStartAngle(0.0)
+ , pinchLastAngle(0.0), pinchRotation(0.0)
{
}
@@ -97,6 +99,7 @@ public:
qreal pinchStartRotation;
qreal pinchStartAngle;
qreal pinchLastAngle;
+ qreal pinchRotation;
QPointF sceneStartCenter;
QPointF pinchStartCenter;
QPointF sceneLastCenter;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 27a1301..84dcec6 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -578,12 +578,14 @@ void QDeclarativeColumn::reportConflictingAnchors()
\sa Grid::spacing
*/
QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
-: QDeclarativeBasePositioner(Horizontal, parent), m_layoutDirection(Qt::LeftToRight)
+: QDeclarativeBasePositioner(Horizontal, parent)
{
}
/*!
\qmlproperty enumeration Row::layoutDirection
+ \since Quick 1.1
+
This property holds the layoutDirection of the row.
Possible values:
@@ -599,20 +601,39 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
*/
Qt::LayoutDirection QDeclarativeRow::layoutDirection() const
{
- return m_layoutDirection;
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
}
void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
{
- if (m_layoutDirection != layoutDirection) {
- m_layoutDirection = layoutDirection;
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate* >(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
+/*!
+ \qmlproperty enumeration Row::effectiveLayoutDirection
+ This property holds the effective layout direction of the row positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the row positioner will be mirrored. However, the
+ property \l {Row::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Row::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeRow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
void QDeclarativeRow::doPositioning(QSizeF *contentSize)
{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
int hoffset = 0;
QList<int> hoffsets;
@@ -621,7 +642,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
if (!child.item || !child.isVisible)
continue;
- if(m_layoutDirection == Qt::LeftToRight){
+ if(d->isLeftToRight()){
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
@@ -636,7 +657,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
contentSize->setWidth(hoffset - spacing());
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
return;
//Right to Left layout
@@ -790,7 +811,7 @@ void QDeclarativeRow::reportConflictingAnchors()
\sa rows, columns
*/
QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
- QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight), m_layoutDirection(Qt::LeftToRight)
+ QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
{
}
@@ -859,16 +880,18 @@ void QDeclarativeGrid::setFlow(Flow flow)
/*!
\qmlproperty enumeration Grid::layoutDirection
+ \since Quick 1.1
+
This property holds the layout direction of the layout.
Possible values are:
\list
- \o Qt.LeftToRight (default) - Items are positioned beginning
- from the top, left anchor. The flow direction is dependent
- on the \l Grid::flow property.
- \o Qt.RightToLeft - Items are positioned beginning from the
- top, right anchor. The flow direction is dependent on the
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Grid::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
\l Grid::flow property.
\endlist
@@ -876,21 +899,39 @@ void QDeclarativeGrid::setFlow(Flow flow)
*/
Qt::LayoutDirection QDeclarativeGrid::layoutDirection() const
{
- return m_layoutDirection;
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
}
void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
{
- if (m_layoutDirection != layoutDirection) {
- m_layoutDirection = layoutDirection;
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
-void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
+/*!
+ \qmlproperty enumeration Grid::effectiveLayoutDirection
+ This property holds the effective layout direction of the grid positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \l {Grid::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Grid::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeGrid::effectiveLayoutDirection() const
{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
int c = m_columns;
int r = m_rows;
//Is allocating the extra QPODVector too much overhead?
@@ -980,7 +1021,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
end = widthSum;
int xoffset=0;
- if(m_layoutDirection == Qt::RightToLeft)
+ if(!d->isLeftToRight())
xoffset=end;
int yoffset=0;
int curRow =0;
@@ -988,7 +1029,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
for (int i = 0; i < visibleItems.count(); ++i) {
const PositionedItem &child = visibleItems.at(i);
int childXOffset = xoffset;
- if(m_layoutDirection == Qt::RightToLeft)
+ if(!d->isLeftToRight())
childXOffset -= QGraphicsItemPrivate::get(child.item)->width();
if((child.item->x()!=childXOffset)||(child.item->y()!=yoffset)){
positionX(childXOffset, child);
@@ -996,7 +1037,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
}
if (m_flow == LeftToRight) {
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset+=maxColWidth[curCol]+spacing();
else
xoffset-=maxColWidth[curCol]+spacing();
@@ -1004,7 +1045,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
curCol%=c;
if (!curCol){
yoffset+=maxRowHeight[curRow]+spacing();
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset=0;
else
xoffset=end;
@@ -1017,7 +1058,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
curRow++;
curRow%=r;
if (!curRow){
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset+=maxColWidth[curCol]+spacing();
else
xoffset-=maxColWidth[curCol]+spacing();
@@ -1152,12 +1193,10 @@ class QDeclarativeFlowPrivate : public QDeclarativeBasePositionerPrivate
public:
QDeclarativeFlowPrivate()
- : QDeclarativeBasePositionerPrivate(), flow(QDeclarativeFlow::LeftToRight),
- layoutDirection(Qt::LeftToRight)
+ : QDeclarativeBasePositionerPrivate(), flow(QDeclarativeFlow::LeftToRight)
{}
QDeclarativeFlow::Flow flow;
- Qt::LayoutDirection layoutDirection;
};
QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
@@ -1201,16 +1240,18 @@ void QDeclarativeFlow::setFlow(Flow flow)
/*!
\qmlproperty enumeration Flow::layoutDirection
+ \since Quick 1.1
+
This property holds the layout direction of the layout.
Possible values are:
\list
- \o Qt.LeftToRight (default) - Items are positioned beginning
- from the top, left anchor. The flow direction is dependent
- on the \l Flow::flow property.
- \o Qt.RightToLeft - Items are positioned beginning from the
- top, right anchor. The flow direction is dependent on the
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Flow::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
\l Flow::flow property.
\endlist
@@ -1230,9 +1271,26 @@ void QDeclarativeFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
+/*!
+ \qmlproperty enumeration Flow::effectiveLayoutDirection
+ This property holds the effective layout direction of the flow positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \l {Flow::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Flow::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeFlow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
{
Q_D(QDeclarativeFlow);
@@ -1262,7 +1320,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
}
}
- if(d->layoutDirection == Qt::LeftToRight){
+ if(d->isLeftToRight()){
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
@@ -1285,7 +1343,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
}
}
- if(d->layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
return;
int end;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index 55d8fa1..214c04f 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -130,20 +130,22 @@ class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
{
Q_OBJECT
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeRow(QDeclarativeItem *parent=0);
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
virtual void reportConflictingAnchors();
private:
- Qt::LayoutDirection m_layoutDirection;
Q_DISABLE_COPY(QDeclarativeRow)
};
@@ -154,7 +156,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
-
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeGrid(QDeclarativeItem *parent=0);
@@ -171,12 +173,14 @@ public:
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
void rowsChanged();
void columnsChanged();
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
@@ -186,7 +190,6 @@ private:
int m_rows;
int m_columns;
Flow m_flow;
- Qt::LayoutDirection m_layoutDirection;
Q_DISABLE_COPY(QDeclarativeGrid)
};
@@ -194,8 +197,9 @@ class QDeclarativeFlowPrivate;
class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
{
Q_OBJECT
- Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeFlow(QDeclarativeItem *parent=0);
@@ -206,10 +210,11 @@ public:
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
-
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index df105c6..e80129d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -75,7 +75,7 @@ public:
QDeclarativeBasePositionerPrivate()
: spacing(0), type(QDeclarativeBasePositioner::None)
, moveTransition(0), addTransition(0), queuedPositioning(false)
- , doingPositioning(false), anchorConflict(false)
+ , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight)
{
}
@@ -100,6 +100,9 @@ public:
bool doingPositioning : 1;
bool anchorConflict : 1;
+ Qt::LayoutDirection layoutDirection;
+
+
void schedulePositioning()
{
Q_Q(QDeclarativeBasePositioner);
@@ -109,6 +112,18 @@ public:
}
}
+ void mirrorChange() {
+ Q_Q(QDeclarativeBasePositioner);
+ if (type != QDeclarativeBasePositioner::Vertical)
+ q->prePositioning();
+ }
+ bool isLeftToRight() const {
+ if (type == QDeclarativeBasePositioner::Vertical)
+ return true;
+ else
+ return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight;
+ }
+
virtual void itemSiblingOrderChanged(QDeclarativeItem* other)
{
Q_UNUSED(other);
@@ -139,6 +154,19 @@ public:
Q_Q(QDeclarativeBasePositioner);
q->positionedItems.removeOne(QDeclarativeBasePositioner::PositionedItem(item));
}
+
+ static Qt::LayoutDirection getLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ return positioner->d_func()->layoutDirection;
+ }
+
+ static Qt::LayoutDirection getEffectiveLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ if (positioner->d_func()->effectiveLayoutMirror)
+ return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return positioner->d_func()->layoutDirection;
+ }
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 559d061..994c01e 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -49,7 +49,6 @@
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
-#include <QTextCursor>
#include <QGraphicsSceneMouseEvent>
#include <QPainter>
#include <QAbstractTextDocumentLayout>
@@ -88,13 +87,12 @@ DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE);
QString QDeclarativeTextPrivate::elideChar = QString(0x2026);
QDeclarativeTextPrivate::QDeclarativeTextPrivate()
-: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft),
+: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft),
vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone),
format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), lineHeight(1),
- lineHeightMode(QDeclarativeText::ProportionalHeight),
- lineCount(1), truncated(false), maximumLineCount(INT_MAX),
+ lineHeightMode(QDeclarativeText::ProportionalHeight), lineCount(1), truncated(false), maximumLineCount(INT_MAX),
maximumLineCountValid(false), imageCacheDirty(true), updateOnComponentComplete(true), richText(false), singleline(false),
- cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), naturalWidth(0), doc(0)
+ cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), hAlignImplicit(true), rightToLeftText(false), naturalWidth(0), doc(0)
{
cacheAllTextAsImage = enableImageCache();
QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton;
@@ -260,18 +258,26 @@ void QDeclarativeTextPrivate::updateSize()
//setup instance of QTextLayout for all cases other than richtext
if (!richText) {
- size = setupTextLayout();
- if (layedOutTextSize != size) {
+ QRect textRect = setupTextLayout();
+ if (layedOutTextRect.size() != textRect.size())
q->prepareGeometryChange();
- layedOutTextSize = size;
- }
+ layedOutTextRect = textRect;
+ size = textRect.size();
dy -= size.height();
} else {
singleline = false; // richtext can't elide or be optimized for single-line case
ensureDoc();
doc->setDefaultFont(font);
+
+ QDeclarativeText::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeText::AlignLeft)
+ horizontalAlignment = QDeclarativeText::AlignRight;
+ else if (horizontalAlignment == QDeclarativeText::AlignRight)
+ horizontalAlignment = QDeclarativeText::AlignLeft;
+ }
QTextOption option;
- option.setAlignment((Qt::Alignment)int(hAlign | vAlign));
+ option.setAlignment((Qt::Alignment)int(horizontalAlignment | vAlign));
option.setWrapMode(QTextOption::WrapMode(wrapMode));
doc->setDefaultTextOption(option);
if (requireImplicitWidth && q->widthValid()) {
@@ -284,9 +290,9 @@ void QDeclarativeTextPrivate::updateSize()
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
QSize dsize = doc->size().toSize();
- if (dsize != layedOutTextSize) {
+ if (dsize != layedOutTextRect.size()) {
q->prepareGeometryChange();
- layedOutTextSize = dsize;
+ layedOutTextRect = QRect(QPoint(0,0), dsize);
}
size = QSize(int(doc->idealWidth()),dsize.height());
}
@@ -321,45 +327,29 @@ void QDeclarativeTextPrivate::updateSize()
Returns the size of the final text. This can be used to position the text vertically (the text is
already absolutely positioned horizontally).
*/
-QSize QDeclarativeTextPrivate::setupTextLayout()
+QRect QDeclarativeTextPrivate::setupTextLayout()
{
// ### text layout handling should be profiled and optimized as needed
// what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine);
Q_Q(QDeclarativeText);
layout.setCacheEnabled(true);
- qreal height = 0;
- qreal widthUsed = 0;
qreal lineWidth = 0;
- int visibleTextLength = 0;
int visibleCount = 0;
//set manual width
- if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid())
+ if (q->widthValid())
lineWidth = q->width();
QTextOption textOption = layout.textOption();
- if (hAlign == QDeclarativeText::AlignJustify)
- textOption.setAlignment(Qt::Alignment(hAlign));
+ textOption.setAlignment(Qt::Alignment(q->effectiveHAlign()));
textOption.setWrapMode(QTextOption::WrapMode(wrapMode));
layout.setTextOption(textOption);
- QDeclarativeText::HAlignment hAlignment = hAlign;
- if(text.isRightToLeft()) {
- if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) {
- hAlignment = QDeclarativeText::AlignRight;
- } else if (hAlign == QDeclarativeText::AlignRight) {
- hAlignment = QDeclarativeText::AlignLeft;
- } else {
- hAlignment = hAlign;
- }
- }
-
bool elideText = false;
bool truncate = false;
QFontMetrics fm(layout.font());
- qreal elideWidth = fm.width(elideChar);
elidePos = QPointF();
if (requireImplicitWidth && q->widthValid()) {
@@ -371,47 +361,47 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
break;
}
layout.endLayout();
- naturalWidth = 0;
+ QRectF br;
for (int i = 0; i < layout.lineCount(); ++i) {
QTextLine line = layout.lineAt(i);
- naturalWidth = qMax(naturalWidth, line.naturalTextWidth());
+ br = br.united(line.naturalTextRect());
}
+ naturalWidth = br.width();
}
if (maximumLineCountValid) {
layout.beginLayout();
if (!lineWidth)
lineWidth = INT_MAX;
- int y = 0;
int linesLeft = maximumLineCount;
+ int visibleTextLength = 0;
while (linesLeft > 0) {
QTextLine line = layout.createLine();
if (!line.isValid())
break;
visibleCount++;
- line.setLineWidth(lineWidth);
+ if (lineWidth)
+ line.setLineWidth(lineWidth);
visibleTextLength += line.textLength();
if (--linesLeft == 0) {
if (visibleTextLength < text.length()) {
truncate = true;
if (elideMode==QDeclarativeText::ElideRight && q->widthValid()) {
+ qreal elideWidth = fm.width(elideChar);
// Need to correct for alignment
line.setLineWidth(lineWidth-elideWidth);
- int x = line.naturalTextWidth();
- if (hAlignment == QDeclarativeText::AlignRight) {
- x = q->width()-elideWidth;
- } else if (hAlignment == QDeclarativeText::AlignHCenter) {
- x = (q->width()+line.naturalTextWidth()-elideWidth)/2;
+ if (layout.text().mid(line.textStart(), line.textLength()).isRightToLeft()) {
+ line.setPosition(QPointF(line.position().x() + elideWidth, line.position().y()));
+ elidePos.setX(line.naturalTextRect().left() - elideWidth);
+ } else {
+ elidePos.setX(line.naturalTextRect().right());
}
- elidePos = QPointF(x, y + fm.ascent());
elideText = true;
}
}
}
-
- y += line.height();
}
layout.endLayout();
@@ -433,36 +423,23 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
layout.endLayout();
}
+ qreal height = 0;
+ QRectF br;
for (int i = 0; i < layout.lineCount(); ++i) {
QTextLine line = layout.lineAt(i);
- widthUsed = qMax(widthUsed, line.naturalTextWidth());
+ // set line spacing
+ line.setPosition(QPointF(line.position().x(), height));
+ if (elideText && i == layout.lineCount()-1) {
+ elidePos.setY(height + fm.ascent());
+ br = br.united(QRectF(elidePos, QSizeF(fm.width(elideChar), fm.ascent())));
+ }
+ br = br.united(line.naturalTextRect());
+ height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight;
}
+ br.setHeight(height);
- qreal layoutWidth = q->widthValid() ? q->width() : widthUsed;
if (!q->widthValid())
- naturalWidth = layoutWidth;
-
- qreal x = 0;
- for (int i = 0; i < layout.lineCount(); ++i) {
- QTextLine line = layout.lineAt(i);
- line.setPosition(QPointF(0, height));
- height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight;
-
- if (!cacheAllTextAsImage) {
- if ((hAlignment == QDeclarativeText::AlignLeft) || (hAlignment == QDeclarativeText::AlignJustify)) {
- x = 0;
- } else if (hAlignment == QDeclarativeText::AlignRight) {
- x = layoutWidth - line.naturalTextWidth();
- if (elideText && i == layout.lineCount()-1)
- x -= elideWidth; // Correct for when eliding multilines
- } else if (hAlignment == QDeclarativeText::AlignHCenter) {
- x = (layoutWidth - line.naturalTextWidth()) / 2;
- if (elideText && i == layout.lineCount()-1)
- x -= elideWidth/2; // Correct for when eliding multilines
- }
- line.setPosition(QPointF(x, line.y()));
- }
- }
+ naturalWidth = br.width();
//Update the number of visible lines
if (lineCount != visibleCount) {
@@ -470,7 +447,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
emit q->lineCountChanged();
}
- return QSize(qCeil(widthUsed), qCeil(height));
+ return QRect(qRound(br.x()), qRound(br.y()), qCeil(br.width()), qCeil(br.height()));
}
/*!
@@ -480,21 +457,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle)
{
//do layout
- QSize size = layedOutTextSize;
-
- qreal x = 0;
- for (int i = 0; i < layout.lineCount(); ++i) {
- QTextLine line = layout.lineAt(i);
- if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) {
- x = 0;
- } else if (hAlign == QDeclarativeText::AlignRight) {
- x = size.width() - line.naturalTextWidth();
- } else if (hAlign == QDeclarativeText::AlignHCenter) {
- x = (size.width() - line.naturalTextWidth()) / 2;
- }
- line.setPosition(QPointF(x, line.y()));
- }
-
+ QSize size = layedOutTextRect.size();
//paint text
QPixmap img(size);
if (!size.isEmpty()) {
@@ -507,7 +470,7 @@ QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle)
#ifdef Q_WS_MAC
qt_applefontsmoothing_enabled = oldSmooth;
#endif
- drawTextLayout(&p, QPointF(0,0), drawStyle);
+ drawTextLayout(&p, QPointF(-layedOutTextRect.x(),0), drawStyle);
}
return img;
}
@@ -525,7 +488,7 @@ void QDeclarativeTextPrivate::drawTextLayout(QPainter *painter, const QPointF &p
painter->setFont(font);
layout.draw(painter, pos);
if (!elidePos.isNull())
- painter->drawText(elidePos, elideChar);
+ painter->drawText(pos + elidePos, elideChar);
}
/*!
@@ -930,14 +893,18 @@ void QDeclarativeText::setText(const QString &n)
return;
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(n));
- if (d->richText && isComponentComplete()) {
- d->ensureDoc();
- d->doc->setText(n);
- }
-
d->text = n;
+ if (isComponentComplete()) {
+ if (d->richText) {
+ d->ensureDoc();
+ d->doc->setText(n);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
+ }
+ d->determineHorizontalAlignment();
+ }
d->updateLayout();
-
emit textChanged(d->text);
}
@@ -1060,9 +1027,12 @@ void QDeclarativeText::setStyleColor(const QColor &color)
/*!
\qmlproperty enumeration Text::horizontalAlignment
\qmlproperty enumeration Text::verticalAlignment
+ \qmlproperty enumeration Text::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the Text items
- width and height. By default, the text is top-left aligned.
+ width and height. By default, the text is vertically aligned to the top. Horizontal
+ alignment follows the natural alignment of the text, for example text that is read
+ from left to right will be aligned to the left.
The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight, \c Text.AlignHCenter and
\c Text.AlignJustify. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom
@@ -1072,6 +1042,11 @@ void QDeclarativeText::setStyleColor(const QColor &color)
all alignments are equivalent. If you want the text to be, say, centered in its parent, then you will
need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to
that of the parent.
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of Text, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
{
@@ -1082,16 +1057,78 @@ QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
void QDeclarativeText::setHAlign(HAlignment align)
{
Q_D(QDeclarativeText);
- if (d->hAlign == align)
- return;
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete())
+ d->updateLayout();
+}
- if (isComponentComplete())
- prepareGeometryChange();
+void QDeclarativeText::resetHAlign()
+{
+ Q_D(QDeclarativeText);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete())
+ d->updateLayout();
+}
- d->hAlign = align;
- d->updateLayout();
+QDeclarativeText::HAlignment QDeclarativeText::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeText);
+ QDeclarativeText::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeText::AlignLeft:
+ effectiveAlignment = QDeclarativeText::AlignRight;
+ break;
+ case QDeclarativeText::AlignRight:
+ effectiveAlignment = QDeclarativeText::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeText);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+
+ emit q->horizontalAlignmentChanged(hAlign);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeText);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ return setHAlign(alignToRight ? QDeclarativeText::AlignRight : QDeclarativeText::AlignLeft);
+ }
+ return false;
+}
- emit horizontalAlignmentChanged(align);
+void QDeclarativeTextPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeText);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeText::AlignRight || hAlign == QDeclarativeText::AlignLeft)) {
+ updateLayout();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
+}
+
+QTextDocument *QDeclarativeTextPrivate::textDocument()
+{
+ return doc;
}
QDeclarativeText::VAlignment QDeclarativeText::vAlign() const
@@ -1145,6 +1182,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
/*!
\qmlproperty int Text::lineCount
+ \since Quick 1.1
Returns the number of lines visible in the text item.
@@ -1160,6 +1198,7 @@ int QDeclarativeText::lineCount() const
/*!
\qmlproperty bool Text::truncated
+ \since Quick 1.1
Returns true if the text has been truncated due to \l maximumLineCount
or \l elide.
@@ -1176,6 +1215,7 @@ bool QDeclarativeText::truncated() const
/*!
\qmlproperty int Text::maximumLineCount
+ \since Quick 1.1
Set this property to limit the number of lines that the text item will show.
If elide is set to Text.ElideRight, the text will be elided appropriately.
@@ -1342,44 +1382,25 @@ QRectF QDeclarativeText::boundingRect() const
{
Q_D(const QDeclarativeText);
- int w = width();
- int h = height();
-
- int x = 0;
- int y = 0;
-
- QSize size = d->layedOutTextSize;
+ QRect rect = d->layedOutTextRect;
if (d->style != Normal)
- size += QSize(2,2);
+ rect.adjust(-1, 0, 1, 2);
// Could include font max left/right bearings to either side of rectangle.
- switch (d->hAlign) {
- case AlignLeft:
- case AlignJustify:
- x = 0;
- break;
- case AlignRight:
- x = w - size.width();
- break;
- case AlignHCenter:
- x = (w - size.width()) / 2;
- break;
- }
-
+ int h = height();
switch (d->vAlign) {
case AlignTop:
- y = 0;
break;
case AlignBottom:
- y = h - size.height();
+ rect.setY(h - rect.height());
break;
case AlignVCenter:
- y = (h - size.height()) / 2;
+ rect.setY((h - rect.height()) / 2);
break;
}
- return QRectF(x,y,size.width(),size.height());
+ return QRectF(rect);
}
/*! \internal */
@@ -1428,6 +1449,7 @@ qreal QDeclarativeText::paintedHeight() const
/*!
\qmlproperty real Text::lineHeight
+ \since Quick 1.1
Sets the line height for the text.
The value can be in pixels or a multiplier depending on lineHeightMode.
@@ -1524,8 +1546,8 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
} else {
QRectF bounds = boundingRect();
- bool needClip = clip() && (d->layedOutTextSize.width() > width() ||
- d->layedOutTextSize.height() > height());
+ bool needClip = clip() && (d->layedOutTextRect.width() > width() ||
+ d->layedOutTextRect.height() > height());
if (needClip) {
p->save();
@@ -1557,7 +1579,11 @@ void QDeclarativeText::componentComplete()
if (d->richText) {
d->ensureDoc();
d->doc->setText(d->text);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
}
+ d->determineHorizontalAlignment();
d->updateLayout();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
index b8835d1..a1153c2 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -69,7 +69,8 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeText : public QDeclarativeImplici
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged)
Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -133,6 +134,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
VAlignment vAlign() const;
void setVAlign(VAlignment align);
@@ -188,6 +191,7 @@ Q_SIGNALS:
void paintedSizeChanged();
Q_REVISION(1) void lineHeightChanged(qreal lineHeight);
Q_REVISION(1) void lineHeightModeChanged(LineHeightMode mode);
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
index 36ae123..e3ab62a 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
@@ -76,6 +76,10 @@ public:
void updateSize();
void updateLayout();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeText::HAlignment, bool forceAlign = false);
+ void mirrorChange();
+ QTextDocument *textDocument();
QString text;
QFont font;
@@ -110,8 +114,10 @@ public:
bool cacheAllTextAsImage:1;
bool internalWidthUpdate:1;
bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
- QSize layedOutTextSize;
+ QRect layedOutTextRect;
QSize paintedSize;
qreal naturalWidth;
virtual qreal implicitWidth() const;
@@ -119,7 +125,7 @@ public:
QPixmap textDocumentImage(bool drawStyle);
QTextDocumentWithImageResources *doc;
- QSize setupTextLayout();
+ QRect setupTextLayout();
QPixmap textLayoutImage(bool drawStyle);
void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle);
QDeclarativeTextLayout layout;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index e2f6265..2cb1c94 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qmath.h>
+#include <private/qtextengine_p.h>
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
@@ -249,6 +250,7 @@ void QDeclarativeTextEdit::setText(const QString &text)
Q_D(QDeclarativeTextEdit);
if (QDeclarativeTextEdit::text() == text)
return;
+
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
#ifndef QT_NO_TEXTHTMLPARSER
@@ -457,9 +459,12 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextEdit::horizontalAlignment
\qmlproperty enumeration TextEdit::verticalAlignment
+ \qmlproperty enumeration TextEdit::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the TextEdit item's
- width and height. By default, the text is top-left aligned.
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
Valid values for \c horizontalAlignment are:
\list
@@ -473,8 +478,13 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
\list
\o TextEdit.AlignTop (default)
\o TextEdit.AlignBottom
- \c TextEdit.AlignVCenter
+ \o TextEdit.AlignVCenter
\endlist
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextEdit, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
{
@@ -482,15 +492,80 @@ QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
return d->hAlign;
}
-void QDeclarativeTextEdit::setHAlign(QDeclarativeTextEdit::HAlignment alignment)
+void QDeclarativeTextEdit::setHAlign(HAlignment align)
{
Q_D(QDeclarativeTextEdit);
- if (alignment == d->hAlign)
- return;
- d->hAlign = alignment;
- d->updateDefaultTextOption();
- updateSize();
- emit horizontalAlignmentChanged(d->hAlign);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+void QDeclarativeTextEdit::resetHAlign()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QDeclarativeTextEdit::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextEdit::AlignLeft:
+ effectiveAlignment = QDeclarativeTextEdit::AlignRight;
+ break;
+ case QDeclarativeTextEdit::AlignRight:
+ effectiveAlignment = QDeclarativeTextEdit::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextEditPrivate::setHAlign(QDeclarativeTextEdit::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeTextEdit::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(alignment);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextEditPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ return setHAlign(alignToRight ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextEditPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextEdit::AlignRight || hAlign == QDeclarativeTextEdit::AlignLeft)) {
+ updateDefaultTextOption();
+ q->updateSize();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
}
QDeclarativeTextEdit::VAlignment QDeclarativeTextEdit::vAlign() const
@@ -544,6 +619,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
/*!
\qmlproperty int TextEdit::lineCount
+ \since Quick 1.1
Returns the total number of lines in the textEdit item.
*/
@@ -605,6 +681,22 @@ int QDeclarativeTextEdit::positionAt(int x, int y) const
{
Q_D(const QDeclarativeTextEdit);
int r = d->document->documentLayout()->hitTest(QPoint(x,y-d->yoff), Qt::FuzzyHit);
+ QTextCursor cursor = d->control->textCursor();
+ if (r > cursor.position()) {
+ // The cursor position includes positions within the preedit text, but only positions in the
+ // same text block are offset so it is possible to get a position that is either part of the
+ // preedit or the next text block.
+ QTextLayout *layout = cursor.block().layout();
+ const int preeditLength = layout
+ ? layout->preeditAreaText().length()
+ : 0;
+ if (preeditLength > 0
+ && d->document->documentLayout()->blockBoundingRect(cursor.block()).contains(x,y-d->yoff)) {
+ r = r > cursor.position() + preeditLength
+ ? r - preeditLength
+ : cursor.position();
+ }
+ }
return r;
}
@@ -950,6 +1042,8 @@ void QDeclarativeTextEdit::componentComplete()
Q_D(QDeclarativeTextEdit);
QDeclarativePaintedItem::componentComplete();
if (d->dirty) {
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
updateSize();
d->dirty = false;
}
@@ -977,6 +1071,10 @@ void QDeclarativeTextEdit::setSelectByMouse(bool on)
if (d->selectByMouse != on) {
d->selectByMouse = on;
setKeepMouseGrab(on);
+ if (on)
+ setTextInteractionFlags(d->control->textInteractionFlags() | Qt::TextSelectableByMouse);
+ else
+ setTextInteractionFlags(d->control->textInteractionFlags() & ~Qt::TextSelectableByMouse);
emit selectByMouseChanged(on);
}
}
@@ -1029,11 +1127,10 @@ void QDeclarativeTextEdit::setReadOnly(bool r)
setFlag(QGraphicsItem::ItemAcceptsInputMethod, !r);
Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse;
- if (r) {
+ if (d->selectByMouse)
flags = flags | Qt::TextSelectableByMouse;
- } else {
- flags = flags | Qt::TextEditorInteraction;
- }
+ if (!r)
+ flags = flags | Qt::TextSelectableByKeyboard | Qt::TextEditable;
d->control->setTextInteractionFlags(flags);
if (!r)
d->control->moveCursor(QTextCursor::End);
@@ -1125,12 +1222,13 @@ void QDeclarativeTextEdit::keyReleaseEvent(QKeyEvent *event)
void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
{
Q_Q(QDeclarativeTextEdit);
- q->setCursorVisible(hasFocus);
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
QDeclarativeItemPrivate::focusChanged(hasFocus);
}
/*!
\qmlmethod void TextEdit::deselect()
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1195,6 +1293,23 @@ void QDeclarativeTextEdit::select(int start, int end)
updateSelectionMarkers();
}
+/*!
+ \qmlmethod void TextEdit::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextEdit::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->text.mid(start, end - start).isRightToLeft();
+ }
+}
+
#ifndef QT_NO_CLIPBOARD
/*!
\qmlmethod TextEdit::cut()
@@ -1251,8 +1366,8 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
}
}
- if (event->type() != QEvent::GraphicsSceneMouseDoubleClick || d->selectByMouse)
- d->control->processEvent(event, QPointF(0, -d->yoff));
+
+ d->control->processEvent(event, QPointF(0, -d->yoff));
if (!event->isAccepted())
QDeclarativePaintedItem::mousePressEvent(event);
}
@@ -1287,13 +1402,11 @@ Handles the given mouse \a event.
void QDeclarativeTextEdit::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
- if (d->selectByMouse) {
- d->control->processEvent(event, QPointF(0, -d->yoff));
- if (!event->isAccepted())
- QDeclarativePaintedItem::mouseDoubleClickEvent(event);
- } else {
+
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
QDeclarativePaintedItem::mouseDoubleClickEvent(event);
- }
+
}
/*!
@@ -1303,14 +1416,9 @@ Handles the given mouse \a event.
void QDeclarativeTextEdit::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
- if (d->selectByMouse) {
- d->control->processEvent(event, QPointF(0, -d->yoff));
- if (!event->isAccepted())
- QDeclarativePaintedItem::mouseMoveEvent(event);
- event->setAccepted(true);
- } else {
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
QDeclarativePaintedItem::mouseMoveEvent(event);
- }
}
/*!
@@ -1320,7 +1428,10 @@ Handles the given input method \a event.
void QDeclarativeTextEdit::inputMethodEvent(QInputMethodEvent *event)
{
Q_D(QDeclarativeTextEdit);
+ const bool wasComposing = isInputMethodComposing();
d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (wasComposing != isInputMethodComposing())
+ emit inputMethodComposingChanged();
}
/*!
@@ -1385,19 +1496,38 @@ void QDeclarativeTextEdit::updateImgCache(const QRectF &rf)
/*!
\qmlproperty bool TextEdit::canPaste
+ \since QtQuick 1.1
Returns true if the TextEdit is writable and the content of the clipboard is
suitable for pasting into the TextEdit.
-
- \since QtQuick 1.1
*/
-
bool QDeclarativeTextEdit::canPaste() const
{
Q_D(const QDeclarativeTextEdit);
return d->canPaste;
}
+/*!
+ \qmlproperty bool TextEdit::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextEdit has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextEdit to edit or commit the partial text. This property can be used
+ to determine when to disable events handlers that may interfere with the
+ correct operation of an input method.
+*/
+bool QDeclarativeTextEdit::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (QTextLayout *layout = d->control->textCursor().block().layout())
+ return layout->preeditAreaText().length() > 0;
+ return false;
+}
+
void QDeclarativeTextEditPrivate::init()
{
Q_Q(QDeclarativeTextEdit);
@@ -1409,7 +1539,7 @@ void QDeclarativeTextEditPrivate::init()
control = new QTextControl(q);
control->setIgnoreUnusedNavigationEvents(true);
- control->setTextInteractionFlags(control->textInteractionFlags() | Qt::LinksAccessibleByMouse);
+ control->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByKeyboard | Qt::TextEditable);
control->setDragEnabled(false);
// QTextControl follows the default text color
@@ -1433,6 +1563,7 @@ void QDeclarativeTextEditPrivate::init()
#ifndef QT_NO_CLIPBOARD
QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
+ canPaste = control->canPaste();
#endif
document = control->document();
@@ -1447,6 +1578,9 @@ void QDeclarativeTextEdit::q_textChanged()
{
Q_D(QDeclarativeTextEdit);
d->text = text();
+ d->rightToLeftText = d->document->begin().layout()->engine()->isRightToLeft();
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
updateSize();
updateTotalLines();
updateMicroFocus();
@@ -1611,9 +1745,18 @@ void QDeclarativeTextEdit::updateTotalLines()
void QDeclarativeTextEditPrivate::updateDefaultTextOption()
{
+ Q_Q(QDeclarativeTextEdit);
QTextOption opt = document->defaultTextOption();
int oldAlignment = opt.alignment();
- opt.setAlignment((Qt::Alignment)(int)(hAlign | vAlign));
+
+ QDeclarativeTextEdit::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeTextEdit::AlignLeft)
+ horizontalAlignment = QDeclarativeTextEdit::AlignRight;
+ else if (horizontalAlignment == QDeclarativeTextEdit::AlignRight)
+ horizontalAlignment = QDeclarativeTextEdit::AlignLeft;
+ }
+ opt.setAlignment((Qt::Alignment)(int)(horizontalAlignment | vAlign));
QTextOption::WrapMode oldWrapMode = opt.wrapMode();
opt.setWrapMode(QTextOption::WrapMode(wrapMode));
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 7785a7a..25ca1e7 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -72,7 +72,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -94,6 +95,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
public:
QDeclarativeTextEdit(QDeclarativeItem *parent=0);
@@ -152,6 +154,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
VAlignment vAlign() const;
void setVAlign(VAlignment align);
@@ -215,6 +219,8 @@ public:
QRectF boundingRect() const;
+ bool isInputMethodComposing() const;
+
Q_SIGNALS:
void textChanged(const QString &);
void paintedSizeChanged();
@@ -242,12 +248,15 @@ Q_SIGNALS:
Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
Q_REVISION(1) void linkActivated(const QString &link);
Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
public Q_SLOTS:
void selectAll();
void selectWord();
void select(int start, int end);
Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 111cc02..36e1b51 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -71,8 +71,8 @@ public:
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), requireImplicitWidth(false),
- textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0),
- format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
+ hAlignImplicit(true), rightToLeftText(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
+ cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
mouseSelectionMode(QDeclarativeTextEdit::SelectCharacters), selectByMouse(false), canPaste(false),
yoff(0)
{
@@ -88,6 +88,9 @@ public:
void updateDefaultTextOption();
void relayoutDocument();
void updateSelection();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextEdit::HAlignment, bool forceAlign = false);
+ void mirrorChange();
qreal implicitWidth() const;
void focusChanged(bool);
@@ -112,6 +115,8 @@ public:
bool clickCausedFocus : 1;
bool persistentSelection : 1;
bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
qreal textMargin;
int lastSelectionStart;
int lastSelectionEnd;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index f9f2b18..c6de7a0 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -51,6 +51,7 @@
#include <QFontMetrics>
#include <QPainter>
#include <QTextBoundaryFinder>
+#include <QInputContext>
#include <qstyle.h>
#ifndef QT_NO_LINEEDIT
@@ -325,9 +326,12 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextInput::horizontalAlignment
+ \qmlproperty enumeration TextInput::effectiveHorizontalAlignment
Sets the horizontal alignment of the text within the TextInput item's
- width and height. By default, the text is left aligned.
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
TextInput does not have vertical alignment, as the natural height is
exactly the height of the single line of text. If you set the height
@@ -337,6 +341,11 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and
\c TextInput.AlignHCenter.
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextInput, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
{
@@ -347,12 +356,78 @@ QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
void QDeclarativeTextInput::setHAlign(HAlignment align)
{
Q_D(QDeclarativeTextInput);
- if(align == d->hAlign)
- return;
- d->hAlign = align;
- updateRect();
- d->updateHorizontalScroll();
- emit horizontalAlignmentChanged(d->hAlign);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ updateRect();
+ d->updateHorizontalScroll();
+ }
+}
+
+void QDeclarativeTextInput::resetHAlign()
+{
+ Q_D(QDeclarativeTextInput);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ updateRect();
+ d->updateHorizontalScroll();
+ }
+}
+
+QDeclarativeTextInput::HAlignment QDeclarativeTextInput::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextInput);
+ QDeclarativeTextInput::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextInput::AlignLeft:
+ effectiveAlignment = QDeclarativeTextInput::AlignRight;
+ break;
+ case QDeclarativeTextInput::AlignRight:
+ effectiveAlignment = QDeclarativeTextInput::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextInput);
+ if ((hAlign != alignment || forceAlign) && alignment <= QDeclarativeTextInput::AlignHCenter) { // justify not supported
+ QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ return true;
+ emit q->horizontalAlignmentChanged(alignment);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ return false;
+}
+
+bool QDeclarativeTextInputPrivate::determineHorizontalAlignment()
+{
+ if (hAlignImplicit) {
+ // if no explicit alignment has been set, follow the natural layout direction of the text
+ QString text = control->text();
+ bool isRightToLeft = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : text.isRightToLeft();
+ return setHAlign(isRightToLeft ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextInputPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextInput);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) {
+ q->updateRect();
+ updateHorizontalScroll();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
}
/*!
@@ -481,6 +556,7 @@ QRect QDeclarativeTextInput::cursorRectangle() const
Q_D(const QDeclarativeTextInput);
QRect r = d->control->cursorRect();
r.setHeight(r.height()-1); // Make consistent with TextEdit (QLineControl inexplicably adds 1)
+ r.moveLeft(r.x() - d->hscroll);
return r;
}
@@ -776,6 +852,15 @@ bool QDeclarativeTextInput::hasAcceptableInput() const
}
/*!
+ \qmlsignal TextInput::onAccepted()
+
+ This handler is called when the Return or Enter key is pressed.
+ Note that if there is a \l validator or \l inputMask set on the text
+ input, the handler will only be emitted if the input is in an acceptable
+ state.
+*/
+
+/*!
\qmlproperty enumeration TextInput::echoMode
Specifies how the text should be displayed in the TextInput.
@@ -911,14 +996,22 @@ void QDeclarativeTextInput::moveCursor()
QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
{
Q_D(const QDeclarativeTextInput);
+ if (pos > d->control->cursorPosition())
+ pos += d->control->preeditAreaText().length();
return QRectF(d->control->cursorToX(pos)-d->hscroll,
0.0,
d->control->cursorWidth(),
cursorRectangle().height());
}
+int QDeclarativeTextInput::positionAt(int x) const
+{
+ return positionAt(x, CursorBetweenCharacters);
+}
+
/*!
- \qmlmethod int TextInput::positionAt(int x)
+ \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters)
+ \since Quick 1.1
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -927,18 +1020,33 @@ QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
This means that for all x values before the first character this function returns 0,
and for all x values after the last character this function returns text.length.
+
+ The cursor position type specifies how the cursor position should be resolved.
+
+ \list
+ \o TextInput.CursorBetweenCharacters - Returns the position between characters that is nearest x.
+ \o TextInput.CursorOnCharacter - Returns the position before the character that is nearest x.
+ \endlist
*/
-int QDeclarativeTextInput::positionAt(int x) const
+int QDeclarativeTextInput::positionAt(int x, CursorPosition position) const
{
Q_D(const QDeclarativeTextInput);
- return d->control->xToPos(x + d->hscroll);
+ int pos = d->control->xToPos(x + d->hscroll, QTextLine::CursorPosition(position));
+ const int cursor = d->control->cursor();
+ if (pos > cursor) {
+ const int preeditLength = d->control->preeditAreaText().length();
+ pos = pos > cursor + preeditLength
+ ? pos - preeditLength
+ : cursor;
+ }
+ return pos;
}
void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
{
Q_Q(QDeclarativeTextInput);
focused = hasFocus;
- q->setCursorVisible(hasFocus);
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
if(q->echoMode() == QDeclarativeTextInput::PasswordEchoOnEdit && !hasFocus)
control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
if (!hasFocus)
@@ -952,16 +1060,21 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
keyPressPreHandler(ev);
if (ev->isAccepted())
return;
- if (((ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier) // Don't allow MacOSX up/down support, and we don't allow a completer.
- || (((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
- || (d->control->cursor() == d->control->text().length()
- && ev->key() == Qt::Key_Right))
- && (d->lastSelectionStart == d->lastSelectionEnd)))
- {
- //ignore when moving off the end
- //unless there is a selection, because then moving will do something (deselect)
+
+ // Don't allow MacOSX up/down support, and we don't allow a completer.
+ bool ignore = (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier;
+ if (!ignore && (d->lastSelectionStart == d->lastSelectionEnd) && (ev->key() == Qt::Key_Right || ev->key() == Qt::Key_Left)) {
+ // Ignore when moving off the end unless there is a selection,
+ // because then moving will do something (deselect).
+ int cursorPosition = d->control->cursor();
+ if (cursorPosition == 0)
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
+ if (cursorPosition == d->control->text().length())
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
+ }
+ if (ignore) {
ev->ignore();
- }else{
+ } else {
d->control->processKeyEvent(ev);
}
if (!ev->isAccepted())
@@ -972,18 +1085,22 @@ void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev)
{
Q_D(QDeclarativeTextInput);
ev->ignore();
+ const bool wasComposing = d->control->preeditAreaText().length() > 0;
inputMethodPreHandler(ev);
- if (ev->isAccepted())
- return;
- if (d->control->isReadOnly()) {
- ev->ignore();
- } else {
- d->control->processInputMethodEvent(ev);
- updateSize();
- d->updateHorizontalScroll();
+ if (!ev->isAccepted()) {
+ if (d->control->isReadOnly()) {
+ ev->ignore();
+ } else {
+ d->control->processInputMethodEvent(ev);
+ updateSize();
+ d->updateHorizontalScroll();
+ }
}
if (!ev->isAccepted())
QDeclarativePaintedItem::inputMethodEvent(ev);
+
+ if (wasComposing != (d->control->preeditAreaText().length() > 0))
+ emit inputMethodComposingChanged();
}
/*!
@@ -993,6 +1110,8 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonDblClick))
+ return;
if (d->selectByMouse) {
int cursor = d->xToPos(event->pos().x());
d->control->selectWordAtPos(cursor);
@@ -1005,6 +1124,8 @@ void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonPress))
+ return;
if(d->focusOnPress){
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus();
@@ -1032,6 +1153,8 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
+ return;
if (d->selectByMouse) {
if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
setKeepMouseGrab(true);
@@ -1049,6 +1172,8 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonRelease))
+ return;
if (d->selectByMouse)
setKeepMouseGrab(false);
if (!d->showInputPanelOnFocus) { // input panel on click
@@ -1066,6 +1191,44 @@ void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QDeclarativePaintedItem::mouseReleaseEvent(event);
}
+bool QDeclarativeTextInputPrivate::sendMouseEventToInputContext(
+ QGraphicsSceneMouseEvent *event, QEvent::Type eventType)
+{
+#if !defined QT_NO_IM
+ if (event->widget() && control->composeMode()) {
+ int tmp_cursor = xToPos(event->pos().x());
+ int mousePos = tmp_cursor - control->cursor();
+ if (mousePos < 0 || mousePos > control->preeditAreaText().length()) {
+ mousePos = -1;
+ // don't send move events outside the preedit area
+ if (eventType == QEvent::MouseMove)
+ return true;
+ }
+
+ QInputContext *qic = event->widget()->inputContext();
+ if (qic) {
+ QMouseEvent mouseEvent(
+ eventType,
+ event->widget()->mapFromGlobal(event->screenPos()),
+ event->screenPos(),
+ event->button(),
+ event->buttons(),
+ event->modifiers());
+ // may be causing reset() in some input methods
+ qic->mouseHandler(mousePos, &mouseEvent);
+ event->setAccepted(mouseEvent.isAccepted());
+ }
+ if (!control->preeditAreaText().isEmpty())
+ return true;
+ }
+#else
+ Q_UNUSED(event);
+ Q_UNUSED(eventType)
+#endif
+
+ return false;
+}
+
bool QDeclarativeTextInput::sceneEvent(QEvent *event)
{
bool rv = QDeclarativeItem::sceneEvent(event);
@@ -1120,11 +1283,12 @@ void QDeclarativeTextInputPrivate::updateHorizontalScroll()
int cix = qRound(control->cursorToX(control->cursor() + preeditLength));
QRect br(q->boundingRect().toRect());
int widthUsed = calculateTextWidth();
- Qt::Alignment va = QStyle::visualAlignment(control->layoutDirection(), QFlag(Qt::Alignment(hAlign)));
+
+ QDeclarativeTextInput::HAlignment effectiveHAlign = q->effectiveHAlign();
if (autoScroll) {
if (widthUsed <= br.width()) {
// text fits in br; use hscroll for alignment
- switch (va & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
+ switch (effectiveHAlign & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
case Qt::AlignRight:
hscroll = widthUsed - br.width() - 1;
break;
@@ -1156,11 +1320,11 @@ void QDeclarativeTextInputPrivate::updateHorizontalScroll()
hscroll = cix;
}
} else {
- switch (va & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
- case Qt::AlignRight:
+ switch (effectiveHAlign) {
+ case QDeclarativeTextInput::AlignRight:
hscroll = q->width() - widthUsed;
break;
- case Qt::AlignHCenter:
+ case QDeclarativeTextInput::AlignHCenter:
hscroll = (q->width() - widthUsed) / 2;
break;
default:
@@ -1204,13 +1368,16 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
Q_D(const QDeclarativeTextInput);
switch(property) {
case Qt::ImMicroFocus:
- return d->control->cursorRect();
+ return cursorRectangle();
case Qt::ImFont:
return font();
case Qt::ImCursorPosition:
return QVariant(d->control->cursor());
case Qt::ImSurroundingText:
- return QVariant(text());
+ if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
+ return QVariant(displayText());
+ else
+ return QVariant(text());
case Qt::ImCurrentSelection:
return QVariant(selectedText());
case Qt::ImMaximumTextLength:
@@ -1229,6 +1396,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
/*!
\qmlmethod void TextInput::deselect()
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1249,6 +1417,23 @@ void QDeclarativeTextInput::selectAll()
d->control->setSelection(0, d->control->text().length());
}
+/*!
+ \qmlmethod void TextInput::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextInput::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextInput);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->control->text().mid(start, end - start).isRightToLeft();
+ }
+}
+
#ifndef QT_NO_CLIPBOARD
/*!
\qmlmethod TextInput::cut()
@@ -1410,6 +1595,13 @@ void QDeclarativeTextInput::setMouseSelectionMode(SelectionMode mode)
}
}
+/*!
+ \qmlproperty bool TextInput::canPaste
+ \since QtQuick 1.1
+
+ Returns true if the TextInput is writable and the content of the clipboard is
+ suitable for pasting into the TextEdit.
+*/
bool QDeclarativeTextInput::canPaste() const
{
Q_D(const QDeclarativeTextInput);
@@ -1478,38 +1670,41 @@ void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode)
anchor = d->control->selectionStart();
if (anchor < pos || (anchor == pos && cursor < pos)) {
- QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text());
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
finder.setPosition(anchor);
const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
- if (!(reasons & QTextBoundaryFinder::StartWord)
- || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor)) {
+ if (anchor < text.length() && (!(reasons & QTextBoundaryFinder::StartWord)
+ || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor))) {
finder.toPreviousBoundary();
}
- anchor = finder.position();
+ anchor = finder.position() != -1 ? finder.position() : 0;
finder.setPosition(pos);
- if (!finder.isAtBoundary())
+ if (pos > 0 && !finder.boundaryReasons())
finder.toNextBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : text.length();
- d->control->setSelection(anchor, finder.position() - anchor);
+ d->control->setSelection(anchor, cursor - anchor);
} else if (anchor > pos || (anchor == pos && cursor > pos)) {
- QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text());
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
finder.setPosition(anchor);
const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
- if (!(reasons & QTextBoundaryFinder::EndWord)
- || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor)) {
+ if (anchor > 0 && (!(reasons & QTextBoundaryFinder::EndWord)
+ || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor))) {
finder.toNextBoundary();
}
-
- anchor = finder.position();
+ anchor = finder.position() != -1 ? finder.position() : text.length();
finder.setPosition(pos);
- if (!finder.isAtBoundary())
+ if (pos < text.length() && !finder.boundaryReasons())
finder.toPreviousBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : 0;
- d->control->setSelection(anchor, finder.position() - anchor);
+ d->control->setSelection(anchor, cursor - anchor);
}
}
}
@@ -1628,6 +1823,25 @@ void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
QDeclarativePaintedItem::focusInEvent(event);
}
+/*!
+ \qmlproperty bool TextInput::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextInput has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextInput to edit or commit the partial text. This property can be
+ used to determine when to disable events handlers that may interfere with
+ the correct operation of an input method.
+*/
+bool QDeclarativeTextInput::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->preeditAreaText().length() > 0;
+}
+
void QDeclarativeTextInputPrivate::init()
{
Q_Q(QDeclarativeTextInput);
@@ -1652,7 +1866,12 @@ void QDeclarativeTextInputPrivate::init()
q, SLOT(q_canPasteChanged()));
q->connect(QApplication::clipboard(), SIGNAL(dataChanged()),
q, SLOT(q_canPasteChanged()));
+ canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
#endif // QT_NO_CLIPBOARD
+ q->connect(control, SIGNAL(updateMicroFocus()),
+ q, SLOT(updateMicroFocus()));
+ q->connect(control, SIGNAL(displayTextChanged(QString)),
+ q, SLOT(updateRect()));
q->updateSize();
oldValidity = control->hasAcceptableInput();
lastSelectionStart = 0;
@@ -1660,6 +1879,7 @@ void QDeclarativeTextInputPrivate::init()
QPalette p = control->palette();
selectedTextColor = p.color(QPalette::HighlightedText);
selectionColor = p.color(QPalette::Highlight);
+ determineHorizontalAlignment();
}
void QDeclarativeTextInput::cursorPosChanged()
@@ -1707,6 +1927,7 @@ void QDeclarativeTextInput::q_textChanged()
{
Q_D(QDeclarativeTextInput);
updateSize();
+ d->determineHorizontalAlignment();
d->updateHorizontalScroll();
updateMicroFocus();
emit textChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index e1e66a9..8c873b3 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -70,8 +70,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
-
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
@@ -97,6 +97,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
public:
QDeclarativeTextInput(QDeclarativeItem* parent=0);
@@ -120,8 +121,14 @@ public:
SelectWords
};
+ enum CursorPosition {
+ CursorBetweenCharacters,
+ CursorOnCharacter
+ };
+
//Auxilliary functions needed to control the TextInput from QML
Q_INVOKABLE int positionAt(int x) const;
+ Q_INVOKABLE Q_REVISION(1) int positionAt(int x, CursorPosition position) const;
Q_INVOKABLE QRectF positionToRectangle(int pos) const;
Q_INVOKABLE void moveCursorSelection(int pos);
Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode);
@@ -146,6 +153,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
bool isReadOnly() const;
void setReadOnly(bool);
@@ -204,6 +213,8 @@ public:
QRectF boundingRect() const;
bool canPaste() const;
+ bool isInputMethodComposing() const;
+
Q_SIGNALS:
void textChanged();
void cursorPositionChanged();
@@ -231,6 +242,8 @@ Q_SIGNALS:
void selectByMouseChanged(bool selectByMouse);
Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -251,6 +264,7 @@ public Q_SLOTS:
void selectWord();
void select(int start, int end);
Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index f7446b4..fd4da2e 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -74,9 +74,9 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
mouseSelectionMode(QDeclarativeTextInput::SelectCharacters),
- hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
+ hscroll(0), oldScroll(0), oldValidity(false), focused(false), focusOnPress(true),
showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
- autoScroll(true), selectByMouse(false), canPaste(false)
+ autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true)
{
#ifdef Q_OS_SYMBIAN
if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
@@ -103,7 +103,11 @@ public:
void startCreatingCursor();
void focusChanged(bool hasFocus);
void updateHorizontalScroll();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextInput::HAlignment, bool forceAlign = false);
+ void mirrorChange();
int calculateTextWidth();
+ bool sendMouseEventToInputContext(QGraphicsSceneMouseEvent *event, QEvent::Type eventType);
QLineControl* control;
@@ -124,17 +128,18 @@ public:
int lastSelectionEnd;
int oldHeight;
int oldWidth;
- bool oldValidity;
int hscroll;
int oldScroll;
- bool focused;
- bool focusOnPress;
- bool showInputPanelOnFocus;
- bool clickCausedFocus;
- bool cursorVisible;
- bool autoScroll;
- bool selectByMouse;
- bool canPaste;
+ bool oldValidity:1;
+ bool focused:1;
+ bool focusOnPress:1;
+ bool showInputPanelOnFocus:1;
+ bool clickCausedFocus:1;
+ bool cursorVisible:1;
+ bool autoScroll:1;
+ bool selectByMouse:1;
+ bool canPaste:1;
+ bool hAlignImplicit:1;
static inline QDeclarativeTextInputPrivate *get(QDeclarativeTextInput *t) {
return t->d_func();
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index b24dd2c..31819f5 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -99,7 +99,6 @@ class DrawTextItemRecorder: public QPaintEngine
needFreshCurrentItem = false;
last.numChars += ti.num_chars;
- last.numGlyphs += ti.glyphs.numGlyphs;
}
}
@@ -111,7 +110,7 @@ class DrawTextItemRecorder: public QPaintEngine
currentItem.font = ti.font();
currentItem.charOffset = charOffset;
currentItem.numChars = ti.num_chars;
- currentItem.numGlyphs = ti.glyphs.numGlyphs;
+ currentItem.numGlyphs = 0;
currentItem.glyphOffset = glyphOffset;
currentItem.positionOffset = positionOffset;
currentItem.useBackendOptimizations = m_useBackendOptimizations;
@@ -121,6 +120,8 @@ class DrawTextItemRecorder: public QPaintEngine
m_inertText->items.append(currentItem);
}
+ QStaticTextItem &currentItem = m_inertText->items.last();
+
QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform();
matrix.translate(position.x(), position.y());
@@ -129,18 +130,18 @@ class DrawTextItemRecorder: public QPaintEngine
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
int size = glyphs.size();
- Q_ASSERT(size == ti.glyphs.numGlyphs);
Q_ASSERT(size == positions.size());
+ currentItem.numGlyphs += size;
m_inertText->glyphs.resize(m_inertText->glyphs.size() + size);
m_inertText->positions.resize(m_inertText->glyphs.size());
m_inertText->chars.resize(m_inertText->chars.size() + ti.num_chars);
glyph_t *glyphsDestination = m_inertText->glyphs.data() + glyphOffset;
- qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * ti.glyphs.numGlyphs);
+ qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * size);
QFixedPoint *positionsDestination = m_inertText->positions.data() + positionOffset;
- qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * ti.glyphs.numGlyphs);
+ qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * size);
QChar *charsDestination = m_inertText->chars.data() + charOffset;
qMemCopy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars);
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 0554897..f57f842 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -608,7 +608,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
out->types << ref;
}
- Object *root = unit->parser().tree();
+ QDeclarativeParser::Object *root = unit->parser().tree();
Q_ASSERT(root);
this->engine = engine;
@@ -637,7 +637,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
return !isError();
}
-void QDeclarativeCompiler::compileTree(Object *tree)
+void QDeclarativeCompiler::compileTree(QDeclarativeParser::Object *tree)
{
compileState.root = tree;
componentStat.lineNumber = tree->location.start.line;
@@ -715,14 +715,14 @@ void QDeclarativeCompiler::compileTree(Object *tree)
enginePrivate->registerCompositeType(output);
}
-static bool ValuePtrLessThan(const Value *t1, const Value *t2)
+static bool ValuePtrLessThan(const QDeclarativeParser::Value *t1, const QDeclarativeParser::Value *t2)
{
return t1->location.start.line < t2->location.start.line ||
(t1->location.start.line == t2->location.start.line &&
t1->location.start.column < t2->location.start.column);
}
-bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
{
componentStat.objects++;
@@ -799,7 +799,7 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
defaultProperty->values = obj->defaultProperty->values;
defaultProperty->values += explicitProperty->values;
- foreach(Value *value, defaultProperty->values)
+ foreach(QDeclarativeParser::Value *value, defaultProperty->values)
value->addref();
qSort(defaultProperty->values.begin(), defaultProperty->values.end(), ValuePtrLessThan);
@@ -1262,7 +1262,7 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
if (!obj->dynamicSlots.isEmpty())
COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions."));
- Object *root = 0;
+ QDeclarativeParser::Object *root = 0;
if (obj->defaultProperty && obj->defaultProperty->values.count())
root = obj->defaultProperty->values.first()->object;
@@ -1302,7 +1302,7 @@ bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeParser::Object *ob
// Build a sub-object. A sub-object is one that was not created directly by
// QML - such as a grouped property object, or an attached object. Sub-object's
// can't have an id, involve a custom parser, have attached properties etc.
-bool QDeclarativeCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
{
Q_ASSERT(obj->metatype);
Q_ASSERT(!obj->defaultProperty);
@@ -1615,7 +1615,7 @@ void QDeclarativeCompiler::genListProperty(QDeclarativeParser::Property *prop,
output->bytecode << fetch;
for (int ii = 0; ii < prop->values.count(); ++ii) {
- Value *v = prop->values.at(ii);
+ QDeclarativeParser::Value *v = prop->values.at(ii);
if (v->type == Value::CreatedObject) {
@@ -1903,7 +1903,7 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
if (prop->values.count() > 1) {
COMPILE_EXCEPTION(prop, tr("Single property assignment expected"));
} else if (prop->values.count()) {
- Value *value = prop->values.at(0);
+ QDeclarativeParser::Value *value = prop->values.at(0);
if (value->object) {
COMPILE_EXCEPTION(prop, tr("Unexpected object assignment"));
@@ -1932,7 +1932,7 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
}
for (int ii = 0; ii < prop->onValues.count(); ++ii) {
- Value *v = prop->onValues.at(ii);
+ QDeclarativeParser::Value *v = prop->onValues.at(ii);
Q_ASSERT(v->object);
COMPILE_CHECK(buildPropertyOnAssignment(prop, obj, baseObj, v, ctxt));
@@ -1962,7 +1962,7 @@ bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
bool assignedBinding = false;
for (int ii = 0; ii < prop->values.count(); ++ii) {
- Value *v = prop->values.at(ii);
+ QDeclarativeParser::Value *v = prop->values.at(ii);
if (v->object) {
v->type = Value::CreatedObject;
COMPILE_CHECK(buildObject(v->object, ctxt));
@@ -2017,7 +2017,7 @@ bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property
COMPILE_EXCEPTION(prop->values.at(0), tr( "Cannot assign multiple values to a singular property") );
for (int ii = 0; ii < prop->values.count(); ++ii) {
- Value *v = prop->values.at(ii);
+ QDeclarativeParser::Value *v = prop->values.at(ii);
if (v->object) {
COMPILE_CHECK(buildPropertyObjectAssignment(prop, obj, v, ctxt));
@@ -2030,7 +2030,7 @@ bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property
}
for (int ii = 0; ii < prop->onValues.count(); ++ii) {
- Value *v = prop->onValues.at(ii);
+ QDeclarativeParser::Value *v = prop->onValues.at(ii);
Q_ASSERT(v->object);
COMPILE_CHECK(buildPropertyOnAssignment(prop, obj, obj, v, ctxt));
@@ -2385,7 +2385,7 @@ bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeParser::Object
COMPILE_EXCEPTION(property, tr("Invalid property nesting"));
for (int ii = 0; ii < p.defaultValue->values.count(); ++ii) {
- Value *v = p.defaultValue->values.at(ii);
+ QDeclarativeParser::Value *v = p.defaultValue->values.at(ii);
v->addref();
property->values.append(v);
}
@@ -2678,7 +2678,7 @@ static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node)
bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
QByteArray &data,
- Object *obj,
+ QDeclarativeParser::Object *obj,
const Object::DynamicProperty &prop)
{
if (!prop.defaultValue)
@@ -2701,7 +2701,7 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
if (!compileState.ids.contains(alias.at(0)))
COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
- Object *idObject = compileState.ids[alias.at(0)];
+ QDeclarativeParser::Object *idObject = compileState.ids[alias.at(0)];
QByteArray typeName;
@@ -2884,7 +2884,7 @@ bool QDeclarativeCompiler::completeComponentBuild()
componentStat.ids = compileState.ids.count();
for (int ii = 0; ii < compileState.aliasingObjects.count(); ++ii) {
- Object *aliasObject = compileState.aliasingObjects.at(ii);
+ QDeclarativeParser::Object *aliasObject = compileState.aliasingObjects.at(ii);
COMPILE_CHECK(buildDynamicMeta(aliasObject, ResolveAliases));
}
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 5840f70..fc393d1 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -615,10 +615,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
- \qmlmethod object Component::createObject(Item parent, Script valuemap = null)
+ \qmlmethod object Component::createObject(Item parent, object properties)
- Creates and returns an object instance of this component that will have the given
- \a parent. Returns null if object creation fails.
+ Creates and returns an object instance of this component that will have
+ the given \a parent and \a properties. The \a properties argument is optional.
+ Returns null if object creation fails.
The object will be created in the same context as the one in which the component
was created. This function will always return null when called on components
@@ -630,14 +631,23 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
property, or else the object will not be visible.
If a \a parent is not provided to createObject(), a reference to the returned object must be held so that
- it is not destroyed by the garbage collector. This is regardless of Item.parent being set afterwards,
+ it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards,
since setting the Item parent does not change object ownership; only the graphical parent is changed.
- Since QtQuick 1.1, a map of property values can be optionally passed to the method that applies values to the object's properties
- before its creation is finalised. This will avoid binding issues that can occur when the object is
- instantiated before property bindings have been set. For example:
+ As of QtQuick 1.1, this method accepts an optional \a properties argument that specifies a
+ map of initial property values for the created object. These values are applied before object
+ creation is finalized. (This is more efficient than setting property values after object creation,
+ particularly where large sets of property values are defined, and also allows property bindings
+ to be set up before the object is created.)
- \code component.createObject(parent, {"x": 100, "y": 100, "specialProperty": someObject}); \endcode
+ The \a properties argument is specified as a map of property-value items. For example, the code
+ below creates an object with initial \c x and \c y values of 100 and 200, respectively:
+
+ \qml
+ var component = Qt.createComponent("Button.qml");
+ if (component.status == Component.Ready)
+ component.createObject(parent, {"x": 100, "y": 100});
+ \endqml
Dynamically created instances can be deleted with the \c destroy() method.
See \l {Dynamic Object Management in QML} for more information.
@@ -870,7 +880,6 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon
state->bindValues = enginePriv->bindValues;
state->parserStatus = enginePriv->parserStatus;
- state->finalizedParserStatus = enginePriv->finalizedParserStatus;
state->componentAttached = enginePriv->componentAttached;
if (state->componentAttached)
state->componentAttached->prev = &state->componentAttached;
@@ -878,7 +887,6 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon
enginePriv->componentAttached = 0;
enginePriv->bindValues.clear();
enginePriv->parserStatus.clear();
- enginePriv->finalizedParserStatus.clear();
state->completePending = true;
enginePriv->inProgressCreations++;
}
@@ -909,7 +917,6 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi
state->bindValues = enginePriv->bindValues;
state->parserStatus = enginePriv->parserStatus;
- state->finalizedParserStatus = enginePriv->finalizedParserStatus;
state->componentAttached = enginePriv->componentAttached;
if (state->componentAttached)
state->componentAttached->prev = &state->componentAttached;
@@ -917,7 +924,6 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi
enginePriv->componentAttached = 0;
enginePriv->bindValues.clear();
enginePriv->parserStatus.clear();
- enginePriv->finalizedParserStatus.clear();
state->completePending = true;
enginePriv->inProgressCreations++;
}
@@ -955,14 +961,17 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
QDeclarativeEnginePrivate::clear(ps);
}
- for (int ii = 0; ii < state->finalizedParserStatus.count(); ++ii) {
- QPair<QDeclarativeGuard<QObject>, int> status = state->finalizedParserStatus.at(ii);
- QObject *obj = status.first;
- if (obj) {
- void *args[] = { 0 };
- QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
- status.second, args);
+ if (1 == enginePriv->inProgressCreations) {
+ for (int ii = 0; ii < enginePriv->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = enginePriv->finalizedParserStatus.at(ii);
+ QObject *obj = status.first;
+ if (obj) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
+ status.second, args);
+ }
}
+ enginePriv->finalizedParserStatus.clear();
}
while (state->componentAttached) {
@@ -977,7 +986,6 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
state->bindValues.clear();
state->parserStatus.clear();
- state->finalizedParserStatus.clear();
state->completePending = false;
enginePriv->inProgressCreations--;
@@ -987,7 +995,6 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
enginePriv->erroredBindings->removeError();
}
}
-
}
}
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
index f8bec2b..020c5e0 100644
--- a/src/declarative/qml/qdeclarativecomponent_p.h
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -101,7 +101,6 @@ public:
ConstructionState() : componentAttached(0), completePending(false) {}
QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> > bindValues;
QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> > parserStatus;
- QList<QPair<QDeclarativeGuard<QObject>, int> > finalizedParserStatus;
QDeclarativeComponentAttached *componentAttached;
QList<QDeclarativeError> errors;
bool completePending;
diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp
index 8dd6824..856108c 100644
--- a/src/declarative/qml/qdeclarativecustomparser.cpp
+++ b/src/declarative/qml/qdeclarativecustomparser.cpp
@@ -131,7 +131,7 @@ QDeclarativeCustomParserNodePrivate::fromProperty(QDeclarativeParser::Property *
prop.d->values << QVariant::fromValue(props.at(ii));
} else {
for(int ii = 0; ii < p->values.count(); ++ii) {
- Value *v = p->values.at(ii);
+ QDeclarativeParser::Value *v = p->values.at(ii);
v->type = QDeclarativeParser::Value::Literal;
if(v->object) {
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 8c7f3ad..31fd516 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -167,17 +167,19 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) const
{
int userType = value.userType();
- if (QDeclarativeValueTypeFactory::isValueType(userType))
- return value;
- /*
- if (QDeclarativeMetaType::isList(userType)) {
- int count = QDeclarativeMetaType::listCount(value);
+ if (value.type() == QVariant::List) {
QVariantList contents;
- for (int i=0; i<count; i++)
- contents << valueContents(QDeclarativeMetaType::listAt(value, i));
+ QVariantList list = value.toList();
+ int count = list.size();
+ for (int i = 0; i < count; i++)
+ contents << valueContents(list.at(i));
return contents;
- } else */
+ }
+
+ if (QDeclarativeValueTypeFactory::isValueType(userType))
+ return value;
+
if (QDeclarativeMetaType::isQObject(userType)) {
QObject *o = QDeclarativeMetaType::toQObject(value);
if (o) {
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 87183c4..7a1234d 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -457,6 +457,7 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
}
QString url = uri;
+ bool versionFound = false;
if (importType == QDeclarativeScriptParser::Import::Library) {
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
@@ -522,18 +523,18 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
}
}
- if (!found) {
- found = QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin);
- if (!found) {
- if (errorString) {
- bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
- if (anyversion)
- *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
- else
- *errorString = QDeclarativeImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg);
- }
- return false;
+ if (QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin))
+ versionFound = true;
+
+ if (!versionFound && qmldircomponents.isEmpty()) {
+ if (errorString) {
+ bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
+ if (anyversion)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
+ else
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg);
}
+ return false;
}
} else {
@@ -578,7 +579,7 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
url.chop(1);
}
- if (vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
+ if (!versionFound && vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin();
int lowest_maj = INT_MAX;
int lowest_min = INT_MAX;
@@ -952,7 +953,8 @@ void QDeclarativeImportDatabase::addPluginPath(const QString& path)
qDebug().nospace() << "QDeclarativeImportDatabase::addPluginPath: " << path;
QUrl url = QUrl(path);
- if (url.isRelative() || url.scheme() == QLatin1String("file")) {
+ if (url.isRelative() || url.scheme() == QLatin1String("file")
+ || (url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path
QDir dir = QDir(path);
filePluginPath.prepend(dir.canonicalPath());
} else {
@@ -974,7 +976,8 @@ void QDeclarativeImportDatabase::addImportPath(const QString& path)
QUrl url = QUrl(path);
QString cPath;
- if (url.isRelative() || url.scheme() == QLatin1String("file")) {
+ if (url.isRelative() || url.scheme() == QLatin1String("file")
+ || (url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path
QDir dir = QDir(path);
cPath = dir.canonicalPath();
} else {
diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp
index 9598d98..346fee5 100644
--- a/src/declarative/qml/qdeclarativelist.cpp
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -88,6 +88,7 @@ void QDeclarativeListReferencePrivate::release()
/*!
\class QDeclarativeListReference
\since 4.7
+\module QtDeclarative
\brief The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties.
QDeclarativeListReference allows C++ programs to read from, and assign values to a QML list property in a
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 2aa2059..dc3ecca 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -368,7 +368,7 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
newBinding = new QDeclarativeBinding(value, obj, evalContext);
newBinding->setSourceLocation(ctxtInfo.fileName(), ctxtInfo.functionStartLineNumber());
newBinding->setTarget(QDeclarativePropertyPrivate::restore(*lastData, valueTypeData, obj, evalContext));
- if (newBinding->expression().contains("this"))
+ if (newBinding->expression().contains(QLatin1String("this")))
newBinding->setEvaluateFlags(newBinding->evaluateFlags() | QDeclarativeBinding::RequiresThisObject);
}
diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp
index 35bb0f1..d5b9424 100644
--- a/src/declarative/qml/qdeclarativeparser.cpp
+++ b/src/declarative/qml/qdeclarativeparser.cpp
@@ -225,9 +225,9 @@ QDeclarativeParser::Property::~Property()
if (value) value->release();
}
-Object *QDeclarativeParser::Property::getValue(const LocationSpan &l)
+QDeclarativeParser::Object *QDeclarativeParser::Property::getValue(const LocationSpan &l)
{
- if (!value) { value = new Object; value->location = l; }
+ if (!value) { value = new QDeclarativeParser::Object; value->location = l; }
return value;
}
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index 61e3002..0dd0edb 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -427,7 +427,7 @@ bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const
*/
int QDeclarativeProperty::propertyType() const
{
- return d ? d->propertyType() : QVariant::Invalid;
+ return d ? d->propertyType() : int(QVariant::Invalid);
}
bool QDeclarativePropertyPrivate::isValueType() const
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 996920a..ad03e10 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -65,16 +65,16 @@ class ProcessAST: protected AST::Visitor
{
struct State {
State() : object(0), property(0) {}
- State(Object *o) : object(o), property(0) {}
- State(Object *o, Property *p) : object(o), property(p) {}
+ State(QDeclarativeParser::Object *o) : object(o), property(0) {}
+ State(QDeclarativeParser::Object *o, Property *p) : object(o), property(p) {}
- Object *object;
+ QDeclarativeParser::Object *object;
Property *property;
};
struct StateStack : public QStack<State>
{
- void pushObject(Object *obj)
+ void pushObject(QDeclarativeParser::Object *obj)
{
push(State(obj));
}
@@ -105,7 +105,7 @@ public:
protected:
- Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment,
+ QDeclarativeParser::Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment,
const QString &objectType,
AST::SourceLocation typeLocation,
LocationSpan location,
@@ -134,7 +134,7 @@ protected:
QString asString(AST::UiQualifiedId *node) const;
const State state() const;
- Object *currentObject() const;
+ QDeclarativeParser::Object *currentObject() const;
Property *currentProperty() const;
QString qualifiedNameId() const;
@@ -200,7 +200,7 @@ const ProcessAST::State ProcessAST::state() const
return _stateStack.back();
}
-Object *ProcessAST::currentObject() const
+QDeclarativeParser::Object *ProcessAST::currentObject() const
{
return state().object;
}
@@ -229,7 +229,7 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const
return s;
}
-Object *
+QDeclarativeParser::Object *
ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
bool onAssignment,
const QString &objectType,
@@ -286,7 +286,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
if (lastTypeDot >= 0)
resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/'));
- Object *obj = new Object;
+ QDeclarativeParser::Object *obj = new QDeclarativeParser::Object;
QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType);
obj->type = typeRef->id;
@@ -302,7 +302,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
if (propertyCount) {
Property *prop = currentProperty();
- Value *v = new Value;
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
v->object = obj;
v->location = obj->location;
if (onAssignment)
@@ -319,7 +319,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
_parser->setTree(obj);
} else {
const State state = _stateStack.top();
- Value *v = new Value;
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
v->object = obj;
v->location = obj->location;
if (state.property) {
@@ -594,7 +594,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
property.defaultValue->location =
location(node->expression->firstSourceLocation(),
node->expression->lastSourceLocation());
- Value *value = new Value;
+ QDeclarativeParser::Value *value = new QDeclarativeParser::Value;
value->location = location(node->expression->firstSourceLocation(),
node->expression->lastSourceLocation());
value->value = getVariant(node->expression);
@@ -698,7 +698,7 @@ bool ProcessAST::visit(AST::UiScriptBinding *node)
prop->location.range.length = prop->location.range.offset + prop->location.range.length - node->qualifiedId->identifierToken.offset;
prop->location.range.offset = node->qualifiedId->identifierToken.offset;
- Value *v = new Value;
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
v->value = primitive;
v->location = location(node->statement->firstSourceLocation(),
node->statement->lastSourceLocation());
@@ -776,7 +776,10 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
f = f->finish();
}
- QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken);
+ AST::SourceLocation loc = funDecl->rparenToken;
+ loc.offset = loc.end();
+ loc.startColumn += 1;
+ QString body = textAt(loc, funDecl->rbraceToken);
slot.name = funDecl->name->asString().toUtf8();
slot.body = body;
obj->dynamicSlots << slot;
@@ -870,7 +873,7 @@ QList<QDeclarativeScriptParser::TypeReference*> QDeclarativeScriptParser::refere
return _refTypes;
}
-Object *QDeclarativeScriptParser::tree() const
+QDeclarativeParser::Object *QDeclarativeScriptParser::tree() const
{
return root;
}
@@ -1193,7 +1196,7 @@ QDeclarativeScriptParser::TypeReference *QDeclarativeScriptParser::findOrCreateT
return type;
}
-void QDeclarativeScriptParser::setTree(Object *tree)
+void QDeclarativeScriptParser::setTree(QDeclarativeParser::Object *tree)
{
Q_ASSERT(! root);
diff --git a/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
index 200cc1c..4c312b5 100644
--- a/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
@@ -184,7 +184,7 @@ void QDeclarativeValueTypeScriptClass::setProperty(Object *obj, const Identifier
newBinding->setSourceLocation(ctxtInfo.fileName(), ctxtInfo.functionStartLineNumber());
QDeclarativeProperty prop = QDeclarativePropertyPrivate::restore(cacheData, valueTypeData, ref->object, ctxt);
newBinding->setTarget(prop);
- if (newBinding->expression().contains("this"))
+ if (newBinding->expression().contains(QLatin1String("this")))
newBinding->setEvaluateFlags(newBinding->evaluateFlags() | QDeclarativeBinding::RequiresThisObject);
}
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 366c64b..2d551f2 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -938,7 +938,6 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
QDeclarativeEnginePrivate::clear(bindValues);
QDeclarativeEnginePrivate::clear(parserStatus);
- ep->finalizedParserStatus.clear();
return 0;
}
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 6cd99e2..2e8ab18 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -43,6 +43,7 @@
#include "private/qdeclarativelistmodel_p.h"
#include "private/qdeclarativelistmodelworkeragent_p.h"
#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeexpression_p.h"
#include <QtCore/qcoreevent.h>
#include <QtCore/qcoreapplication.h>
@@ -104,6 +105,19 @@ private:
int m_id;
};
+class WorkerErrorEvent : public QEvent
+{
+public:
+ enum Type { WorkerError = WorkerRemoveEvent::WorkerRemove + 1 };
+
+ WorkerErrorEvent(const QDeclarativeError &error);
+
+ QDeclarativeError error() const;
+
+private:
+ QDeclarativeError m_error;
+};
+
class QDeclarativeWorkerScriptEnginePrivate : public QObject
{
Q_OBJECT
@@ -146,6 +160,7 @@ public:
WorkerScript();
int id;
+ QUrl source;
bool initialized;
QDeclarativeWorkerScript *owner;
QScriptValue object;
@@ -173,6 +188,7 @@ protected:
private:
void processMessage(int, const QVariant &);
void processLoad(int, const QUrl &);
+ void reportScriptException(WorkerScript *);
};
QDeclarativeWorkerScriptEnginePrivate::QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *engine)
@@ -273,6 +289,11 @@ void QDeclarativeWorkerScriptEnginePrivate::processMessage(int id, const QVarian
args.setProperty(0, variantToScriptValue(data, workerEngine));
script->callback.call(script->object, args);
+
+ if (workerEngine->hasUncaughtException()) {
+ reportScriptException(script);
+ workerEngine->clearExceptions();
+ }
}
}
@@ -286,7 +307,7 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
QFile f(fileName);
if (f.open(QIODevice::ReadOnly)) {
QByteArray data = f.readAll();
- QString script = QString::fromUtf8(data);
+ QString sourceCode = QString::fromUtf8(data);
QScriptValue activation = getWorker(id);
@@ -296,10 +317,19 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
ctxt->pushScope(urlContext);
ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
- QDeclarativeScriptParser::extractPragmas(script);
+ QDeclarativeScriptParser::extractPragmas(sourceCode);
workerEngine->baseUrl = url;
- workerEngine->evaluate(script);
+ workerEngine->evaluate(sourceCode);
+
+ WorkerScript *script = workers.value(id);
+ if (script) {
+ script->source = url;
+ if (workerEngine->hasUncaughtException()) {
+ reportScriptException(script);
+ workerEngine->clearExceptions();
+ }
+ }
workerEngine->popContext();
} else {
@@ -307,6 +337,22 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
}
}
+void QDeclarativeWorkerScriptEnginePrivate::reportScriptException(WorkerScript *script)
+{
+ if (!script || !workerEngine->hasUncaughtException())
+ return;
+
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(workerEngine, error);
+ error.setUrl(script->source);
+
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(workerEngine);
+
+ QMutexLocker(&p->m_lock);
+ if (script->owner)
+ QCoreApplication::postEvent(script->owner, new WorkerErrorEvent(error));
+}
+
QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &value)
{
if (value.isBool()) {
@@ -453,6 +499,16 @@ int WorkerRemoveEvent::workerId() const
return m_id;
}
+WorkerErrorEvent::WorkerErrorEvent(const QDeclarativeError &error)
+: QEvent((QEvent::Type)WorkerError), m_error(error)
+{
+}
+
+QDeclarativeError WorkerErrorEvent::error() const
+{
+ return m_error;
+}
+
QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent)
: QThread(parent), d(new QDeclarativeWorkerScriptEnginePrivate(parent))
{
@@ -682,6 +738,10 @@ bool QDeclarativeWorkerScript::event(QEvent *event)
emit message(value);
}
return true;
+ } else if (event->type() == (QEvent::Type)WorkerErrorEvent::WorkerError) {
+ WorkerErrorEvent *workerEvent = static_cast<WorkerErrorEvent *>(event);
+ QDeclarativeEnginePrivate::warning(qmlEngine(this), workerEvent->error());
+ return true;
} else {
return QObject::event(event);
}
diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp
index 1d7ca80..3b1e09b 100644
--- a/src/declarative/qml/qperformancetimer.cpp
+++ b/src/declarative/qml/qperformancetimer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/qml/qperformancetimer_p.h b/src/declarative/qml/qperformancetimer_p.h
index 14310bf..2787921 100644
--- a/src/declarative/qml/qperformancetimer_p.h
+++ b/src/declarative/qml/qperformancetimer_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index eaf0cfa..dc6d524 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -182,12 +182,11 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
{
Q_D(QDeclarativeAbstractAnimation);
if (!d->componentComplete) {
- if (d->running && r == d->running) //don't re-register
- return;
d->running = r;
if (r == false)
d->avoidPropertyValueSourceStart = true;
- else {
+ else if (!d->registered) {
+ d->registered = true;
QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
}
@@ -204,6 +203,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
d->running = r;
if (d->running) {
+ bool supressStart = false;
if (d->alwaysRunToEnd && d->loopCount != 1
&& qtAnimation()->state() == QAbstractAnimation::Running) {
//we've restarted before the final loop finished; restore proper loop count
@@ -211,6 +211,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
qtAnimation()->setLoopCount(d->loopCount);
else
qtAnimation()->setLoopCount(qtAnimation()->currentLoop() + d->loopCount);
+ supressStart = true; //we want the animation to continue, rather than restart
}
if (!d->connectedTimeLine) {
@@ -218,7 +219,8 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
this, SLOT(timelineComplete()));
d->connectedTimeLine = true;
}
- d->commence();
+ if (!supressStart)
+ d->commence();
emit started();
} else {
if (d->alwaysRunToEnd) {
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
index 15bda3c..048ecb1 100644
--- a/src/declarative/util/qdeclarativeanimation_p_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -210,7 +210,7 @@ public:
: running(false), paused(false), alwaysRunToEnd(false),
connectedTimeLine(false), componentComplete(true),
avoidPropertyValueSourceStart(false), disableUserControl(false),
- loopCount(1), group(0) {}
+ registered(false), loopCount(1), group(0) {}
bool running:1;
bool paused:1;
@@ -219,6 +219,7 @@ public:
bool componentComplete:1;
bool avoidPropertyValueSourceStart:1;
bool disableUserControl:1;
+ bool registered:1;
int loopCount;
diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp
index e0f6df2..3e66e14 100644
--- a/src/declarative/util/qdeclarativeapplication.cpp
+++ b/src/declarative/util/qdeclarativeapplication.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/util/qdeclarativeapplication_p.h b/src/declarative/util/qdeclarativeapplication_p.h
index caaed18..f59a5fb 100644
--- a/src/declarative/util/qdeclarativeapplication_p.h
+++ b/src/declarative/util/qdeclarativeapplication_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
index 0ceda35..8a8d05e 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject.cpp
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -289,17 +289,19 @@ void QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant
int id = -1;
if (iter == d->type->d->names.end()) {
- id = d->type->createProperty(name.constData()) - d->type->d->propertyOffset;
+ id = createProperty(name.constData(), "") - d->type->d->propertyOffset;
} else {
id = *iter;
}
- QVariant &dataVal = d->getData(id);
- if (dataVal == val)
- return;
+ if (id >= 0) {
+ QVariant &dataVal = d->getData(id);
+ if (dataVal == val)
+ return;
- dataVal = val;
- activate(d->object, id + d->type->d->signalOffset, 0);
+ dataVal = val;
+ activate(d->object, id + d->type->d->signalOffset, 0);
+ }
}
// returns true if this value has been initialized by a call to either value() or setValue()
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index ccd122e..9bcb263 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -281,7 +281,7 @@ QDeclarativePropertyChangesParser::compile(const QList<QDeclarativeCustomParserP
QDeclarativeParser::Variant v = qvariant_cast<QDeclarativeParser::Variant>(data.at(ii).second);
QVariant var;
bool isScript = v.isScript();
- QDeclarativeBinding::Identifier id;
+ QDeclarativeBinding::Identifier id = 0;
switch(v.type()) {
case QDeclarativeParser::Variant::Boolean:
var = QVariant(v.asBoolean());
diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp
index 1a3e0be..915f027 100644
--- a/src/declarative/util/qdeclarativepropertymap.cpp
+++ b/src/declarative/util/qdeclarativepropertymap.cpp
@@ -182,7 +182,18 @@ QVariant QDeclarativePropertyMap::value(const QString &key) const
void QDeclarativePropertyMap::insert(const QString &key, const QVariant &value)
{
Q_D(QDeclarativePropertyMap);
- d->mo->setValue(key.toUtf8(), value);
+ //The following strings shouldn't be used as property names
+ if (key != QLatin1String("keys")
+ && key != QLatin1String("valueChanged")
+ && key != QLatin1String("QObject")
+ && key != QLatin1String("destroyed")
+ && key != QLatin1String("deleteLater")) {
+ d->mo->setValue(key.toUtf8(), value);
+ } else {
+ qWarning() << "Creating property with name"
+ << key
+ << "is not permitted, conflicts with internal symbols.";
+ }
}
/*!
@@ -258,7 +269,7 @@ QVariant &QDeclarativePropertyMap::operator[](const QString &key)
Q_D(QDeclarativePropertyMap);
QByteArray utf8key = key.toUtf8();
if (!d->keys.contains(key))
- d->mo->setValue(utf8key, QVariant()); //force creation -- needed below
+ insert(key, QVariant());//force creation -- needed below
return (*(d->mo))[utf8key];
}
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index ec2b083..1212a1c 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -236,7 +236,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
/*!
\qmlclass SpringAnimation QDeclarativeSpringAnimation
\ingroup qml-animation-transition
- \inherits Animation
+ \inherits NumberAnimation
\since 4.7
\brief The SpringAnimation element allows a property to track a value in a spring-like motion.
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index d691f94..d5c7d1b 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -46,11 +46,9 @@
#include <QDebug>
#include <QStringList>
-#include <QQueue>
+#include <QMap>
#include <QApplication>
#include <QThread>
-#include <QMutex>
-#include <QWaitCondition>
#include <QXmlQuery>
#include <QXmlResultItems>
#include <QXmlNodeModelIndex>
@@ -58,6 +56,7 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QTimer>
+#include <QMutex>
#include <private/qobject_p.h>
@@ -147,39 +146,32 @@ struct XmlQueryJob
QStringList keyRoleResultsCache;
};
-class QDeclarativeXmlQuery : public QThread
+class QDeclarativeXmlQuery : public QObject
{
Q_OBJECT
public:
QDeclarativeXmlQuery(QObject *parent=0)
- : QThread(parent), m_quit(false), m_abortQueryId(-1), m_queryIds(XMLLISTMODEL_CLEAR_ID + 1) {
+ : QObject(parent), m_queryIds(XMLLISTMODEL_CLEAR_ID + 1) {
qRegisterMetaType<QDeclarativeXmlQueryResult>("QDeclarativeXmlQueryResult");
- m_currentJob.queryId = -1;
+ moveToThread(&m_thread);
+ m_thread.start(QThread::IdlePriority);
}
~QDeclarativeXmlQuery() {
- m_mutex.lock();
- m_quit = true;
- m_condition.wakeOne();
- m_mutex.unlock();
-
- wait();
+ if(m_thread.isRunning()) {
+ m_thread.quit();
+ m_thread.wait();
+ }
}
void abort(int id) {
- QMutexLocker locker(&m_mutex);
- QQueue<XmlQueryJob>::iterator it;
- for (it = m_jobs.begin(); it != m_jobs.end(); ++it) {
- if ((*it).queryId == id) {
- m_jobs.erase(it);
- return;
- }
+ QMutexLocker ml(&m_mutex);
+ if (id != -1) {
+ m_jobs.remove(id);
}
- m_abortQueryId = id;
}
- int doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *> *roleObjects, QStringList keyRoleResultsCache) {
- QMutexLocker locker(&m_mutex);
+ int doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) {
XmlQueryJob job;
job.queryId = m_queryIds;
@@ -198,69 +190,69 @@ public:
if (roleObjects->at(i)->isKey())
job.keyRoleQueries << job.roleQueries.last();
}
- m_jobs.enqueue(job);
- m_queryIds++;
- if (!isRunning())
- start(QThread::IdlePriority);
- else
- m_condition.wakeOne();
+ {
+ QMutexLocker ml(&m_mutex);
+ m_jobs.insert(m_queryIds, job);
+ m_queryIds++;
+ if (m_queryIds <= 0)
+ m_queryIds = 1;
+ }
+
+ QMetaObject::invokeMethod(this, "processQuery", Qt::QueuedConnection, Q_ARG(int, job.queryId));
return job.queryId;
}
+private slots:
+ void processQuery(int queryId) {
+ XmlQueryJob job;
+
+ {
+ QMutexLocker ml(&m_mutex);
+ if (!m_jobs.contains(queryId))
+ return;
+ job = m_jobs.value(queryId);
+ }
+
+ QDeclarativeXmlQueryResult r;
+ doQueryJob(&job);
+ doSubQueryJob(&job);
+ r.queryId = job.queryId;
+ r.size = m_size;
+ r.data = m_modelData;
+ r.inserted = m_insertedItemRanges;
+ r.removed = m_removedItemRanges;
+ r.keyRoleResultsCache = job.keyRoleResultsCache;
+
+ {
+ QMutexLocker ml(&m_mutex);
+ if (m_jobs.contains(queryId)) {
+ emit queryCompleted(r);
+ m_jobs.remove(queryId);
+ }
+ }
+ }
+
Q_SIGNALS:
void queryCompleted(const QDeclarativeXmlQueryResult &);
void error(void*, const QString&);
protected:
- void run() {
- m_mutex.lock();
-
- while (!m_quit) {
- if (!m_jobs.isEmpty())
- m_currentJob = m_jobs.dequeue();
- m_mutex.unlock();
-
- QDeclarativeXmlQueryResult r;
- if (m_currentJob.queryId != -1) {
- doQueryJob();
- doSubQueryJob();
- r.queryId = m_currentJob.queryId;
- r.size = m_size;
- r.data = m_modelData;
- r.inserted = m_insertedItemRanges;
- r.removed = m_removedItemRanges;
- r.keyRoleResultsCache = m_currentJob.keyRoleResultsCache;
- }
- m_mutex.lock();
- if (m_currentJob.queryId != -1 && m_abortQueryId != m_currentJob.queryId)
- emit queryCompleted(r);
- if (m_jobs.isEmpty() && !m_quit)
- m_condition.wait(&m_mutex);
- m_currentJob.queryId = -1;
- m_abortQueryId = -1;
- }
-
- m_mutex.unlock();
- }
private:
- void doQueryJob();
- void doSubQueryJob();
- void getValuesOfKeyRoles(QStringList *values, QXmlQuery *query) const;
+ void doQueryJob(XmlQueryJob* job);
+ void doSubQueryJob(XmlQueryJob* job);
+ void getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const;
void addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const;
private:
QMutex m_mutex;
- QWaitCondition m_condition;
- QQueue<XmlQueryJob> m_jobs;
- XmlQueryJob m_currentJob;
- bool m_quit;
- int m_abortQueryId;
+ QThread m_thread;
+ QMap<int, XmlQueryJob> m_jobs;
+ int m_queryIds;
QString m_prefix;
int m_size;
- int m_queryIds;
QList<QList<QVariant> > m_modelData;
QList<QDeclarativeXmlListRange> m_insertedItemRanges;
QList<QDeclarativeXmlListRange> m_removedItemRanges;
@@ -268,16 +260,16 @@ private:
Q_GLOBAL_STATIC(QDeclarativeXmlQuery, globalXmlQuery)
-void QDeclarativeXmlQuery::doQueryJob()
+void QDeclarativeXmlQuery::doQueryJob(XmlQueryJob* currentJob)
{
- Q_ASSERT(m_currentJob.queryId != -1);
+ Q_ASSERT(currentJob->queryId != -1);
QString r;
QXmlQuery query;
- QBuffer buffer(&m_currentJob.data);
+ QBuffer buffer(&currentJob->data);
buffer.open(QIODevice::ReadOnly);
query.bindVariable(QLatin1String("src"), &buffer);
- query.setQuery(m_currentJob.namespaces + m_currentJob.query);
+ query.setQuery(currentJob->namespaces + currentJob->query);
query.evaluateTo(&r);
//always need a single root element
@@ -285,9 +277,9 @@ void QDeclarativeXmlQuery::doQueryJob()
QBuffer b(&xml);
b.open(QIODevice::ReadOnly);
- QString namespaces = QLatin1String("declare namespace dummy=\"http://qtsotware.com/dummy\";\n") + m_currentJob.namespaces;
+ QString namespaces = QLatin1String("declare namespace dummy=\"http://qtsotware.com/dummy\";\n") + currentJob->namespaces;
QString prefix = QLatin1String("doc($inputDocument)/dummy:items") +
- m_currentJob.query.mid(m_currentJob.query.lastIndexOf(QLatin1Char('/')));
+ currentJob->query.mid(currentJob->query.lastIndexOf(QLatin1Char('/')));
//figure out how many items we are dealing with
int count = -1;
@@ -302,18 +294,16 @@ void QDeclarativeXmlQuery::doQueryJob()
count = item.toAtomicValue().toInt();
}
- m_currentJob.data = xml;
+ currentJob->data = xml;
m_prefix = namespaces + prefix + QLatin1Char('/');
m_size = 0;
if (count > 0)
m_size = count;
}
-void QDeclarativeXmlQuery::getValuesOfKeyRoles(QStringList *values, QXmlQuery *query) const
+void QDeclarativeXmlQuery::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const
{
- Q_ASSERT(m_currentJob.queryId != -1);
-
- const QStringList &keysQueries = m_currentJob.keyRoleQueries;
+ const QStringList &keysQueries = currentJob.keyRoleQueries;
QString keysQuery;
if (keysQueries.count() == 1)
keysQuery = m_prefix + keysQueries[0];
@@ -341,34 +331,34 @@ void QDeclarativeXmlQuery::addIndexToRangeList(QList<QDeclarativeXmlListRange> *
ranges->append(qMakePair(index, 1));
}
-void QDeclarativeXmlQuery::doSubQueryJob()
+void QDeclarativeXmlQuery::doSubQueryJob(XmlQueryJob* currentJob)
{
- Q_ASSERT(m_currentJob.queryId != -1);
+ Q_ASSERT(currentJob->queryId != -1);
m_modelData.clear();
- QBuffer b(&m_currentJob.data);
+ QBuffer b(&currentJob->data);
b.open(QIODevice::ReadOnly);
QXmlQuery subquery;
subquery.bindVariable(QLatin1String("inputDocument"), &b);
QStringList keyRoleResults;
- getValuesOfKeyRoles(&keyRoleResults, &subquery);
+ getValuesOfKeyRoles(*currentJob, &keyRoleResults, &subquery);
// See if any values of key roles have been inserted or removed.
m_insertedItemRanges.clear();
m_removedItemRanges.clear();
- if (m_currentJob.keyRoleResultsCache.isEmpty()) {
+ if (currentJob->keyRoleResultsCache.isEmpty()) {
m_insertedItemRanges << qMakePair(0, m_size);
} else {
- if (keyRoleResults != m_currentJob.keyRoleResultsCache) {
+ if (keyRoleResults != currentJob->keyRoleResultsCache) {
QStringList temp;
- for (int i=0; i<m_currentJob.keyRoleResultsCache.count(); i++) {
- if (!keyRoleResults.contains(m_currentJob.keyRoleResultsCache[i]))
+ for (int i=0; i<currentJob->keyRoleResultsCache.count(); i++) {
+ if (!keyRoleResults.contains(currentJob->keyRoleResultsCache[i]))
addIndexToRangeList(&m_removedItemRanges, i);
else
- temp << m_currentJob.keyRoleResultsCache[i];
+ temp << currentJob->keyRoleResultsCache[i];
}
for (int i=0; i<keyRoleResults.count(); i++) {
@@ -379,11 +369,11 @@ void QDeclarativeXmlQuery::doSubQueryJob()
}
}
}
- m_currentJob.keyRoleResultsCache = keyRoleResults;
+ currentJob->keyRoleResultsCache = keyRoleResults;
// Get the new values for each role.
//### we might be able to condense even further (query for everything in one go)
- const QStringList &queries = m_currentJob.roleQueries;
+ const QStringList &queries = currentJob->roleQueries;
for (int i = 0; i < queries.size(); ++i) {
QList<QVariant> resultList;
if (!queries[i].isEmpty()) {
@@ -397,7 +387,7 @@ void QDeclarativeXmlQuery::doSubQueryJob()
item = resultItems.next();
}
} else {
- emit error(m_currentJob.roleQueryErrorId.at(i), queries[i]);
+ emit error(currentJob->roleQueryErrorId.at(i), queries[i]);
}
}
//### should warn here if things have gone wrong.
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 0c1304f..897a916 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -2996,6 +2996,7 @@ void QFileDialogPrivate::_q_useNameFilter(int index)
const int fileNameExtensionLength = fileNameExtension.count();
fileName.replace(fileName.count() - fileNameExtensionLength,
fileNameExtensionLength, newNameFilterExtension);
+ qFileDialogUi->listView->clearSelection();
lineEdit()->setText(fileName);
}
}
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 12e77b1..b36b21e 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -78,11 +78,11 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
#endif
m_resolveSymlinks(false), m_iconProvider(&defaultProvider)
{
-#ifndef Q_OS_WIN
+#ifdef Q_OS_WIN
+ m_resolveSymlinks = true;
+#elif !defined(Q_OS_INTEGRITY)
userId = getuid();
groupId = getgid();
-#else
- m_resolveSymlinks = true;
#endif
#ifndef QT_NO_FILESYSTEMWATCHER
watcher = new QFileSystemWatcher(this);
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index dd27aff..cb8eb6a 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1458,7 +1458,6 @@ void QFileSystemModel::setIconProvider(QFileIconProvider *provider)
{
Q_D(QFileSystemModel);
d->fileInfoGatherer.setIconProvider(provider);
- QApplication::processEvents();
d->root.updateIcon(provider, QString());
}
diff --git a/src/gui/embedded/embedded.pri b/src/gui/embedded/embedded.pri
index eb13d8d..31f0bc6 100644
--- a/src/gui/embedded/embedded.pri
+++ b/src/gui/embedded/embedded.pri
@@ -120,6 +120,12 @@ embedded {
LIBS += -lgf
}
+ contains( gfx-drivers, integrityfb ) {
+ HEADERS += embedded/qscreenintegrityfb_qws.h
+ SOURCES += embedded/qscreenintegrityfb_qws.cpp
+ LIBS += -lfbdev
+ }
+
contains( gfx-drivers, qvfb ) {
HEADERS += embedded/qscreenvfb_qws.h
SOURCES += embedded/qscreenvfb_qws.cpp
@@ -174,6 +180,11 @@ embedded {
SOURCES += embedded/qkbdqnx_qws.cpp
}
+ contains( kbd-drivers, integrity ) {
+ HEADERS += embedded/qkbdintegrity_qws.h
+ SOURCES += embedded/qkbdintegrity_qws.cpp
+ }
+
#
# Mouse drivers
#
@@ -207,4 +218,9 @@ embedded {
HEADERS += embedded/qmouseqnx_qws.h
SOURCES += embedded/qmouseqnx_qws.cpp
}
+
+ contains( mouse-drivers, integrity ) {
+ HEADERS += embedded/qmouseintegrity_qws.h
+ SOURCES += embedded/qmouseintegrity_qws.cpp
+ }
}
diff --git a/src/gui/embedded/qkbddriverfactory_qws.cpp b/src/gui/embedded/qkbddriverfactory_qws.cpp
index 661b073..45825e5 100644
--- a/src/gui/embedded/qkbddriverfactory_qws.cpp
+++ b/src/gui/embedded/qkbddriverfactory_qws.cpp
@@ -49,6 +49,7 @@
#include "qkbdum_qws.h"
#include "qkbdvfb_qws.h"
#include "qkbdqnx_qws.h"
+#include "qkbdintegrity_qws.h"
#include <stdlib.h>
#include "private/qfactoryloader_p.h"
#include "qkbddriverplugin_qws.h"
@@ -106,6 +107,10 @@ QWSKeyboardHandler *QKbdDriverFactory::create(const QString& key, const QString&
if (driver == QLatin1String("qnx") || driver.isEmpty())
return new QWSQnxKeyboardHandler(device);
#endif
+#if defined(Q_OS_INTEGRITY)
+ if (driver == QLatin1String("integrity") || driver.isEmpty())
+ return new QWSIntKeyboardHandler(device);
+#endif
#ifndef QT_NO_QWS_KEYBOARD
# ifndef QT_NO_QWS_KBD_TTY
if (driver == QLatin1String("tty") || driver.isEmpty())
@@ -151,6 +156,9 @@ QStringList QKbdDriverFactory::keys()
#if defined(Q_OS_QNX) && !defined(QT_NO_QWS_KBD_QNX)
list << QLatin1String("QNX");
#endif
+#if defined(Q_OS_INTEGRITY) && !defined(QT_NO_QWS_KBD_INTEGRITY)
+ list << QLatin1String("INTEGRITY");
+#endif
#ifndef QT_NO_QWS_KBD_TTY
list << QLatin1String("TTY");
#endif
diff --git a/src/gui/embedded/qkbdintegrity_qws.cpp b/src/gui/embedded/qkbdintegrity_qws.cpp
new file mode 100644
index 0000000..b2df422
--- /dev/null
+++ b/src/gui/embedded/qkbdintegrity_qws.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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$
+**
+****************************************************************************/
+
+#if !defined(QT_NO_QWS_KEYBOARD) && !defined(QT_NO_QWS_KBD_INTEGRITY)
+
+#include "qkbdintegrity_qws.h"
+#include <qwindowsystem_qws.h>
+#include <qapplication.h>
+#include <qtimer.h>
+#include <qthread.h>
+
+#include <INTEGRITY.h>
+
+
+//===========================================================================
+
+QT_BEGIN_NAMESPACE
+
+//
+// INTEGRITY keyboard
+//
+
+class QIntKeyboardListenThread;
+
+class QWSIntKbPrivate : public QObject
+{
+ Q_OBJECT
+ friend class QIntKeyboardListenThread;
+public:
+ QWSIntKbPrivate(QWSKeyboardHandler *, const QString &device);
+ ~QWSIntKbPrivate();
+ void dataReady(int amount) { emit kbdDataAvailable(amount); }
+ uint8_t scancodebuf[32 /* USB_SCANCODE_BUF_LEN */ ];
+ uint8_t rxpost;
+ uint8_t rxack;
+
+Q_SIGNALS:
+ void kbdDataAvailable(int amount);
+
+private Q_SLOTS:
+ void readKeyboardData(int amount);
+
+private:
+ QWSKeyboardHandler *handler;
+ QIntKeyboardListenThread *kbdthread;
+};
+class QIntKeyboardListenThread : public QThread
+{
+protected:
+ QWSIntKbPrivate *imp;
+ bool loop;
+public:
+ QIntKeyboardListenThread(QWSIntKbPrivate *im) : QThread(), imp(im) {};
+ ~QIntKeyboardListenThread() {};
+ void run();
+ void stoploop() { loop = false; };
+};
+
+
+QWSIntKeyboardHandler::QWSIntKeyboardHandler(const QString &device)
+ : QWSKeyboardHandler(device)
+{
+ d = new QWSIntKbPrivate(this, device);
+}
+
+QWSIntKeyboardHandler::~QWSIntKeyboardHandler()
+{
+ delete d;
+}
+
+//void QWSIntKeyboardHandler::processKeyEvent(int keycode, bool isPress,
+// bool autoRepeat)
+//{
+// QWSKeyboardHandler::processKeyEvent(keycode, isPress, autoRepeat);
+//}
+
+void QIntKeyboardListenThread::run(void)
+{
+ Error E;
+ Buffer b;
+ Connection kbdc;
+ bool waitforresource = true;
+ do {
+ E = RequestResource((Object*)&kbdc,
+ "USBKeyboardClient", "!systempassword");
+ if (E == Success) {
+ loop = false;
+ } else {
+ E = RequestResource((Object*)&kbdc,
+ "KeyboardClient", "!systempassword");
+ if (E == Success) {
+ waitforresource = false;
+ }
+ }
+ if (waitforresource)
+ ::sleep(1);
+ } while (loop && waitforresource);
+ if (!loop)
+ return;
+ b.BufferType = DataBuffer | LastBuffer;
+ b.Length = sizeof(imp->scancodebuf);
+ b.TheAddress = (Address)imp->scancodebuf;
+ do {
+ b.Transferred = 0;
+ b.TheAddress = (Address)imp->scancodebuf + imp->rxpost;
+ CheckSuccess(SynchronousReceive(kbdc, &b));
+ imp->rxpost += b.Transferred;
+ if (imp->rxpost >= 32 /* USB_SCANCODE_BUF_LEN */)
+ imp->rxpost = 0;
+ if (imp->rxpost == (imp->rxack + b.Transferred) % 32 /* USB_SCANCODE_BUF_LEN */) {
+ imp->kbdDataAvailable(b.Transferred);
+ }
+ } while (loop);
+}
+
+void QWSIntKbPrivate::readKeyboardData(int amount)
+{
+ uint16_t keycode;
+ do {
+ if (scancodebuf[rxack] == 0xe0) {
+ keycode = scancodebuf[rxack] << 8;
+ rxack++;
+ if (rxack >= 32 /* USB_SCANCODE_BUF_LEN */)
+ rxack = 0;
+ } else {
+ keycode = 0;
+ }
+
+ handler->processKeycode(keycode + (scancodebuf[rxack] & 0x7f),
+ (scancodebuf[rxack] & 0x80) == 0,
+ scancodebuf[rxack] == 2);
+ rxack++;
+ if (rxack >= 32 /* USB_SCANCODE_BUF_LEN */)
+ rxack = 0;
+ } while (rxack != rxpost);
+}
+
+QWSIntKbPrivate::QWSIntKbPrivate(QWSKeyboardHandler *h, const QString &device) : handler(h)
+{
+ connect(this, SIGNAL(kbdDataAvailable(int)), this, SLOT(readKeyboardData(int)));
+ this->handler = handler;
+ rxack = rxpost = 0;
+ kbdthread = new QIntKeyboardListenThread(this);
+ kbdthread->start();
+}
+
+QWSIntKbPrivate::~QWSIntKbPrivate()
+{
+ kbdthread->stoploop();
+ kbdthread->wait();
+ delete kbdthread;
+}
+
+
+QT_END_NAMESPACE
+
+#include "qkbdintegrity_qws.moc"
+
+#endif // QT_NO_QWS_KEYBOARD || QT_NO_QWS_KBD_TTY
diff --git a/src/gui/embedded/qkbdintegrity_qws.h b/src/gui/embedded/qkbdintegrity_qws.h
new file mode 100644
index 0000000..f9ae4e3
--- /dev/null
+++ b/src/gui/embedded/qkbdintegrity_qws.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QKBDINTEGRITY_QWS_H
+#define QKBDINTEGRITY_QWS_H
+
+#include <QtGui/qkbd_qws.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+#ifndef QT_NO_QWS_KEYBOARD
+
+#ifndef QT_NO_QWS_KBD_INTEGRITY
+
+class QSocketNotifier;
+class QWSIntKbPrivate;
+
+class QWSIntKeyboardHandler : public QWSKeyboardHandler
+{
+public:
+ explicit QWSIntKeyboardHandler(const QString&);
+ virtual ~QWSIntKeyboardHandler();
+
+//protected:
+// virtual void processKeyEvent(int keycode, bool isPress, bool autoRepeat);
+
+private:
+ QWSIntKbPrivate *d;
+};
+
+#endif // QT_NO_QWS_KBD_INTEGRITY
+
+#endif // QT_NO_QWS_KEYBOARD
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QKBDINTEGRITY_QWS_H
diff --git a/src/gui/embedded/qmousedriverfactory_qws.cpp b/src/gui/embedded/qmousedriverfactory_qws.cpp
index 81e6552..f67284d 100644
--- a/src/gui/embedded/qmousedriverfactory_qws.cpp
+++ b/src/gui/embedded/qmousedriverfactory_qws.cpp
@@ -48,6 +48,7 @@
#include "qmousevfb_qws.h"
#include "qmousetslib_qws.h"
#include "qmouseqnx_qws.h"
+#include "qmouseintegrity_qws.h"
#include <stdlib.h>
#include "private/qfactoryloader_p.h"
#include "qmousedriverplugin_qws.h"
@@ -107,6 +108,10 @@ QWSMouseHandler *QMouseDriverFactory::create(const QString& key, const QString &
if (driver == QLatin1String("qnx") || driver.isEmpty())
return new QQnxMouseHandler(key, device);
#endif
+#if defined(Q_OS_INTEGRITY) && !defined(QT_NO_MOUSE_INTEGRITY)
+ if (driver == QLatin1String("integrity") || driver.isEmpty())
+ return new QIntMouseHandler(key, device);
+#endif
#ifndef QT_NO_QWS_MOUSE_LINUXTP
if (driver == QLatin1String("linuxtp") || driver.isEmpty())
return new QWSLinuxTPMouseHandler(key, device);
@@ -157,6 +162,9 @@ QStringList QMouseDriverFactory::keys()
#if defined(Q_OS_QNX) && !defined(QT_NO_QWS_MOUSE_QNX)
list << QLatin1String("QNX");
#endif
+#if defined(Q_OS_INTEGRITY) && !defined(QT_NO_QWS_MOUSE_INTEGRITY)
+ list << QLatin1String("INTEGRITY");
+#endif
#ifndef QT_NO_QWS_MOUSE_LINUXTP
list << QLatin1String("LinuxTP");
#endif
diff --git a/src/gui/embedded/qmouseintegrity_qws.cpp b/src/gui/embedded/qmouseintegrity_qws.cpp
new file mode 100644
index 0000000..78a8c1b
--- /dev/null
+++ b/src/gui/embedded/qmouseintegrity_qws.cpp
@@ -0,0 +1,271 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QT_NO_QWS_MOUSE_INTEGRITY
+
+#include "qmouseintegrity_qws.h"
+#include <qwindowsystem_qws.h>
+#include <qapplication.h>
+#include <qtimer.h>
+#include <qthread.h>
+
+#include <INTEGRITY.h>
+
+
+typedef Address MOUSEHandler;
+typedef struct MOUSEMessageStruct
+{
+ Value x;
+ Value y;
+ Value z;
+ Value buttons;
+} MOUSEMessage;
+
+static Error MOUSE_Init(MOUSEHandler *handler, Boolean *isabsolute);
+static Error MOUSE_SynchronousGetPosition(MOUSEHandler handler, MOUSEMessage *msg,
+ Boolean absolute);
+static Error MOUSE_ShouldFilter(MOUSEHandler handler, Boolean *filter);
+
+QT_BEGIN_NAMESPACE
+
+class QIntMouseListenThread;
+
+class QIntMousePrivate : public QObject
+{
+ Q_OBJECT
+ friend class QIntMouseListenTaskThread;
+Q_SIGNALS:
+ void mouseDataAvailable(int x, int y, int buttons);
+public:
+ QIntMousePrivate(QIntMouseHandler *handler);
+ ~QIntMousePrivate();
+ void dataReady(int x, int y, int buttons) { emit mouseDataAvailable(x, y, buttons); }
+ bool calibrated;
+ bool waitforread;
+ bool suspended;
+ QIntMouseListenThread *mousethread;
+
+private:
+ QIntMouseHandler *handler;
+};
+
+class QIntMouseListenThread : public QThread
+{
+protected:
+ QIntMousePrivate *imp;
+ bool loop;
+public:
+ QIntMouseListenThread(QIntMousePrivate *im) : QThread(), imp(im) {};
+ ~QIntMouseListenThread() {};
+ void run();
+ void stoploop() { loop = false; };
+};
+
+
+QIntMouseHandler::QIntMouseHandler(const QString &driver, const QString &device)
+ : QObject(), QWSCalibratedMouseHandler(driver, device)
+{
+ QPoint test(1,1);
+ d = new QIntMousePrivate(this);
+ connect(d, SIGNAL(mouseDataAvailable(int, int, int)), this, SLOT(readMouseData(int, int, int)));
+
+ d->calibrated = (test != transform(test));
+
+ d->mousethread->start();
+}
+
+QIntMouseHandler::~QIntMouseHandler()
+{
+ disconnect(d, SIGNAL(mouseDataAvailable(int, int, int)), this, SLOT(readMouseData(int, int, int)));
+ delete d;
+}
+
+void QIntMouseHandler::resume()
+{
+ d->suspended = true;
+}
+
+void QIntMouseHandler::suspend()
+{
+ d->suspended = false;
+}
+
+void QIntMouseHandler::readMouseData(int x, int y, int buttons)
+{
+ d->waitforread = false;
+ if (d->suspended)
+ return;
+ if (d->calibrated) {
+ sendFiltered(QPoint(x, y), buttons);
+ } else {
+ QPoint pos;
+ pos = transform(QPoint(x, y));
+ limitToScreen(pos);
+ mouseChanged(pos, buttons, 0);
+ }
+}
+
+void QIntMouseHandler::clearCalibration()
+{
+ QWSCalibratedMouseHandler::clearCalibration();
+}
+
+void QIntMouseHandler::calibrate(const QWSPointerCalibrationData *data)
+{
+ QWSCalibratedMouseHandler::calibrate(data);
+}
+
+void QIntMouseListenThread::run(void)
+{
+ MOUSEHandler handler;
+ MOUSEMessage msg;
+ Boolean filter;
+ Boolean isabsolute;
+ loop = true;
+ CheckSuccess(MOUSE_Init(&handler, &isabsolute));
+ CheckSuccess(MOUSE_ShouldFilter(handler, &filter));
+ if (!filter)
+ imp->calibrated = false;
+ imp->waitforread = false;
+ do {
+ MOUSE_SynchronousGetPosition(handler, &msg, isabsolute);
+ imp->dataReady(msg.x, msg.y, msg.buttons);
+ } while (loop);
+ QThread::exit(0);
+}
+
+QIntMousePrivate::QIntMousePrivate(QIntMouseHandler *handler)
+ : QObject()
+{
+ this->handler = handler;
+ suspended = false;
+ mousethread = new QIntMouseListenThread(this);
+}
+
+QIntMousePrivate::~QIntMousePrivate()
+{
+ mousethread->stoploop();
+ mousethread->wait();
+ delete mousethread;
+}
+
+QT_END_NAMESPACE
+
+#include "qmouseintegrity_qws.moc"
+
+typedef struct USBMouseStruct
+{
+ Connection mouseconn;
+ Buffer mousemsg[2];
+ Value x;
+ Value y;
+} USBMouse;
+
+USBMouse mousedev;
+
+Error MOUSE_Init(MOUSEHandler *handler, Boolean *isabsolute)
+{
+ Error E;
+ bool loop = true;
+ memset((void*)&mousedev, 0, sizeof(USBMouse));
+ mousedev.mousemsg[0].BufferType = DataImmediate;
+ mousedev.mousemsg[1].BufferType = DataImmediate | LastBuffer;
+ do {
+ E = RequestResource((Object*)&mousedev.mouseconn,
+ "MouseClient", "!systempassword");
+ if (E == Success) {
+ *isabsolute = true;
+ loop = false;
+ } else {
+ E = RequestResource((Object*)&mousedev.mouseconn,
+ "USBMouseClient", "!systempassword");
+ if (E == Success) {
+ *isabsolute = false;
+ loop = false;
+ }
+ }
+ if (loop)
+ sleep(1);
+ } while (loop);
+ *handler = (MOUSEHandler)&mousedev;
+ return Success;
+}
+
+Error MOUSE_SynchronousGetPosition(MOUSEHandler handler, MOUSEMessage *msg,
+ Boolean isabsolute)
+{
+ signed long x;
+ signed long y;
+ USBMouse *mdev = (USBMouse *)handler;
+ mdev->mousemsg[0].Transferred = 0;
+ mdev->mousemsg[1].Transferred = 0;
+ SynchronousReceive(mdev->mouseconn, mdev->mousemsg);
+ if (isabsolute) {
+ x = (signed long)mdev->mousemsg[0].Length;
+ y = (signed long)mdev->mousemsg[1].TheAddress;
+ } else {
+ x = mdev->x + (signed long)mdev->mousemsg[0].Length;
+ y = mdev->y + (signed long)mdev->mousemsg[1].TheAddress;
+ }
+ if (x < 0)
+ mdev->x = 0;
+ else
+ mdev->x = x;
+ if (y < 0)
+ mdev->y = 0;
+ else
+ mdev->y = y;
+ msg->x = mdev->x;
+ msg->y = mdev->y;
+ msg->buttons = mdev->mousemsg[0].TheAddress;
+ return Success;
+}
+
+Error MOUSE_ShouldFilter(MOUSEHandler handler, Boolean *filter)
+{
+ if (filter == NULL)
+ return Failure;
+ *filter = false;
+ return Success;
+}
+
+#endif // QT_NO_QWS_MOUSE_INTEGRITY
+
diff --git a/src/gui/embedded/qmouseintegrity_qws.h b/src/gui/embedded/qmouseintegrity_qws.h
new file mode 100644
index 0000000..46d27a3
--- /dev/null
+++ b/src/gui/embedded/qmouseintegrity_qws.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QMOUSEINTEGRITY_QWS_H
+#define QMOUSEINTEGRITY_QWS_H
+
+#include <QtGui/qmouse_qws.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+#ifndef QT_NO_QWS_MOUSE_INTEGRITY
+
+class QSocketNotifier;
+class QIntMousePrivate;
+
+class QIntMouseHandler : public QObject, public QWSCalibratedMouseHandler {
+ Q_OBJECT
+public:
+ QIntMouseHandler(const QString &driver = QString(),
+ const QString &device = QString());
+ ~QIntMouseHandler();
+
+ void resume();
+ void suspend();
+
+ void calibrate(const QWSPointerCalibrationData *data);
+ void clearCalibration();
+
+private:
+ QIntMousePrivate *d;
+private Q_SLOTS:
+ void readMouseData(int x, int y, int buttons);
+};
+#endif // QT_NO_QWS_MOUSE_INTEGRITY
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QMOUSEINTEGRITY_QWS_H
diff --git a/src/gui/embedded/qscreen_qws.h b/src/gui/embedded/qscreen_qws.h
index d237dd8..17ffbbb 100644
--- a/src/gui/embedded/qscreen_qws.h
+++ b/src/gui/embedded/qscreen_qws.h
@@ -193,7 +193,7 @@ class Q_GUI_EXPORT QScreen {
public:
enum ClassId { LinuxFBClass, TransformedClass, VNCClass, MultiClass,
VFbClass, DirectFBClass, SvgalibClass, ProxyClass,
- GLClass, CustomClass = 1024 };
+ GLClass, IntfbClass, CustomClass = 1024 };
QScreen(int display_id, ClassId classId);
explicit QScreen(int display_id);
@@ -358,6 +358,7 @@ private:
friend class QLinuxFbScreen;
friend class QVFbScreen;
friend class QProxyScreen;
+ friend class QIntfbScreen;
#endif
friend void qt_solidFill_setup(QScreen*, const QColor&, const QRegion&);
friend void qt_blit_setup(QScreen *screen, const QImage &image,
diff --git a/src/gui/embedded/qscreendriverfactory_qws.cpp b/src/gui/embedded/qscreendriverfactory_qws.cpp
index c0ae214..ea194e5 100644
--- a/src/gui/embedded/qscreendriverfactory_qws.cpp
+++ b/src/gui/embedded/qscreendriverfactory_qws.cpp
@@ -48,6 +48,7 @@
#include "qscreenvfb_qws.h"
#include "qscreenmulti_qws_p.h"
#include "qscreenqnx_qws.h"
+#include "qscreenintegrityfb_qws.h"
#include <stdlib.h>
#include "private/qfactoryloader_p.h"
#include "qscreendriverplugin_qws.h"
@@ -112,6 +113,10 @@ QScreen *QScreenDriverFactory::create(const QString& key, int displayId)
if (driver == QLatin1String("qnx") || driver.isEmpty())
return new QQnxScreen(displayId);
#endif
+#if defined(Q_OS_INTEGRITY) && !defined(QT_NO_QWS_INTEGRITY)
+ if (driver == QLatin1String("integrityfb") || driver.isEmpty())
+ return new QIntfbScreen(displayId);
+#endif
#ifndef QT_NO_QWS_QVFB
if (driver == QLatin1String("qvfb") || driver.isEmpty())
return new QVFbScreen(displayId);
@@ -159,6 +164,9 @@ QStringList QScreenDriverFactory::keys()
#if defined(Q_OS_QNX) && !defined(QT_NO_QWS_QNX)
list << QLatin1String("QNX");
#endif
+#if defined(Q_OS_INTEGRITY) && !defined(QT_NO_QWS_INTEGRITY)
+ list << QLatin1String("INTEGRITYFB");
+#endif
#ifndef QT_NO_QWS_QVFB
list << QLatin1String("QVFb");
#endif
diff --git a/src/gui/embedded/qscreenintegrityfb_qws.cpp b/src/gui/embedded/qscreenintegrityfb_qws.cpp
new file mode 100644
index 0000000..7b24490
--- /dev/null
+++ b/src/gui/embedded/qscreenintegrityfb_qws.cpp
@@ -0,0 +1,405 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QT_NO_QWS_INTEGRITYFB
+
+#include <qscreenintegrityfb_qws.h>
+#include <qwindowsystem_qws.h>
+#include <qsocketnotifier.h>
+#include <qapplication.h>
+#include <qscreen_qws.h>
+#include "qmouseintegrity_qws.h"
+#include "qkbdintegrity_qws.h"
+#include <qmousedriverfactory_qws.h>
+#include <qkbddriverfactory_qws.h>
+#include <qdebug.h>
+
+#include <INTEGRITY.h>
+#include <device/fbdriver.h>
+
+QT_BEGIN_NAMESPACE
+
+class QIntfbScreenPrivate
+{
+public:
+ QIntfbScreenPrivate();
+ ~QIntfbScreenPrivate();
+
+ FBHandle handle;
+ struct FBInfoStruct fbinfo;
+
+ QWSMouseHandler *mouse;
+#ifndef QT_NO_QWS_KEYBOARD
+ QWSKeyboardHandler *keyboard;
+#endif
+};
+
+QIntfbScreenPrivate::QIntfbScreenPrivate()
+ : mouse(0)
+
+{
+#ifndef QT_NO_QWS_KEYBOARD
+ keyboard = 0;
+#endif
+}
+
+QIntfbScreenPrivate::~QIntfbScreenPrivate()
+{
+ delete mouse;
+#ifndef QT_NO_QWS_KEYBOARD
+ delete keyboard;
+#endif
+}
+
+/*!
+ \internal
+
+ \class QIntfbScreen
+ \ingroup qws
+
+ \brief The QIntfbScreen class implements a screen driver for the
+ INTEGRITY framebuffer drivers.
+
+ Note that this class is only available in \l{Qt for INTEGRITY}.
+ Custom screen drivers can be added by subclassing the
+ QScreenDriverPlugin class, using the QScreenDriverFactory class to
+ dynamically load the driver into the application, but there should
+ only be one screen object per application.
+
+ \sa QScreen, QScreenDriverPlugin, {Running Applications}
+*/
+
+/*!
+ \fn bool QIntfbScreen::connect(const QString & displaySpec)
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::disconnect()
+ \reimp
+*/
+
+/*!
+ \fn bool QIntfbScreen::initDevice()
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::restore()
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::save()
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::setDirty(const QRect & r)
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::setMode(int nw, int nh, int nd)
+ \reimp
+*/
+
+/*!
+ \fn void QIntfbScreen::shutdownDevice()
+ \reimp
+*/
+
+/*!
+ \fn QIntfbScreen::QIntfbScreen(int displayId)
+
+ Constructs a QVNCScreen object. The \a displayId argument
+ identifies the Qt for Embedded Linux server to connect to.
+*/
+QIntfbScreen::QIntfbScreen(int display_id)
+ : QScreen(display_id, IntfbClass), d_ptr(new QIntfbScreenPrivate)
+{
+ d_ptr->handle = 0;
+ data = 0;
+}
+
+/*!
+ Destroys this QIntfbScreen object.
+*/
+QIntfbScreen::~QIntfbScreen()
+{
+ delete d_ptr;
+}
+
+static QIntfbScreen *connected = 0;
+
+bool QIntfbScreen::connect(const QString &displaySpec)
+{
+ FBDriver *fbdev;
+
+ CheckSuccess(gh_FB_get_driver(0, &fbdev));
+ CheckSuccess(gh_FB_init_device(fbdev, 0, &d_ptr->handle));
+ CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo));
+
+ data = (uchar *)d_ptr->fbinfo.start;
+
+ d = d_ptr->fbinfo.bitsperpixel;
+ switch (d) {
+ case 1:
+ setPixelFormat(QImage::Format_Mono);
+ break;
+ case 8:
+ setPixelFormat(QImage::Format_Indexed8);
+ break;
+ case 12:
+ setPixelFormat(QImage::Format_RGB444);
+ break;
+ case 15:
+ setPixelFormat(QImage::Format_RGB555);
+ break;
+ case 16:
+ setPixelFormat(QImage::Format_RGB16);
+ break;
+ case 18:
+ setPixelFormat(QImage::Format_RGB666);
+ break;
+ case 24:
+ setPixelFormat(QImage::Format_RGB888);
+#ifdef QT_QWS_DEPTH_GENERIC
+#if Q_BYTE_ORDER != Q_BIG_ENDIAN
+ qt_set_generic_blit(this, 24,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ d_ptr->fbinfo.redoffset,
+ d_ptr->fbinfo.greenoffset,
+ d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset);
+#else
+ qt_set_generic_blit(this, 24,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ 16 - d_ptr->fbinfo.redoffset,
+ 16 - d_ptr->fbinfo.greenoffset,
+ 16 - d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset);
+#endif
+#endif
+ break;
+ case 32:
+ setPixelFormat(QImage::Format_ARGB32_Premultiplied);
+#ifdef QT_QWS_DEPTH_GENERIC
+#if Q_BYTE_ORDER != Q_BIG_ENDIAN
+ qt_set_generic_blit(this, 32,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ d_ptr->fbinfo.redoffset,
+ d_ptr->fbinfo.greenoffset,
+ d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset);
+#else
+ qt_set_generic_blit(this, 32,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ 24 - d_ptr->fbinfo.redoffset,
+ 24 - d_ptr->fbinfo.greenoffset,
+ 24 - d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0);
+#endif
+#endif
+ break;
+ }
+
+ dw = w = d_ptr->fbinfo.width;
+ dh = h = d_ptr->fbinfo.height;
+
+ /* assumes no padding */
+ lstep = w * ((d + 7) >> 3);
+
+ mapsize = size = h * lstep;
+
+ /* default values */
+ int dpi = 72;
+ physWidth = qRound(dw * 25.4 / dpi);
+ physHeight = qRound(dh * 25.4 / dpi);
+
+ qDebug("Connected to INTEGRITYfb server: %d x %d x %d %dx%dmm (%dx%ddpi)",
+ w, h, d, physWidth, physHeight, qRound(dw*25.4/physWidth), qRound(dh*25.4/physHeight) );
+
+
+ QWSServer::setDefaultMouse("integrity");
+ QWSServer::setDefaultKeyboard("integrity");
+
+ connected = this;
+
+ return true;
+}
+
+void QIntfbScreen::disconnect()
+{
+ connected = 0;
+}
+
+bool QIntfbScreen::initDevice()
+{
+
+ CheckSuccess(gh_FB_set_info(d_ptr->handle, &d_ptr->fbinfo, false));
+ CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo));
+ data = (uchar *)d_ptr->fbinfo.start;
+ d = d_ptr->fbinfo.bitsperpixel;
+ dw = w = d_ptr->fbinfo.width;
+ dh = h = d_ptr->fbinfo.height;
+ mapsize = d_ptr->fbinfo.length;
+ /* assumes no padding */
+ lstep = w * ((d + 7) >> 3);
+
+ mapsize = size = h * lstep;
+
+ data = (uchar *)d_ptr->fbinfo.start;
+
+ d = d_ptr->fbinfo.bitsperpixel;
+ switch (d) {
+ case 1:
+ setPixelFormat(QImage::Format_Mono);
+ break;
+ case 8:
+ setPixelFormat(QImage::Format_Indexed8);
+ break;
+ case 12:
+ setPixelFormat(QImage::Format_RGB444);
+ break;
+ case 15:
+ setPixelFormat(QImage::Format_RGB555);
+ break;
+ case 16:
+ setPixelFormat(QImage::Format_RGB16);
+ break;
+ case 18:
+ setPixelFormat(QImage::Format_RGB666);
+ break;
+ case 24:
+ setPixelFormat(QImage::Format_RGB888);
+ break;
+ case 32:
+ setPixelFormat(QImage::Format_ARGB32_Premultiplied);
+ break;
+ }
+#ifdef QT_QWS_DEPTH_GENERIC
+#if defined(__BIG_ENDIAN__)
+ qt_set_generic_blit(this, d,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ 24 - d_ptr->fbinfo.redoffset,
+ 24 - d_ptr->fbinfo.greenoffset,
+ 24 - d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0);
+#else
+ qt_set_generic_blit(this, d,
+ d_ptr->fbinfo.redbits,
+ d_ptr->fbinfo.greenbits,
+ d_ptr->fbinfo.bluebits,
+ d_ptr->fbinfo.alphabits,
+ d_ptr->fbinfo.redoffset,
+ d_ptr->fbinfo.greenoffset,
+ d_ptr->fbinfo.blueoffset,
+ d_ptr->fbinfo.alphaoffset);
+#endif
+#endif
+
+#ifndef QT_NO_QWS_CURSOR
+ QScreenCursor::initSoftwareCursor();
+#endif
+ return true;
+}
+
+void QIntfbScreen::shutdownDevice()
+{
+ gh_FB_close(d_ptr->handle);
+}
+
+void QIntfbScreen::setMode(int ,int ,int)
+{
+}
+
+// save the state of the graphics card
+// This is needed so that e.g. we can restore the palette when switching
+// between linux virtual consoles.
+void QIntfbScreen::save()
+{
+ // nothing to do.
+}
+
+// restore the state of the graphics card.
+void QIntfbScreen::restore()
+{
+}
+void QIntfbScreen::setDirty(const QRect& rect)
+{
+ FBRect fbrect;
+ fbrect.dx = rect.x();
+ fbrect.dy = rect.y();
+ fbrect.width = rect.width();
+ fbrect.height = rect.height();
+ gh_FB_expose(d_ptr->handle, &fbrect);
+}
+
+void QIntfbScreen::setBrightness(int b)
+{
+ if (connected) {
+ }
+}
+
+void QIntfbScreen::blank(bool on)
+{
+}
+
+#endif // QT_NO_QWS_INTEGRITYFB
+
+QT_END_NAMESPACE
+
diff --git a/src/gui/embedded/qscreenintegrityfb_qws.h b/src/gui/embedded/qscreenintegrityfb_qws.h
new file mode 100644
index 0000000..06b3967
--- /dev/null
+++ b/src/gui/embedded/qscreenintegrityfb_qws.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QSCREENINTEGRITYFB_QWS_H
+#define QSCREENINTEGRITYFB_QWS_H
+
+#include <QtGui/qscreen_qws.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+#ifndef QT_NO_QWS_INTEGRITYFB
+
+class QIntfbScreenPrivate;
+
+class Q_GUI_EXPORT QIntfbScreen : public QScreen
+{
+public:
+ explicit QIntfbScreen(int display_id);
+ virtual ~QIntfbScreen();
+ virtual bool initDevice();
+ virtual bool connect(const QString &displaySpec);
+ virtual void disconnect();
+ virtual void shutdownDevice();
+ virtual void save();
+ virtual void restore();
+ virtual void setMode(int nw,int nh,int nd);
+ virtual void setDirty(const QRect& r);
+ virtual void blank(bool);
+ static void setBrightness(int b);
+
+private:
+ QIntfbScreenPrivate *d_ptr;
+};
+
+#endif // QT_NO_QWS_INTEGRITYFB
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSCREENINTEGRITYFB_QWS_H
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index ecc8941..2bf744d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -5577,8 +5577,10 @@ void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem, QGraphicsItem *s
parent->d_ptr->subFocusItemChange();
} while (!parent->isPanel() && (parent = parent->d_ptr->parent) && (visible || !parent->d_ptr->visible));
- if (scene && !scene->isActive())
+ if (scene && !scene->isActive()) {
+ scene->d_func()->passiveFocusItem = subFocusItem;
scene->d_func()->lastFocusItem = subFocusItem;
+ }
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 77ccc8e..6ff1d38 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -306,6 +306,7 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
rectAdjust(2),
focusItem(0),
lastFocusItem(0),
+ passiveFocusItem(0),
tabFocusFirst(0),
activePanel(0),
lastActivePanel(0),
@@ -630,6 +631,8 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
focusItem = 0;
if (item == lastFocusItem)
lastFocusItem = 0;
+ if (item == passiveFocusItem)
+ passiveFocusItem = 0;
if (item == activePanel) {
// ### deactivate...
activePanel = 0;
@@ -2980,7 +2983,7 @@ void QGraphicsScene::removeItem(QGraphicsItem *item)
QGraphicsItem *QGraphicsScene::focusItem() const
{
Q_D(const QGraphicsScene);
- return isActive() ? d->focusItem : d->lastFocusItem;
+ return isActive() ? d->focusItem : d->passiveFocusItem;
}
/*!
@@ -3054,6 +3057,7 @@ void QGraphicsScene::clearFocus()
Q_D(QGraphicsScene);
if (d->hasFocus) {
d->hasFocus = false;
+ d->passiveFocusItem = d->focusItem;
setFocusItem(0, Qt::OtherFocusReason);
}
}
@@ -3757,9 +3761,9 @@ void QGraphicsScene::focusInEvent(QFocusEvent *focusEvent)
focusEvent->ignore();
break;
default:
- if (d->lastFocusItem) {
+ if (d->passiveFocusItem) {
// Set focus on the last focus item
- setFocusItem(d->lastFocusItem, focusEvent->reason());
+ setFocusItem(d->passiveFocusItem, focusEvent->reason());
}
break;
}
@@ -3778,6 +3782,7 @@ void QGraphicsScene::focusOutEvent(QFocusEvent *focusEvent)
{
Q_D(QGraphicsScene);
d->hasFocus = false;
+ d->passiveFocusItem = d->focusItem;
setFocusItem(0, focusEvent->reason());
// Remove all popups when the scene loses focus.
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 2314e37..9460a4d 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -150,6 +150,7 @@ public:
quint32 rectAdjust;
QGraphicsItem *focusItem;
QGraphicsItem *lastFocusItem;
+ QGraphicsItem *passiveFocusItem;
QGraphicsWidget *tabFocusFirst;
QGraphicsItem *activePanel;
QGraphicsItem *lastActivePanel;
diff --git a/src/gui/graphicsview/qgridlayoutengine.cpp b/src/gui/graphicsview/qgridlayoutengine.cpp
index 375c723..b8586ce 100644
--- a/src/gui/graphicsview/qgridlayoutengine.cpp
+++ b/src/gui/graphicsview/qgridlayoutengine.cpp
@@ -1175,7 +1175,7 @@ QSizeF QGridLayoutEngine::sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHi
//constraints to find the column widths
q_rowData.calculateGeometries(0, rowCount(), height, sizehint_yy.data(), sizehint_heights.data(),
0, sizehint_totalBoxes[Ver], q_infos[Ver]);
- ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, sizehint_yy.data(), sizehint_heights.data(), Qt::Vertical);
+ ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, sizehint_yy.data(), sizehint_heights.data(), Qt::Horizontal);
sizeHintCalculated = true;
}
}
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 92ea397..72738c9 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -29,7 +29,10 @@ HEADERS += \
image/qpixmapdata_p.h \
image/qpixmapdatafactory_p.h \
image/qpixmapfilter_p.h \
- image/qimagepixmapcleanuphooks_p.h
+ image/qimagepixmapcleanuphooks_p.h \
+ image/qvolatileimage_p.h \
+ image/qvolatileimagedata_p.h \
+ image/qnativeimagehandleprovider_p.h
SOURCES += \
image/qbitmap.cpp \
@@ -53,7 +56,8 @@ SOURCES += \
image/qpixmap_raster.cpp \
image/qpixmap_blitter.cpp \
image/qnativeimage.cpp \
- image/qimagepixmapcleanuphooks.cpp
+ image/qimagepixmapcleanuphooks.cpp \
+ image/qvolatileimage.cpp
win32 {
SOURCES += image/qpixmap_win.cpp
@@ -77,6 +81,13 @@ else:symbian {
SOURCES += image/qpixmap_s60.cpp
}
+!symbian|contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2) {
+ SOURCES += image/qvolatileimagedata.cpp
+}
+else {
+ SOURCES += image/qvolatileimagedata_symbian.cpp
+}
+
# Built-in image format support
HEADERS += \
image/qbmphandler_p.h \
diff --git a/src/network/access/qnetworkaccessdatabackend_p.h b/src/gui/image/qnativeimagehandleprovider_p.h
index 18569ec..4e6ed38 100644
--- a/src/network/access/qnetworkaccessdatabackend_p.h
+++ b/src/gui/image/qnativeimagehandleprovider_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtNetwork module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,46 +39,31 @@
**
****************************************************************************/
-#ifndef QNETWORKACCESSDATABACKEND_P_H
-#define QNETWORKACCESSDATABACKEND_P_H
+#ifndef QNATIVEIMAGEHANDLEPROVIDER_P_H
+#define QNATIVEIMAGEHANDLEPROVIDER_P_H
//
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of the Network Access API. This header file may change from
-// version to version without notice, or even be removed.
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
-#include "qnetworkaccessbackend_p.h"
+#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
-class QNetworkAccessDataBackend: public QNetworkAccessBackend
+class QNativeImageHandleProvider
{
public:
- QNetworkAccessDataBackend();
- virtual ~QNetworkAccessDataBackend();
-
- virtual void open();
- virtual void closeDownstreamChannel();
- virtual void closeUpstreamChannel();
- virtual bool waitForDownstreamReadyRead(int msecs);
- virtual bool waitForUpstreamBytesWritten(int msecs);
-
- virtual bool processRequestSynchronously();
-};
-
-class QNetworkAccessDataBackendFactory: public QNetworkAccessBackendFactory
-{
-public:
- virtual QNetworkAccessBackend *create(QNetworkAccessManager::Operation op,
- const QNetworkRequest &request) const;
+ virtual void get(void **handle, QString *type) = 0;
+ virtual void release(void *handle, const QString &type) = 0;
};
QT_END_NAMESPACE
-#endif
+#endif // QNATIVEIMAGEHANDLEPROVIDER_P_H
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index f896572..6e13324 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -112,8 +112,16 @@ void QPixmap::init(int w, int h, Type type)
init(w, h, int(type));
}
+extern QApplication::Type qt_appType;
+
void QPixmap::init(int w, int h, int type)
{
+ if (qt_appType == QApplication::Tty) {
+ qWarning("QPixmap: Cannot create a QPixmap when no GUI is being used");
+ data = 0;
+ return;
+ }
+
if ((w > 0 && h > 0) || type == QPixmapData::BitmapType)
data = QPixmapData::create(w, h, (QPixmapData::PixelType) type);
else
@@ -1636,16 +1644,6 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
{Implicit Data Sharing} documentation. QPixmap objects can also be
streamed.
- Depending on the system, QPixmap is stored using a RGB32 or a
- premultiplied alpha format. If the image has an alpha channel, and
- if the system allows, the preferred format is premultiplied alpha.
- Note also that QPixmap, unlike QImage, may be hardware dependent.
- On X11, Mac and Symbian, a QPixmap is stored on the server side while
- a QImage is stored on the client side (on Windows, these two classes
- have an equivalent internal representation, i.e. both QImage and
- QPixmap are stored on the client side and don't use any GDI
- resources).
-
Note that the pixel data in a pixmap is internal and is managed by
the underlying window system. Because QPixmap is a QPaintDevice
subclass, QPainter can be used to draw directly onto pixmaps.
@@ -2012,7 +2010,7 @@ void QPixmap::detach()
}
if (data->is_cached && data->ref == 1)
- QImagePixmapCleanupHooks::executePixmapDataModificationHooks(pd);
+ QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data());
#if defined(Q_WS_MAC)
QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(pd) : 0;
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index e8a7b89..26d3b87 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 55b5618..9f4260c 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 1e7ff04..a5f42c1 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -386,6 +386,9 @@ int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
void QRasterPixmapData::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
{
QImage::Format format;
+ if (flags & Qt::NoFormatConversion)
+ format = sourceImage.format();
+ else
#ifdef Q_WS_QWS
if (pixelType() == BitmapType) {
format = QImage::Format_Mono;
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index ca5f133..fbdebf3 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -374,6 +374,8 @@ CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
To be sure that QPixmap does not modify your original instance, you should
make a copy of your \c CFbsBitmap before calling this function.
If the CFbsBitmap is not valid this function will return a null QPixmap.
+ For performance reasons it is recommended to use a \a bitmap with a display
+ mode of EColor16MAP or EColor16MU whenever possible.
\warning This function is only available on Symbian OS.
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 5c05c28..6bbce09 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -71,7 +71,9 @@ public:
#if defined(Q_OS_SYMBIAN)
enum NativeType {
FbsBitmap,
- SgImage
+ SgImage,
+ VolatileImage,
+ NativeImageHandleProvider
};
#endif
enum ClassId { RasterClass, X11Class, MacClass, DirectFBClass,
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
new file mode 100644
index 0000000..098e9a1
--- /dev/null
+++ b/src/gui/image/qvolatileimage.cpp
@@ -0,0 +1,318 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 "qvolatileimage_p.h"
+#include "qvolatileimagedata_p.h"
+#include <QtGui/private/qpaintengine_raster_p.h>
+#include <QtGui/private/qpixmapdata_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImagePaintEnginePrivate : public QRasterPaintEnginePrivate
+{
+public:
+ QVolatileImagePaintEnginePrivate() { }
+ QVolatileImage *img;
+};
+
+class QVolatileImagePaintEngine : public QRasterPaintEngine
+{
+ Q_DECLARE_PRIVATE(QVolatileImagePaintEngine)
+
+public:
+ QVolatileImagePaintEngine(QPaintDevice *device, QVolatileImage *img);
+ bool begin(QPaintDevice *device);
+ bool end();
+ void drawPixmap(const QPointF &p, const QPixmap &pm);
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
+};
+
+QVolatileImage::QVolatileImage()
+ : d(new QVolatileImageData)
+{
+}
+
+QVolatileImage::QVolatileImage(int w, int h, QImage::Format format)
+ : d(new QVolatileImageData(w, h, format))
+{
+}
+
+QVolatileImage::QVolatileImage(const QImage &sourceImage)
+ : d(new QVolatileImageData(sourceImage))
+{
+}
+
+QVolatileImage::QVolatileImage(void *nativeImage, void *nativeMask)
+ : d(new QVolatileImageData(nativeImage, nativeMask))
+{
+}
+
+// Need non-inline, non-autogenerated copy ctor, dtor, op= to keep the
+// fwd declared QSharedData working.
+
+QVolatileImage::QVolatileImage(const QVolatileImage &other)
+ : d(other.d)
+{
+}
+
+QVolatileImage::~QVolatileImage()
+{
+}
+
+QVolatileImage &QVolatileImage::operator=(const QVolatileImage &rhs)
+{
+ d = rhs.d;
+ return *this;
+}
+
+bool QVolatileImage::isNull() const
+{
+ return d->image.isNull();
+}
+
+QImage::Format QVolatileImage::format() const
+{
+ return d->image.format();
+}
+
+int QVolatileImage::width() const
+{
+ return d->image.width();
+}
+
+int QVolatileImage::height() const
+{
+ return d->image.height();
+}
+
+int QVolatileImage::bytesPerLine() const
+{
+ return d->image.bytesPerLine();
+}
+
+int QVolatileImage::byteCount() const
+{
+ return d->image.byteCount();
+}
+
+int QVolatileImage::depth() const
+{
+ return d->image.depth();
+}
+
+bool QVolatileImage::hasAlphaChannel() const
+{
+ return d->image.hasAlphaChannel();
+}
+
+void QVolatileImage::beginDataAccess() const
+{
+ d->beginDataAccess();
+}
+
+void QVolatileImage::endDataAccess(bool readOnly) const
+{
+ d->endDataAccess(readOnly);
+}
+
+/*!
+ Access to pixel data via bits() or constBits() should be guarded by
+ begin/endDataAccess().
+ */
+uchar *QVolatileImage::bits()
+{
+ return d->image.bits();
+}
+
+const uchar *QVolatileImage::constBits() const
+{
+ return d->image.constBits();
+}
+
+bool QVolatileImage::ensureFormat(QImage::Format format)
+{
+ return d->ensureFormat(format);
+}
+
+/*!
+ This will always perform a copy of the pixel data.
+ */
+QImage QVolatileImage::toImage() const
+{
+ d->beginDataAccess();
+ QImage newImage = d->image.copy(); // no sharing allowed
+ d->endDataAccess(true);
+ return newImage;
+}
+
+/*!
+ Returns a reference to the image that is potentially using some native
+ buffer internally. Access to the image's pixel data should be guarded by
+ begin/endDataAccess(). Use it when there is a need for QImage APIs not provided
+ by this class. The returned QImage must never be shared or assigned to.
+ */
+QImage &QVolatileImage::imageRef() // non-const, in order to cause a detach
+{
+ d->ensureImage();
+ return d->image;
+}
+
+void *QVolatileImage::duplicateNativeImage() const
+{
+ return d->duplicateNativeImage();
+}
+
+void QVolatileImage::setAlphaChannel(const QPixmap &alphaChannel)
+{
+ ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ beginDataAccess();
+ imageRef().setAlphaChannel(alphaChannel.toImage());
+ endDataAccess();
+ d->ensureImage();
+}
+
+void QVolatileImage::fill(uint pixelValue)
+{
+ beginDataAccess();
+ imageRef().fill(pixelValue);
+ endDataAccess();
+ d->ensureImage();
+}
+
+void QVolatileImage::copyFrom(QVolatileImage *source, const QRect &rect)
+{
+ if (source->isNull()) {
+ return;
+ }
+ QRect r = rect;
+ if (rect.isNull()) {
+ r = QRect(0, 0, source->width(), source->height());
+ }
+ source->beginDataAccess();
+ QImage &srcImgRef(source->imageRef());
+ int srcbpl = srcImgRef.bytesPerLine();
+ int srcbpp = srcImgRef.depth() / 8;
+ const uchar *sptr = srcImgRef.constBits() + r.y() * srcbpl;
+ beginDataAccess();
+ QImage &dstImgRef(imageRef());
+ int dstbpl = dstImgRef.bytesPerLine();
+ uchar *dptr = dstImgRef.bits();
+ for (int y = 0; y < r.height(); ++y) {
+ qMemCopy(dptr, sptr + r.x() * srcbpp, r.width() * srcbpp);
+ sptr += srcbpl;
+ dptr += dstbpl;
+ }
+ endDataAccess();
+ source->endDataAccess(true);
+}
+
+/*!
+ To be called from the PixmapData's paintEngine().
+ */
+QPaintEngine *QVolatileImage::paintEngine()
+{
+ if (!d->pengine) {
+ d->pengine = new QVolatileImagePaintEngine(&imageRef(), this);
+ }
+ return d->pengine;
+}
+
+QVolatileImagePaintEngine::QVolatileImagePaintEngine(QPaintDevice *device,
+ QVolatileImage *img)
+ : QRasterPaintEngine(*(new QVolatileImagePaintEnginePrivate), device)
+{
+ Q_D(QVolatileImagePaintEngine);
+ d->img = img;
+}
+
+bool QVolatileImagePaintEngine::begin(QPaintDevice *device)
+{
+ Q_D(QVolatileImagePaintEngine);
+ d->img->beginDataAccess();
+ return QRasterPaintEngine::begin(device);
+}
+
+bool QVolatileImagePaintEngine::end()
+{
+ Q_D(QVolatileImagePaintEngine);
+ bool ret = QRasterPaintEngine::end();
+ d->img->endDataAccess();
+ return ret;
+}
+
+// For non-RasterClass pixmaps drawPixmap() would call toImage() which is slow in
+// our case. Therefore drawPixmap() is rerouted to drawImage().
+
+void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
+{
+#ifdef Q_OS_SYMBIAN
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(p, img->imageRef());
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(p, pm);
+ }
+#else
+ QRasterPaintEngine::drawPixmap(p, pm);
+#endif
+}
+
+void QVolatileImagePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
+{
+#ifdef Q_OS_SYMBIAN
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ }
+#else
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+#endif
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h
new file mode 100644
index 0000000..fc5d6b1
--- /dev/null
+++ b/src/gui/image/qvolatileimage_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QVOLATILEIMAGE_P_H
+#define QVOLATILEIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qimage.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImageData;
+
+class Q_GUI_EXPORT QVolatileImage
+{
+public:
+ QVolatileImage();
+ QVolatileImage(int w, int h, QImage::Format format);
+ explicit QVolatileImage(const QImage &sourceImage);
+ explicit QVolatileImage(void *nativeImage, void *nativeMask = 0);
+ QVolatileImage(const QVolatileImage &other);
+ ~QVolatileImage();
+ QVolatileImage &operator=(const QVolatileImage &rhs);
+
+ bool isNull() const;
+ QImage::Format format() const;
+ int width() const;
+ int height() const;
+ int bytesPerLine() const;
+ int byteCount() const;
+ int depth() const;
+ bool hasAlphaChannel() const;
+ void beginDataAccess() const;
+ void endDataAccess(bool readOnly = false) const;
+ uchar *bits();
+ const uchar *constBits() const;
+ bool ensureFormat(QImage::Format format);
+ QImage toImage() const;
+ QImage &imageRef();
+ QPaintEngine *paintEngine();
+ void setAlphaChannel(const QPixmap &alphaChannel);
+ void fill(uint pixelValue);
+ void *duplicateNativeImage() const;
+ void copyFrom(QVolatileImage *source, const QRect &rect);
+
+private:
+ QSharedDataPointer<QVolatileImageData> d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QVOLATILEIMAGE_P_H
diff --git a/src/gui/image/qvolatileimagedata.cpp b/src/gui/image/qvolatileimagedata.cpp
new file mode 100644
index 0000000..51b5995
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 "qvolatileimagedata_p.h"
+#include <QtGui/qpaintengine.h>
+
+QT_BEGIN_NAMESPACE
+
+QVolatileImageData::QVolatileImageData()
+ : pengine(0)
+{
+}
+
+QVolatileImageData::QVolatileImageData(int w, int h, QImage::Format format)
+ : pengine(0)
+{
+ image = QImage(w, h, format);
+}
+
+QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
+ : pengine(0)
+{
+ image = sourceImage;
+}
+
+QVolatileImageData::QVolatileImageData(void *, void *)
+ : pengine(0)
+{
+ // Not supported.
+}
+
+QVolatileImageData::QVolatileImageData(const QVolatileImageData &other)
+{
+ image = other.image;
+ // The detach is not mandatory here but we do it nonetheless in order to
+ // keep the behavior consistent with other platforms.
+ image.detach();
+ pengine = 0;
+}
+
+QVolatileImageData::~QVolatileImageData()
+{
+ delete pengine;
+}
+
+void QVolatileImageData::beginDataAccess() const
+{
+ // nothing to do here
+}
+
+void QVolatileImageData::endDataAccess(bool readOnly) const
+{
+ Q_UNUSED(readOnly);
+ // nothing to do here
+}
+
+bool QVolatileImageData::ensureFormat(QImage::Format format)
+{
+ if (image.format() != format) {
+ image = image.convertToFormat(format);
+ }
+ return true;
+}
+
+void *QVolatileImageData::duplicateNativeImage() const
+{
+ return 0;
+}
+
+void QVolatileImageData::ensureImage()
+{
+ // nothing to do here
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qvolatileimagedata_p.h b/src/gui/image/qvolatileimagedata_p.h
new file mode 100644
index 0000000..dab1685
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QVOLATILEIMAGEDATA_P_H
+#define QVOLATILEIMAGEDATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qimage.h>
+#include <QtCore/qshareddata.h>
+
+#ifdef Q_OS_SYMBIAN
+class CFbsBitmap;
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImageData : public QSharedData
+{
+public:
+ QVolatileImageData();
+ QVolatileImageData(int w, int h, QImage::Format format);
+ QVolatileImageData(const QImage &sourceImage);
+ QVolatileImageData(void *nativeImage, void *nativeMask);
+ QVolatileImageData(const QVolatileImageData &other);
+ ~QVolatileImageData();
+
+ void beginDataAccess() const;
+ void endDataAccess(bool readOnly = false) const;
+ bool ensureFormat(QImage::Format format);
+ void *duplicateNativeImage() const;
+ void ensureImage();
+
+#ifdef Q_OS_SYMBIAN
+ void updateImage();
+ void initWithBitmap(CFbsBitmap *source);
+ void applyMask(CFbsBitmap *mask);
+ void ensureBitmap();
+ void release();
+ QVolatileImageData *next;
+ QVolatileImageData *prev;
+ CFbsBitmap *bitmap;
+#endif
+ QImage image;
+ QPaintEngine *pengine;
+};
+
+QT_END_NAMESPACE
+
+#endif // QVOLATILEIMAGEDATA_P_H
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
new file mode 100644
index 0000000..6e2909b
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata_symbian.cpp
@@ -0,0 +1,474 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 "qvolatileimagedata_p.h"
+#include <fbs.h>
+#include <QtGui/private/qt_s60_p.h>
+#include <QtGui/qpaintengine.h>
+#include <QtGui/private/qimage_p.h>
+
+QT_BEGIN_NAMESPACE
+
+static CFbsBitmap *rasterizeBitmap(CFbsBitmap *bitmap, TDisplayMode newMode)
+{
+ if (!bitmap) {
+ return 0;
+ }
+ QScopedPointer<CFbsBitmap> newBitmap(new CFbsBitmap);
+ if (newBitmap->Create(bitmap->SizeInPixels(), newMode) != KErrNone) {
+ qWarning("QVolatileImage: Failed to create new bitmap");
+ return 0;
+ }
+ CFbsBitmapDevice *bitmapDevice = 0;
+ CFbsBitGc *bitmapGc = 0;
+ QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(newBitmap.data()));
+ QScopedPointer<CFbsBitmapDevice> bitmapDevicePtr(bitmapDevice);
+ QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
+ bitmapGc->Activate(bitmapDevice);
+ bitmapGc->BitBlt(TPoint(), bitmap);
+ delete bitmapGc;
+ return newBitmap.take();
+}
+
+static inline TDisplayMode format2TDisplayMode(QImage::Format format)
+{
+ TDisplayMode mode;
+ switch (format) {
+ case QImage::Format_MonoLSB:
+ mode = EGray2;
+ break;
+ case QImage::Format_Indexed8:
+ mode = EColor256;
+ break;
+ case QImage::Format_RGB444:
+ mode = EColor4K;
+ break;
+ case QImage::Format_RGB16:
+ mode = EColor64K;
+ break;
+ case QImage::Format_RGB888:
+ mode = EColor16M;
+ break;
+ case QImage::Format_RGB32:
+ mode = EColor16MU;
+ break;
+ case QImage::Format_ARGB32:
+ mode = EColor16MA;
+ break;
+ case QImage::Format_ARGB32_Premultiplied:
+ mode = Q_SYMBIAN_ECOLOR16MAP;
+ break;
+ default:
+ mode = ENone;
+ break;
+ }
+ return mode;
+}
+
+static CFbsBitmap *imageToBitmap(const QImage &image)
+{
+ if (image.isNull()) {
+ return 0;
+ }
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Create(TSize(image.width(), image.height()),
+ format2TDisplayMode(image.format())) == KErrNone) {
+ bitmap->BeginDataAccess();
+ uchar *dptr = reinterpret_cast<uchar *>(bitmap->DataAddress());
+ int bmpLineLen = bitmap->DataStride();
+ int imgLineLen = image.bytesPerLine();
+ if (bmpLineLen == imgLineLen) {
+ qMemCopy(dptr, image.constBits(), image.byteCount());
+ } else {
+ int len = qMin(bmpLineLen, imgLineLen);
+ const uchar *sptr = image.constBits();
+ for (int y = 0; y < image.height(); ++y) {
+ qMemCopy(dptr, sptr, len);
+ dptr += bmpLineLen;
+ sptr += imgLineLen;
+ }
+ }
+ bitmap->EndDataAccess();
+ } else {
+ qWarning("QVolatileImage: Failed to create source bitmap");
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static CFbsBitmap *copyData(const QVolatileImageData &source)
+{
+ source.beginDataAccess();
+ CFbsBitmap *bmp = imageToBitmap(source.image);
+ source.endDataAccess();
+ return bmp;
+}
+
+static CFbsBitmap *convertData(const QVolatileImageData &source, QImage::Format newFormat)
+{
+ source.beginDataAccess();
+ QImage img = source.image.convertToFormat(newFormat);
+ CFbsBitmap *bmp = imageToBitmap(img);
+ source.endDataAccess();
+ return bmp;
+}
+
+static CFbsBitmap *duplicateBitmap(const CFbsBitmap &sourceBitmap)
+{
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Duplicate(sourceBitmap.Handle()) != KErrNone) {
+ qWarning("QVolatileImage: Failed to duplicate source bitmap");
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static CFbsBitmap *createBitmap(int w, int h, QImage::Format format)
+{
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Create(TSize(w, h), format2TDisplayMode(format)) != KErrNone) {
+ qWarning("QVolatileImage: Failed to create source bitmap %d,%d (%d)", w, h, format);
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static inline bool bitmapNeedsCopy(CFbsBitmap *bitmap)
+{
+ bool needsCopy = bitmap->IsCompressedInRAM();
+#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
+ needsCopy |= (bitmap->ExtendedBitmapType() != KNullUid);
+#endif
+ return needsCopy;
+}
+
+static bool cleanup_function_registered = false;
+static QVolatileImageData *firstImageData = 0;
+
+static void cleanup()
+{
+ if (RFbsSession::GetSession()) {
+ QVolatileImageData *imageData = firstImageData;
+ while (imageData) {
+ imageData->release();
+ imageData = imageData->next;
+ }
+ }
+}
+
+static void ensureCleanup()
+{
+ // Destroy all underlying bitmaps in a post routine to prevent panics.
+ // This is a must because CFbsBitmap destructor needs the fbs session,
+ // that was used to create the bitmap, to be open still.
+ if (!cleanup_function_registered) {
+ qAddPostRoutine(cleanup);
+ cleanup_function_registered = true;
+ }
+}
+
+static void registerImageData(QVolatileImageData *imageData)
+{
+ ensureCleanup();
+ imageData->next = firstImageData;
+ if (firstImageData) {
+ firstImageData->prev = imageData;
+ }
+ firstImageData = imageData;
+}
+
+static void unregisterImageData(QVolatileImageData *imageData)
+{
+ if (imageData->prev) {
+ imageData->prev->next = imageData->next;
+ } else {
+ firstImageData = imageData->next;
+ }
+ if (imageData->next) {
+ imageData->next->prev = imageData->prev;
+ }
+}
+
+QVolatileImageData::QVolatileImageData()
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+}
+
+QVolatileImageData::QVolatileImageData(int w, int h, QImage::Format format)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ bitmap = createBitmap(w, h, format);
+ updateImage();
+}
+
+QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ image = sourceImage;
+ // The following is not mandatory, but we do it here to have a bitmap
+ // created always in order to reduce local heap usage.
+ ensureBitmap();
+}
+
+QVolatileImageData::QVolatileImageData(void *nativeImage, void *nativeMask)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ if (nativeImage) {
+ CFbsBitmap *source = static_cast<CFbsBitmap *>(nativeImage);
+ CFbsBitmap *mask = static_cast<CFbsBitmap *>(nativeMask);
+ initWithBitmap(source);
+ if (mask) {
+ applyMask(mask);
+ }
+ }
+}
+
+QVolatileImageData::QVolatileImageData(const QVolatileImageData &other)
+{
+ bitmap = 0;
+ pengine = 0;
+ next = prev = 0;
+ registerImageData(this);
+ if (!other.image.isNull()) {
+ bitmap = copyData(other);
+ updateImage();
+ }
+}
+
+QVolatileImageData::~QVolatileImageData()
+{
+ release();
+ unregisterImageData(this);
+}
+
+void QVolatileImageData::release()
+{
+ delete bitmap;
+ bitmap = 0;
+ delete pengine;
+ pengine = 0;
+}
+
+void QVolatileImageData::beginDataAccess() const
+{
+ if (bitmap) {
+ bitmap->BeginDataAccess();
+ }
+}
+
+void QVolatileImageData::endDataAccess(bool readOnly) const
+{
+ if (bitmap) {
+ bitmap->EndDataAccess(readOnly);
+ }
+}
+
+bool QVolatileImageData::ensureFormat(QImage::Format format)
+{
+ if (image.isNull()) {
+ return false;
+ }
+ if (image.format() != format) {
+ CFbsBitmap *newBitmap = convertData(*this, format);
+ if (newBitmap && newBitmap != bitmap) {
+ delete bitmap;
+ bitmap = newBitmap;
+ updateImage();
+ } else {
+ return false;
+ }
+ }
+ return true;
+}
+
+void *QVolatileImageData::duplicateNativeImage() const
+{
+ const_cast<QVolatileImageData *>(this)->ensureBitmap();
+ if (bitmap) {
+ if (bitmap->DisplayMode() == EColor16M) {
+ // slow path: needs rgb swapping
+ beginDataAccess();
+ QImage tmp = image.rgbSwapped();
+ endDataAccess(true);
+ return imageToBitmap(tmp);
+ } else if (bitmap->DisplayMode() == EGray2) {
+ // slow path: needs inverting pixels
+ beginDataAccess();
+ QImage tmp = image.copy();
+ endDataAccess(true);
+ tmp.invertPixels();
+ return imageToBitmap(tmp);
+ } else {
+ // fast path: just duplicate the bitmap
+ return duplicateBitmap(*bitmap);
+ }
+ }
+ return 0;
+}
+
+void QVolatileImageData::updateImage()
+{
+ if (bitmap) {
+ TSize size = bitmap->SizeInPixels();
+ beginDataAccess();
+ // Use existing buffer, no copy. The data address never changes so it
+ // is enough to do this whenever we have a new CFbsBitmap. N.B. never
+ // use const uchar* here, that would create a read-only image data which
+ // would make a copy in detach() even when refcount is 1.
+ image = QImage(reinterpret_cast<uchar *>(bitmap->DataAddress()),
+ size.iWidth, size.iHeight, bitmap->DataStride(),
+ qt_TDisplayMode2Format(bitmap->DisplayMode()));
+ endDataAccess(true);
+ } else {
+ image = QImage();
+ }
+}
+
+void QVolatileImageData::initWithBitmap(CFbsBitmap *source)
+{
+ bool needsCopy = bitmapNeedsCopy(source);
+ if (source->DisplayMode() == EColor16M) {
+ // EColor16M is BGR
+ CFbsBitmap *unswappedBmp = source;
+ if (needsCopy) {
+ unswappedBmp = rasterizeBitmap(source, source->DisplayMode());
+ }
+ unswappedBmp->BeginDataAccess();
+ TSize sourceSize = unswappedBmp->SizeInPixels();
+ QImage img((uchar *) unswappedBmp->DataAddress(),
+ sourceSize.iWidth, sourceSize.iHeight, unswappedBmp->DataStride(),
+ qt_TDisplayMode2Format(unswappedBmp->DisplayMode()));
+ img = img.rgbSwapped();
+ unswappedBmp->EndDataAccess(true);
+ bitmap = imageToBitmap(img);
+ if (needsCopy) {
+ delete unswappedBmp;
+ }
+ } else if (needsCopy) {
+ // Rasterize extended and compressed bitmaps.
+ bitmap = rasterizeBitmap(source, EColor16MAP);
+ } else if (source->DisplayMode() == EGray2) {
+ // The pixels will be inverted, must make a copy.
+ bitmap = rasterizeBitmap(source, source->DisplayMode());
+ } else {
+ // Efficient path: no pixel data copying. Just duplicate. This of course
+ // means the original bitmap's data may get modified, but that's fine
+ // and is in accordance with the QPixmap::fromSymbianCFbsBitmap() docs.
+ bitmap = duplicateBitmap(*source);
+ }
+ updateImage();
+ if (bitmap && bitmap->DisplayMode() == EGray2) {
+ // Symbian thinks set pixels are white/transparent, Qt thinks they are
+ // foreground/solid. Invert mono bitmaps so that masks work correctly.
+ beginDataAccess();
+ image.invertPixels();
+ endDataAccess();
+ }
+}
+
+void QVolatileImageData::applyMask(CFbsBitmap *mask)
+{
+ ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ bool destroyMask = false;
+ if (bitmapNeedsCopy(mask)) {
+ mask = rasterizeBitmap(mask, EColor16MU);
+ if (!mask) {
+ return;
+ }
+ destroyMask = true;
+ }
+ mask->BeginDataAccess();
+ TSize maskSize = mask->SizeInPixels();
+ QImage maskImg((const uchar *) mask->DataAddress(), maskSize.iWidth, maskSize.iHeight,
+ mask->DataStride(), qt_TDisplayMode2Format(mask->DisplayMode()));
+ if (mask->DisplayMode() == EGray2) {
+ maskImg = maskImg.copy();
+ maskImg.invertPixels();
+ }
+ beginDataAccess();
+ image.setAlphaChannel(maskImg);
+ endDataAccess();
+ mask->EndDataAccess(true);
+ ensureImage();
+ if (destroyMask) {
+ delete mask;
+ }
+}
+
+void QVolatileImageData::ensureImage()
+{
+ if (bitmap && !image.isNull()) {
+ QImageData *imaged = image.data_ptr();
+ if (imaged->ref != 1 || imaged->ro_data) {
+ // This is bad, the imagedata got shared somehow. Detach, in order to
+ // have the next check fail and thus have 'image' recreated.
+ beginDataAccess();
+ image.detach();
+ endDataAccess(true);
+ }
+ }
+ if (bitmap && image.constBits() != reinterpret_cast<const uchar *>(bitmap->DataAddress())) {
+ // Should not ever get here. If we do it means that either 'image' has
+ // been replaced with a copy (e.g. because some QImage API assigned a
+ // new, regular QImage to *this) or the bitmap's data address changed
+ // unexpectedly.
+ qWarning("QVolatileImageData: Ptr mismatch");
+ // Recover by recreating the image so that it uses the bitmap as its buffer.
+ updateImage();
+ }
+}
+
+void QVolatileImageData::ensureBitmap()
+{
+ if (!bitmap && !image.isNull()) {
+ bitmap = imageToBitmap(image);
+ updateImage();
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index ffad75b..075d5da 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -864,7 +864,7 @@ static bool read_xpm_body(
QByteArray buf(200, 0);
int i;
- if (cpp > 15)
+ if (cpp < 0 || cpp > 15)
return false;
// For > 256 colors, we delay creation of the image until
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 8c8ffd4..de3577f 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -93,6 +93,9 @@ public:
TCoeInputCapabilities inputCapabilities();
+ void resetSplitViewWidget(bool keepInputWidget = false);
+ void ensureFocusWidgetVisible(QWidget *widget);
+
protected:
void timerEvent(QTimerEvent *timerEvent);
@@ -104,9 +107,11 @@ private:
void queueInputCapabilitiesChanged();
bool needsInputPanel();
void commitTemporaryPreeditString();
+ bool isWidgetVisible(QWidget *widget, int offset = 0);
private Q_SLOTS:
void ensureInputCapabilitiesChanged();
+ void translateInputWidget();
// From MCoeFepAwareTextEditor
public:
@@ -155,9 +160,15 @@ private:
QBasicTimer m_tempPreeditStringTimeout;
bool m_hasTempPreeditString;
+ int m_splitViewResizeBy;
+ Qt::WindowStates m_splitViewPreviousWindowStates;
+ QRectF m_transformation;
+
friend class tst_QInputContext;
};
+Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable);
+
QT_END_NAMESPACE
#endif // QT_NO_IM
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 1bef64d..73aa982 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -48,6 +48,8 @@
#include <qgraphicsscene.h>
#include <qgraphicswidget.h>
#include <qsymbianevent.h>
+#include <qlayout.h>
+#include <qdesktopwidget.h>
#include <private/qcore_symbian_p.h>
#include <fepitfr.h>
@@ -67,8 +69,16 @@
// that support text selection.
#define QT_EAknEditorFlagSelectionVisible 0x100000
+// EAknEditorFlagEnablePartialScreen is only valid from Sym^3 onwards.
+#define QT_EAknEditorFlagEnablePartialScreen 0x200000
+
QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
+{
+ S60->partial_keyboard = enable;
+}
+
QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
: QInputContext(parent),
m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new
@@ -80,13 +90,19 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_inlinePosition(0),
m_formatRetriever(0),
m_pointerHandler(0),
- m_hasTempPreeditString(false)
+ m_hasTempPreeditString(false),
+ m_splitViewResizeBy(0),
+ m_splitViewPreviousWindowStates(Qt::WindowNoState)
{
m_fepState->SetObjectProvider(this);
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
- m_fepState->SetFlags(EAknEditorFlagDefault | QT_EAknEditorFlagSelectionVisible);
- else
- m_fepState->SetFlags(EAknEditorFlagDefault);
+ int defaultFlags = EAknEditorFlagDefault;
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ if (S60->partial_keyboard) {
+ defaultFlags |= QT_EAknEditorFlagEnablePartialScreen;
+ }
+ defaultFlags |= QT_EAknEditorFlagSelectionVisible;
+ }
+ m_fepState->SetFlags(defaultFlags);
m_fepState->SetDefaultInputMode( EAknEditorTextInputMode );
m_fepState->SetPermittedInputModes( EAknEditorAllInputModes );
m_fepState->SetDefaultCase( EAknEditorTextCase );
@@ -210,6 +226,21 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
return false;
switch (event->type()) {
+ case QEvent::MouseButtonPress:
+ // Alphanumeric keypad doesn't like it when we click and text is still getting displayed
+ // It ignores the mouse event, so we need to commit and send a selection event (which will get triggered
+ // after the commit)
+ if (!m_preeditString.isEmpty()) {
+ commitCurrentString(false);
+
+ int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
+
+ QList<QInputMethodEvent::Attribute> selectAttributes;
+ selectAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, 0, QVariant());
+ QInputMethodEvent selectEvent(QLatin1String(""), selectAttributes);
+ sendEvent(selectEvent);
+ }
+ break;
case QEvent::KeyPress:
commitTemporaryPreeditString();
// fall through intended
@@ -343,6 +374,164 @@ TCoeInputCapabilities QCoeFepInputContext::inputCapabilities()
return TCoeInputCapabilities(m_textCapabilities, this, 0);
}
+void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
+{
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(S60->splitViewLastWidget);
+
+ if (!gv) {
+ return;
+ }
+
+ QSymbianControl *symControl = static_cast<QSymbianControl*>(gv->effectiveWinId());
+ symControl->CancelLongTapTimer();
+
+ const bool alwaysResize = (gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff);
+ QWidget *windowToMove = gv->window();
+
+ bool userResize = gv->testAttribute(Qt::WA_Resized);
+
+ windowToMove->setUpdatesEnabled(false);
+
+ if (!alwaysResize) {
+ if (gv->scene()) {
+ disconnect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
+ QGraphicsItem *rootItem;
+ foreach (QGraphicsItem *item, gv->scene()->items()) {
+ if (!item->parentItem()) {
+ rootItem = item;
+ break;
+ }
+ }
+ if (rootItem)
+ rootItem->resetTransform();
+ }
+ } else {
+ if (m_splitViewResizeBy)
+ gv->resize(gv->rect().width(), m_splitViewResizeBy);
+ }
+ // Resizing might have led to widget losing its original windowstate.
+ // Restore previous window state.
+
+ if (m_splitViewPreviousWindowStates != windowToMove->windowState())
+ windowToMove->setWindowState(m_splitViewPreviousWindowStates);
+
+ windowToMove->setUpdatesEnabled(true);
+
+ gv->setAttribute(Qt::WA_Resized, userResize); //not a user resize
+
+ m_splitViewResizeBy = 0;
+ if (!keepInputWidget) {
+ m_splitViewPreviousWindowStates = Qt::WindowNoState;
+ S60->splitViewLastWidget = 0;
+ }
+}
+
+// Checks if a given widget is visible in the splitview rect. The offset
+// parameter can be used to validate if moving widget upwards or downwards
+// by the offset would make a difference for the visibility.
+
+bool QCoeFepInputContext::isWidgetVisible(QWidget *widget, int offset)
+{
+ bool visible = false;
+ if (widget) {
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ QWidget *window = QApplication::activeWindow();
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(widget);
+ if (gv && window) {
+ if (QGraphicsScene *scene = gv->scene()) {
+ if (QGraphicsItem *focusItem = scene->focusItem()) {
+ QPoint cursorPos = window->mapToGlobal(focusItem->cursor().pos());
+ cursorPos.setY(cursorPos.y() + offset);
+ if (splitViewRect.contains(cursorPos)) {
+ visible = true;
+ }
+ }
+ }
+ }
+ }
+ return visible;
+}
+
+// Ensure that the input widget is visible in the splitview rect.
+
+void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
+{
+ // Native side opening and closing its virtual keyboard when it changes the keyboard layout,
+ // has an adverse impact on long tap timer. Cancel the timer when splitview opens to avoid this.
+ QSymbianControl *symControl = static_cast<QSymbianControl*>(widget->effectiveWinId());
+ symControl->CancelLongTapTimer();
+
+ // Graphicsviews that have vertical scrollbars should always be resized to the splitview area.
+ // Graphicsviews without scrollbars should be translated.
+
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(widget);
+ if (!gv)
+ return;
+
+ const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff);
+ const bool moveWithinVisibleArea = (S60->splitViewLastWidget != 0);
+
+ QWidget *windowToMove = gv ? gv : symControl->widget();
+ if (!windowToMove->isWindow())
+ windowToMove = windowToMove->window();
+ if (!windowToMove) {
+ return;
+ }
+
+ // When opening the keyboard (not moving within the splitview area), save the original
+ // window state. In some cases, ensuring input widget visibility might lead to window
+ // states getting changed.
+
+ if (!moveWithinVisibleArea) {
+ S60->splitViewLastWidget = widget;
+ m_splitViewPreviousWindowStates = windowToMove->windowState();
+ }
+
+ int windowTop = widget->window()->pos().y();
+
+ const bool userResize = widget->testAttribute(Qt::WA_Resized);
+
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+
+
+ // When resizing a window widget, it will lose its maximized window state.
+ // Native applications hide statuspane in splitview state, so lets move to
+ // fullscreen mode. This makes available area slightly bigger, which helps usability
+ // and greatly reduces event passing in orientation switch cases,
+ // as the statuspane size is not changing.
+
+ if (!(windowToMove->windowState() & Qt::WindowFullScreen)) {
+ windowToMove->setWindowState(
+ (windowToMove->windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | Qt::WindowFullScreen);
+ }
+
+ if (alwaysResize) {
+ windowToMove->setUpdatesEnabled(false);
+ if (!moveWithinVisibleArea)
+ m_splitViewResizeBy = widget->height();
+
+ windowTop = widget->geometry().top();
+ widget->resize(widget->width(), splitViewRect.height() - windowTop);
+
+ if (gv->scene()) {
+ const QRectF microFocusRect = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ gv->ensureVisible(microFocusRect);
+ }
+ windowToMove->setUpdatesEnabled(true);
+ } else {
+ if (!moveWithinVisibleArea) {
+ // Check if the widget contains cursorPositionChanged signal and connect to it.
+ const char *signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged())).constData();
+ int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal + 1);
+ if (index != -1)
+ connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
+ }
+ translateInputWidget();
+ }
+
+ widget->setAttribute(Qt::WA_Resized, userResize); //not a user resize
+}
+
static QTextCharFormat qt_TCharFormat2QTextCharFormat(const TCharFormat &cFormat, bool validStyleColor)
{
QTextCharFormat qFormat;
@@ -474,10 +663,12 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
m_fepState->SetPermittedCases(flags);
ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateCaseModeUpdate);
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
- flags = QT_EAknEditorFlagSelectionVisible;
- else
- flags = 0;
+ flags = 0;
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ if (S60->partial_keyboard)
+ flags |= QT_EAknEditorFlagEnablePartialScreen;
+ flags |= QT_EAknEditorFlagSelectionVisible;
+ }
if (hints & ImhUppercaseOnly && !(hints & ImhLowercaseOnly)
|| hints & ImhLowercaseOnly && !(hints & ImhUppercaseOnly)) {
flags |= EAknEditorFlagFixedCase;
@@ -604,6 +795,47 @@ void QCoeFepInputContext::ensureInputCapabilitiesChanged()
m_pendingInputCapabilitiesChanged = false;
}
+void QCoeFepInputContext::translateInputWidget()
+{
+ QGraphicsView *gv = qobject_cast<QGraphicsView *>(S60->splitViewLastWidget);
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+
+ QRectF cursor = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QPolygon cursorP = gv->mapFromScene(cursor);
+ QRectF vkbRect = QRectF(splitViewRect.bottomLeft(), qApp->desktop()->rect().bottomRight());
+ if (cursor.isEmpty() || vkbRect.isEmpty())
+ return;
+
+ // Fetch root item (i.e. graphicsitem with no parent)
+ QGraphicsItem *rootItem;
+ foreach (QGraphicsItem *item, gv->scene()->items()) {
+ if (!item->parentItem()) {
+ rootItem = item;
+ break;
+ }
+ }
+ if (!rootItem)
+ return;
+
+ m_transformation = (rootItem->transform().isTranslating()) ? QRectF(0,0, gv->width(), rootItem->transform().dy()) : QRectF();
+
+ // Do nothing if the cursor is visible in the splitview area.
+ if (splitViewRect.contains(cursorP.boundingRect()))
+ return;
+
+ // New Y position should be ideally at the center of the splitview area.
+ // If that would expose unpainted canvas, limit the tranformation to the visible scene bottom.
+
+ const qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom() + m_transformation.height();
+ qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2)));
+
+ // Do not allow transform above screen top.
+ if (m_transformation.height() + dy > 0)
+ return;
+
+ rootItem->setTransform(QTransform::fromTranslate(0, dy), true);
+}
+
void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* /*aCustomDraw*/,
MFepInlineTextFormatRetriever& aInlineTextFormatRetriever,
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index 6359f0b..d6d9536 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -3274,9 +3274,17 @@ void QHeaderViewPrivate::clear()
void QHeaderViewPrivate::flipSortIndicator(int section)
{
Q_Q(QHeaderView);
- bool ascending = (sortIndicatorSection != section
- || sortIndicatorOrder == Qt::DescendingOrder);
- q->setSortIndicator(section, ascending ? Qt::AscendingOrder : Qt::DescendingOrder);
+ Qt::SortOrder sortOrder;
+ if (sortIndicatorSection == section) {
+ sortOrder = (sortIndicatorOrder == Qt::DescendingOrder) ? Qt::AscendingOrder : Qt::DescendingOrder;
+ } else {
+ const QVariant value = model->headerData(section, orientation, Qt::InitialSortOrderRole);
+ if (value.canConvert(QVariant::Int))
+ sortOrder = static_cast<Qt::SortOrder>(value.toInt());
+ else
+ sortOrder = Qt::AscendingOrder;
+ }
+ q->setSortIndicator(section, sortOrder);
}
void QHeaderViewPrivate::cascadingResize(int visual, int newSize)
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index 3196ba5..eb56f56 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -227,7 +227,7 @@ public:
void _q_sourceColumnsRemoved(const QModelIndex &source_parent,
int start, int end);
- void clear_mapping();
+ void _q_clearMapping();
void sort();
bool update_source_sort_column();
@@ -281,7 +281,7 @@ typedef QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping *> IndexMap;
void QSortFilterProxyModelPrivate::_q_sourceModelDestroyed()
{
QAbstractProxyModelPrivate::_q_sourceModelDestroyed();
- clear_mapping();
+ _q_clearMapping();
}
void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source_parent)
@@ -293,7 +293,7 @@ void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source
}
}
-void QSortFilterProxyModelPrivate::clear_mapping()
+void QSortFilterProxyModelPrivate::_q_clearMapping()
{
// store the persistent indexes
QModelIndexPairList source_indexes = store_persistent_indexes();
@@ -1225,7 +1225,7 @@ void QSortFilterProxyModelPrivate::_q_sourceReset()
{
Q_Q(QSortFilterProxyModel);
invalidatePersistentIndexes();
- clear_mapping();
+ _q_clearMapping();
// All internal structures are deleted in clear()
q->endResetModel();
update_source_sort_column();
@@ -1521,6 +1521,7 @@ QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent)
d->filter_column = 0;
d->filter_role = Qt::DisplayRole;
d->dynamic_sortfilter = false;
+ connect(this, SIGNAL(modelReset()), this, SLOT(_q_clearMapping()));
}
/*!
@@ -1622,7 +1623,7 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
connect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset()));
connect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset()));
- d->clear_mapping();
+ d->_q_clearMapping();
endResetModel();
if (d->update_source_sort_column() && d->dynamic_sortfilter)
d->sort();
@@ -2313,7 +2314,7 @@ void QSortFilterProxyModel::clear()
{
Q_D(QSortFilterProxyModel);
emit layoutAboutToBeChanged();
- d->clear_mapping();
+ d->_q_clearMapping();
emit layoutChanged();
}
@@ -2328,7 +2329,7 @@ void QSortFilterProxyModel::invalidate()
{
Q_D(QSortFilterProxyModel);
emit layoutAboutToBeChanged();
- d->clear_mapping();
+ d->_q_clearMapping();
emit layoutChanged();
}
diff --git a/src/gui/itemviews/qsortfilterproxymodel.h b/src/gui/itemviews/qsortfilterproxymodel.h
index 09fd20f..afeaa69 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.h
+++ b/src/gui/itemviews/qsortfilterproxymodel.h
@@ -189,6 +189,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsInserted(const QModelIndex &source_parent, int start, int end))
Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end))
Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsRemoved(const QModelIndex &source_parent, int start, int end))
+ Q_PRIVATE_SLOT(d_func(), void _q_clearMapping())
};
QT_END_NAMESPACE
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d03babb..21c9d3b 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2744,6 +2744,7 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const
int start = -1;
int end = -1;
+ int indexRow = index.row();
int count = d->header->count();
bool emptyHeader = (count == 0);
QModelIndex parent = index.parent();
@@ -2780,7 +2781,7 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const
int logicalColumn = emptyHeader ? column : d->header->logicalIndex(column);
if (d->header->isSectionHidden(logicalColumn))
continue;
- QModelIndex idx = d->model->index(index.row(), logicalColumn, parent);
+ QModelIndex idx = d->model->index(indexRow, logicalColumn, parent);
if (idx.isValid()) {
QWidget *editor = d->editorForIndex(idx).widget.data();
if (editor && d->persistent.contains(editor)) {
@@ -3215,14 +3216,14 @@ int QTreeViewPrivate::itemHeight(int item) const
if (viewItems.isEmpty())
return 0;
const QModelIndex &index = viewItems.at(item).index;
+ if (!index.isValid())
+ return 0;
int height = viewItems.at(item).height;
- if (height <= 0 && index.isValid()) {
+ if (height <= 0) {
height = q_func()->indexRowSizeHint(index);
viewItems[item].height = height;
}
- if (!index.isValid() || height < 0)
- return 0;
- return height;
+ return qMax(height, 0);
}
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index a6815a8..954c6de 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -639,6 +639,8 @@ public:
int pressureSupported;
int maxTouchPressure;
QList<QTouchEvent::TouchPoint> appAllTouchPoints;
+
+ bool useTranslucentEGLSurfaces;
#endif
private:
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index f0801e3..642d3e6 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -204,6 +204,11 @@ QString qws_dataDir()
result = QT_VFB_DATADIR(qws_display_id);
QByteArray dataDir = result.toLocal8Bit();
+#if defined(Q_OS_INTEGRITY)
+ /* ensure filesystem is ready before starting requests */
+ WaitForFileSystemInitialization();
+#endif
+
if (QT_MKDIR(dataDir, 0700)) {
if (errno != EEXIST) {
qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData());
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index eb9c7ed..3ce597b 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -87,7 +87,7 @@
#include <hal.h>
#include <hal_data.h>
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
#include <graphics/wstfxconst.h>
#endif
@@ -96,6 +96,9 @@ QT_BEGIN_NAMESPACE
// Goom Events through Window Server
static const int KGoomMemoryLowEvent = 0x10282DBF;
static const int KGoomMemoryGoodEvent = 0x20026790;
+// Split view open/close events from AVKON
+static const int KSplitViewOpenEvent = 0x2001E2C0;
+static const int KSplitViewCloseEvent = 0x2001E2C1;
#if defined(QT_DEBUG)
static bool appNoGrab = false; // Grabbing enabled
@@ -401,6 +404,7 @@ QSymbianControl::QSymbianControl(QWidget *w)
, m_longTapDetector(0)
, m_ignoreFocusChanged(0)
, m_symbianPopupIsOpen(0)
+ , m_inExternalScreenOverride(false)
{
}
@@ -408,9 +412,11 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
{
if (!desktop)
{
- if (isWindowOwning || !qwidget->parentWidget())
- CreateWindowL(S60->windowGroup());
- else
+ if (isWindowOwning || !qwidget->parentWidget()
+ || qwidget->parentWidget()->windowType() == Qt::Desktop) {
+ RWindowGroup &wg(S60->windowGroup(qwidget));
+ CreateWindowL(wg);
+ } else {
/**
* TODO: in order to avoid creating windows for all ancestors of
* this widget up to the root window, the parameter passed to
@@ -420,6 +426,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
* is created for a widget between this one and the root window.
*/
CreateWindowL(qwidget->parentWidget()->winId());
+ }
// Necessary in order to be able to track the activation status of
// the control's window
@@ -432,7 +439,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
DrawableWindow()->SetPointerGrab(ETrue);
}
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
if (OwnsWindow()) {
TTfxWindowPurpose windowPurpose(ETfxPurposeNone);
switch (qwidget->windowType()) {
@@ -452,7 +459,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
windowPurpose = ETfxPurposeSplashScreenWindow;
break;
default:
- windowPurpose = (isWindowOwning || !qwidget->parentWidget())
+ windowPurpose = (isWindowOwning || !qwidget->parentWidget() || qwidget->parentWidget()->windowType() == Qt::Desktop)
? ETfxPurposeWindow : ETfxPurposeChildWindow;
break;
}
@@ -983,14 +990,15 @@ TKeyResponse QSymbianControl::handleVirtualMouse(const TKeyEvent& keyEvent,TEven
}
}
//clip to screen size (window server allows a sprite hotspot to be outside the screen)
+ int screenNumber = S60->screenNumberForWidget(qwidget);
if (x < 0)
x = 0;
- else if (x >= S60->screenWidthInPixels)
- x = S60->screenWidthInPixels - 1;
+ else if (x >= S60->screenWidthInPixelsForScreen[screenNumber])
+ x = S60->screenWidthInPixelsForScreen[screenNumber] - 1;
if (y < 0)
y = 0;
- else if (y >= S60->screenHeightInPixels)
- y = S60->screenHeightInPixels - 1;
+ else if (y >= S60->screenHeightInPixelsForScreen[screenNumber])
+ y = S60->screenHeightInPixelsForScreen[screenNumber] - 1;
TPoint epos(x, y);
TPoint cpos = epos - PositionRelativeToScreen();
fakeEvent.iPosition = cpos;
@@ -1167,6 +1175,18 @@ void QSymbianControl::SizeChanged()
QSize newSize(Size().iWidth, Size().iHeight);
if (oldSize != newSize) {
+ const bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
+ const int screenNumber = S60->screenNumberForWidget(qwidget);
+ if (!m_inExternalScreenOverride && isFullscreen && screenNumber > 0) {
+ int screenWidth = S60->screenWidthInPixelsForScreen[screenNumber];
+ int screenHeight = S60->screenHeightInPixelsForScreen[screenNumber];
+ TSize screenSize(screenWidth, screenHeight);
+ if (screenWidth > 0 && screenHeight > 0 && screenSize != Size()) {
+ m_inExternalScreenOverride = true;
+ SetExtent(TPoint(0, 0), screenSize);
+ return;
+ }
+ }
QRect cr = qwidget->geometry();
cr.setSize(newSize);
qwidget->data->crect = cr;
@@ -1189,6 +1209,8 @@ void QSymbianControl::SizeChanged()
}
}
+ m_inExternalScreenOverride = false;
+
// CCoeControl::SetExtent calls SizeChanged, but does not call
// PositionChanged, so we call it here to ensure that the widget's
// position is updated.
@@ -1224,6 +1246,11 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
return;
+#ifdef Q_WS_S60
+ if (S60->splitViewLastWidget)
+ return;
+#endif
+
// Popups never get focused, but still receive the FocusChanged when they are hidden.
if (QApplicationPrivate::popupWidgets != 0
|| (qwidget->windowType() & Qt::Popup) == Qt::Popup)
@@ -1302,9 +1329,56 @@ void QSymbianControl::handleClientAreaChange()
}
}
+bool QSymbianControl::isSplitViewWidget(QWidget *widget) {
+ bool returnValue = true;
+ //Ignore events sent to non-active windows, not visible widgets and not parents of input widget.
+ if (!qwidget->isActiveWindow()
+ || !qwidget->isVisible()
+ || !qwidget->isAncestorOf(widget)) {
+
+ returnValue = false;
+ }
+ return returnValue;
+}
+
void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
+ case KSplitViewCloseEvent: //intentional fall-through
+ case KSplitViewOpenEvent: {
+#if !defined(QT_NO_IM) && defined(Q_WS_S60)
+
+ //Fetch widget getting the text input
+ QWidget *widget = QWidget::keyboardGrabber();
+ if (!widget) {
+ if (QApplicationPrivate::popupWidgets) {
+ widget = QApplication::activePopupWidget()->focusWidget();
+ if (!widget) {
+ widget = QApplication::activePopupWidget();
+ }
+ } else {
+ widget = QApplicationPrivate::focus_widget;
+ if (!widget) {
+ widget = qwidget;
+ }
+ }
+ }
+ if (widget) {
+ QCoeFepInputContext *ic = qobject_cast<QCoeFepInputContext *>(widget->inputContext());
+ if (!ic) {
+ ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
+ }
+ if (ic && isSplitViewWidget(widget)) {
+ if (resourceType == KSplitViewCloseEvent) {
+ ic->resetSplitViewWidget();
+ } else {
+ ic->ensureFocusWidgetVisible(widget);
+ }
+ }
+ }
+#endif // !defined(QT_NO_IM) && defined(Q_WS_S60)
+ }
+ break;
case KInternalStatusPaneChange:
handleClientAreaChange();
if (IsFocused() && IsVisible()) {
@@ -1547,6 +1621,8 @@ void qt_init(QApplicationPrivate * /* priv */, int)
repository = 0;
#endif
+ qt_keymapper_private()->updateInputLanguage();
+
#ifdef QT_KEYPAD_NAVIGATION
if (touch) {
QApplicationPrivate::navigationMode = Qt::NavigationModeNone;
@@ -1586,10 +1662,36 @@ void qt_init(QApplicationPrivate * /* priv */, int)
systemFont.setFamily(systemFont.defaultFamily());
QApplicationPrivate::setSystemFont(systemFont);
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
QObject::connect(qApp, SIGNAL(aboutToQuit()), qApp, SLOT(_q_aboutToQuit()));
#endif
+#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true;
+
+ const TUid KIvePropertyCat = {0x2726beef};
+ enum TIvePropertyChipType {
+ EVCBCM2727B1 = 0x00000000,
+ EVCBCM2763A0 = 0x04000100,
+ EVCBCM2763B0 = 0x04000102,
+ EVCBCM2763C0 = 0x04000103,
+ EVCBCM2763C1 = 0x04000104,
+ EVCBCMUnknown = 0x7fffffff
+ };
+
+ TInt chipType = EVCBCMUnknown;
+ if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) {
+ if (chipType == EVCBCM2727B1) {
+ // We have only 32MB GPU memory. Use raster surfaces
+ // for transparent TLWs.
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+ }
+ } else {
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+ }
+#else
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+#endif
/*
### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag
int argc = priv->argc;
@@ -1693,7 +1795,7 @@ bool QApplicationPrivate::modalState()
void QApplicationPrivate::enterModal_sys(QWidget *widget)
{
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
S60->wsSession().SendEffectCommand(ETfxCmdAppModalModeEnter);
#endif
if (widget) {
@@ -1711,7 +1813,7 @@ void QApplicationPrivate::enterModal_sys(QWidget *widget)
void QApplicationPrivate::leaveModal_sys(QWidget *widget)
{
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
S60->wsSession().SendEffectCommand(ETfxCmdAppModalModeExit);
#endif
if (widget) {
@@ -1986,7 +2088,10 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
return 1;
}
break;
- case EEventScreenDeviceChanged:
+ case EEventScreenDeviceChanged: // fallthrough
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ case EEventDisplayChanged:
+#endif
if (callSymbianEventFilters(symbianEvent))
return 1;
if (S60)
@@ -2094,6 +2199,13 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
}
break;
#endif
+
+#ifdef Q_WS_S60
+ case KEikInputLanguageChange:
+ qt_keymapper_private()->updateInputLanguage();
+ break;
+#endif
+
default:
break;
}
@@ -2392,7 +2504,7 @@ void QApplication::restoreOverrideCursor()
void QApplicationPrivate::_q_aboutToQuit()
{
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
// Send the shutdown tfx command
S60->wsSession().SendEffectCommand(ETfxCmdAppShutDown);
#endif
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index fbb4920..589b12e 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -5227,14 +5227,15 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
bool trust = isVisible()
&& (d->topData()->parentWinId == XNone ||
d->topData()->parentWinId == QX11Info::appRootWindow());
+ bool isCPos = false;
if (event->xconfigure.send_event || trust) {
// if a ConfigureNotify comes from a real sendevent request, we can
// trust its values.
newCPos.rx() = event->xconfigure.x + event->xconfigure.border_width;
newCPos.ry() = event->xconfigure.y + event->xconfigure.border_width;
+ isCPos = true;
}
-
if (isVisible())
QApplication::syncX();
@@ -5260,6 +5261,7 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
otherEvent.xconfigure.border_width;
newCPos.ry() = otherEvent.xconfigure.y +
otherEvent.xconfigure.border_width;
+ isCPos = true;
}
}
#ifndef QT_NO_XSYNC
@@ -5272,6 +5274,19 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
#endif // QT_NO_XSYNC
}
+ if (!isCPos) {
+ // we didn't get an updated position of the toplevel.
+ // either we haven't moved or there is a bug in the window manager.
+ // anyway, let's query the position to be certain.
+ int x, y;
+ Window child;
+ XTranslateCoordinates(X11->display, internalWinId(),
+ QApplication::desktop()->screen(d->xinfo.screen())->internalWinId(),
+ 0, 0, &x, &y, &child);
+ newCPos.rx() = x;
+ newCPos.ry() = y;
+ }
+
QRect cr (geometry());
if (newCPos != cr.topLeft()) { // compare with cpos (exluding frame)
QPoint oldPos = geometry().topLeft();
@@ -5314,18 +5329,6 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
}
if (wasResize) {
- static bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
- if (d->extra->compress_events && !slowResize && !data->in_show && isVisible()) {
- QApplication::syncX();
- XEvent otherEvent;
- while (XCheckTypedWindowEvent(X11->display, internalWinId(), ConfigureNotify, &otherEvent)
- && !qt_x11EventFilter(&otherEvent) && !x11Event(&otherEvent)
- && otherEvent.xconfigure.event == otherEvent.xconfigure.window) {
- data->crect.setWidth(otherEvent.xconfigure.width);
- data->crect.setHeight(otherEvent.xconfigure.height);
- }
- }
-
if (isVisible() && data->crect.size() != oldSize) {
Q_ASSERT(d->extra->topextra);
QWidgetBackingStore *bs = d->extra->topextra->backingStore.data();
@@ -5334,7 +5337,7 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
// resize optimization in order to get invalidated regions for resized widgets.
// The optimization discards all invalidateBuffer() calls since we're going to
// repaint everything anyways, but that's not the case with static contents.
- if (!slowResize && !hasStaticContents)
+ if (!hasStaticContents)
d->extra->topextra->inTopLevelResize = true;
QResizeEvent e(data->crect.size(), oldSize);
QApplication::sendSpontaneousEvent(this, &e);
diff --git a/src/gui/kernel/qcocoaintrospection_mac.mm b/src/gui/kernel/qcocoaintrospection_mac.mm
index 9b536b7..70c893a 100644
--- a/src/gui/kernel/qcocoaintrospection_mac.mm
+++ b/src/gui/kernel/qcocoaintrospection_mac.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qcocoaintrospection_p.h b/src/gui/kernel/qcocoaintrospection_p.h
index b9422e8..1c7d6ac 100644
--- a/src/gui/kernel/qcocoaintrospection_p.h
+++ b/src/gui/kernel/qcocoaintrospection_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qcocoapanel_mac_p.h b/src/gui/kernel/qcocoapanel_mac_p.h
index b41a4b5..5426159 100644
--- a/src/gui/kernel/qcocoapanel_mac_p.h
+++ b/src/gui/kernel/qcocoapanel_mac_p.h
@@ -60,6 +60,13 @@
QT_FORWARD_DECLARE_CLASS(QStringList);
QT_FORWARD_DECLARE_CLASS(QCocoaDropData);
+@interface NSPanel (QtIntegration)
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
+- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
+- (void)draggingExited:(id <NSDraggingInfo>)sender;
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+@end
+
@interface QT_MANGLE_NAMESPACE(QCocoaPanel) : NSPanel {
QStringList *currentCustomDragTypes;
QCocoaDropData *dropData;
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 662b825..7d41f3d 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -88,6 +88,8 @@ QT_END_NAMESPACE
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
if (!widget)
return NO; // This should happen only for qt_root_win
+ if (QApplicationPrivate::isBlockedByModal(widget))
+ return NO;
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
@@ -99,6 +101,8 @@ QT_END_NAMESPACE
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
if (!widget)
return NO; // This should happen only for qt_root_win
+ if ([self isSheet])
+ return NO;
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 976612e..43eb072 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -858,7 +858,7 @@ static int qCocoaViewCount = 0;
- (BOOL)resignFirstResponder
{
if (!qwidget)
- return NO;
+ return YES;
// Seems like the following test only triggers if this
// view is inside a QMacNativeWidget:
@@ -1044,7 +1044,7 @@ static int qCocoaViewCount = 0;
QString qtText;
// Cursor position is retrived from the range.
QList<QInputMethodEvent::Attribute> attrs;
- attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location, 1, QVariant());
+ attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location + selRange.length, 1, QVariant());
if ([aString isKindOfClass:[NSAttributedString class]]) {
qtText = QCFString::toQString(reinterpret_cast<CFStringRef>([aString string]));
composingLength = qtText.length();
diff --git a/src/gui/kernel/qcocoawindow_mac_p.h b/src/gui/kernel/qcocoawindow_mac_p.h
index e6b50f5..d567cab 100644
--- a/src/gui/kernel/qcocoawindow_mac_p.h
+++ b/src/gui/kernel/qcocoawindow_mac_p.h
@@ -74,6 +74,13 @@ QT_FORWARD_DECLARE_CLASS(QCocoaDropData);
- (QWidget *)QT_MANGLE_NAMESPACE(qt_qwidget);
@end
+@interface NSWindow (QtIntegration)
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
+- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
+- (void)draggingExited:(id <NSDraggingInfo>)sender;
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+@end
+
@interface QT_MANGLE_NAMESPACE(QCocoaWindow) : NSWindow {
QStringList *currentCustomDragTypes;
QCocoaDropData *dropData;
diff --git a/src/gui/kernel/qcursor_mac.mm b/src/gui/kernel/qcursor_mac.mm
index 0d57b85..0afa3ee 100644
--- a/src/gui/kernel/qcursor_mac.mm
+++ b/src/gui/kernel/qcursor_mac.mm
@@ -215,7 +215,7 @@ void qt_mac_update_cursor()
widgetUnderMouse = qt_button_down;
} else {
QPoint localPoint;
- QPoint globalPoint = QCursor::pos();
+ QPoint globalPoint;
qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, 0, &widgetUnderMouse);
}
qt_mac_updateCursorWithWidgetUnderMouse(widgetUnderMouse);
diff --git a/src/gui/kernel/qdesktopwidget_qpa_p.h b/src/gui/kernel/qdesktopwidget_qpa_p.h
index 47ccca2..abee8a1 100644
--- a/src/gui/kernel/qdesktopwidget_qpa_p.h
+++ b/src/gui/kernel/qdesktopwidget_qpa_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 3653ae2..c3963f4 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -44,36 +44,67 @@
#include "qwidget_p.h"
#include "qt_s60_p.h"
#include <w32std.h>
-
-#include "hal.h"
-#include "hal_data.h"
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+#include <graphics/displaycontrol.h>
+#endif
QT_BEGIN_NAMESPACE
-class QDesktopWidgetPrivate : public QWidgetPrivate
+extern int qt_symbian_create_desktop_on_screen;
+
+class QSingleDesktopWidget : public QWidget
+{
+public:
+ QSingleDesktopWidget();
+ ~QSingleDesktopWidget();
+};
+
+QSingleDesktopWidget::QSingleDesktopWidget()
+ : QWidget(0, Qt::Desktop)
+{
+}
+
+QSingleDesktopWidget::~QSingleDesktopWidget()
{
+ const QObjectList &childList = children();
+ for (int i = childList.size(); i > 0 ;) {
+ --i;
+ childList.at(i)->setParent(0);
+ }
+}
+class QDesktopWidgetPrivate : public QWidgetPrivate
+{
public:
QDesktopWidgetPrivate();
~QDesktopWidgetPrivate();
-
static void init(QDesktopWidget *that);
static void cleanup();
+ static void init_sys();
static int screenCount;
static int primaryScreen;
static QVector<QRect> *rects;
static QVector<QRect> *workrects;
+ static QVector<QWidget *> *screens;
static int refcount;
+
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ static MDisplayControl *displayControl;
+#endif
};
int QDesktopWidgetPrivate::screenCount = 1;
int QDesktopWidgetPrivate::primaryScreen = 0;
QVector<QRect> *QDesktopWidgetPrivate::rects = 0;
QVector<QRect> *QDesktopWidgetPrivate::workrects = 0;
+QVector<QWidget *> *QDesktopWidgetPrivate::screens = 0;
int QDesktopWidgetPrivate::refcount = 0;
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+MDisplayControl *QDesktopWidgetPrivate::displayControl = 0;
+#endif
QDesktopWidgetPrivate::QDesktopWidgetPrivate()
{
@@ -88,25 +119,55 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
void QDesktopWidgetPrivate::init(QDesktopWidget *that)
{
- Q_UNUSED(that);
-// int screenCount=0;
-
- // ### TODO: Implement proper multi-display support
- QDesktopWidgetPrivate::screenCount = 1;
-// if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone)
-// QDesktopWidgetPrivate::screenCount = screenCount;
-// else
-// QDesktopWidgetPrivate::screenCount = 0;
+ // Note that on S^3 devices the screen count retrieved via RWsSession
+ // will always be 2 but the width and height for screen number 1 will
+ // be 0 as long as TV-out is not connected.
+ //
+ // On the other hand a valid size for screen 1 will be reported even
+ // after the cable is disconnected. In order to overcome this, we use
+ // MDisplayControl::NumberOfResolutions() to check if the display is
+ // valid or not.
+
+ screenCount = S60->screenCount();
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ if (displayControl) {
+ if (displayControl->NumberOfResolutions() < 1)
+ screenCount = 1;
+ }
+#endif
+ if (screenCount < 1) {
+ qWarning("No screen available");
+ screenCount = 1;
+ }
rects = new QVector<QRect>();
workrects = new QVector<QRect>();
-
- rects->resize(QDesktopWidgetPrivate::screenCount);
- workrects->resize(QDesktopWidgetPrivate::screenCount);
-
- (*rects)[0].setRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
- QRect wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
- (*workrects)[0].setRect(wr.x(), wr.y(), wr.width(), wr.height());
+ screens = new QVector<QWidget *>();
+
+ rects->resize(screenCount);
+ workrects->resize(screenCount);
+ screens->resize(screenCount);
+
+ for (int i = 0; i < screenCount; ++i) {
+ // All screens will have a position of (0, 0) as there is no true virtual desktop
+ // or pointer event support for multiple screens on Symbian.
+ QRect r(0, 0,
+ S60->screenWidthInPixelsForScreen[i], S60->screenHeightInPixelsForScreen[i]);
+ // Stop here if empty and ignore this screen.
+ if (r.isEmpty()) {
+ screenCount = i;
+ break;
+ }
+ (*rects)[i] = r;
+ QRect wr;
+ if (i == 0)
+ wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ else
+ wr = rects->at(i);
+ (*workrects)[i].setRect(wr.x(), wr.y(), wr.width(), wr.height());
+ (*screens)[i] = 0;
+ }
+ (*screens)[0] = that;
}
void QDesktopWidgetPrivate::cleanup()
@@ -115,6 +176,27 @@ void QDesktopWidgetPrivate::cleanup()
rects = 0;
delete workrects;
workrects = 0;
+ if (screens) {
+ // First item is the QDesktopWidget so skip it.
+ for (int i = 1; i < screens->count(); ++i)
+ delete screens->at(i);
+ }
+ delete screens;
+ screens = 0;
+}
+
+void QDesktopWidgetPrivate::init_sys()
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ CWsScreenDevice *dev = S60->screenDevice(1);
+ if (dev) {
+ displayControl = static_cast<MDisplayControl *>(
+ dev->GetInterface(MDisplayControl::ETypeId));
+ if (displayControl) {
+ displayControl->EnableDisplayChangeEvents(ETrue);
+ }
+ }
+#endif
}
@@ -122,6 +204,7 @@ QDesktopWidget::QDesktopWidget()
: QWidget(*new QDesktopWidgetPrivate, 0, Qt::Desktop)
{
setObjectName(QLatin1String("desktop"));
+ QDesktopWidgetPrivate::init_sys();
QDesktopWidgetPrivate::init(this);
}
@@ -131,7 +214,7 @@ QDesktopWidget::~QDesktopWidget()
bool QDesktopWidget::isVirtualDesktop() const
{
- return true;
+ return false;
}
int QDesktopWidget::primaryScreen() const
@@ -145,9 +228,23 @@ int QDesktopWidget::numScreens() const
return QDesktopWidgetPrivate::screenCount;
}
-QWidget *QDesktopWidget::screen(int /* screen */)
+static inline QWidget *newSingleDesktopWidget(int screen)
{
- return this;
+ qt_symbian_create_desktop_on_screen = screen;
+ QWidget *w = new QSingleDesktopWidget;
+ qt_symbian_create_desktop_on_screen = -1;
+ return w;
+}
+
+QWidget *QDesktopWidget::screen(int screen)
+{
+ Q_D(QDesktopWidget);
+ if (screen < 0 || screen >= d->screenCount)
+ screen = d->primaryScreen;
+ if (!d->screens->at(screen)
+ || d->screens->at(screen)->windowType() != Qt::Desktop)
+ (*d->screens)[screen] = newSingleDesktopWidget(screen);
+ return (*d->screens)[screen];
}
const QRect QDesktopWidget::availableGeometry(int screen) const
@@ -168,14 +265,19 @@ const QRect QDesktopWidget::screenGeometry(int screen) const
return d->rects->at(screen);
}
-int QDesktopWidget::screenNumber(const QWidget * /* widget */) const
+int QDesktopWidget::screenNumber(const QWidget *widget) const
{
- return QDesktopWidgetPrivate::primaryScreen;
+ Q_D(const QDesktopWidget);
+ return widget
+ ? S60->screenNumberForWidget(widget)
+ : d->primaryScreen;
}
-int QDesktopWidget::screenNumber(const QPoint & /* point */) const
+int QDesktopWidget::screenNumber(const QPoint &point) const
{
- return QDesktopWidgetPrivate::primaryScreen;
+ Q_UNUSED(point);
+ Q_D(const QDesktopWidget);
+ return d->primaryScreen;
}
void QDesktopWidget::resizeEvent(QResizeEvent *)
@@ -203,6 +305,10 @@ void QDesktopWidget::resizeEvent(QResizeEvent *)
if (oldrect != newrect)
emit workAreaResized(j);
}
+
+ if (oldscreencount != d->screenCount) {
+ emit screenCountChanged(d->screenCount);
+ }
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index e7abb47..698c94b 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -53,6 +53,10 @@
#include "qgesture.h"
#include "qgesture_p.h"
+#ifdef Q_OS_SYMBIAN
+#include "private/qcore_symbian_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -724,12 +728,12 @@ QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
The \a type parameter must be QEvent::KeyPress, QEvent::KeyRelease,
or QEvent::ShortcutOverride.
- Int \a key is the code for the Qt::Key that the event loop should listen
- for. If \a key is 0, the event is not a result of a known key; for
+ Int \a key is the code for the Qt::Key that the event loop should listen
+ for. If \a key is 0, the event is not a result of a known key; for
example, it may be the result of a compose sequence or keyboard macro.
- The \a modifiers holds the keyboard modifiers, and the given \a text
- is the Unicode text that the key generated. If \a autorep is true,
- isAutoRepeat() will be true. \a count is the number of keys involved
+ The \a modifiers holds the keyboard modifiers, and the given \a text
+ is the Unicode text that the key generated. If \a autorep is true,
+ isAutoRepeat() will be true. \a count is the number of keys involved
in the event.
*/
QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text,
@@ -1658,7 +1662,7 @@ Qt::ButtonState QContextMenuEvent::state() const
string is controlled by the widget only). The AttributeType enum
describes the different attributes that can be set.
- A class implementing QWidget::inputMethodEvent() or
+ A class implementing QWidget::inputMethodEvent() or
QGraphicsItem::inputMethodEvent() should at least understand and
honor the \l TextFormat and \l Cursor attributes.
@@ -3023,9 +3027,16 @@ QShowEvent::~QShowEvent()
This event is only used to notify the application of a request.
It may be safely ignored.
- \note This class is currently supported for Mac OS X only.
+ \note This class is currently supported for Mac OS X and Symbian only.
*/
+QFileOpenEventPrivate::~QFileOpenEventPrivate()
+{
+#ifdef Q_OS_SYMBIAN
+ file.Close();
+#endif
+}
+
/*!
\internal
@@ -3049,6 +3060,22 @@ QFileOpenEvent::QFileOpenEvent(const QUrl &url)
f = url.toLocalFile();
}
+#ifdef Q_OS_SYMBIAN
+/*! \internal
+*/
+QFileOpenEvent::QFileOpenEvent(const RFile &fileHandle)
+ : QEvent(FileOpen)
+{
+ TFileName fullName;
+ fileHandle.FullName(fullName);
+ f = qt_TDesC2QString(fullName);
+ QScopedPointer<QFileOpenEventPrivate> priv(new QFileOpenEventPrivate(QUrl::fromLocalFile(f)));
+ // Duplicate here allows the file handle to be valid after S60 app construction is complete.
+ qt_symbian_throwIfError(priv->file.Duplicate(fileHandle));
+ d = reinterpret_cast<QEventPrivate *>(priv.take());
+}
+#endif
+
/*! \internal
*/
QFileOpenEvent::~QFileOpenEvent()
@@ -3074,6 +3101,39 @@ QUrl QFileOpenEvent::url() const
return reinterpret_cast<const QFileOpenEventPrivate *>(d)->url;
}
+/*!
+ \fn bool openFile(QFile &file, QIODevice::OpenMode flags) const
+
+ Opens a QFile on the file referenced by this event.
+ Returns true if successful; otherwise returns false.
+
+ This is necessary as some files cannot be opened by name, but require specific
+ information stored in this event.
+ For example, if this QFileOpenEvent contains a request to open a Symbian data caged file,
+ the QFile could only be opened from the Symbian RFile used in the construction of this event.
+
+ \since 4.8
+*/
+bool QFileOpenEvent::openFile(QFile &file, QIODevice::OpenMode flags) const
+{
+ file.setFileName(f);
+#ifdef Q_OS_SYMBIAN
+ const QFileOpenEventPrivate *priv = reinterpret_cast<const QFileOpenEventPrivate *>(d);
+ if (priv->file.SubSessionHandle()) {
+ RFile dup;
+ // Duplicate here means that the opened QFile will continue to be valid beyond the lifetime of this QFileOpenEvent.
+ // It also allows openFile to be used in threads other than the thread in which the QFileOpenEvent was created.
+ if (dup.Duplicate(priv->file) == KErrNone) {
+ QScopedPointer<RFile, QScopedPointerRCloser<RFile> > dupCloser(&dup);
+ bool open = file.open(dup, flags, QFile::AutoCloseHandle);
+ dupCloser.take();
+ return open;
+ }
+ }
+#endif
+ return file.open(flags);
+}
+
#ifndef QT_NO_TOOLBAR
/*!
\internal
@@ -3622,7 +3682,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
#endif
-/*!
+/*!
\class QTouchEvent
\brief The QTouchEvent class contains parameters that describe a touch event.
\since 4.6
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a7b06f4..93c2bc5 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -54,6 +54,11 @@
#include <QtCore/qvariant.h>
#include <QtCore/qmap.h>
#include <QtCore/qset.h>
+#include <QtCore/qfile.h>
+
+#ifdef Q_OS_SYMBIAN
+class RFile;
+#endif
QT_BEGIN_HEADER
@@ -641,10 +646,14 @@ class Q_GUI_EXPORT QFileOpenEvent : public QEvent
public:
QFileOpenEvent(const QString &file);
QFileOpenEvent(const QUrl &url);
+#ifdef Q_OS_SYMBIAN
+ QFileOpenEvent(const RFile &fileHandle);
+#endif
~QFileOpenEvent();
inline QString file() const { return f; }
QUrl url() const;
+ bool openFile(QFile &file, QIODevice::OpenMode flags) const;
private:
QString f;
};
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 3a27023..b79f372 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -46,6 +46,10 @@
#include <QtCore/qurl.h>
#include <QtGui/qevent.h>
+#ifdef Q_OS_SYMBIAN
+#include <f32file.h>
+#endif
+
QT_BEGIN_NAMESPACE
//
@@ -174,8 +178,12 @@ public:
: url(url)
{
}
+ ~QFileOpenEventPrivate();
QUrl url;
+#ifdef Q_OS_SYMBIAN
+ RFile file;
+#endif
};
diff --git a/src/gui/kernel/qeventdispatcher_glib_qpa.cpp b/src/gui/kernel/qeventdispatcher_glib_qpa.cpp
index 01d40ca..603aa2d 100644
--- a/src/gui/kernel/qeventdispatcher_glib_qpa.cpp
+++ b/src/gui/kernel/qeventdispatcher_glib_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qeventdispatcher_glib_qpa_p.h b/src/gui/kernel/qeventdispatcher_glib_qpa_p.h
index 1c32ab2..701f673 100644
--- a/src/gui/kernel/qeventdispatcher_glib_qpa_p.h
+++ b/src/gui/kernel/qeventdispatcher_glib_qpa_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 15410ad..677a736 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -561,6 +561,7 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
wakeUp();
emit awake();
+ bool excludeUserEvents = flags & QEventLoop::ExcludeUserInputEvents;
bool retVal = false;
forever {
if (d->interrupt)
@@ -571,7 +572,7 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
NSEvent* event = 0;
// First, send all previously excluded input events, if any:
- if (!(flags & QEventLoop::ExcludeUserInputEvents)) {
+ if (!excludeUserEvents) {
while (!d->queuedUserInputEvents.isEmpty()) {
event = static_cast<NSEvent *>(d->queuedUserInputEvents.takeFirst());
if (!filterEvent(event)) {
@@ -586,12 +587,12 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
// application, we should not run or stop NSApplication; This will be
// done from the application itself. And if processEvents is called
// manually (rather than from a QEventLoop), we cannot enter a tight
- // loop and block this call, but instead we need to return after one flush:
+ // loop and block this call, but instead we need to return after one flush.
+ // Finally, if we are to exclude user input events, we cannot call [NSApp run]
+ // as we then loose control over which events gets dispatched:
const bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning];
- const bool canExec_Qt =
- (flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec)
- && !(flags & QEventLoop::ExcludeUserInputEvents);
-
+ const bool canExec_Qt = !excludeUserEvents &&
+ (flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec) ;
if (canExec_Qt && canExec_3rdParty) {
// We can use exec-mode, meaning that we can stay in a tight loop until
@@ -619,22 +620,46 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
// Instead we will process all current pending events and return.
d->ensureNSAppInitialized();
if (NSModalSession session = d->currentModalSession()) {
- if (flags & QEventLoop::WaitForMoreEvents)
- qt_mac_waitForMoreModalSessionEvents();
- NSInteger status = [NSApp runModalSession:session];
- if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) {
- // INVARIANT: Someone called [NSApp stopModal:] from outside the event
- // dispatcher (e.g to stop a native dialog). But that call wrongly stopped
- // 'session' as well. As a result, we need to restart all internal sessions:
- d->temporarilyStopAllModalSessions();
- }
- retVal = true;
- } else do {
- event = [NSApp nextEventMatchingMask:NSAnyEventMask
+ // INVARIANT: a modal window is executing.
+ if (!excludeUserEvents) {
+ // Since we can dispatch all kinds of events, we choose
+ // to use cocoa's native way of running modal sessions:
+ if (flags & QEventLoop::WaitForMoreEvents)
+ qt_mac_waitForMoreModalSessionEvents();
+ NSInteger status = [NSApp runModalSession:session];
+ if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) {
+ // INVARIANT: Someone called [NSApp stopModal:] from outside the event
+ // dispatcher (e.g to stop a native dialog). But that call wrongly stopped
+ // 'session' as well. As a result, we need to restart all internal sessions:
+ d->temporarilyStopAllModalSessions();
+ }
+ retVal = true;
+ } else do {
+ // Dispatch all non-user events (but que non-user events up for later). In
+ // this case, we need more control over which events gets dispatched, and
+ // cannot use [NSApp runModalSession:session]:
+ event = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:nil
- inMode:NSDefaultRunLoopMode
+ inMode:NSModalPanelRunLoopMode
dequeue: YES];
+ if (event) {
+ if (IsMouseOrKeyEvent(event)) {
+ [event retain];
+ d->queuedUserInputEvents.append(event);
+ continue;
+ }
+ if (!filterEvent(event) && qt_mac_send_event(flags, event, 0))
+ retVal = true;
+ }
+ } while (!d->interrupt && event != nil);
+ } else do {
+ // INVARIANT: No modal window is executing.
+ event = [NSApp nextEventMatchingMask:NSAnyEventMask
+ untilDate:nil
+ inMode:NSDefaultRunLoopMode
+ dequeue: YES];
+
if (event) {
if (flags & QEventLoop::ExcludeUserInputEvents) {
if (IsMouseOrKeyEvent(event)) {
@@ -648,6 +673,11 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
}
} while (!d->interrupt && event != nil);
+ // Be sure to flush the Qt posted events when not using exec mode
+ // (exec mode will always do this call from the event loop source):
+ if (!d->interrupt)
+ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+
// Since the window that holds modality might have changed while processing
// events, we we need to interrupt when we return back the previous process
// event recursion to ensure that we spin the correct modal session.
diff --git a/src/gui/kernel/qeventdispatcher_qpa.cpp b/src/gui/kernel/qeventdispatcher_qpa.cpp
index 519d2a6..7701612 100644
--- a/src/gui/kernel/qeventdispatcher_qpa.cpp
+++ b/src/gui/kernel/qeventdispatcher_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qeventdispatcher_qpa_p.h b/src/gui/kernel/qeventdispatcher_qpa_p.h
index 8065c3e..d4d2be1 100644
--- a/src/gui/kernel/qeventdispatcher_qpa_p.h
+++ b/src/gui/kernel/qeventdispatcher_qpa_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 7a7c6a5..ec2d849 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -213,6 +213,7 @@ public:
int mapS60ScanCodesToQt(TUint s60key);
int mapQtToS60Key(int qtKey);
int mapQtToS60ScanCodes(int qtKey);
+ void updateInputLanguage();
#endif
};
diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp
index f0b17ac..bcf32a5 100644
--- a/src/gui/kernel/qkeymapper_s60.cpp
+++ b/src/gui/kernel/qkeymapper_s60.cpp
@@ -40,7 +40,11 @@
****************************************************************************/
#include "private/qkeymapper_p.h"
+#include <private/qcore_symbian_p.h>
#include <e32keys.h>
+#include <e32cmn.h>
+#include <centralrepository.h>
+#include <biditext.h>
QT_BEGIN_NAMESPACE
@@ -214,4 +218,32 @@ int QKeyMapperPrivate::mapQtToS60ScanCodes(int qtKey)
}
return res;
}
+
+void QKeyMapperPrivate::updateInputLanguage()
+{
+#ifdef Q_WS_S60
+ TInt err;
+ CRepository *repo;
+ const TUid KCRUidAknFep = TUid::Uid(0x101F876D);
+ const TUint32 KAknFepInputTxtLang = 0x00000005;
+ TRAP(err, repo = CRepository::NewL(KCRUidAknFep));
+ if (err != KErrNone)
+ return;
+
+ TInt symbianLang;
+ err = repo->Get(KAknFepInputTxtLang, symbianLang);
+ delete repo;
+ if (err != KErrNone)
+ return;
+
+ QString qtLang = QString::fromAscii(qt_symbianLocaleName(symbianLang));
+ keyboardInputLocale = QLocale(qtLang);
+ keyboardInputDirection = (TBidiText::ScriptDirectionality(TLanguage(symbianLang)) == TBidiText::ERightToLeft)
+ ? Qt::RightToLeft : Qt::LeftToRight;
+#else
+ keyboardInputLocale = QLocale();
+ keyboardInputDirection = Qt::LeftToRight;
+#endif
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index fff4e19..e169f08 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h
index 3f7bfbb..78cd444 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.h
+++ b/src/gui/kernel/qplatformclipboard_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index ac557b9..2ea8332 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformeventloopintegration_qpa.cpp b/src/gui/kernel/qplatformeventloopintegration_qpa.cpp
index fdb3852..0ed43eb 100644
--- a/src/gui/kernel/qplatformeventloopintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformeventloopintegration_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformeventloopintegration_qpa.h b/src/gui/kernel/qplatformeventloopintegration_qpa.h
index 6e0f984..87df7ae 100644
--- a/src/gui/kernel/qplatformeventloopintegration_qpa.h
+++ b/src/gui/kernel/qplatformeventloopintegration_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformglcontext_qpa.cpp b/src/gui/kernel/qplatformglcontext_qpa.cpp
index 1673aed..86740e8 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformglcontext_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformglcontext_qpa.h b/src/gui/kernel/qplatformglcontext_qpa.h
index 807ed3d..a680c85 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.h
+++ b/src/gui/kernel/qplatformglcontext_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 0cac57d..7fb7fbd 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index 7050245..e40cb48 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
index 17a130d..4135c9e 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
index 77e1da1..a6042a8 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
+++ b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
index 3bf2474..62920b6 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.h b/src/gui/kernel/qplatformintegrationplugin_qpa.h
index 9c37cf7..17bcba0 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.h
+++ b/src/gui/kernel/qplatformintegrationplugin_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index 118835f..c9f3dc6 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h
index 1f52764..b3bb121 100644
--- a/src/gui/kernel/qplatformscreen_qpa.h
+++ b/src/gui/kernel/qplatformscreen_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index b6b6693..19bf7a9 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h
index abc35d1..41a4bac 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.cpp b/src/gui/kernel/qplatformwindowformat_qpa.cpp
index 44b0698..ddc6239 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.cpp
+++ b/src/gui/kernel/qplatformwindowformat_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.h b/src/gui/kernel/qplatformwindowformat_qpa.h
index 790385b..fa01a8a 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.h
+++ b/src/gui/kernel/qplatformwindowformat_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index d5a780c..32123ee 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -184,7 +184,7 @@ struct dndenum_mapper
bool Qt2Mac;
};
-#ifdef QT_MAC_USE_COCOA && __OBJC__
+#if defined(QT_MAC_USE_COCOA) && defined(__OBJC__)
static dndenum_mapper dnd_enums[] = {
{ NSDragOperationLink, Qt::LinkAction, true },
@@ -1048,7 +1048,6 @@ QWidget *qt_mac_getTargetForKeyEvent(QWidget *widgetThatReceivedEvent)
// events
QWidget *qt_mac_getTargetForMouseEvent(
// You can call this function without providing an event.
- // If so, set returnGlobalPoint before the call.
NSEvent *event,
QEvent::Type eventType,
QPoint &returnLocalPoint,
@@ -1057,7 +1056,8 @@ QWidget *qt_mac_getTargetForMouseEvent(
QWidget **returnWidgetUnderMouse)
{
Q_UNUSED(event);
- returnGlobalPoint = flipPoint([NSEvent mouseLocation]).toPoint();
+ NSPoint nsglobalpoint = event ? [[event window] convertBaseToScreen:[event locationInWindow]] : [NSEvent mouseLocation];
+ returnGlobalPoint = flipPoint(nsglobalpoint).toPoint();
QWidget *mouseGrabber = QWidget::mouseGrabber();
bool buttonDownNotBlockedByModal = qt_button_down && !QApplicationPrivate::isBlockedByModal(qt_button_down);
QWidget *popup = QApplication::activePopupWidget();
@@ -1627,6 +1627,7 @@ void qt_mac_constructQIconFromIconRef(const IconRef icon, const IconRef overlayI
#ifdef QT_MAC_USE_COCOA
void qt_mac_menu_collapseSeparators(void */*NSMenu **/ theMenu, bool collapse)
{
+ QMacCocoaAutoReleasePool pool;
OSMenuRef menu = static_cast<OSMenuRef>(theMenu);
if (collapse) {
bool previousIsSeparator = true; // setting to true kills all the separators placed at the top.
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 40697bf..3bb27c3 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -64,6 +64,7 @@
#include "qapplication.h"
#include "qelapsedtimer.h"
#include "QtCore/qthreadstorage.h"
+#include "qwidget_p.h"
#include <w32std.h>
#include <coecntrl.h>
#include <eikenv.h>
@@ -84,6 +85,8 @@ QT_BEGIN_NAMESPACE
// system events seems to start with 0x10
const TInt KInternalStatusPaneChange = 0x50000000;
+static const int qt_symbian_max_screens = 4;
+
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
#define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
@@ -142,7 +145,10 @@ public:
int avkonComponentsSupportTransparency : 1;
int menuBeingConstructed : 1;
int orientationSet : 1;
+ int partial_keyboard : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
+ QPointer<QWidget> splitViewLastWidget;
+
static CEikButtonGroupContainer *cba;
enum ScanCodeState {
@@ -154,8 +160,14 @@ public:
static inline void updateScreenSize();
inline RWsSession& wsSession();
+ static inline int screenCount();
static inline RWindowGroup& windowGroup();
+ static inline RWindowGroup& windowGroup(const QWidget *widget);
+ static inline RWindowGroup& windowGroup(int screenNumber);
inline CWsScreenDevice* screenDevice();
+ inline CWsScreenDevice* screenDevice(const QWidget *widget);
+ inline CWsScreenDevice* screenDevice(int screenNumber);
+ static inline int screenNumberForWidget(const QWidget *widget);
static inline CCoeAppUi* appUi();
static inline CEikMenuBar* menuBar();
#ifdef Q_WS_S60
@@ -172,6 +184,11 @@ public:
#ifdef Q_OS_SYMBIAN
TTrapHandler *s60InstalledTrapHandler;
#endif
+
+ int screenWidthInPixelsForScreen[qt_symbian_max_screens];
+ int screenHeightInPixelsForScreen[qt_symbian_max_screens];
+ int screenWidthInTwipsForScreen[qt_symbian_max_screens];
+ int screenHeightInTwipsForScreen[qt_symbian_max_screens];
};
Q_AUTOTEST_EXPORT QS60Data* qGlobalS60Data();
@@ -252,6 +269,7 @@ private:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
+ bool isSplitViewWidget(QWidget *widget);
public:
void handleClientAreaChange();
@@ -270,6 +288,8 @@ private:
// Fader object used to fade everything except this menu and the CBA.
TAknPopupFader popupFader;
#endif
+
+ bool m_inExternalScreenOverride : 1;
};
inline QS60Data::QS60Data()
@@ -297,6 +317,7 @@ inline QS60Data::QS60Data()
avkonComponentsSupportTransparency(0),
menuBeingConstructed(0),
orientationSet(0),
+ partial_keyboard(0),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
@@ -320,6 +341,17 @@ inline void QS60Data::updateScreenSize()
S60->defaultDpiY = S60->screenHeightInPixels / inches;
inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
S60->defaultDpiX = S60->screenWidthInPixels / inches;
+
+ int screens = S60->screenCount();
+ for (int i = 0; i < screens; ++i) {
+ CWsScreenDevice *dev = S60->screenDevice(i);
+ mode = dev->CurrentScreenMode();
+ dev->GetScreenModeSizeAndRotation(mode, params);
+ S60->screenWidthInPixelsForScreen[i] = params.iPixelSize.iWidth;
+ S60->screenHeightInPixelsForScreen[i] = params.iPixelSize.iHeight;
+ S60->screenWidthInTwipsForScreen[i] = params.iTwipsSize.iWidth;
+ S60->screenHeightInTwipsForScreen[i] = params.iTwipsSize.iHeight;
+ }
}
inline RWsSession& QS60Data::wsSession()
@@ -330,11 +362,38 @@ inline RWsSession& QS60Data::wsSession()
return tls.localData()->wsSession;
}
+inline int QS60Data::screenCount()
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ CCoeEnv *env = CCoeEnv::Static();
+ if (env) {
+ return qMin(env->WsSession().NumberOfScreens(), qt_symbian_max_screens);
+ }
+#endif
+ return 1;
+}
+
inline RWindowGroup& QS60Data::windowGroup()
{
return CCoeEnv::Static()->RootWin();
}
+inline RWindowGroup& QS60Data::windowGroup(const QWidget *widget)
+{
+ return windowGroup(screenNumberForWidget(widget));
+}
+
+inline RWindowGroup& QS60Data::windowGroup(int screenNumber)
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ RWindowGroup *wg = CCoeEnv::Static()->RootWin(screenNumber);
+ return wg ? *wg : windowGroup();
+#else
+ Q_UNUSED(screenNumber);
+ return windowGroup();
+#endif
+}
+
inline CWsScreenDevice* QS60Data::screenDevice()
{
if(!tls.hasLocalData()) {
@@ -343,6 +402,36 @@ inline CWsScreenDevice* QS60Data::screenDevice()
return tls.localData()->screenDevice;
}
+inline CWsScreenDevice* QS60Data::screenDevice(const QWidget *widget)
+{
+ return screenDevice(screenNumberForWidget(widget));
+}
+
+inline CWsScreenDevice* QS60Data::screenDevice(int screenNumber)
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ CCoeEnv *env = CCoeEnv::Static();
+ if (env) {
+ CWsScreenDevice *dev = env->ScreenDevice(screenNumber);
+ return dev ? dev : screenDevice();
+ } else {
+ return screenDevice();
+ }
+#else
+ return screenDevice();
+#endif
+}
+
+inline int QS60Data::screenNumberForWidget(const QWidget *widget)
+{
+ if (!widget)
+ return 0;
+ const QWidget *w = widget;
+ while (w->parentWidget())
+ w = w->parentWidget();
+ return qt_widget_private(const_cast<QWidget *>(w))->symbianScreenNumber;
+}
+
inline CCoeAppUi* QS60Data::appUi()
{
return CCoeEnv::Static()-> AppUi();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 198d4e5..4e18940 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -310,6 +310,8 @@ QWidgetPrivate::QWidgetPrivate(int version)
, needWindowChange(0)
, window_event(0)
, qd_hd(0)
+#elif defined(Q_OS_SYMBIAN)
+ , symbianScreenNumber(0)
#endif
{
if (!qApp) {
@@ -404,11 +406,24 @@ void QWidgetPrivate::scrollChildren(int dx, int dy)
}
}
+QInputContext *QWidgetPrivate::assignedInputContext() const
+{
+#ifndef QT_NO_IM
+ const QWidget *widget = q_func();
+ while (widget) {
+ if (QInputContext *qic = widget->d_func()->ic)
+ return qic;
+ widget = widget->parentWidget();
+ }
+#endif
+ return 0;
+}
+
QInputContext *QWidgetPrivate::inputContext() const
{
#ifndef QT_NO_IM
- if (ic)
- return ic;
+ if (QInputContext *qic = assignedInputContext())
+ return qic;
return qApp->inputContext();
#else
return 0;
@@ -1282,6 +1297,10 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
// programmer specified desktop widget
xinfo = desktopWidget->d_func()->xinfo;
}
+#elif defined(Q_OS_SYMBIAN)
+ if (desktopWidget) {
+ symbianScreenNumber = qt_widget_private(desktopWidget)->symbianScreenNumber;
+ }
#elif defined(Q_WS_QPA)
if (desktopWidget) {
int screen = desktopWidget->d_func()->topData()->screenIndex;
@@ -10822,7 +10841,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
case Qt::WA_InputMethodEnabled: {
#ifndef QT_NO_IM
QWidget *focusWidget = d->effectiveFocusWidget();
- QInputContext *ic = focusWidget->d_func()->ic;
+ QInputContext *ic = focusWidget->d_func()->assignedInputContext();
if (!ic && (!on || hasFocus()))
ic = focusWidget->d_func()->inputContext();
if (ic) {
@@ -11309,7 +11328,7 @@ void QWidget::updateMicroFocus()
#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
Q_D(QWidget);
// and optimization to update input context only it has already been created.
- if (d->ic || qApp->d_func()->inputContext) {
+ if (d->assignedInputContext() || qApp->d_func()->inputContext) {
QInputContext *ic = inputContext();
if (ic)
ic->update();
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 492292c..ea55acd 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -570,6 +570,7 @@ public:
// sub-classes that their internals are about to be released.
virtual void aboutToDestroy() {}
+ QInputContext *assignedInputContext() const;
QInputContext *inputContext() const;
inline QWidget *effectiveFocusWidget() {
QWidget *w = q_func();
@@ -901,6 +902,7 @@ public:
#elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN
static QWidget *mouseGrabber;
static QWidget *keyboardGrabber;
+ int symbianScreenNumber; // only valid for desktop widget and top-levels
void s60UpdateIsOpaque();
void reparentChildren();
void registerTouchWindow();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index d8779c8..16f28c7 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -54,7 +54,6 @@
#ifdef Q_WS_S60
#include <aknappui.h>
-#include <akntoolbar.h>
#include <eikbtgpc.h>
#endif
@@ -64,6 +63,19 @@
// CCoeControl objects until after the CONE event handler has finished running.
Q_DECLARE_METATYPE(WId)
+// Workaround for the fact that S60 SDKs 3.x do not contain the akntoolbar.h
+// header, even though the documentation says that it should be there, and indeed
+// it is present in the library.
+class CAknToolbar : public CAknControl,
+ public MCoeControlObserver,
+ public MCoeControlBackground,
+ public MEikCommandObserver,
+ public MAknFadedComponent
+{
+public:
+ IMPORT_C void SetToolbarVisibility(const TBool visible);
+};
+
QT_BEGIN_NAMESPACE
extern bool qt_nograb();
@@ -72,6 +84,8 @@ QWidget *QWidgetPrivate::mouseGrabber = 0;
QWidget *QWidgetPrivate::keyboardGrabber = 0;
CEikButtonGroupContainer *QS60Data::cba = 0;
+int qt_symbian_create_desktop_on_screen = -1;
+
static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
{
if ( a.count() != b.count())
@@ -337,12 +351,18 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
int sh = clientRect.Height();
if (desktop) {
- TSize screenSize = S60->screenDevice()->SizeInPixels();
+ symbianScreenNumber = qMax(qt_symbian_create_desktop_on_screen, 0);
+ TSize screenSize = S60->screenDevice(symbianScreenNumber)->SizeInPixels();
data.crect.setRect(0, 0, screenSize.iWidth, screenSize.iHeight);
q->setAttribute(Qt::WA_DontShowOnScreen);
} else if (topLevel && !q->testAttribute(Qt::WA_Resized)){
int width = sw;
int height = sh;
+ if (symbianScreenNumber > 0) {
+ TSize screenSize = S60->screenDevice(symbianScreenNumber)->SizeInPixels();
+ width = screenSize.iWidth;
+ height = screenSize.iHeight;
+ }
if (extra) {
width = qMax(qMin(width, extra->maxw), extra->minw);
height = qMax(qMin(height, extra->maxh), extra->minh);
@@ -632,7 +652,7 @@ void QWidgetPrivate::raise_sys()
// If toplevel widget, raise app to foreground
if (q->isWindow())
- S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), 0);
+ S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup(q).Identifier(), 0);
}
}
@@ -644,7 +664,7 @@ void QWidgetPrivate::lower_sys()
if (q->internalWinId()) {
// If toplevel widget, lower app to background
if (q->isWindow())
- S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), -1);
+ S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup(q).Identifier(), -1);
else
q->internalWinId()->DrawableWindow()->SetOrdinalPosition(-1);
}
@@ -714,6 +734,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
{
Q_Q(QWidget);
+ if (parent && parent->windowType() == Qt::Desktop) {
+ symbianScreenNumber = qt_widget_private(parent)->symbianScreenNumber;
+ parent = 0;
+ }
+
bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
if (q->isVisible() && q->parentWidget() && parent != q->parentWidget())
@@ -792,17 +817,21 @@ void QWidgetPrivate::s60UpdateIsOpaque()
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
- window->SetSurfaceTransparency(!isOpaque);
- extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
-#else
+ if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ window->SetSurfaceTransparency(!isOpaque);
+ extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
+ return;
+ }
+#endif
if (!isOpaque) {
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
if (window->SetTransparencyAlphaChannel() == KErrNone) {
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
extra->topextra->nativeWindowTransparencyEnabled = 1;
- if (extra->topextra->backingStore.data() &&
- QApplicationPrivate::graphics_system_name == QLatin1String("openvg")) {
+ if (extra->topextra->backingStore.data() && (
+ QApplicationPrivate::graphics_system_name == QLatin1String("openvg")
+ || QApplicationPrivate::graphics_system_name == QLatin1String("opengl"))) {
// Semi-transparent EGL surfaces aren't supported. We need to
// recreate backing store to get translucent surface (raster surface).
extra->topextra->backingStore.create(q);
@@ -813,7 +842,6 @@ void QWidgetPrivate::s60UpdateIsOpaque()
window->SetTransparentRegion(TRegionFix<1>());
extra->topextra->nativeWindowTransparencyEnabled = 0;
}
-#endif
}
void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
@@ -1029,7 +1057,7 @@ int QWidget::metric(PaintDeviceMetric m) const
} else if (m == PdmHeight) {
val = data->crect.height();
} else {
- CWsScreenDevice *scr = S60->screenDevice();
+ CWsScreenDevice *scr = S60->screenDevice(this);
switch(m) {
case PdmDpiX:
case PdmPhysicalDpiX:
@@ -1199,7 +1227,16 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) {
setAttribute(Qt::WA_OutsideWSRange, false);
- window->SetExtentToWholeScreen();
+ if (d->symbianScreenNumber > 0) {
+ int w = S60->screenWidthInPixelsForScreen[d->symbianScreenNumber];
+ int h = S60->screenHeightInPixelsForScreen[d->symbianScreenNumber];
+ if (w <= 0 || h <= 0)
+ window->SetExtentToWholeScreen();
+ else
+ window->SetExtent(TPoint(0, 0), TSize(w, h));
+ } else {
+ window->SetExtentToWholeScreen();
+ }
} else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint)) {
setAttribute(Qt::WA_OutsideWSRange, false);
TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this));
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index b378b78..4bff5ac 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1496,7 +1496,7 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
|| !QX11Info::appDefaultColormap(xinfo.screen())) {
// unknown DE or non-default visual/colormap, use 1bpp bitmap
if (!forceReset || !topData->iconPixmap)
- topData->iconPixmap = new QBitmap(qt_toX11Pixmap(icon.pixmap(QSize(64,64))));
+ topData->iconPixmap = new QPixmap(qt_toX11Pixmap(QBitmap(icon.pixmap(QSize(64,64)))));
pixmap_handle = topData->iconPixmap->handle();
} else {
// default depth, use a normal pixmap (even though this
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index b6177b0..c53eedb 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h
index 39c2f79..9dce7ea 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index d9aef20..181eda8 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -79,9 +79,9 @@ public:
void copyDataTo(T *values) const;
- T *data() { return m[0]; }
- const T *data() const { return m[0]; }
- const T *constData() const { return m[0]; }
+ T *data() { return *m; }
+ const T *data() const { return *m; }
+ const T *constData() const { return *m; }
#if !defined(Q_NO_TEMPLATE_FRIENDS)
template<int NN, int MM, typename TT>
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 706450a..ad05116 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -173,8 +173,8 @@ public:
QGenericMatrix<N, M, qreal> toGenericMatrix() const;
inline qreal *data();
- inline const qreal *data() const { return m[0]; }
- inline const qreal *constData() const { return m[0]; }
+ inline const qreal *data() const { return *m; }
+ inline const qreal *constData() const { return *m; }
void optimize();
@@ -974,7 +974,7 @@ inline qreal *QMatrix4x4::data()
// We have to assume that the caller will modify the matrix elements,
// so we flip it over to "General" mode.
flagBits = General;
- return m[0];
+ return *m;
}
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/gui/math3d/qvector2d.cpp b/src/gui/math3d/qvector2d.cpp
index 7f5a937..1fccfc9 100644
--- a/src/gui/math3d/qvector2d.cpp
+++ b/src/gui/math3d/qvector2d.cpp
@@ -60,6 +60,11 @@ QT_BEGIN_NAMESPACE
The QVector2D class can also be used to represent vertices in 2D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector2D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector2D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QVector3D, QVector4D, QQuaternion
*/
diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp
index 2414b5f..7bf0400 100644
--- a/src/gui/math3d/qvector3d.cpp
+++ b/src/gui/math3d/qvector3d.cpp
@@ -63,6 +63,11 @@ QT_BEGIN_NAMESPACE
The QVector3D class can also be used to represent vertices in 3D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector3D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector3D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QVector2D, QVector4D, QQuaternion
*/
diff --git a/src/gui/math3d/qvector4d.cpp b/src/gui/math3d/qvector4d.cpp
index 74dedc4..23befc0 100644
--- a/src/gui/math3d/qvector4d.cpp
+++ b/src/gui/math3d/qvector4d.cpp
@@ -59,6 +59,11 @@ QT_BEGIN_NAMESPACE
The QVector4D class can also be used to represent vertices in 4D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector4D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector4D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QQuaternion, QVector2D, QVector3D
*/
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 129bba5..e5d8abc 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -1143,6 +1143,11 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
return;
}
+ // If there's no partial update support we always need
+ // to do a full repaint before flushing
+ if (!windowSurface->hasPartialUpdateSupport())
+ fullUpdatePending = true;
+
// Nothing to repaint.
if (!isDirty()) {
qt_flush(exposedWidget, exposedRegion, windowSurface, tlw, tlwOffset);
diff --git a/src/gui/painting/qbackingstore_p.h b/src/gui/painting/qbackingstore_p.h
index e2b21c3..47387ab 100644
--- a/src/gui/painting/qbackingstore_p.h
+++ b/src/gui/painting/qbackingstore_p.h
@@ -209,8 +209,9 @@ private:
{
#ifdef Q_WS_QWS
return tlw->frameGeometry();
-#endif
+#else
return tlw->data->crect;
+#endif
}
inline void appendDirtyOnScreenWidget(QWidget *widget)
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index dc90003..10674f8 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -309,7 +309,7 @@ template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
const uchar *src = srcPixels + y * sbpl;
const uchar *srcEnd = src + srcOffset;
while (src < srcEnd) {
-#if defined(QT_ARCH_ARMV5) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU))
+#if defined(QT_ARCH_ARMV5) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU)) || (defined(QT_ARCH_INTEGRITY) && !defined(_X86_))
// non-16-bit aligned memory access is not possible on PowerPC,
// ARM <v6 (QT_ARCH_ARMV5) & SH & AVR32 & SPARC w/GCC
quint16 spix = (quint16(src[2])<<8) + src[1];
diff --git a/src/gui/painting/qblittable.cpp b/src/gui/painting/qblittable.cpp
index f4b84a9..5802531 100644
--- a/src/gui/painting/qblittable.cpp
+++ b/src/gui/painting/qblittable.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index cb56cb2..9d0e822 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp
index 806df29..af9854c 100644
--- a/src/gui/painting/qdrawhelper_arm_simd.cpp
+++ b/src/gui/painting/qdrawhelper_arm_simd.cpp
@@ -201,8 +201,8 @@ argb32constalpha_next_pixel
uxtb16 r10, r9
uxtb16 r6, r9, ror #8
- // Negate r11 and extract src alpha
- mvn r9, r11 // bitwise not
+ // Negate r8 and extract src alpha
+ mvn r9, r8 // bitwise not
uxtb r9, r9, ror #24
mla r10, r9, r10, r14
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 2d61cc5..d8793c3 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE
pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel); \
pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel); \
\
- /* 3. devide by 255, that's the tricky part. \
+ /* 3. divide by 255, that's the tricky part. \
we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256 */ \
/** so first (X + X/256 + rounding) */\
pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8)); \
@@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE
pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8)); \
pixelVectorAG = _mm_add_epi16(pixelVectorAG, half); \
\
- /** second devide by 256 */\
+ /** second divide by 256 */\
pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8); \
/** for AG, we could >> 8 to divide followed by << 8 to put the \
bytes in the correct position. By masking instead, we execute \
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 8d39b59..171ef46 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -89,4 +89,9 @@ QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin)
return createPixmapData(origin->pixelType());
}
+void QGraphicsSystem::releaseCachedResources()
+{
+ // Do nothing here
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index 1aa3aa0..0f99a31 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -76,6 +76,8 @@ public:
//### Remove this & change qpixmap.cpp & qbitmap.cpp once every platform is gaurenteed
// to have a graphics system.
static QPixmapData *createDefaultPixmapData(QPixmapData::PixelType type);
+
+ virtual void releaseCachedResources();
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 0294c4b..5841d40 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -285,6 +285,7 @@ void QRuntimeWindowSurface::flush(QWidget *widget, const QRegion &region,
void QRuntimeWindowSurface::setGeometry(const QRect &rect)
{
+ QWindowSurface::setGeometry(rect);
m_windowSurface->setGeometry(rect);
}
diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp
index 2e8d9dd..500748e 100644
--- a/src/gui/painting/qpaintengine_blitter.cpp
+++ b/src/gui/painting/qpaintengine_blitter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index c8aa536..be8b2bc 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 47caa9f..9242fb6 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -662,19 +662,19 @@ QRasterPaintEngineState::QRasterPaintEngineState()
QRasterPaintEngineState::QRasterPaintEngineState(QRasterPaintEngineState &s)
: QPainterState(s)
+ , lastPen(s.lastPen)
+ , penData(s.penData)
, stroker(s.stroker)
+ , strokeFlags(s.strokeFlags)
, lastBrush(s.lastBrush)
, brushData(s.brushData)
- , lastPen(s.lastPen)
- , penData(s.penData)
, fillFlags(s.fillFlags)
- , strokeFlags(s.strokeFlags)
, pixmapFlags(s.pixmapFlags)
, intOpacity(s.intOpacity)
, txscale(s.txscale)
- , flag_bits(s.flag_bits)
, clip(s.clip)
, dirty(s.dirty)
+ , flag_bits(s.flag_bits)
{
brushData.tempImage = 0;
penData.tempImage = 0;
@@ -3716,6 +3716,13 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line,
const bool squareCap = (pen.capStyle() == Qt::SquareCap);
const QVector<qreal> pattern = pen.dashPattern();
+ qreal patternLength = 0;
+ for (int i = 0; i < pattern.size(); ++i)
+ patternLength += pattern.at(i);
+
+ if (patternLength <= 0)
+ return;
+
qreal length = line.length();
Q_ASSERT(length > 0);
while (length > 0) {
diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp
index 1bc7799..ca303be 100644
--- a/src/gui/painting/qpaintengine_s60.cpp
+++ b/src/gui/painting/qpaintengine_s60.cpp
@@ -41,6 +41,7 @@
#include <private/qpaintengine_s60_p.h>
#include <private/qpixmap_s60_p.h>
#include <private/qt_s60_p.h>
+#include <private/qvolatileimage_p.h>
QT_BEGIN_NAMESPACE
@@ -90,7 +91,15 @@ void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
QRasterPaintEngine::drawPixmap(p, pm);
srcData->endDataAccess();
} else {
- QRasterPaintEngine::drawPixmap(p, pm);
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(p, img->imageRef());
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(p, pm);
+ }
}
}
@@ -102,7 +111,15 @@ void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRect
QRasterPaintEngine::drawPixmap(r, pm, sr);
srcData->endDataAccess();
} else {
- QRasterPaintEngine::drawPixmap(r, pm, sr);
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ }
}
}
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 81ca40f..8bff021 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -874,7 +874,7 @@ void QPainterPath::arcTo(const QRectF &rect, qreal startAngle, qreal sweepLength
rect.x(), rect.y(), rect.width(), rect.height(), startAngle, sweepLength);
#endif
- if (!qt_is_finite(rect.x()) && !qt_is_finite(rect.y()) || !qt_is_finite(rect.width()) || !qt_is_finite(rect.height())
+ if ((!qt_is_finite(rect.x()) && !qt_is_finite(rect.y())) || !qt_is_finite(rect.width()) || !qt_is_finite(rect.height())
|| !qt_is_finite(startAngle) || !qt_is_finite(sweepLength)) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::arcTo: Adding arc where a parameter is NaN or Inf, ignoring call");
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index f262144..b7f5160 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -936,7 +936,7 @@ void QPdfEnginePrivate::writeInfo()
xprintf("\n/Creator ");
printString(creator);
xprintf("\n/Producer ");
- printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2010 Nokia Corporation and/or its subsidiary(-ies)"));
+ printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2011 Nokia Corporation and/or its subsidiary(-ies)"));
QDateTime now = QDateTime::currentDateTime().toUTC();
QTime t = now.time();
QDate d = now.date();
diff --git a/src/gui/painting/qprinterinfo_p.h b/src/gui/painting/qprinterinfo_p.h
index 7781d59..fcc1acb 100644
--- a/src/gui/painting/qprinterinfo_p.h
+++ b/src/gui/painting/qprinterinfo_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 80353bc..fca46b4 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -668,26 +668,28 @@ template <class Iterator> bool qt_stroke_side(Iterator *it,
#endif
QLineF line(qt_fixed_to_real(prev.x), qt_fixed_to_real(prev.y),
qt_fixed_to_real(e.x), qt_fixed_to_real(e.y));
- QLineF normal = line.normalVector();
- normal.setLength(offset);
- line.translate(normal.dx(), normal.dy());
-
- // If we are starting a new subpath, move to correct starting point.
- if (first) {
- if (capFirst)
- stroker->joinPoints(prev.x, prev.y, line, stroker->capStyleMode());
- else
- stroker->emitMoveTo(qt_real_to_fixed(line.x1()), qt_real_to_fixed(line.y1()));
- *startTangent = line;
- first = false;
- } else {
- stroker->joinPoints(prev.x, prev.y, line, stroker->joinStyleMode());
- }
+ if (line.p1() != line.p2()) {
+ QLineF normal = line.normalVector();
+ normal.setLength(offset);
+ line.translate(normal.dx(), normal.dy());
+
+ // If we are starting a new subpath, move to correct starting point.
+ if (first) {
+ if (capFirst)
+ stroker->joinPoints(prev.x, prev.y, line, stroker->capStyleMode());
+ else
+ stroker->emitMoveTo(qt_real_to_fixed(line.x1()), qt_real_to_fixed(line.y1()));
+ *startTangent = line;
+ first = false;
+ } else {
+ stroker->joinPoints(prev.x, prev.y, line, stroker->joinStyleMode());
+ }
- // Add the stroke for this line.
- stroker->emitLineTo(qt_real_to_fixed(line.x2()),
- qt_real_to_fixed(line.y2()));
- prev = e;
+ // Add the stroke for this line.
+ stroker->emitLineTo(qt_real_to_fixed(line.x2()),
+ qt_real_to_fixed(line.y2()));
+ prev = e;
+ }
// CurveToElement
} else if (e.isCurveTo()) {
diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
index 0993b22..63364f3 100644
--- a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
+++ b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac_p.h b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h
index 8a552fb..b0075b6 100644
--- a/src/gui/painting/qunifiedtoolbarsurface_mac_p.h
+++ b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index b5b8b81..0c99f80 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -49,6 +49,7 @@
#include <avkon.rsg>
#endif
#include <barsread.h>
+#include <coeutils.h>
#include <qconfig.h>
#include "qs60mainappui.h"
@@ -401,6 +402,16 @@ void QS60MainAppUi::HandleForegroundEventL(TBool aForeground)
QS60MainAppUiBase::HandleForegroundEventL(aForeground);
}
+/*!
+ \internal
+*/
+TBool QS60MainAppUi::ProcessCommandParametersL(TApaCommand /*aCommand*/, TFileName &/*aDocumentName*/, const TDesC8 &/*aTail*/)
+{
+ // bypass CEikAppUi::ProcessCommandParametersL(..) which modifies aDocumentName, preventing apparc document opening from working.
+ // The return value is effectively unused in Qt apps (see QS60MainDocument::OpenFileL)
+ return EFalse;
+}
+
#ifndef Q_WS_S60
void QS60StubAknAppUi::HandleViewDeactivation(const TVwsViewId &, const TVwsViewId &) {}
diff --git a/src/gui/s60framework/qs60mainappui.h b/src/gui/s60framework/qs60mainappui.h
index ce3b5b0..bf118ff 100644
--- a/src/gui/s60framework/qs60mainappui.h
+++ b/src/gui/s60framework/qs60mainappui.h
@@ -131,6 +131,7 @@ public:
virtual void HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId);
virtual void PrepareToExit();
virtual void HandleTouchPaneSizeChange();
+ virtual TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName &aDocumentName, const TDesC8 &aTail);
protected:
virtual void HandleScreenDeviceChangedL();
diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp
index a8886ac..37bd55f 100644
--- a/src/gui/s60framework/qs60maindocument.cpp
+++ b/src/gui/s60framework/qs60maindocument.cpp
@@ -41,6 +41,9 @@
#include "qs60mainappui.h"
#include "qs60maindocument.h"
+#include "qcoreapplication.h"
+#include "qevent.h"
+#include "private/qcore_symbian_p.h"
#include <exception>
@@ -108,9 +111,15 @@ CEikAppUi *QS60MainDocument::CreateAppUiL()
/*!
\internal
*/
-CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs)
+CFileStore *QS60MainDocument::OpenFileL(TBool /*aDoOpen*/, const TDesC &aFilename, RFs &/*aFs*/)
{
- return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs);
+ QT_TRYCATCH_LEAVING( {
+ QCoreApplication* app = QCoreApplication::instance();
+ QString qname = qt_TDesC2QString(aFilename);
+ QFileOpenEvent* event = new QFileOpenEvent(qname);
+ app->postEvent(app, event);
+ })
+ return 0;
}
/*!
@@ -118,7 +127,12 @@ CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, R
*/
void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile)
{
- QS60MainDocumentBase::OpenFileL(aFileStore, aFile);
+ QT_TRYCATCH_LEAVING( {
+ QCoreApplication* app = QCoreApplication::instance();
+ QFileOpenEvent* event = new QFileOpenEvent(aFile);
+ app->postEvent(app, event);
+ aFileStore = 0;
+ })
}
QT_END_NAMESPACE
diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp
index eadb8ff..2a0de3c 100644
--- a/src/gui/statemachine/qguistatemachine.cpp
+++ b/src/gui/statemachine/qguistatemachine.cpp
@@ -404,6 +404,7 @@ static QEvent *cloneEvent(QEvent *e)
we2->setButtons(we->buttons());
we2->setModifiers(we->modifiers());
we2->setOrientation(we->orientation());
+ we2->setDelta(we->delta());
return we2;
}
#endif
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index ac05789..64722c7 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -4621,6 +4621,13 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
tdi.attributes &= ~kThemeTrackShowThumb;
if (scrollBarLength < scrollButtonsCutoffSize(scrollButtonsCutoff, sizePolicy))
tdi.enableState = kThemeTrackNothingToScroll;
+ } else {
+ if (!(slider->subControls & SC_SliderHandle))
+ tdi.attributes &= ~kThemeTrackShowThumb;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ if (!(slider->subControls & SC_SliderGroove))
+ tdi.attributes |= kThemeTrackHideTrack;
+#endif
}
HIThemeDrawTrack(&tdi, tracking ? 0 : &macRect, cg,
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index ecc2539..c107511 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2643,10 +2643,13 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
//native items have small empty areas at the beginning and end of menu item
sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth));
- if (QS60StylePrivate::isTouchSupported())
+ if (QS60StylePrivate::isTouchSupported()) {
//Make itemview easier to use in touch devices
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
//QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values
+ if (ct == CT_MenuItem)
+ sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values
+ }
break;
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 605872e..600c631 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -47,6 +47,7 @@
#include "private/qt_s60_p.h"
#include "private/qpixmap_s60_p.h"
#include "private/qcore_symbian_p.h"
+#include "private/qvolatileimage_p.h"
#include "qapplication.h"
#include "qsettings.h"
@@ -637,9 +638,22 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask
if (error)
return QPixmap();
- QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(icon);
- if (mask)
- pixmap.setAlphaChannel(QPixmap::fromSymbianCFbsBitmap(mask));
+ QPixmap pixmap;
+ QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ bool nativeMaskSupported = (pd->toNativeType(QPixmapData::VolatileImage) != 0);
+ if (mask && nativeMaskSupported) {
+ // Efficient path, less copying and conversion.
+ QVolatileImage img(icon, mask);
+ pd->fromNativeType(&img, QPixmapData::VolatileImage);
+ pixmap = QPixmap(pd.take());
+ } else {
+ // Potentially more expensive path.
+ pd->fromNativeType(icon, QPixmapData::FbsBitmap);
+ pixmap = QPixmap(pd.take());
+ if (mask) {
+ pixmap.setAlphaChannel(QPixmap::fromSymbianCFbsBitmap(mask));
+ }
+ }
if ((flags & QS60StylePrivate::SF_PointEast) ||
(flags & QS60StylePrivate::SF_PointSouth) ||
@@ -795,6 +809,8 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+ static const TDisplayMode displayMode = S60->supportsPremultipliedAlpha ? Q_SYMBIAN_ECOLOR16MAP : EColor16MA;
+ static const TInt drawParam = S60->supportsPremultipliedAlpha ? KAknsDrawParamDefault : KAknsDrawParamRGBOnly;
QPixmap result;
@@ -833,7 +849,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
// QS60WindowSurface::unlockBitmapHeap();
CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen
CleanupStack::PushL(background);
- User::LeaveIfError(background->Create(targetSize, EColor16MA));
+ User::LeaveIfError(background->Create(targetSize, displayMode));
CFbsBitmapDevice *dev = CFbsBitmapDevice::NewL(background);
CleanupStack::PushL(dev);
@@ -854,7 +870,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
*gc,
TPoint(),
targetSize,
- KAknsDrawParamDefault | KAknsDrawParamRGBOnly);
+ drawParam);
if (drawn)
result = fromFbsBitmap(background, NULL, flags, targetSize);
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 4b591e2..ecf924c 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -4238,7 +4238,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
return;
case PE_Widget:
- if (!rule.hasDrawable()) {
+ if (w && !rule.hasDrawable()) {
QWidget *container = containerWidget(w);
if (styleSheetCaches->autoFillDisabledWidgets.contains(container)
&& (container == w || !renderRule(container, opt).hasBackground())) {
diff --git a/src/gui/styles/qstylesheetstyle_default.cpp b/src/gui/styles/qstylesheetstyle_default.cpp
index 002dcff..76ffac8 100644
--- a/src/gui/styles/qstylesheetstyle_default.cpp
+++ b/src/gui/styles/qstylesheetstyle_default.cpp
@@ -151,7 +151,7 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
BasicSelector bSelector;
Selector selector;
Declaration decl;
- Value value;
+ QCss::Value value;
Pseudo pseudo;
AttributeSelector attr;
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 54ca7cc..052dc72 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -649,7 +649,7 @@ bool ValueExtractor::extractOutline(int *borders, QBrush *colors, BorderStyle *s
return hit;
}
-static Qt::Alignment parseAlignment(const Value *values, int count)
+static Qt::Alignment parseAlignment(const QCss::Value *values, int count)
{
Qt::Alignment a[2] = { 0, 0 };
for (int i = 0; i < qMin(2, count); i++) {
@@ -672,7 +672,7 @@ static Qt::Alignment parseAlignment(const Value *values, int count)
return a[0] | a[1];
}
-static ColorData parseColorValue(Value v)
+static ColorData parseColorValue(QCss::Value v)
{
if (v.type == Value::Identifier || v.type == Value::String) {
v.variant.convert(QVariant::Color);
@@ -706,7 +706,7 @@ static ColorData parseColorValue(Value v)
if (!p.testExpr())
return ColorData();
- QVector<Value> colorDigits;
+ QVector<QCss::Value> colorDigits;
if (!p.parseExpr(&colorDigits))
return ColorData();
@@ -738,7 +738,7 @@ static QColor colorFromData(const ColorData& c, const QPalette &pal)
return QColor();
}
-static BrushData parseBrushValue(const Value &v, const QPalette &pal)
+static BrushData parseBrushValue(const QCss::Value &v, const QPalette &pal)
{
ColorData c = parseColorValue(v);
if (c.type == ColorData::Color) {
@@ -780,7 +780,7 @@ static BrushData parseBrushValue(const Value &v, const QPalette &pal)
return BrushData();
parser.skipSpace();
if (attr.compare(QLatin1String("stop"), Qt::CaseInsensitive) == 0) {
- Value stop, color;
+ QCss::Value stop, color;
parser.next();
if (!parser.parseTerm(&stop)) return BrushData();
parser.skipSpace();
@@ -792,7 +792,7 @@ static BrushData parseBrushValue(const Value &v, const QPalette &pal)
stops.append(QGradientStop(stop.variant.toReal(), colorFromData(cd, pal)));
} else {
parser.next();
- Value value;
+ QCss::Value value;
(void)parser.parseTerm(&value);
if (attr.compare(QLatin1String("spread"), Qt::CaseInsensitive) == 0) {
spread = spreads.indexOf(value.variant.toString());
@@ -856,7 +856,7 @@ static QBrush brushFromData(const BrushData& c, const QPalette &pal)
}
}
-static BorderStyle parseStyleValue(Value v)
+static BorderStyle parseStyleValue(QCss::Value v)
{
if (v.type == Value::KnownIdentifier) {
switch (v.variant.toInt()) {
@@ -941,7 +941,7 @@ void ValueExtractor::borderValue(const Declaration &decl, int *width, QCss::Bord
decl.d->parsed = QVariant::fromValue<BorderData>(data);
}
-static void parseShorthandBackgroundProperty(const QVector<Value> &values, BrushData *brush, QString *image, Repeat *repeat, Qt::Alignment *alignment, const QPalette &pal)
+static void parseShorthandBackgroundProperty(const QVector<QCss::Value> &values, BrushData *brush, QString *image, Repeat *repeat, Qt::Alignment *alignment, const QPalette &pal)
{
*brush = BrushData();
*image = QString();
@@ -949,7 +949,7 @@ static void parseShorthandBackgroundProperty(const QVector<Value> &values, Brush
*alignment = Qt::AlignTop | Qt::AlignLeft;
for (int i = 0; i < values.count(); ++i) {
- const Value &v = values.at(i);
+ const QCss::Value &v = values.at(i);
if (v.type == Value::Uri) {
*image = v.variant.toString();
continue;
@@ -996,7 +996,7 @@ bool ValueExtractor::extractBackground(QBrush *brush, QString *image, Repeat *re
const Declaration &decl = declarations.at(i);
if (decl.d->values.isEmpty())
continue;
- const Value &val = decl.d->values.at(0);
+ const QCss::Value &val = decl.d->values.at(0);
switch (decl.d->propertyId) {
case BackgroundColor:
*brush = decl.brushValue();
@@ -1050,7 +1050,7 @@ bool ValueExtractor::extractBackground(QBrush *brush, QString *image, Repeat *re
return hit;
}
-static bool setFontSizeFromValue(Value value, QFont *font, int *fontSizeAdjustment)
+static bool setFontSizeFromValue(QCss::Value value, QFont *font, int *fontSizeAdjustment)
{
if (value.type == Value::KnownIdentifier) {
bool valid = true;
@@ -1087,7 +1087,7 @@ static bool setFontSizeFromValue(Value value, QFont *font, int *fontSizeAdjustme
return valid;
}
-static bool setFontStyleFromValue(const Value &value, QFont *font)
+static bool setFontStyleFromValue(const QCss::Value &value, QFont *font)
{
if (value.type != Value::KnownIdentifier)
return false ;
@@ -1100,7 +1100,7 @@ static bool setFontStyleFromValue(const Value &value, QFont *font)
return false;
}
-static bool setFontWeightFromValue(const Value &value, QFont *font)
+static bool setFontWeightFromValue(const QCss::Value &value, QFont *font)
{
if (value.type == Value::KnownIdentifier) {
switch (value.variant.toInt()) {
@@ -1121,12 +1121,12 @@ static bool setFontWeightFromValue(const Value &value, QFont *font)
* and set it the \a font
* \returns true if a family was extracted.
*/
-static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font, int start = 0)
+static bool setFontFamilyFromValues(const QVector<QCss::Value> &values, QFont *font, int start = 0)
{
QString family;
bool shouldAddSpace = false;
for (int i = start; i < values.count(); ++i) {
- const Value &v = values.at(i);
+ const QCss::Value &v = values.at(i);
if (v.type == Value::TermOperatorComma) {
family += QLatin1Char(',');
shouldAddSpace = false;
@@ -1146,7 +1146,7 @@ static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font, i
return true;
}
-static void setTextDecorationFromValues(const QVector<Value> &values, QFont *font)
+static void setTextDecorationFromValues(const QVector<QCss::Value> &values, QFont *font)
{
for (int i = 0; i < values.count(); ++i) {
if (values.at(i).type != Value::KnownIdentifier)
@@ -1165,7 +1165,7 @@ static void setTextDecorationFromValues(const QVector<Value> &values, QFont *fon
}
}
-static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font, int *fontSizeAdjustment)
+static void parseShorthandFontProperty(const QVector<QCss::Value> &values, QFont *font, int *fontSizeAdjustment)
{
font->setStyle(QFont::StyleNormal);
font->setWeight(QFont::Normal);
@@ -1190,7 +1190,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font
}
}
-static void setFontVariantFromValue(const Value &value, QFont *font)
+static void setFontVariantFromValue(const QCss::Value &value, QFont *font)
{
if (value.type == Value::KnownIdentifier) {
switch (value.variant.toInt()) {
@@ -1201,7 +1201,7 @@ static void setFontVariantFromValue(const Value &value, QFont *font)
}
}
-static void setTextTransformFromValue(const Value &value, QFont *font)
+static void setTextTransformFromValue(const QCss::Value &value, QFont *font)
{
if (value.type == Value::KnownIdentifier) {
switch (value.variant.toInt()) {
@@ -1226,7 +1226,7 @@ bool ValueExtractor::extractFont(QFont *font, int *fontSizeAdjustment)
const Declaration &decl = declarations.at(i);
if (decl.d->values.isEmpty())
continue;
- const Value &val = decl.d->values.at(0);
+ const QCss::Value &val = decl.d->values.at(0);
switch (decl.d->propertyId) {
case FontSize: setFontSizeFromValue(val, font, fontSizeAdjustment); break;
case FontStyle: setFontStyleFromValue(val, font); break;
@@ -1411,7 +1411,7 @@ bool Declaration::realValue(qreal *real, const char *unit) const
return ok;
}
-static bool intValueHelper(const Value &v, int *i, const char *unit)
+static bool intValueHelper(const QCss::Value &v, int *i, const char *unit)
{
if (unit && v.type != Value::Length)
return false;
@@ -1460,7 +1460,7 @@ QRect Declaration::rectValue() const
if (d->parsed.isValid())
return qvariant_cast<QRect>(d->parsed);
- const Value &v = d->values.at(0);
+ const QCss::Value &v = d->values.at(0);
if (v.type != Value::Function)
return QRect();
QStringList func = v.variant.toStringList();
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index 79c46b3..86bafc9 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -71,6 +71,9 @@
#if defined(Q_OS_VXWORKS) && defined(NONE)
# undef NONE
#endif
+#if defined(Q_OS_INTEGRITY)
+# undef Value
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 084b7ac..64eb27a 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -139,6 +139,9 @@ bool QFontDef::exactMatch(const QFontDef &other) const
QFontDatabase::parseFontName(family, this_foundry, this_family);
QFontDatabase::parseFontName(other.family, other_foundry, other_family);
+ this_family = QFontDatabase::resolveFontFamilyAlias(this_family);
+ other_family = QFontDatabase::resolveFontFamilyAlias(other_family);
+
return (styleHint == other.styleHint
&& styleStrategy == other.styleStrategy
&& weight == other.weight
diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp
index 7b09b59..ff12da8 100644
--- a/src/gui/text/qfont_qpa.cpp
+++ b/src/gui/text/qfont_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 8e92b1a..1e94bf5 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1087,6 +1087,12 @@ QT_BEGIN_INCLUDE_NAMESPACE
#elif defined(Q_OS_SYMBIAN)
# include "qfontdatabase_s60.cpp"
#endif
+#if !defined(Q_WS_X11)
+QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
+{
+ return family;
+}
+#endif
QT_END_INCLUDE_NAMESPACE
static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey)
diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h
index 3e9483b..ae1130e 100644
--- a/src/gui/text/qfontdatabase.h
+++ b/src/gui/text/qfontdatabase.h
@@ -152,6 +152,7 @@ public:
private:
static void createDatabase();
static void parseFontName(const QString &name, QString &foundry, QString &family);
+ static QString resolveFontFamilyAlias(const QString &family);
#if defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_SYMBIAN)
static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request);
#endif
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index e6d99c6..7bcce56 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 2186058..02b0148 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -1972,17 +1972,6 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
#ifndef QT_NO_FONTCONFIG
} else if (X11->has_fontconfig) {
fe = loadFc(d, script, req);
- if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize && mainThread && qt_is_gui_used) {
- QFontEngine *xlfdFontEngine = loadXlfd(d->screen, script, req);
- if (xlfdFontEngine->fontDef.family == fe->fontDef.family) {
- delete fe;
- fe = xlfdFontEngine;
- } else {
- delete xlfdFontEngine;
- }
- }
-
-
#endif
} else if (mainThread && qt_is_gui_used) {
fe = loadXlfd(d->screen, script, req);
@@ -2131,4 +2120,26 @@ bool QFontDatabase::supportsThreadedFontRendering()
#endif
}
+QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
+{
+#if defined(QT_NO_FONTCONFIG)
+ return family;
+#else
+ FcPattern *pattern = FcPatternCreate();
+ if (!pattern)
+ return family;
+
+ FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) family.toUtf8().data());
+ FcConfigSubstitute(0, pattern, FcMatchPattern);
+ FcDefaultSubstitute(pattern);
+
+ FcChar8 *familyAfterSubstitution;
+ FcPatternGetString(pattern, FC_FAMILY, 0, &familyAfterSubstitution);
+ QString resolved = QString::fromUtf8((const char *) familyAfterSubstitution);
+ FcPatternDestroy(pattern);
+
+ return resolved;
+#endif
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index 2ae60b1..526b566 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -234,7 +234,8 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
int idx = rtlOffset + rtlSign * i;
outGlyphs[idx] = tmpGlyphs[i] | fontIndex;
outAdvances_x[idx] = QFixed::fromReal(tmpPoints[i + 1].x - tmpPoints[i].x);
- outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i + 1].y - tmpPoints[i].y);
+ // Use negative y advance for flipped coordinate system
+ outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i].y - tmpPoints[i + 1].y);
if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
outAdvances_x[idx] = outAdvances_x[idx].round();
diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h
index b4450fa..7d17aef 100644
--- a/src/gui/text/qfontengine_coretext_p.h
+++ b/src/gui/text/qfontengine_coretext_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontengine_mac_p.h b/src/gui/text/qfontengine_mac_p.h
index 5577c76..6967348 100644
--- a/src/gui/text/qfontengine_mac_p.h
+++ b/src/gui/text/qfontengine_mac_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp
index cccbc92..851bb59 100644
--- a/src/gui/text/qfontengine_qpa.cpp
+++ b/src/gui/text/qfontengine_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontengine_qpa_p.h b/src/gui/text/qfontengine_qpa_p.h
index 467fca6..e15beae 100644
--- a/src/gui/text/qfontengine_qpa_p.h
+++ b/src/gui/text/qfontengine_qpa_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp
index 4802b94..b71c4a7 100644
--- a/src/gui/text/qfontengine_qws.cpp
+++ b/src/gui/text/qfontengine_qws.cpp
@@ -288,13 +288,16 @@ private:
#else
void readNode(QIODevice& f)
{
- uchar rw = f.getch();
- uchar cl = f.getch();
+ char rw;
+ char cl;
+ f.getChar(&rw);
+ f.getChar(&cl);
min = (rw << 8) | cl;
- rw = f.getch();
- cl = f.getch();
+ f.getChar(&rw);
+ f.getChar(&cl);
max = (rw << 8) | cl;
- int flags = f.getch();
+ char flags;
+ f.getChar(&flags);
if ( flags & 1 )
less = new QPFGlyphTree;
else
@@ -332,7 +335,7 @@ private:
int n = max-min+1;
for (int i=0; i<n; i++) {
glyph[i].metrics = new QPFGlyphMetrics;
- f.readBlock((char*)glyph[i].metrics, sizeof(QPFGlyphMetrics));
+ f.read((char*)glyph[i].metrics, sizeof(QPFGlyphMetrics));
}
if ( less )
less->readMetrics(f);
@@ -365,7 +368,7 @@ private:
//############### s = qt_screen->mapToDevice( s );
uint datasize = glyph[i].metrics->linestep * s.height();
glyph[i].data = new uchar[datasize]; // ### deleted?
- f.readBlock((char*)glyph[i].data, datasize);
+ f.read((char*)glyph[i].data, datasize);
}
if ( less )
less->readData(f);
@@ -385,6 +388,32 @@ public:
size_t mmapLength;
};
+#if defined(Q_OS_INTEGRITY)
+static void *qt_mmap(void *start, size_t length, int /*prot*/, int /*flags*/, int fd, off_t offset)
+{
+ // INTEGRITY cannot mmap local files - load it into a local buffer
+ if (::lseek(fd, offset, SEEK_SET) == -1) {
+# if defined(DEBUG_FONTENGINE)
+ perror("lseek failed");
+# endif
+ }
+ void *buf = malloc(length);
+ if (::read(fd, buf, length) != (ssize_t)length) {
+# if defined(DEBUG_FONTENGINE)
+ perror("read failed");
+# endif
+ }
+
+ return buf;
+}
+#else
+static inline void *qt_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
+{
+ return mmap(start, length, prot, flags, fd, offset);
+}
+#endif
+
+
QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
{
@@ -395,16 +424,18 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QT_STATBUF st;
if ( QT_FSTAT( f, &st ) )
qFatal("Failed to stat %s",QFile::encodeName(fn).data());
- uchar* data = (uchar*)mmap( 0, // any address
+ uchar* data = (uchar*)qt_mmap( 0, // any address
st.st_size, // whole file
PROT_READ, // read-only memory
-#if !defined(Q_OS_SOLARIS) && !defined(Q_OS_QNX4) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_VXWORKS)
+#if defined(Q_OS_INTEGRITY)
+ 0,
+#elif !defined(Q_OS_SOLARIS) && !defined(Q_OS_QNX4) && !defined(Q_OS_VXWORKS)
MAP_FILE | MAP_PRIVATE, // swap-backed map from file
#else
MAP_PRIVATE,
#endif
f, 0 ); // from offset 0 of f
-#if defined(Q_OS_QNX4) && !defined(MAP_FAILED)
+#if !defined(MAP_FAILED) && (defined(Q_OS_QNX4) || defined(Q_OS_INTEGRITY))
#define MAP_FAILED ((void *)-1)
#endif
if ( !data || data == (uchar*)MAP_FAILED )
diff --git a/src/gui/text/qglyphs.cpp b/src/gui/text/qglyphs.cpp
index 2447752..affa08a 100644
--- a/src/gui/text/qglyphs.cpp
+++ b/src/gui/text/qglyphs.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qglyphs.h b/src/gui/text/qglyphs.h
index 282ecb4..5f37136 100644
--- a/src/gui/text/qglyphs.h
+++ b/src/gui/text/qglyphs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qglyphs_p.h b/src/gui/text/qglyphs_p.h
index c39f5d0..c632e2f 100644
--- a/src/gui/text/qglyphs_p.h
+++ b/src/gui/text/qglyphs_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index afe762a..ef4e565 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h
index a1faea9..e0e4f04 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.h
+++ b/src/gui/text/qplatformfontdatabase_qpa.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index e15c06d..b7a2697 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -285,7 +285,7 @@ bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
if (cursor.position() != oldCursorPos)
emit q->cursorPositionChanged();
emit q->microFocusChanged();
- } else if (ignoreNavigationEvents && isNavigationEvent) {
+ } else if (ignoreNavigationEvents && isNavigationEvent && oldSelection.anchor() == cursor.anchor()) {
return false;
}
@@ -933,15 +933,18 @@ void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *conte
break; }
case QEvent::MouseMove: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseMoveEvent(ev->buttons(), matrix.map(ev->pos()));
+ d->mouseMoveEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
+ ev->buttons(), ev->globalPos());
break; }
case QEvent::MouseButtonRelease: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseReleaseEvent(ev->button(), matrix.map(ev->pos()));
+ d->mouseReleaseEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
+ ev->buttons(), ev->globalPos());
break; }
case QEvent::MouseButtonDblClick: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseDoubleClickEvent(e, ev->button(), matrix.map(ev->pos()));
+ d->mouseDoubleClickEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
+ ev->buttons(), ev->globalPos());
break; }
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent *>(e));
@@ -1001,15 +1004,18 @@ void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *conte
break; }
case QEvent::GraphicsSceneMouseMove: {
QGraphicsSceneMouseEvent *ev = static_cast<QGraphicsSceneMouseEvent *>(e);
- d->mouseMoveEvent(ev->buttons(), matrix.map(ev->pos()));
+ d->mouseMoveEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(), ev->buttons(),
+ ev->screenPos());
break; }
case QEvent::GraphicsSceneMouseRelease: {
QGraphicsSceneMouseEvent *ev = static_cast<QGraphicsSceneMouseEvent *>(e);
- d->mouseReleaseEvent(ev->button(), matrix.map(ev->pos()));
+ d->mouseReleaseEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(), ev->buttons(),
+ ev->screenPos());
break; }
case QEvent::GraphicsSceneMouseDoubleClick: {
QGraphicsSceneMouseEvent *ev = static_cast<QGraphicsSceneMouseEvent *>(e);
- d->mouseDoubleClickEvent(e, ev->button(), matrix.map(ev->pos()));
+ d->mouseDoubleClickEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(), ev->buttons(),
+ ev->screenPos());
break; }
case QEvent::GraphicsSceneContextMenu: {
QGraphicsSceneContextMenuEvent *ev = static_cast<QGraphicsSceneContextMenuEvent *>(e);
@@ -1018,7 +1024,8 @@ void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *conte
case QEvent::GraphicsSceneHoverMove: {
QGraphicsSceneHoverEvent *ev = static_cast<QGraphicsSceneHoverEvent *>(e);
- d->mouseMoveEvent(Qt::NoButton, matrix.map(ev->pos()));
+ d->mouseMoveEvent(ev, Qt::NoButton, matrix.map(ev->pos()), ev->modifiers(),Qt::NoButton,
+ ev->screenPos());
break; }
case QEvent::GraphicsSceneDragEnter: {
@@ -1488,6 +1495,11 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
{
Q_Q(QTextControl);
+ if (sendMouseEventToInputContext(
+ e, QEvent::MouseButtonPress, button, pos, modifiers, buttons, globalPos)) {
+ return;
+ }
+
if (interactionFlags & Qt::LinksAccessibleByMouse) {
anchorOnMousePress = q->anchorAt(pos);
@@ -1530,22 +1542,7 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
return;
}
-#if !defined(QT_NO_IM)
- QTextLayout *layout = cursor.block().layout();
- if (contextWidget && layout && !layout->preeditAreaText().isEmpty()) {
- QInputContext *ctx = inputContext();
- if (ctx) {
- QMouseEvent ev(QEvent::MouseButtonPress, contextWidget->mapFromGlobal(globalPos), globalPos,
- button, buttons, modifiers);
- ctx->mouseHandler(cursorPos - cursor.position(), &ev);
- }
- if (!layout->preeditAreaText().isEmpty()) {
- e->ignore();
- return;
- }
- }
-#endif
- if (modifiers == Qt::ShiftModifier) {
+ if (modifiers == Qt::ShiftModifier && (interactionFlags & Qt::TextSelectableByMouse)) {
if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) {
selectedWordOnDoubleClick = cursor;
selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor);
@@ -1590,10 +1587,16 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
hadSelectionOnMousePress = cursor.hasSelection();
}
-void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF &mousePos)
+void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, const QPointF &mousePos, Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons, const QPoint &globalPos)
{
Q_Q(QTextControl);
+ if (sendMouseEventToInputContext(
+ e, QEvent::MouseMove, button, mousePos, modifiers, buttons, globalPos)) {
+ return;
+ }
+
if (interactionFlags & Qt::LinksAccessibleByMouse) {
QString anchor = q->anchorAt(mousePos);
if (anchor != highlightedAnchor) {
@@ -1605,7 +1608,10 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF
if (!(buttons & Qt::LeftButton))
return;
- if (!((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable)))
+ const bool selectable = interactionFlags & Qt::TextSelectableByMouse;
+ const bool editable = interactionFlags & Qt::TextEditable;
+
+ if (!selectable && !editable)
return;
if (!(mousePressed
@@ -1621,13 +1627,11 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF
startDrag();
return;
}
- const qreal mouseX = qreal(mousePos.x());
-#if !defined(QT_NO_IM)
- QTextLayout *layout = cursor.block().layout();
- if (layout && !layout->preeditAreaText().isEmpty())
+ if (!selectable)
return;
-#endif
+
+ const qreal mouseX = qreal(mousePos.x());
int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit);
if (newCursorPos == -1)
@@ -1653,8 +1657,10 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF
emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection();
#ifndef QT_NO_IM
- if (QInputContext *ic = inputContext()) {
- ic->update();
+ if (contextWidget) {
+ if (QInputContext *ic = inputContext()) {
+ ic->update();
+ }
}
#endif //QT_NO_IM
} else {
@@ -1666,10 +1672,16 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF
repaintOldAndNewSelection(oldSelection);
}
-void QTextControlPrivate::mouseReleaseEvent(Qt::MouseButton button, const QPointF &pos)
+void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons, const QPoint &globalPos)
{
Q_Q(QTextControl);
+ if (sendMouseEventToInputContext(
+ e, QEvent::MouseButtonRelease, button, pos, modifiers, buttons, globalPos)) {
+ return;
+ }
+
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();
@@ -1727,19 +1739,21 @@ void QTextControlPrivate::mouseReleaseEvent(Qt::MouseButton button, const QPoint
}
}
-void QTextControlPrivate::mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos)
+void QTextControlPrivate::mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons, const QPoint &globalPos)
{
Q_Q(QTextControl);
+
+ if (sendMouseEventToInputContext(
+ e, QEvent::MouseButtonDblClick, button, pos, modifiers, buttons, globalPos)) {
+ return;
+ }
+
if (button != Qt::LeftButton
|| !(interactionFlags & Qt::TextSelectableByMouse)) {
e->ignore();
return;
}
-#if !defined(QT_NO_IM)
- QTextLayout *layout = cursor.block().layout();
- if (layout && !layout->preeditAreaText().isEmpty())
- return;
-#endif
#ifndef QT_NO_DRAGANDDROP
mightStartDrag = false;
@@ -1768,6 +1782,45 @@ void QTextControlPrivate::mouseDoubleClickEvent(QEvent *e, Qt::MouseButton butto
}
}
+bool QTextControlPrivate::sendMouseEventToInputContext(
+ QEvent *e, QEvent::Type eventType, Qt::MouseButton button, const QPointF &pos,
+ Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
+{
+#if !defined(QT_NO_IM)
+ Q_Q(QTextControl);
+
+ QTextLayout *layout = cursor.block().layout();
+ if (contextWidget && layout && !layout->preeditAreaText().isEmpty()) {
+ QInputContext *ctx = inputContext();
+ int cursorPos = q->hitTest(pos, Qt::FuzzyHit) - cursor.position();
+
+ if (cursorPos < 0 || cursorPos > layout->preeditAreaText().length()) {
+ cursorPos = -1;
+ // don't send move events outside the preedit area
+ if (eventType == QEvent::MouseMove)
+ return true;
+ }
+ if (ctx) {
+ QMouseEvent ev(eventType, contextWidget->mapFromGlobal(globalPos), globalPos,
+ button, buttons, modifiers);
+ ctx->mouseHandler(cursorPos, &ev);
+ e->setAccepted(ev.isAccepted());
+ }
+ if (!layout->preeditAreaText().isEmpty())
+ return true;
+ }
+#else
+ Q_UNUSED(e);
+ Q_UNUSED(eventType);
+ Q_UNUSED(button);
+ Q_UNUSED(pos);
+ Q_UNUSED(modifiers);
+ Q_UNUSED(buttons);
+ Q_UNUSED(globalPos);
+#endif
+ return false;
+}
+
void QTextControlPrivate::contextMenuEvent(const QPoint &screenPos, const QPointF &docPos, QWidget *contextWidget)
{
#ifdef QT_NO_CONTEXTMENU
diff --git a/src/gui/text/qtextcontrol_p_p.h b/src/gui/text/qtextcontrol_p_p.h
index ecd13ea..94670e2 100644
--- a/src/gui/text/qtextcontrol_p_p.h
+++ b/src/gui/text/qtextcontrol_p_p.h
@@ -135,9 +135,23 @@ public:
Qt::KeyboardModifiers modifiers,
Qt::MouseButtons buttons,
const QPoint &globalPos);
- void mouseMoveEvent(Qt::MouseButtons buttons, const QPointF &pos);
- void mouseReleaseEvent(Qt::MouseButton button, const QPointF &pos);
- void mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos);
+ void mouseMoveEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
+ Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons,
+ const QPoint &globalPos);
+ void mouseReleaseEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
+ Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons,
+ const QPoint &globalPos);
+ void mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
+ Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons,
+ const QPoint &globalPos);
+ bool sendMouseEventToInputContext(QEvent *e, QEvent::Type eventType, Qt::MouseButton button,
+ const QPointF &pos,
+ Qt::KeyboardModifiers modifiers,
+ Qt::MouseButtons buttons,
+ const QPoint &globalPos);
void contextMenuEvent(const QPoint &screenPos, const QPointF &docPos, QWidget *contextWidget);
void focusEvent(QFocusEvent *e);
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 415fa4b..a63fdbf 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1385,6 +1385,15 @@ void QTextEngine::shape(int item) const
}
}
+static inline void releaseCachedFontEngine(QFontEngine *fontEngine)
+{
+ if (fontEngine) {
+ fontEngine->ref.deref();
+ if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
+ delete fontEngine;
+ }
+}
+
void QTextEngine::invalidate()
{
freeMemory();
@@ -1392,6 +1401,9 @@ void QTextEngine::invalidate()
maxWidth = 0;
if (specialData)
specialData->resolvedFormatIndices.clear();
+
+ releaseCachedFontEngine(feCache.prevFontEngine);
+ releaseCachedFontEngine(feCache.prevScaledFontEngine);
feCache.reset();
}
@@ -1824,7 +1836,11 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
scaledEngine = font.d->engineForScript(script);
}
feCache.prevFontEngine = engine;
+ if (engine)
+ engine->ref.ref();
feCache.prevScaledFontEngine = scaledEngine;
+ if (scaledEngine)
+ scaledEngine->ref.ref();
feCache.prevScript = script;
feCache.prevPosition = si.position;
feCache.prevLength = length(&si);
@@ -1835,6 +1851,8 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
else {
engine = font.d->engineForScript(script);
feCache.prevFontEngine = engine;
+ if (engine)
+ engine->ref.ref();
feCache.prevScript = script;
feCache.prevPosition = -1;
feCache.prevLength = -1;
diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp
index c0a1e64..97e8c5b 100644
--- a/src/gui/text/qtextengine_mac.cpp
+++ b/src/gui/text/qtextengine_mac.cpp
@@ -607,8 +607,9 @@ void QTextEngine::shapeTextMac(int item) const
bool stringToCMapFailed = false;
if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) {
ensureSpace(num_glyphs);
- stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters,
- attributes());
+ g = availableGlyphs(&si);
+ stringToCMapFailed = !fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters,
+ attributes());
}
if (!stringToCMapFailed) {
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index c5b6e14..0081550 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1504,7 +1504,7 @@ QTextBlock QTextBlock::next() const
*/
QTextBlock QTextBlock::previous() const
{
- if (!isValid())
+ if (!p)
return QTextBlock();
return QTextBlock(p, p->blockMap().previous(n));
diff --git a/src/gui/util/qflickgesture.cpp b/src/gui/util/qflickgesture.cpp
index eb0cc8d..8baca07 100644
--- a/src/gui/util/qflickgesture.cpp
+++ b/src/gui/util/qflickgesture.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qflickgesture_p.h b/src/gui/util/qflickgesture_p.h
index c3c263b..451b579 100644
--- a/src/gui/util/qflickgesture_p.h
+++ b/src/gui/util/qflickgesture_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscroller.cpp b/src/gui/util/qscroller.cpp
index d60f44e..ac5607c 100644
--- a/src/gui/util/qscroller.cpp
+++ b/src/gui/util/qscroller.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscroller.h b/src/gui/util/qscroller.h
index 7d7e1ca..a026be4 100644
--- a/src/gui/util/qscroller.h
+++ b/src/gui/util/qscroller.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscroller_mac.mm b/src/gui/util/qscroller_mac.mm
index 3203036..f544788 100644
--- a/src/gui/util/qscroller_mac.mm
+++ b/src/gui/util/qscroller_mac.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscroller_p.h b/src/gui/util/qscroller_p.h
index d16eef9..fb2b257 100644
--- a/src/gui/util/qscroller_p.h
+++ b/src/gui/util/qscroller_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscrollerproperties.cpp b/src/gui/util/qscrollerproperties.cpp
index b159e05..85e2e82 100644
--- a/src/gui/util/qscrollerproperties.cpp
+++ b/src/gui/util/qscrollerproperties.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscrollerproperties.h b/src/gui/util/qscrollerproperties.h
index e292d8d..75d8932 100644
--- a/src/gui/util/qscrollerproperties.h
+++ b/src/gui/util/qscrollerproperties.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/util/qscrollerproperties_p.h b/src/gui/util/qscrollerproperties_p.h
index 093f615..76d8b0a 100644
--- a/src/gui/util/qscrollerproperties_p.h
+++ b/src/gui/util/qscrollerproperties_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 5f17a2b..6fe87b6 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -562,6 +562,14 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
} else {
qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
}
+
+#ifdef Q_WS_MAC
+ // Since mnemonics is off by default on Mac, we add a Cmd-D
+ // shortcut here to e.g. make the "Don't Save" button work nativly:
+ if (sbutton == QDialogButtonBox::Discard)
+ button->setShortcut(QKeySequence(QLatin1String("Ctrl+D")));
+#endif
+
return button;
}
diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp
index 8e1e7c3..6b64d48 100644
--- a/src/gui/widgets/qeffects.cpp
+++ b/src/gui/widgets/qeffects.cpp
@@ -55,19 +55,6 @@
QT_BEGIN_NAMESPACE
/*
- Internal class to get access to protected QWidget-members
-*/
-
-class QAccessWidget : public QWidget
-{
- friend class QAlphaWidget;
- friend class QRollEffect;
-public:
- QAccessWidget(QWidget* parent=0, Qt::WindowFlags f = 0)
- : QWidget(parent, f) {}
-};
-
-/*
Internal class QAlphaWidget.
The QAlphaWidget is shown while the animation lasts
@@ -98,13 +85,12 @@ private:
QImage backImage;
QImage frontImage;
QImage mixedImage;
- QPointer<QAccessWidget> widget;
+ QPointer<QWidget> widget;
int duration;
int elapsed;
bool showWidget;
QTimer anim;
QElapsedTimer checkTime;
- double windowOpacity;
};
static QAlphaWidget* q_blend = 0;
@@ -119,8 +105,7 @@ QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
setEnabled(false);
#endif
setAttribute(Qt::WA_NoSystemBackground, true);
- widget = (QAccessWidget*)w;
- windowOpacity = w->windowOpacity();
+ widget = w;
alpha = 0;
}
@@ -129,7 +114,7 @@ QAlphaWidget::~QAlphaWidget()
#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
// Restore user-defined opacity value
if (widget)
- widget->setWindowOpacity(windowOpacity);
+ widget->setWindowOpacity(1);
#endif
}
@@ -268,10 +253,10 @@ void QAlphaWidget::render()
alpha = 1;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- if (alpha >= windowOpacity || !showWidget) {
+ if (alpha >= 1 || !showWidget) {
anim.stop();
qApp->removeEventFilter(this);
- widget->setWindowOpacity(windowOpacity);
+ widget->setWindowOpacity(1);
q_blend = 0;
deleteLater();
} else {
@@ -370,7 +355,7 @@ private slots:
void scroll();
private:
- QPointer<QAccessWidget> widget;
+ QPointer<QWidget> widget;
int currentHeight;
int currentWidth;
@@ -401,7 +386,7 @@ QRollEffect::QRollEffect(QWidget* w, Qt::WindowFlags f, DirFlags orient)
setEnabled(false);
#endif
- widget = (QAccessWidget*) w;
+ widget = w;
Q_ASSERT(widget);
setAttribute(Qt::WA_NoSystemBackground, true);
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 4b95000..3eac64a 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -414,13 +414,17 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
if (isGettingInput) {
// If any text is being input, remove selected text.
priorState = m_undoState;
+ if (echoMode() == QLineEdit::PasswordEchoOnEdit && !passwordEchoEditing()) {
+ updatePasswordEchoEditing(true);
+ m_selstart = 0;
+ m_selend = m_text.length();
+ }
removeSelectedText();
}
-
int c = m_cursor; // cursor position after insertion of commit string
if (event->replacementStart() <= 0)
- c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength());
+ c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
m_cursor += event->replacementStart();
@@ -456,6 +460,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
#ifndef QT_NO_IM
setPreeditArea(m_cursor, event->preeditString());
#endif //QT_NO_IM
+ const int oldPreeditCursor = m_preeditCursor;
m_preeditCursor = event->preeditString().length();
m_hideCursor = false;
QList<QTextLayout::FormatRange> formats;
@@ -479,6 +484,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
updateDisplayText(/*force*/ true);
if (cursorPositionChanged)
emitCursorPositionChanged();
+ else if (m_preeditCursor != oldPreeditCursor)
+ emit updateMicroFocus();
if (isGettingInput)
finishChange(priorState);
}
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index bfe50fe..3c505c8 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -425,6 +425,7 @@ Q_SIGNALS:
void textEdited(const QString &);
void resetInputContext();
+ void updateMicroFocus();
void accepted();
void editingFinished();
diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp
index b02db4c..2a486bb 100644
--- a/src/gui/widgets/qmdiarea.cpp
+++ b/src/gui/widgets/qmdiarea.cpp
@@ -674,6 +674,8 @@ QMdiAreaPrivate::QMdiAreaPrivate()
viewMode(QMdiArea::SubWindowView),
#ifndef QT_NO_TABBAR
documentMode(false),
+ tabsClosable(false),
+ tabsMovable(false),
#endif
#ifndef QT_NO_TABWIDGET
tabShape(QTabWidget::Rounded),
@@ -792,6 +794,27 @@ void QMdiAreaPrivate::_q_currentTabChanged(int index)
#endif // QT_NO_TABBAR
}
+void QMdiAreaPrivate::_q_closeTab(int index)
+{
+#ifdef QT_NO_TABBAR
+ Q_UNUSED(index);
+#else
+ QMdiSubWindow *subWindow = childWindows.at(index);
+ Q_ASSERT(subWindow);
+ subWindow->close();
+#endif // QT_NO_TABBAR
+}
+
+void QMdiAreaPrivate::_q_moveTab(int from, int to)
+{
+#ifdef QT_NO_TABBAR
+ Q_UNUSED(from);
+ Q_UNUSED(to);
+#else
+ childWindows.move(from, to);
+#endif // QT_NO_TABBAR
+}
+
/*!
\internal
*/
@@ -1519,6 +1542,8 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode)
Q_ASSERT(!tabBar);
tabBar = new QMdiAreaTabBar(q);
tabBar->setDocumentMode(documentMode);
+ tabBar->setTabsClosable(tabsClosable);
+ tabBar->setMovable(tabsMovable);
#ifndef QT_NO_TABWIDGET
tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition));
#endif
@@ -1550,6 +1575,8 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode)
updateTabBarGeometry();
QObject::connect(tabBar, SIGNAL(currentChanged(int)), q, SLOT(_q_currentTabChanged(int)));
+ QObject::connect(tabBar, SIGNAL(tabCloseRequested(int)), q, SLOT(_q_closeTab(int)));
+ QObject::connect(tabBar, SIGNAL(tabMoved(int,int)), q, SLOT(_q_moveTab(int,int)));
} else
#endif // QT_NO_TABBAR
{ // SubWindowView
@@ -1636,6 +1663,8 @@ void QMdiAreaPrivate::refreshTabBar()
return;
tabBar->setDocumentMode(documentMode);
+ tabBar->setTabsClosable(tabsClosable);
+ tabBar->setMovable(tabsMovable);
#ifndef QT_NO_TABWIDGET
tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition));
#endif
@@ -2114,6 +2143,56 @@ void QMdiArea::setDocumentMode(bool enabled)
d->documentMode = enabled;
d->refreshTabBar();
}
+
+/*!
+ \property QMdiArea::tabsClosable
+ \brief whether the tab bar should place close buttons on each tab in tabbed view mode.
+ \since 4.8
+
+ Tabs are not closable by default.
+
+ \sa QTabBar::tabsClosable, setViewMode()
+*/
+bool QMdiArea::tabsClosable() const
+{
+ Q_D(const QMdiArea);
+ return d->tabsClosable;
+}
+
+void QMdiArea::setTabsClosable(bool closable)
+{
+ Q_D(QMdiArea);
+ if (d->tabsClosable == closable)
+ return;
+
+ d->tabsClosable = closable;
+ d->refreshTabBar();
+}
+
+/*!
+ \property QMdiArea::tabsMovable
+ \brief whether the user can move the tabs within the tabbar area in tabbed view mode.
+ \since 4.8
+
+ Tabs are not movable by default.
+
+ \sa QTabBar::tabsMovable, setViewMode()
+*/
+bool QMdiArea::tabsMovable() const
+{
+ Q_D(const QMdiArea);
+ return d->tabsMovable;
+}
+
+void QMdiArea::setTabsMovable(bool movable)
+{
+ Q_D(QMdiArea);
+ if (d->tabsMovable == movable)
+ return;
+
+ d->tabsMovable = movable;
+ d->refreshTabBar();
+}
#endif // QT_NO_TABBAR
#ifndef QT_NO_TABWIDGET
diff --git a/src/gui/widgets/qmdiarea.h b/src/gui/widgets/qmdiarea.h
index 809bfe4..a4b357c 100644
--- a/src/gui/widgets/qmdiarea.h
+++ b/src/gui/widgets/qmdiarea.h
@@ -65,6 +65,8 @@ class Q_GUI_EXPORT QMdiArea : public QAbstractScrollArea
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
#ifndef QT_NO_TABBAR
Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode)
+ Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable)
+ Q_PROPERTY(bool tabsMovable READ tabsMovable WRITE setTabsMovable)
#endif
#ifndef QT_NO_TABWIDGET
Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape)
@@ -116,6 +118,12 @@ public:
#ifndef QT_NO_TABBAR
bool documentMode() const;
void setDocumentMode(bool enabled);
+
+ void setTabsClosable(bool closable);
+ bool tabsClosable() const;
+
+ void setTabsMovable(bool movable);
+ bool tabsMovable() const;
#endif
#ifndef QT_NO_TABWIDGET
void setTabShape(QTabWidget::TabShape shape);
@@ -156,7 +164,9 @@ private:
Q_DECLARE_PRIVATE(QMdiArea)
Q_PRIVATE_SLOT(d_func(), void _q_deactivateAllWindows())
Q_PRIVATE_SLOT(d_func(), void _q_processWindowStateChanged(Qt::WindowStates, Qt::WindowStates))
- Q_PRIVATE_SLOT(d_func(), void _q_currentTabChanged(int index))
+ Q_PRIVATE_SLOT(d_func(), void _q_currentTabChanged(int))
+ Q_PRIVATE_SLOT(d_func(), void _q_closeTab(int))
+ Q_PRIVATE_SLOT(d_func(), void _q_moveTab(int, int))
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiArea::AreaOptions)
diff --git a/src/gui/widgets/qmdiarea_p.h b/src/gui/widgets/qmdiarea_p.h
index 5d85659..e5e2057 100644
--- a/src/gui/widgets/qmdiarea_p.h
+++ b/src/gui/widgets/qmdiarea_p.h
@@ -165,6 +165,8 @@ public:
QMdiArea::ViewMode viewMode;
#ifndef QT_NO_TABBAR
bool documentMode;
+ bool tabsClosable;
+ bool tabsMovable;
#endif
#ifndef QT_NO_TABWIDGET
QTabWidget::TabShape tabShape;
@@ -189,6 +191,8 @@ public:
void _q_deactivateAllWindows(QMdiSubWindow *aboutToActivate = 0);
void _q_processWindowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
void _q_currentTabChanged(int index);
+ void _q_closeTab(int index);
+ void _q_moveTab(int from, int to);
// Functions.
void appendChild(QMdiSubWindow *child);
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index d3af9e1..7435691 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -967,7 +967,7 @@ void QPlainTextEditPrivate::_q_adjustScrollbars()
++lineNumber;
}
if (lineNumber < layoutLineCount)
- visibleFromBottom += (layoutLineCount - lineNumber - 1);
+ visibleFromBottom += (layoutLineCount - lineNumber);
break;
}
diff --git a/src/gui/widgets/qsizegrip.cpp b/src/gui/widgets/qsizegrip.cpp
index f2ea1bf..630aecf 100644
--- a/src/gui/widgets/qsizegrip.cpp
+++ b/src/gui/widgets/qsizegrip.cpp
@@ -309,6 +309,7 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
#ifdef Q_WS_X11
// Use a native X11 sizegrip for "real" top-level windows if supported.
if (tlw->isWindow() && X11->isSupportedByWM(ATOM(_NET_WM_MOVERESIZE))
+ && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
&& !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -420,7 +421,8 @@ void QSizeGrip::mouseMoveEvent(QMouseEvent * e)
#ifdef Q_WS_X11
if (tlw->isWindow() && X11->isSupportedByWM(ATOM(_NET_WM_MOVERESIZE))
- && tlw->isTopLevel() && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth())
+ && tlw->isTopLevel() && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
+ && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth())
return;
#endif
#ifdef Q_WS_WIN
diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp
index 813ec3e..531acb4 100644
--- a/src/gui/widgets/qtoolbarlayout.cpp
+++ b/src/gui/widgets/qtoolbarlayout.cpp
@@ -647,15 +647,15 @@ QSize QToolBarLayout::expandedSize(const QSize &size) const
void QToolBarLayout::setExpanded(bool exp)
{
- if (exp == expanded)
+ QWidget *tb = qobject_cast<QToolBar*>(parentWidget());
+ if (!tb)
+ return;
+ if (exp == expanded && !tb->isWindow())
return;
expanded = exp;
extension->setChecked(expanded);
- QToolBar *tb = qobject_cast<QToolBar*>(parentWidget());
- if (!tb)
- return;
if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) {
#ifdef QT_NO_DOCKWIDGET
animating = false;
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index d5726c1..9fe01bf 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -365,7 +365,7 @@ void QDeclarativeFolderListModel::refresh()
{
d->folderIndex = QModelIndex();
if (d->count) {
- emit beginRemoveRows(QModelIndex(), 0, d->count);
+ emit beginRemoveRows(QModelIndex(), 0, d->count-1);
d->count = 0;
emit endRemoveRows();
}
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 1b6e723..c2a2e98 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -89,6 +89,10 @@ public:
\warning Elements in the Qt.labs module are not guaranteed to remain compatible
in future versions.
+ \warning GestureArea is an experimental element whose development has
+ been discontinued. PinchArea is available in QtQuick 1.1 and handles
+ two finger gesture input.
+
\note This element is only functional on devices with touch input.
\qml
diff --git a/src/multimedia/audio/qaudiooutput_symbian_p.cpp b/src/multimedia/audio/qaudiooutput_symbian_p.cpp
index ea7cd9f..5db7099 100644
--- a/src/multimedia/audio/qaudiooutput_symbian_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_symbian_p.cpp
@@ -436,8 +436,8 @@ void QAudioOutputPrivate::writePaddingData()
unsigned char *ptr = const_cast<unsigned char*>(outputBuffer.Ptr());
Mem::FillZ(ptr, paddingBytes);
outputBuffer.SetLength(outputBuffer.Length() + paddingBytes);
+ Q_ASSERT(m_bytesPadding >= paddingBytes);
m_bytesPadding -= paddingBytes;
- Q_ASSERT(m_bytesPadding >= 0);
if (m_pullMode && m_source->atEnd())
lastBufferFilled();
diff --git a/src/network/access/access.pri b/src/network/access/access.pri
index f8dfda6..57a79b3 100644
--- a/src/network/access/access.pri
+++ b/src/network/access/access.pri
@@ -8,6 +8,7 @@ HEADERS += \
access/qhttpnetworkreply_p.h \
access/qhttpnetworkconnection_p.h \
access/qhttpnetworkconnectionchannel_p.h \
+ access/qnetworkaccessauthenticationmanager_p.h \
access/qnetworkaccessmanager.h \
access/qnetworkaccessmanager_p.h \
access/qnetworkaccesscache_p.h \
@@ -32,7 +33,8 @@ HEADERS += \
access/qabstractnetworkcache_p.h \
access/qabstractnetworkcache.h \
access/qnetworkdiskcache_p.h \
- access/qnetworkdiskcache.h
+ access/qnetworkdiskcache.h \
+ access/qhttpthreaddelegate_p.h
SOURCES += \
access/qftp.cpp \
@@ -42,6 +44,7 @@ SOURCES += \
access/qhttpnetworkreply.cpp \
access/qhttpnetworkconnection.cpp \
access/qhttpnetworkconnectionchannel.cpp \
+ access/qnetworkaccessauthenticationmanager.cpp \
access/qnetworkaccessmanager.cpp \
access/qnetworkaccesscache.cpp \
access/qnetworkaccessbackend.cpp \
@@ -58,6 +61,7 @@ SOURCES += \
access/qnetworkreplydataimpl.cpp \
access/qnetworkreplyfileimpl.cpp \
access/qabstractnetworkcache.cpp \
- access/qnetworkdiskcache.cpp
+ access/qnetworkdiskcache.cpp \
+ access/qhttpthreaddelegate.cpp
include($$PWD/../../3rdparty/zlib_dependency.pri)
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index e94b099..3502113 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -286,7 +286,13 @@ void QHttpNetworkConnectionPrivate::emitReplyError(QAbstractSocket *socket,
int i = indexOf(socket);
// remove the corrupt data if any
reply->d_func()->eraseData();
+
+ // Clean the channel
channels[i].close();
+ channels[i].reply = 0;
+ channels[i].request = QHttpNetworkRequest();
+ channels[i].requeueCurrentlyPipelinedRequests();
+
// send the next request
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 079f608..41bc64a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -253,7 +253,7 @@ bool QHttpNetworkConnectionChannel::sendRequest()
#endif
{
// get pointer to upload data
- qint64 currentReadSize;
+ qint64 currentReadSize = 0;
qint64 desiredReadSize = qMin(socketWriteMaxSize, bytesTotal - written);
const char *readPointer = uploadByteDevice->readPointer(desiredReadSize, currentReadSize);
@@ -476,7 +476,8 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
}
#ifndef QT_NO_COMPRESS
else if (!expand(false)) { // expand a chunk if possible
- return; // ### expand failed
+ // If expand() failed we can just return, it had already called connection->emitReplyError()
+ return;
}
#endif
}
@@ -645,28 +646,38 @@ void QHttpNetworkConnectionChannel::allDone()
{
#ifndef QT_NO_COMPRESS
// expand the whole data.
- if (reply->d_func()->expectContent() && reply->d_func()->autoDecompress && !reply->d_func()->streamEnd)
- expand(true); // ### if expand returns false, its an error
+ if (reply->d_func()->expectContent() && reply->d_func()->autoDecompress && !reply->d_func()->streamEnd) {
+ bool expandResult = expand(true);
+ // If expand() failed we can just return, it had already called connection->emitReplyError()
+ if (!expandResult)
+ return;
+ }
#endif
+
+ if (!reply) {
+ qWarning() << "QHttpNetworkConnectionChannel::allDone() called without reply. Please report at http://bugreports.qt.nokia.com/";
+ return;
+ }
+
// while handling 401 & 407, we might reset the status code, so save this.
bool emitFinished = reply->d_func()->shouldEmitSignals();
- handleStatus();
- // ### at this point there should be no more data on the socket
- // close if server requested
bool connectionCloseEnabled = reply->d_func()->isConnectionCloseEnabled();
- if (connectionCloseEnabled)
- close();
+ detectPipeliningSupport();
+
+ handleStatus();
+ // handleStatus() might have removed the reply because it already called connection->emitReplyError()
+
// queue the finished signal, this is required since we might send new requests from
// slot connected to it. The socket will not fire readyRead signal, if we are already
// in the slot connected to readyRead
- if (emitFinished)
+ if (reply && emitFinished)
QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
+
+
// reset the reconnection attempts after we receive a complete reply.
// in case of failures, each channel will attempt two reconnects before emitting error.
reconnectAttempts = 2;
- detectPipeliningSupport();
-
// now the channel can be seen as free/idle again, all signal emissions for the reply have been done
this->state = QHttpNetworkConnectionChannel::IdleState;
@@ -717,6 +728,8 @@ void QHttpNetworkConnectionChannel::allDone()
// leading whitespace.
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
} else if (alreadyPipelinedRequests.isEmpty()) {
+ if (connectionCloseEnabled)
+ close();
if (qobject_cast<QHttpNetworkConnection*>(connection))
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 7f6b71f..704cf3a 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -177,6 +177,12 @@ qint64 QHttpNetworkReply::bytesAvailableNextBlock() const
return -1;
}
+bool QHttpNetworkReply::readAnyAvailable() const
+{
+ Q_D(const QHttpNetworkReply);
+ return (d->responseData.bufferCount() > 0);
+}
+
QByteArray QHttpNetworkReply::readAny()
{
Q_D(QHttpNetworkReply);
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 1856d7a..cc0f671 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -125,6 +125,7 @@ public:
qint64 bytesAvailable() const;
qint64 bytesAvailableNextBlock() const;
+ bool readAnyAvailable() const;
QByteArray readAny();
QByteArray readAll();
void setDownstreamLimited(bool t);
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
new file mode 100644
index 0000000..81410a4
--- /dev/null
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -0,0 +1,518 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtNetwork 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 "qhttpthreaddelegate_p.h"
+
+#include <QThread>
+#include <QTimer>
+#include <QAuthenticator>
+#include <QEventLoop>
+
+#include "private/qhttpnetworkreply_p.h"
+#include "private/qnetworkaccesscache_p.h"
+#include "private/qnoncontiguousbytedevice_p.h"
+
+
+QT_BEGIN_NAMESPACE
+
+static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
+{
+ QNetworkReply::NetworkError code;
+ // we've got an error
+ switch (httpStatusCode) {
+ case 401: // Authorization required
+ code = QNetworkReply::AuthenticationRequiredError;
+ break;
+
+ case 403: // Access denied
+ code = QNetworkReply::ContentOperationNotPermittedError;
+ break;
+
+ case 404: // Not Found
+ code = QNetworkReply::ContentNotFoundError;
+ break;
+
+ case 405: // Method Not Allowed
+ code = QNetworkReply::ContentOperationNotPermittedError;
+ break;
+
+ case 407:
+ code = QNetworkReply::ProxyAuthenticationRequiredError;
+ break;
+
+ default:
+ if (httpStatusCode > 500) {
+ // some kind of server error
+ code = QNetworkReply::ProtocolUnknownError;
+ } else if (httpStatusCode >= 400) {
+ // content error we did not handle above
+ code = QNetworkReply::UnknownContentError;
+ } else {
+ qWarning("QNetworkAccess: got HTTP status code %d which is not expected from url: \"%s\"",
+ httpStatusCode, qPrintable(url.toString()));
+ code = QNetworkReply::ProtocolFailure;
+ }
+ }
+
+ return code;
+}
+
+
+static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy)
+{
+ QByteArray result;
+ QUrl copy = url;
+ bool isEncrypted = copy.scheme().toLower() == QLatin1String("https");
+ copy.setPort(copy.port(isEncrypted ? 443 : 80));
+ result = copy.toEncoded(QUrl::RemoveUserInfo | QUrl::RemovePath |
+ QUrl::RemoveQuery | QUrl::RemoveFragment);
+
+#ifndef QT_NO_NETWORKPROXY
+ if (proxy && proxy->type() != QNetworkProxy::NoProxy) {
+ QUrl key;
+
+ switch (proxy->type()) {
+ case QNetworkProxy::Socks5Proxy:
+ key.setScheme(QLatin1String("proxy-socks5"));
+ break;
+
+ case QNetworkProxy::HttpProxy:
+ case QNetworkProxy::HttpCachingProxy:
+ key.setScheme(QLatin1String("proxy-http"));
+ break;
+
+ default:
+ break;
+ }
+
+ if (!key.scheme().isEmpty()) {
+ key.setUserName(proxy->user());
+ key.setHost(proxy->hostName());
+ key.setPort(proxy->port());
+ key.setEncodedQuery(result);
+ result = key.toEncoded();
+ }
+ }
+#endif
+
+ return "http-connection:" + result;
+}
+
+class QNetworkAccessCachedHttpConnection: public QHttpNetworkConnection,
+ public QNetworkAccessCache::CacheableObject
+{
+ // Q_OBJECT
+public:
+ QNetworkAccessCachedHttpConnection(const QString &hostName, quint16 port, bool encrypt)
+ : QHttpNetworkConnection(hostName, port, encrypt)
+ {
+ setExpires(true);
+ setShareable(true);
+ }
+
+ virtual void dispose()
+ {
+#if 0 // sample code; do this right with the API
+ Q_ASSERT(!isWorking());
+#endif
+ delete this;
+ }
+};
+
+
+QThreadStorage<QNetworkAccessCache *> QHttpThreadDelegate::connections;
+
+
+QHttpThreadDelegate::~QHttpThreadDelegate()
+{
+ // It could be that the main thread has asked us to shut down, so we need to delete the HTTP reply
+ if (httpReply) {
+ delete httpReply;
+ }
+
+ // Get the object cache that stores our QHttpNetworkConnection objects
+ // and release the entry for this QHttpNetworkConnection
+ if (connections.hasLocalData() && !cacheKey.isEmpty()) {
+ connections.localData()->releaseEntry(cacheKey);
+ }
+}
+
+
+QHttpThreadDelegate::QHttpThreadDelegate(QObject *parent) :
+ QObject(parent)
+ , ssl(false)
+ , downloadBufferMaximumSize(0)
+ , pendingDownloadData(0)
+ , pendingDownloadProgress(0)
+ , synchronous(false)
+ , incomingStatusCode(0)
+ , isPipeliningUsed(false)
+ , incomingContentLength(-1)
+ , incomingErrorCode(QNetworkReply::NoError)
+ , downloadBuffer(0)
+ , httpConnection(0)
+ , httpReply(0)
+{
+}
+
+// This is invoked as BlockingQueuedConnection from QNetworkAccessHttpBackend in the user thread
+void QHttpThreadDelegate::startRequestSynchronously()
+{
+ synchronous = true;
+
+ QEventLoop synchronousRequestLoop;
+ this->synchronousRequestLoop = &synchronousRequestLoop;
+
+ // Worst case timeout
+ QTimer::singleShot(30*1000, this, SLOT(abortRequest()));
+
+ QMetaObject::invokeMethod(this, "startRequest", Qt::QueuedConnection);
+ synchronousRequestLoop.exec();
+
+ connections.localData()->releaseEntry(cacheKey);
+ connections.setLocalData(0);
+
+}
+
+
+// This is invoked as QueuedConnection from QNetworkAccessHttpBackend in the user thread
+void QHttpThreadDelegate::startRequest()
+{
+ // Check QThreadStorage for the QNetworkAccessCache
+ // If not there, create this connection cache
+ if (!connections.hasLocalData()) {
+ connections.setLocalData(new QNetworkAccessCache());
+ }
+
+ // check if we have an open connection to this host
+ QUrl urlCopy = httpRequest.url();
+ urlCopy.setPort(urlCopy.port(ssl ? 443 : 80));
+
+ if (transparentProxy.type() != QNetworkProxy::NoProxy)
+ cacheKey = makeCacheKey(urlCopy, &transparentProxy);
+ else if (cacheProxy.type() != QNetworkProxy::NoProxy)
+ cacheKey = makeCacheKey(urlCopy, &cacheProxy);
+ else
+ cacheKey = makeCacheKey(urlCopy, 0);
+
+
+ // the http object is actually a QHttpNetworkConnection
+ httpConnection = static_cast<QNetworkAccessCachedHttpConnection *>(connections.localData()->requestEntryNow(cacheKey));
+ if (httpConnection == 0) {
+ // no entry in cache; create an object
+ // the http object is actually a QHttpNetworkConnection
+ httpConnection = new QNetworkAccessCachedHttpConnection(urlCopy.host(), urlCopy.port(), ssl);
+#ifndef QT_NO_OPENSSL
+ // Set the QSslConfiguration from this QNetworkRequest.
+ if (ssl) {
+ httpConnection->setSslConfiguration(incomingSslConfiguration);
+ }
+#endif
+
+#ifndef QT_NO_NETWORKPROXY
+ httpConnection->setTransparentProxy(transparentProxy);
+ httpConnection->setCacheProxy(cacheProxy);
+#endif
+
+ // cache the QHttpNetworkConnection corresponding to this cache key
+ connections.localData()->addEntry(cacheKey, httpConnection);
+ }
+
+
+ // Send the request to the connection
+ httpReply = httpConnection->sendRequest(httpRequest);
+ httpReply->setParent(this);
+
+ // Connect the reply signals that we need to handle and then forward
+ if (synchronous) {
+ connect(httpReply,SIGNAL(headerChanged()), this, SLOT(synchronousHeaderChangedSlot()));
+ connect(httpReply,SIGNAL(finished()), this, SLOT(synchronousFinishedSlot()));
+ connect(httpReply,SIGNAL(finishedWithError(QNetworkReply::NetworkError, const QString)),
+ this, SLOT(synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError,QString)));
+
+ connect(httpReply, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)),
+ this, SLOT(synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*)));
+ connect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ this, SLOT(synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*)));
+
+ // Don't care about ignored SSL errors for now in the synchronous HTTP case.
+ } else if (!synchronous) {
+ connect(httpReply,SIGNAL(headerChanged()), this, SLOT(headerChangedSlot()));
+ connect(httpReply,SIGNAL(finished()), this, SLOT(finishedSlot()));
+ connect(httpReply,SIGNAL(finishedWithError(QNetworkReply::NetworkError, const QString)),
+ this, SLOT(finishedWithErrorSlot(QNetworkReply::NetworkError,QString)));
+ // some signals are only interesting when normal asynchronous style is used
+ connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
+ connect(httpReply,SIGNAL(dataReadProgress(int, int)), this, SLOT(dataReadProgressSlot(int,int)));
+ connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
+ this, SLOT(cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)));
+#ifndef QT_NO_OPENSSL
+ connect(httpReply,SIGNAL(sslErrors(const QList<QSslError>)), this, SLOT(sslErrorsSlot(QList<QSslError>)));
+#endif
+
+ // In the asynchronous HTTP case we can just forward those signals
+ // Connect the reply signals that we can directly forward
+ connect(httpReply, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)),
+ this, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)));
+ connect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
+ }
+}
+
+// This gets called from the user thread or by the synchronous HTTP timeout timer
+void QHttpThreadDelegate::abortRequest()
+{
+ if (httpReply) {
+ delete httpReply;
+ httpReply = 0;
+ this->deleteLater();
+ }
+
+ // Got aborted by the timeout timer
+ if (synchronous)
+ incomingErrorCode = QNetworkReply::TimeoutError;
+}
+
+void QHttpThreadDelegate::readyReadSlot()
+{
+ // Don't do in zerocopy case
+ if (!downloadBuffer.isNull())
+ return;
+
+ while (httpReply->readAnyAvailable()) {
+ pendingDownloadData->fetchAndAddRelease(1);
+ emit downloadData(httpReply->readAny());
+ }
+}
+
+void QHttpThreadDelegate::finishedSlot()
+{
+ if (!httpReply) {
+ qWarning() << "QHttpThreadDelegate::finishedSlot: HTTP reply had already been deleted, internal problem. Please report.";
+ return;
+ }
+
+ // If there is still some data left emit that now
+ while (httpReply->readAnyAvailable()) {
+ pendingDownloadData->fetchAndAddRelease(1);
+ emit downloadData(httpReply->readAny());
+ }
+
+#ifndef QT_NO_OPENSSL
+ if (ssl)
+ emit sslConfigurationChanged(httpReply->sslConfiguration());
+#endif
+
+ if (httpReply->statusCode() >= 400) {
+ // it's an error reply
+ QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
+ "Error downloading %1 - server replied: %2"));
+ msg = msg.arg(QString::fromAscii(httpRequest.url().toEncoded()), httpReply->reasonPhrase());
+ emit error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg);
+ }
+
+ emit downloadFinished();
+
+ QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "deleteLater", Qt::QueuedConnection);
+ httpReply = 0;
+}
+
+void QHttpThreadDelegate::synchronousFinishedSlot()
+{
+ if (httpReply->statusCode() >= 400) {
+ // it's an error reply
+ QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
+ "Error downloading %1 - server replied: %2"));
+ incomingErrorDetail = msg.arg(QString::fromAscii(httpRequest.url().toEncoded()), httpReply->reasonPhrase());
+ incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url());
+ }
+
+ synchronousDownloadData = httpReply->readAll();
+
+ QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection);
+ httpReply = 0;
+}
+
+void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail)
+{
+ if (!httpReply) {
+ qWarning() << "QHttpThreadDelegate::finishedWithErrorSlot: HTTP reply had already been deleted, internal problem. Please report.";
+ return;
+ }
+
+#ifndef QT_NO_OPENSSL
+ if (ssl)
+ emit sslConfigurationChanged(httpReply->sslConfiguration());
+#endif
+ emit error(errorCode,detail);
+ emit downloadFinished();
+
+
+ QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "deleteLater", Qt::QueuedConnection);
+ httpReply = 0;
+}
+
+
+void QHttpThreadDelegate::synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail)
+{
+ incomingErrorCode = errorCode;
+ incomingErrorDetail = detail;
+
+ QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection);
+ httpReply = 0;
+}
+
+static void downloadBufferDeleter(char *ptr)
+{
+ delete[] ptr;
+}
+
+void QHttpThreadDelegate::headerChangedSlot()
+{
+#ifndef QT_NO_OPENSSL
+ if (ssl)
+ emit sslConfigurationChanged(httpReply->sslConfiguration());
+#endif
+
+ // Is using a zerocopy buffer allowed by user and possible with this reply?
+ if (httpReply->supportsUserProvidedDownloadBuffer()
+ && downloadBufferMaximumSize > 0) {
+ char *buf = new char[httpReply->contentLength()]; // throws if allocation fails
+ if (buf) {
+ downloadBuffer = QSharedPointer<char>(buf, downloadBufferDeleter);
+ httpReply->setUserProvidedDownloadBuffer(buf);
+ }
+ }
+
+ // We fetch this into our own
+ incomingHeaders = httpReply->header();
+ incomingStatusCode = httpReply->statusCode();
+ incomingReasonPhrase = httpReply->reasonPhrase();
+ isPipeliningUsed = httpReply->isPipeliningUsed();
+ incomingContentLength = httpReply->contentLength();
+
+ emit downloadMetaData(incomingHeaders,
+ incomingStatusCode,
+ incomingReasonPhrase,
+ isPipeliningUsed,
+ downloadBuffer,
+ incomingContentLength);
+}
+
+void QHttpThreadDelegate::synchronousHeaderChangedSlot()
+{
+ // Store the information we need in this object, the QNetworkAccessHttpBackend will later read it
+ incomingHeaders = httpReply->header();
+ incomingStatusCode = httpReply->statusCode();
+ incomingReasonPhrase = httpReply->reasonPhrase();
+ isPipeliningUsed = httpReply->isPipeliningUsed();
+ incomingContentLength = httpReply->contentLength();
+}
+
+
+void QHttpThreadDelegate::dataReadProgressSlot(int done, int total)
+{
+ // If we don't have a download buffer don't attempt to go this codepath
+ // It is not used by QNetworkAccessHttpBackend
+ if (downloadBuffer.isNull())
+ return;
+
+ pendingDownloadProgress->fetchAndAddRelease(1);
+ emit downloadProgress(done, total);
+}
+
+void QHttpThreadDelegate::cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator)
+{
+ authenticationManager->cacheCredentials(request.url(), authenticator);
+}
+
+
+#ifndef QT_NO_OPENSSL
+void QHttpThreadDelegate::sslErrorsSlot(const QList<QSslError> &errors)
+{
+ emit sslConfigurationChanged(httpReply->sslConfiguration());
+
+ bool ignoreAll = false;
+ QList<QSslError> specificErrors;
+ emit sslErrors(errors, &ignoreAll, &specificErrors);
+ if (ignoreAll)
+ httpReply->ignoreSslErrors();
+ if (!specificErrors.isEmpty())
+ httpReply->ignoreSslErrors(specificErrors);
+}
+#endif
+
+void QHttpThreadDelegate::synchronousAuthenticationRequiredSlot(const QHttpNetworkRequest &request, QAuthenticator *a)
+{
+ Q_UNUSED(request);
+
+ // Ask the credential cache
+ QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), a);
+ if (!credential.isNull()) {
+ a->setUser(credential.user);
+ a->setPassword(credential.password);
+ }
+
+ // Disconnect this connection now since we only want to ask the authentication cache once.
+ QObject::disconnect(this, SLOT(synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*)));
+}
+
+#ifndef QT_NO_NETWORKPROXY
+void QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(const QNetworkProxy &p, QAuthenticator *a)
+{
+ // Ask the credential cache
+ QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedProxyCredentials(p, a);
+ if (!credential.isNull()) {
+ a->setUser(credential.user);
+ a->setPassword(credential.password);
+ }
+
+ // Disconnect this connection now since we only want to ask the authentication cache once.
+ QObject::disconnect(this, SLOT(synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*)));
+}
+
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
new file mode 100644
index 0000000..3b598aa
--- /dev/null
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -0,0 +1,285 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtNetwork 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 QHTTPTHREADDELEGATE_H
+#define QHTTPTHREADDELEGATE_H
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of the Network Access API. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QObject>
+#include <QThreadStorage>
+#include <QNetworkProxy>
+#include <QSslConfiguration>
+#include <QSslError>
+#include <QList>
+#include <QNetworkReply>
+#include "qhttpnetworkrequest_p.h"
+#include "qhttpnetworkconnection_p.h"
+#include <QSharedPointer>
+#include "qsslconfiguration.h"
+#include "private/qnoncontiguousbytedevice_p.h"
+#include "qnetworkaccessauthenticationmanager_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QAuthenticator;
+class QHttpNetworkReply;
+class QEventLoop;
+class QNetworkAccessCache;
+class QNetworkAccessCachedHttpConnection;
+
+class QHttpThreadDelegate : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QHttpThreadDelegate(QObject *parent = 0);
+
+ ~QHttpThreadDelegate();
+
+ // incoming
+ bool ssl;
+#ifndef QT_NO_OPENSSL
+ QSslConfiguration incomingSslConfiguration;
+#endif
+ QHttpNetworkRequest httpRequest;
+ qint64 downloadBufferMaximumSize;
+ // From backend, modified by us for signal compression
+ QSharedPointer<QAtomicInt> pendingDownloadData;
+ QSharedPointer<QAtomicInt> pendingDownloadProgress;
+#ifndef QT_NO_NETWORKPROXY
+ QNetworkProxy cacheProxy;
+ QNetworkProxy transparentProxy;
+#endif
+ QSharedPointer<QNetworkAccessAuthenticationManager> authenticationManager;
+ bool synchronous;
+
+ // outgoing, Retrieved in the synchronous HTTP case
+ QByteArray synchronousDownloadData;
+ QList<QPair<QByteArray,QByteArray> > incomingHeaders;
+ int incomingStatusCode;
+ QString incomingReasonPhrase;
+ bool isPipeliningUsed;
+ qint64 incomingContentLength;
+ QNetworkReply::NetworkError incomingErrorCode;
+ QString incomingErrorDetail;
+
+protected:
+ // The zerocopy download buffer, if used:
+ QSharedPointer<char> downloadBuffer;
+ // The QHttpNetworkConnection that is used
+ QNetworkAccessCachedHttpConnection *httpConnection;
+ QByteArray cacheKey;
+ QHttpNetworkReply *httpReply;
+
+ // Used for implementing the synchronous HTTP, see startRequestSynchronously()
+ QEventLoop *synchronousRequestLoop;
+
+signals:
+ void authenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *);
+#ifndef QT_NO_NETWORKPROXY
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
+#endif
+#ifndef QT_NO_OPENSSL
+ void sslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
+ void sslConfigurationChanged(const QSslConfiguration);
+#endif
+ void downloadMetaData(QList<QPair<QByteArray,QByteArray> >,int,QString,bool,QSharedPointer<char>,qint64);
+ void downloadProgress(qint64, qint64);
+ void downloadData(QByteArray);
+ void error(QNetworkReply::NetworkError, const QString);
+ void downloadFinished();
+public slots:
+ // This are called via QueuedConnection from user thread
+ void startRequest();
+ void abortRequest();
+ // This is called with a BlockingQueuedConnection from user thread
+ void startRequestSynchronously();
+protected slots:
+ // From QHttp*
+ void readyReadSlot();
+ void finishedSlot();
+ void finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
+ void synchronousFinishedSlot();
+ void synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
+ void headerChangedSlot();
+ void synchronousHeaderChangedSlot();
+ void dataReadProgressSlot(int done, int total);
+ void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
+#ifndef QT_NO_OPENSSL
+ void sslErrorsSlot(const QList<QSslError> &errors);
+#endif
+
+ void synchronousAuthenticationRequiredSlot(const QHttpNetworkRequest &request, QAuthenticator *);
+#ifndef QT_NO_NETWORKPROXY
+ void synchronousProxyAuthenticationRequiredSlot(const QNetworkProxy &, QAuthenticator *);
+#endif
+
+protected:
+ // Cache for all the QHttpNetworkConnection objects.
+ // This is per thread.
+ static QThreadStorage<QNetworkAccessCache *> connections;
+
+};
+
+// This QNonContiguousByteDevice is connected to the QNetworkAccessHttpBackend
+// and represents the PUT/POST data.
+class QNonContiguousByteDeviceThreadForwardImpl : public QNonContiguousByteDevice
+{
+ Q_OBJECT
+protected:
+ bool wantDataPending;
+ qint64 m_amount;
+ char *m_data;
+ QByteArray m_dataArray;
+ bool m_atEnd;
+ qint64 m_size;
+public:
+ QNonContiguousByteDeviceThreadForwardImpl(bool aE, qint64 s)
+ : QNonContiguousByteDevice(),
+ wantDataPending(false),
+ m_amount(0),
+ m_data(0),
+ m_atEnd(aE),
+ m_size(s)
+ {
+ }
+
+ ~QNonContiguousByteDeviceThreadForwardImpl()
+ {
+ }
+
+ const char* readPointer(qint64 maximumLength, qint64 &len)
+ {
+ if (m_amount == 0 && wantDataPending == false) {
+ len = 0;
+ wantDataPending = true;
+ emit wantData(maximumLength);
+ } else if (m_amount == 0 && wantDataPending == true) {
+ // Do nothing, we already sent a wantData signal and wait for results
+ len = 0;
+ } else if (m_amount > 0) {
+ len = m_amount;
+ return m_data;
+ }
+ // cannot happen
+ return 0;
+ }
+
+ bool advanceReadPointer(qint64 a)
+ {
+ if (m_data == 0)
+ return false;
+
+ m_amount -= a;
+ m_data += a;
+
+ // To main thread to inform about our state
+ emit processedData(a);
+
+ // FIXME possible optimization, already ask user thread for some data
+
+ return true;
+ }
+
+ bool atEnd()
+ {
+ if (m_amount > 0)
+ return false;
+ else
+ return m_atEnd;
+ }
+
+ bool reset()
+ {
+ m_amount = 0;
+ m_data = 0;
+
+ // Communicate as BlockingQueuedConnection
+ bool b = false;
+ emit resetData(&b);
+ return b;
+ }
+
+ qint64 size()
+ {
+ return m_size;
+ }
+
+public slots:
+ // From user thread:
+ void haveDataSlot(QByteArray dataArray, bool dataAtEnd, qint64 dataSize)
+ {
+ wantDataPending = false;
+
+ m_dataArray = dataArray;
+ m_data = const_cast<char*>(m_dataArray.constData());
+ m_amount = dataArray.size();
+
+ m_atEnd = dataAtEnd;
+ m_size = dataSize;
+
+ // This will tell the HTTP code (QHttpNetworkConnectionChannel) that we have data available now
+ emit readyRead();
+ }
+
+signals:
+ // void readyRead(); in parent class
+ // void readProgress(qint64 current, qint64 total); happens in the main thread with the real bytedevice
+
+ // to main thread:
+ void wantData(qint64);
+ void processedData(qint64);
+ void resetData(bool *b);
+};
+
+QT_END_NAMESPACE
+
+#endif // QHTTPTHREADDELEGATE_H
diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp
new file mode 100644
index 0000000..d2bf00a
--- /dev/null
+++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp
@@ -0,0 +1,297 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtNetwork 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 "qnetworkaccessmanager.h"
+#include "qnetworkaccessmanager_p.h"
+#include "qnetworkaccessauthenticationmanager_p.h"
+
+#include "QtCore/qbuffer.h"
+#include "QtCore/qurl.h"
+#include "QtCore/qvector.h"
+#include "QtCore/QMutexLocker"
+#include "QtNetwork/qauthenticator.h"
+
+QT_BEGIN_NAMESPACE
+
+
+
+
+class QNetworkAuthenticationCache: private QVector<QNetworkAuthenticationCredential>,
+ public QNetworkAccessCache::CacheableObject
+{
+public:
+ QNetworkAuthenticationCache()
+ {
+ setExpires(false);
+ setShareable(true);
+ reserve(1);
+ }
+
+ QNetworkAuthenticationCredential *findClosestMatch(const QString &domain)
+ {
+ iterator it = qLowerBound(begin(), end(), domain);
+ if (it == end() && !isEmpty())
+ --it;
+ if (it == end() || !domain.startsWith(it->domain))
+ return 0;
+ return &*it;
+ }
+
+ void insert(const QString &domain, const QString &user, const QString &password)
+ {
+ QNetworkAuthenticationCredential *closestMatch = findClosestMatch(domain);
+ if (closestMatch && closestMatch->domain == domain) {
+ // we're overriding the current credentials
+ closestMatch->user = user;
+ closestMatch->password = password;
+ } else {
+ QNetworkAuthenticationCredential newCredential;
+ newCredential.domain = domain;
+ newCredential.user = user;
+ newCredential.password = password;
+
+ if (closestMatch)
+ QVector<QNetworkAuthenticationCredential>::insert(++closestMatch, newCredential);
+ else
+ QVector<QNetworkAuthenticationCredential>::insert(end(), newCredential);
+ }
+ }
+
+ virtual void dispose() { delete this; }
+};
+
+#ifndef QT_NO_NETWORKPROXY
+static QByteArray proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm)
+{
+ QUrl key;
+
+ switch (proxy.type()) {
+ case QNetworkProxy::Socks5Proxy:
+ key.setScheme(QLatin1String("proxy-socks5"));
+ break;
+
+ case QNetworkProxy::HttpProxy:
+ case QNetworkProxy::HttpCachingProxy:
+ key.setScheme(QLatin1String("proxy-http"));
+ break;
+
+ case QNetworkProxy::FtpCachingProxy:
+ key.setScheme(QLatin1String("proxy-ftp"));
+ break;
+
+ case QNetworkProxy::DefaultProxy:
+ case QNetworkProxy::NoProxy:
+ // shouldn't happen
+ return QByteArray();
+
+ // no default:
+ // let there be errors if a new proxy type is added in the future
+ }
+
+ if (key.scheme().isEmpty())
+ // proxy type not handled
+ return QByteArray();
+
+ key.setUserName(proxy.user());
+ key.setHost(proxy.hostName());
+ key.setPort(proxy.port());
+ key.setFragment(realm);
+ return "auth:" + key.toEncoded();
+}
+#endif
+
+static inline QByteArray authenticationKey(const QUrl &url, const QString &realm)
+{
+ QUrl copy = url;
+ copy.setFragment(realm);
+ return "auth:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery);
+}
+
+
+#ifndef QT_NO_NETWORKPROXY
+void QNetworkAccessAuthenticationManager::cacheProxyCredentials(const QNetworkProxy &p,
+ const QAuthenticator *authenticator)
+{
+ Q_ASSERT(authenticator);
+ Q_ASSERT(p.type() != QNetworkProxy::DefaultProxy);
+ Q_ASSERT(p.type() != QNetworkProxy::NoProxy);
+
+ QMutexLocker mutexLocker(&mutex);
+
+ QString realm = authenticator->realm();
+ QNetworkProxy proxy = p;
+ proxy.setUser(authenticator->user());
+ // Set two credentials: one with the username and one without
+ do {
+ // Set two credentials actually: one with and one without the realm
+ do {
+ QByteArray cacheKey = proxyAuthenticationKey(proxy, realm);
+ if (cacheKey.isEmpty())
+ return; // should not happen
+
+ QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache;
+ auth->insert(QString(), authenticator->user(), authenticator->password());
+ authenticationCache.addEntry(cacheKey, auth); // replace the existing one, if there's any
+
+ if (realm.isEmpty()) {
+ break;
+ } else {
+ realm.clear();
+ }
+ } while (true);
+
+ if (proxy.user().isEmpty())
+ break;
+ else
+ proxy.setUser(QString());
+ } while (true);
+}
+
+QNetworkAuthenticationCredential
+QNetworkAccessAuthenticationManager::fetchCachedProxyCredentials(const QNetworkProxy &p,
+ const QAuthenticator *authenticator)
+{
+ QNetworkProxy proxy = p;
+ if (proxy.type() == QNetworkProxy::DefaultProxy) {
+ proxy = QNetworkProxy::applicationProxy();
+ }
+ if (!proxy.password().isEmpty())
+ return QNetworkAuthenticationCredential(); // no need to set credentials if it already has them
+
+ QString realm;
+ if (authenticator)
+ realm = authenticator->realm();
+
+ QMutexLocker mutexLocker(&mutex);
+ QByteArray cacheKey = proxyAuthenticationKey(proxy, realm);
+ if (cacheKey.isEmpty())
+ return QNetworkAuthenticationCredential();
+ if (!authenticationCache.hasEntry(cacheKey))
+ return QNetworkAuthenticationCredential();
+
+ QNetworkAuthenticationCache *auth =
+ static_cast<QNetworkAuthenticationCache *>(authenticationCache.requestEntryNow(cacheKey));
+ QNetworkAuthenticationCredential cred = *auth->findClosestMatch(QString());
+ authenticationCache.releaseEntry(cacheKey);
+
+ // proxy cache credentials always have exactly one item
+ Q_ASSERT_X(!cred.isNull(), "QNetworkAccessManager",
+ "Internal inconsistency: found a cache key for a proxy, but it's empty");
+ return cred;
+}
+
+#endif
+
+void QNetworkAccessAuthenticationManager::cacheCredentials(const QUrl &url,
+ const QAuthenticator *authenticator)
+{
+ Q_ASSERT(authenticator);
+ QString domain = QString::fromLatin1("/"); // FIXME: make QAuthenticator return the domain
+ QString realm = authenticator->realm();
+
+ QMutexLocker mutexLocker(&mutex);
+
+ // Set two credentials actually: one with and one without the username in the URL
+ QUrl copy = url;
+ copy.setUserName(authenticator->user());
+ do {
+ QByteArray cacheKey = authenticationKey(copy, realm);
+ if (authenticationCache.hasEntry(cacheKey)) {
+ QNetworkAuthenticationCache *auth =
+ static_cast<QNetworkAuthenticationCache *>(authenticationCache.requestEntryNow(cacheKey));
+ auth->insert(domain, authenticator->user(), authenticator->password());
+ authenticationCache.releaseEntry(cacheKey);
+ } else {
+ QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache;
+ auth->insert(domain, authenticator->user(), authenticator->password());
+ authenticationCache.addEntry(cacheKey, auth);
+ }
+
+ if (copy.userName().isEmpty()) {
+ break;
+ } else {
+ copy.setUserName(QString());
+ }
+ } while (true);
+}
+
+/*!
+ Fetch the credential data from the credential cache.
+
+ If auth is 0 (as it is when called from createRequest()), this will try to
+ look up with an empty realm. That fails in most cases for HTTP (because the
+ realm is seldom empty for HTTP challenges). In any case, QHttpNetworkConnection
+ never sends the credentials on the first attempt: it needs to find out what
+ authentication methods the server supports.
+
+ For FTP, realm is always empty.
+*/
+QNetworkAuthenticationCredential
+QNetworkAccessAuthenticationManager::fetchCachedCredentials(const QUrl &url,
+ const QAuthenticator *authentication)
+{
+ if (!url.password().isEmpty())
+ return QNetworkAuthenticationCredential(); // no need to set credentials if it already has them
+
+ QString realm;
+ if (authentication)
+ realm = authentication->realm();
+
+ QByteArray cacheKey = authenticationKey(url, realm);
+
+ QMutexLocker mutexLocker(&mutex);
+ if (!authenticationCache.hasEntry(cacheKey))
+ return QNetworkAuthenticationCredential();
+
+ QNetworkAuthenticationCache *auth =
+ static_cast<QNetworkAuthenticationCache *>(authenticationCache.requestEntryNow(cacheKey));
+ QNetworkAuthenticationCredential cred = *auth->findClosestMatch(url.path());
+ authenticationCache.releaseEntry(cacheKey);
+ return cred;
+}
+
+void QNetworkAccessAuthenticationManager::clearCache()
+{
+ authenticationCache.clear();
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/network/access/qnetworkaccessauthenticationmanager_p.h b/src/network/access/qnetworkaccessauthenticationmanager_p.h
new file mode 100644
index 0000000..d2347b1
--- /dev/null
+++ b/src/network/access/qnetworkaccessauthenticationmanager_p.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtNetwork 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 QNETWORKACCESSAUTHENTICATIONMANAGER_P_H
+#define QNETWORKACCESSAUTHENTICATIONMANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of the Network Access API. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qnetworkaccessmanager.h"
+#include "qnetworkaccesscache_p.h"
+#include "qnetworkaccessbackend_p.h"
+#include "QtNetwork/qnetworkproxy.h"
+#include "QtCore/QMutex"
+
+QT_BEGIN_NAMESPACE
+
+class QAuthenticator;
+class QAbstractNetworkCache;
+class QNetworkAuthenticationCredential;
+class QNetworkCookieJar;
+
+class QNetworkAuthenticationCredential
+{
+public:
+ QString domain;
+ QString user;
+ QString password;
+ bool isNull() {
+ return domain.isNull();
+ }
+};
+Q_DECLARE_TYPEINFO(QNetworkAuthenticationCredential, Q_MOVABLE_TYPE);
+inline bool operator<(const QNetworkAuthenticationCredential &t1, const QString &t2)
+{ return t1.domain < t2; }
+
+class QNetworkAccessAuthenticationManager
+{
+public:
+ QNetworkAccessAuthenticationManager() { };
+
+ void cacheCredentials(const QUrl &url, const QAuthenticator *auth);
+ QNetworkAuthenticationCredential fetchCachedCredentials(const QUrl &url,
+ const QAuthenticator *auth = 0);
+
+#ifndef QT_NO_NETWORKPROXY
+ void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
+ QNetworkAuthenticationCredential fetchCachedProxyCredentials(const QNetworkProxy &proxy,
+ const QAuthenticator *auth = 0);
+#endif
+
+ void clearCache();
+
+protected:
+ QNetworkAccessCache authenticationCache;
+ QMutex mutex;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index fd1fa60..5aedac9 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -106,12 +106,10 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM
QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice()
{
- QNonContiguousByteDevice* device = 0;
-
if (reply->outgoingDataBuffer)
- device = QNonContiguousByteDeviceFactory::create(reply->outgoingDataBuffer);
+ uploadByteDevice = QSharedPointer<QNonContiguousByteDevice>(QNonContiguousByteDeviceFactory::create(reply->outgoingDataBuffer));
else if (reply->outgoingData) {
- device = QNonContiguousByteDeviceFactory::create(reply->outgoingData);
+ uploadByteDevice = QSharedPointer<QNonContiguousByteDevice>(QNonContiguousByteDeviceFactory::create(reply->outgoingData));
} else {
return 0;
}
@@ -120,14 +118,13 @@ QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice()
reply->request.attribute(QNetworkRequest::DoNotBufferUploadDataAttribute,
QVariant(false)) == QVariant(true);
if (bufferDisallowed)
- device->disableReset();
-
- // make sure we delete this later
- device->setParent(this);
+ uploadByteDevice->disableReset();
- connect(device, SIGNAL(readProgress(qint64,qint64)), this, SLOT(emitReplyUploadProgress(qint64,qint64)));
+ // We want signal emissions only for normal asynchronous uploads
+ if (!isSynchronous())
+ connect(uploadByteDevice.data(), SIGNAL(readProgress(qint64,qint64)), this, SLOT(emitReplyUploadProgress(qint64,qint64)));
- return device;
+ return uploadByteDevice.data();
}
// need to have this function since the reply is a private member variable
@@ -327,11 +324,6 @@ void QNetworkAccessBackend::authenticationRequired(QAuthenticator *authenticator
manager->authenticationRequired(this, authenticator);
}
-void QNetworkAccessBackend::cacheCredentials(QAuthenticator *authenticator)
-{
- manager->cacheCredentials(this->reply->url, authenticator);
-}
-
void QNetworkAccessBackend::metaDataChanged()
{
reply->metaDataChanged();
diff --git a/src/network/access/qnetworkaccessbackend_p.h b/src/network/access/qnetworkaccessbackend_p.h
index 26ee61a..644ae2d 100644
--- a/src/network/access/qnetworkaccessbackend_p.h
+++ b/src/network/access/qnetworkaccessbackend_p.h
@@ -70,7 +70,6 @@ class QNetworkAccessManagerPrivate;
class QNetworkReplyImplPrivate;
class QAbstractNetworkCache;
class QNetworkCacheMetaData;
-class QNetworkAccessBackendUploadIODevice;
class QNonContiguousByteDevice;
// Should support direct file upload from disk or download to disk.
@@ -175,7 +174,6 @@ protected:
// Create the device used for reading the upload data
QNonContiguousByteDevice* createUploadByteDevice();
-
// these functions control the downstream mechanism
// that is, data that has come via the connection and is going out the backend
qint64 nextDownstreamBlockSize() const;
@@ -185,6 +183,8 @@ protected:
void writeDownstreamDataDownloadBuffer(qint64, qint64);
char* getDownloadBuffer(qint64);
+ QSharedPointer<QNonContiguousByteDevice> uploadByteDevice;
+
public slots:
// for task 251801, needs to be a slot to be called asynchronously
void writeDownstreamData(QIODevice *data);
@@ -196,19 +196,22 @@ protected slots:
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth);
#endif
void authenticationRequired(QAuthenticator *auth);
- void cacheCredentials(QAuthenticator *auth);
void metaDataChanged();
void redirectionRequested(const QUrl &destination);
void sslErrors(const QList<QSslError> &errors);
void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal);
+protected:
+ // FIXME In the long run we should get rid of our QNAM architecture
+ // and scrap this ReplyImpl/Backend distinction.
+ QNetworkAccessManagerPrivate *manager;
+ QNetworkReplyImplPrivate *reply;
+
private:
friend class QNetworkAccessManager;
friend class QNetworkAccessManagerPrivate;
- friend class QNetworkAccessBackendUploadIODevice;
friend class QNetworkReplyImplPrivate;
- QNetworkAccessManagerPrivate *manager;
- QNetworkReplyImplPrivate *reply;
+
bool synchronous;
};
diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp
index 6da0722..7ebf626 100644
--- a/src/network/access/qnetworkaccessfilebackend.cpp
+++ b/src/network/access/qnetworkaccessfilebackend.cpp
@@ -75,6 +75,8 @@ QNetworkAccessFileBackendFactory::create(QNetworkAccessManager::Operation op,
//
// this construct here must match the one below in open()
QFileInfo fi(url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery));
+ if ((url.scheme().length()==1) && fi.exists())
+ qWarning("QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files");
if (fi.exists() || (op == QNetworkAccessManager::PutOperation && fi.dir().exists()))
return new QNetworkAccessFileBackend;
}
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 79c43fa..4908e0a 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -52,60 +52,19 @@
#include "QtCore/qdatetime.h"
#include "QtCore/qelapsedtimer.h"
#include "QtNetwork/qsslconfiguration.h"
+#include "qhttpthreaddelegate_p.h"
+#include "qthread.h"
#ifndef QT_NO_HTTP
#include <string.h> // for strchr
-QT_BEGIN_NAMESPACE
+Q_DECLARE_METATYPE(QSharedPointer<char>)
-enum {
- DefaultHttpPort = 80,
- DefaultHttpsPort = 443
-};
+QT_BEGIN_NAMESPACE
class QNetworkProxy;
-static QByteArray makeCacheKey(QNetworkAccessHttpBackend *backend, QNetworkProxy *proxy)
-{
- QByteArray result;
- QUrl copy = backend->url();
- bool isEncrypted = copy.scheme().toLower() == QLatin1String("https");
- copy.setPort(copy.port(isEncrypted ? DefaultHttpsPort : DefaultHttpPort));
- result = copy.toEncoded(QUrl::RemoveUserInfo | QUrl::RemovePath |
- QUrl::RemoveQuery | QUrl::RemoveFragment);
-
-#ifndef QT_NO_NETWORKPROXY
- if (proxy->type() != QNetworkProxy::NoProxy) {
- QUrl key;
-
- switch (proxy->type()) {
- case QNetworkProxy::Socks5Proxy:
- key.setScheme(QLatin1String("proxy-socks5"));
- break;
-
- case QNetworkProxy::HttpProxy:
- case QNetworkProxy::HttpCachingProxy:
- key.setScheme(QLatin1String("proxy-http"));
- break;
-
- default:
- break;
- }
-
- if (!key.scheme().isEmpty()) {
- key.setUserName(proxy->user());
- key.setHost(proxy->hostName());
- key.setPort(proxy->port());
- key.setEncodedQuery(result);
- result = key.toEncoded();
- }
- }
-#endif
-
- return "http-connection:" + result;
-}
-
static inline bool isSeparator(register char c)
{
static const char separators[] = "()<>@,;:\\\"/[]?={}";
@@ -230,71 +189,13 @@ QNetworkAccessHttpBackendFactory::create(QNetworkAccessManager::Operation op,
return 0;
}
-static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
-{
- QNetworkReply::NetworkError code;
- // we've got an error
- switch (httpStatusCode) {
- case 401: // Authorization required
- code = QNetworkReply::AuthenticationRequiredError;
- break;
-
- case 403: // Access denied
- code = QNetworkReply::ContentOperationNotPermittedError;
- break;
-
- case 404: // Not Found
- code = QNetworkReply::ContentNotFoundError;
- break;
-
- case 405: // Method Not Allowed
- code = QNetworkReply::ContentOperationNotPermittedError;
- break;
-
- case 407:
- code = QNetworkReply::ProxyAuthenticationRequiredError;
- break;
-
- default:
- if (httpStatusCode > 500) {
- // some kind of server error
- code = QNetworkReply::ProtocolUnknownError;
- } else if (httpStatusCode >= 400) {
- // content error we did not handle above
- code = QNetworkReply::UnknownContentError;
- } else {
- qWarning("QNetworkAccess: got HTTP status code %d which is not expected from url: \"%s\"",
- httpStatusCode, qPrintable(url.toString()));
- code = QNetworkReply::ProtocolFailure;
- }
- }
-
- return code;
-}
-
-class QNetworkAccessCachedHttpConnection: public QHttpNetworkConnection,
- public QNetworkAccessCache::CacheableObject
-{
- // Q_OBJECT
-public:
- QNetworkAccessCachedHttpConnection(const QString &hostName, quint16 port, bool encrypt)
- : QHttpNetworkConnection(hostName, port, encrypt)
- {
- setExpires(true);
- setShareable(true);
- }
-
- virtual void dispose()
- {
-#if 0 // sample code; do this right with the API
- Q_ASSERT(!isWorking());
-#endif
- delete this;
- }
-};
-
QNetworkAccessHttpBackend::QNetworkAccessHttpBackend()
- : QNetworkAccessBackend(), httpReply(0), http(0), uploadDevice(0)
+ : QNetworkAccessBackend()
+ , statusCode(0)
+ , pendingDownloadDataEmissions(new QAtomicInt())
+ , pendingDownloadProgressEmissions(new QAtomicInt())
+ , loadingFromCache(false)
+ , usingZerocopyDownloadBuffer(false)
#ifndef QT_NO_OPENSSL
, pendingSslConfiguration(0), pendingIgnoreAllSslErrors(false)
#endif
@@ -304,44 +205,14 @@ QNetworkAccessHttpBackend::QNetworkAccessHttpBackend()
QNetworkAccessHttpBackend::~QNetworkAccessHttpBackend()
{
- if (http)
- disconnectFromHttp();
+ // This will do nothing if the request was already finished or aborted
+ emit abortHttpRequest();
+
#ifndef QT_NO_OPENSSL
delete pendingSslConfiguration;
#endif
}
-void QNetworkAccessHttpBackend::disconnectFromHttp()
-{
- if (http) {
- // This is abut disconnecting signals, not about disconnecting TCP connections
- disconnect(http, 0, this, 0);
-
- // Get the object cache that stores our QHttpNetworkConnection objects
- QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getObjectCache(this);
-
- // synchronous calls are not put into the cache, so for them the key is empty
- if (!cacheKey.isEmpty())
- cache->releaseEntry(cacheKey);
- }
-
- // This is abut disconnecting signals, not about disconnecting TCP connections
- if (httpReply)
- disconnect(httpReply, 0, this, 0);
-
- http = 0;
- httpReply = 0;
- cacheKey.clear();
-}
-
-void QNetworkAccessHttpBackend::finished()
-{
- if (http)
- disconnectFromHttp();
- // call parent
- QNetworkAccessBackend::finished();
-}
-
/*
For a given httpRequest
1) If AlwaysNetwork, return
@@ -487,9 +358,82 @@ static QHttpNetworkRequest::Priority convert(const QNetworkRequest::Priority& pr
void QNetworkAccessHttpBackend::postRequest()
{
+ QThread *thread = 0;
+ if (isSynchronous()) {
+ // A synchronous HTTP request uses its own thread
+ thread = new QThread();
+ QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+ thread->start();
+ } else if (!manager->httpThread) {
+ // We use the manager-global thread.
+ // At some point we could switch to having multiple threads if it makes sense.
+ manager->httpThread = new QThread();
+ QObject::connect(manager->httpThread, SIGNAL(finished()), manager->httpThread, SLOT(deleteLater()));
+ manager->httpThread->start();
+#ifndef QT_NO_NETWORKPROXY
+ qRegisterMetaType<QNetworkProxy>("QNetworkProxy");
+#endif
+#ifndef QT_NO_OPENSSL
+ qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
+ qRegisterMetaType<QSslConfiguration>("QSslConfiguration");
+#endif
+ qRegisterMetaType<QList<QPair<QByteArray,QByteArray> > >("QList<QPair<QByteArray,QByteArray> >");
+ qRegisterMetaType<QHttpNetworkRequest>("QHttpNetworkRequest");
+ qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");
+ qRegisterMetaType<QSharedPointer<char> >("QSharedPointer<char>");
+
+ thread = manager->httpThread;
+ } else {
+ // Asynchronous request, thread already exists
+ thread = manager->httpThread;
+ }
+
+ QUrl url = request().url();
+ httpRequest.setUrl(url);
+
+ bool ssl = url.scheme().toLower() == QLatin1String("https");
+ setAttribute(QNetworkRequest::ConnectionEncryptedAttribute, ssl);
+ httpRequest.setSsl(ssl);
+
+
+#ifndef QT_NO_NETWORKPROXY
+ QNetworkProxy transparentProxy, cacheProxy;
+
+ foreach (const QNetworkProxy &p, proxyList()) {
+ // use the first proxy that works
+ // for non-encrypted connections, any transparent or HTTP proxy
+ // for encrypted, only transparent proxies
+ if (!ssl
+ && (p.capabilities() & QNetworkProxy::CachingCapability)
+ && (p.type() == QNetworkProxy::HttpProxy ||
+ p.type() == QNetworkProxy::HttpCachingProxy)) {
+ cacheProxy = p;
+ transparentProxy = QNetworkProxy::NoProxy;
+ break;
+ }
+ if (p.isTransparentProxy()) {
+ transparentProxy = p;
+ cacheProxy = QNetworkProxy::NoProxy;
+ break;
+ }
+ }
+
+ // check if at least one of the proxies
+ if (transparentProxy.type() == QNetworkProxy::DefaultProxy &&
+ cacheProxy.type() == QNetworkProxy::DefaultProxy) {
+ // unsuitable proxies
+ QMetaObject::invokeMethod(this, "error", isSynchronous() ? Qt::DirectConnection : Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProxyNotFoundError),
+ Q_ARG(QString, tr("No suitable proxy found")));
+ QMetaObject::invokeMethod(this, "finished", isSynchronous() ? Qt::DirectConnection : Qt::QueuedConnection);
+ return;
+ }
+#endif
+
+
bool loadedFromCache = false;
- QHttpNetworkRequest httpRequest;
httpRequest.setPriority(convert(request().priority()));
+
switch (operation()) {
case QNetworkAccessManager::GetOperation:
httpRequest.setOperation(QHttpNetworkRequest::Get);
@@ -504,13 +448,13 @@ void QNetworkAccessHttpBackend::postRequest()
case QNetworkAccessManager::PostOperation:
invalidateCache();
httpRequest.setOperation(QHttpNetworkRequest::Post);
- httpRequest.setUploadByteDevice(createUploadByteDevice());
+ createUploadByteDevice();
break;
case QNetworkAccessManager::PutOperation:
invalidateCache();
httpRequest.setOperation(QHttpNetworkRequest::Put);
- httpRequest.setUploadByteDevice(createUploadByteDevice());
+ createUploadByteDevice();
break;
case QNetworkAccessManager::DeleteOperation:
@@ -521,7 +465,7 @@ void QNetworkAccessHttpBackend::postRequest()
case QNetworkAccessManager::CustomOperation:
invalidateCache(); // for safety reasons, we don't know what the operation does
httpRequest.setOperation(QHttpNetworkRequest::Custom);
- httpRequest.setUploadByteDevice(createUploadByteDevice());
+ createUploadByteDevice();
httpRequest.setCustomVerb(request().attribute(
QNetworkRequest::CustomVerbAttribute).toByteArray());
break;
@@ -530,11 +474,6 @@ void QNetworkAccessHttpBackend::postRequest()
break; // can't happen
}
- bool encrypt = (url().scheme().toLower() == QLatin1String("https"));
- httpRequest.setSsl(encrypt);
-
- httpRequest.setUrl(url());
-
QList<QByteArray> headers = request().rawHeaderList();
if (resumeOffset != 0) {
if (headers.contains("Range")) {
@@ -558,6 +497,7 @@ void QNetworkAccessHttpBackend::postRequest()
httpRequest.setHeaderField("Range", "bytes=" + QByteArray::number(resumeOffset) + '-');
}
}
+
foreach (const QByteArray &header, headers)
httpRequest.setHeaderField(header, request().rawHeader(header));
@@ -576,30 +516,155 @@ void QNetworkAccessHttpBackend::postRequest()
QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Manual)
httpRequest.setWithCredentials(false);
- httpReply = http->sendRequest(httpRequest);
- httpReply->setParent(this);
+
+ // Create the HTTP thread delegate
+ QHttpThreadDelegate *delegate = new QHttpThreadDelegate;
+
+ // For the synchronous HTTP, this is the normal way the delegate gets deleted
+ // For the asynchronous HTTP this is a safety measure, the delegate deletes itself when HTTP is finished
+ connect(thread, SIGNAL(finished()), delegate, SLOT(deleteLater()));
+
+ // Set the properties it needs
+ delegate->httpRequest = httpRequest;
+#ifndef QT_NO_NETWORKPROXY
+ delegate->cacheProxy = cacheProxy;
+ delegate->transparentProxy = transparentProxy;
+#endif
+ delegate->ssl = ssl;
#ifndef QT_NO_OPENSSL
- if (pendingSslConfiguration)
- httpReply->setSslConfiguration(*pendingSslConfiguration);
- if (pendingIgnoreAllSslErrors)
- httpReply->ignoreSslErrors();
- httpReply->ignoreSslErrors(pendingIgnoreSslErrorsList);
- connect(httpReply, SIGNAL(sslErrors(QList<QSslError>)),
- SLOT(sslErrors(QList<QSslError>)));
+ if (ssl)
+ delegate->incomingSslConfiguration = request().sslConfiguration();
#endif
- connect(httpReply, SIGNAL(finished()), SLOT(replyFinished()));
- connect(httpReply, SIGNAL(finishedWithError(QNetworkReply::NetworkError,QString)),
- SLOT(httpError(QNetworkReply::NetworkError,QString)));
- connect(httpReply, SIGNAL(headerChanged()), SLOT(replyHeaderChanged()));
- connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
- SLOT(httpCacheCredentials(QHttpNetworkRequest,QAuthenticator*)));
+ // Do we use synchronous HTTP?
+ delegate->synchronous = isSynchronous();
+
+ // The authentication manager is used to avoid the BlockingQueuedConnection communication
+ // from HTTP thread to user thread in some cases.
+ delegate->authenticationManager = manager->authenticationManager;
+
+ if (!isSynchronous()) {
+ // Tell our zerocopy policy to the delegate
+ delegate->downloadBufferMaximumSize =
+ request().attribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute).toLongLong();
+
+ // These atomic integers are used for signal compression
+ delegate->pendingDownloadData = pendingDownloadDataEmissions;
+ delegate->pendingDownloadProgress = pendingDownloadProgressEmissions;
+
+ // Connect the signals of the delegate to us
+ connect(delegate, SIGNAL(downloadData(QByteArray)),
+ this, SLOT(replyDownloadData(QByteArray)),
+ Qt::QueuedConnection);
+ connect(delegate, SIGNAL(downloadFinished()),
+ this, SLOT(replyFinished()),
+ Qt::QueuedConnection);
+ connect(delegate, SIGNAL(downloadMetaData(QList<QPair<QByteArray,QByteArray> >,int,QString,bool,QSharedPointer<char>,qint64)),
+ this, SLOT(replyDownloadMetaData(QList<QPair<QByteArray,QByteArray> >,int,QString,bool,QSharedPointer<char>,qint64)),
+ Qt::QueuedConnection);
+ connect(delegate, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(replyDownloadProgressSlot(qint64,qint64)),
+ Qt::QueuedConnection);
+ connect(delegate, SIGNAL(error(QNetworkReply::NetworkError,QString)),
+ this, SLOT(httpError(QNetworkReply::NetworkError, const QString)),
+ Qt::QueuedConnection);
+#ifndef QT_NO_OPENSSL
+ connect(delegate, SIGNAL(sslConfigurationChanged(QSslConfiguration)),
+ this, SLOT(replySslConfigurationChanged(QSslConfiguration)),
+ Qt::QueuedConnection);
+#endif
+ // Those need to report back, therefire BlockingQueuedConnection
+ connect(delegate, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)),
+ this, SLOT(httpAuthenticationRequired(QHttpNetworkRequest,QAuthenticator*)),
+ Qt::BlockingQueuedConnection);
#ifndef QT_NO_NETWORKPROXY
- connect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
+ connect (delegate, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ Qt::BlockingQueuedConnection);
#endif
- connect(httpReply, SIGNAL(authenticationRequired(const QHttpNetworkRequest,QAuthenticator*)),
- SLOT(httpAuthenticationRequired(const QHttpNetworkRequest,QAuthenticator*)));
+#ifndef QT_NO_OPENSSL
+ connect(delegate, SIGNAL(sslErrors(QList<QSslError>,bool*,QList<QSslError>*)),
+ this, SLOT(replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *)),
+ Qt::BlockingQueuedConnection);
+#endif
+ // This signal we will use to start the request.
+ connect(this, SIGNAL(startHttpRequest()), delegate, SLOT(startRequest()));
+ connect(this, SIGNAL(abortHttpRequest()), delegate, SLOT(abortRequest()));
+
+ if (uploadByteDevice) {
+ QNonContiguousByteDeviceThreadForwardImpl *forwardUploadDevice =
+ new QNonContiguousByteDeviceThreadForwardImpl(uploadByteDevice->atEnd(), uploadByteDevice->size());
+ if (uploadByteDevice->isResetDisabled())
+ forwardUploadDevice->disableReset();
+ forwardUploadDevice->setParent(delegate); // needed to make sure it is moved on moveToThread()
+ delegate->httpRequest.setUploadByteDevice(forwardUploadDevice);
+
+ // From main thread to user thread:
+ QObject::connect(this, SIGNAL(haveUploadData(QByteArray, bool, qint64)),
+ forwardUploadDevice, SLOT(haveDataSlot(QByteArray, bool, qint64)), Qt::QueuedConnection);
+ QObject::connect(uploadByteDevice.data(), SIGNAL(readyRead()),
+ forwardUploadDevice, SIGNAL(readyRead()),
+ Qt::QueuedConnection);
+
+ // From http thread to user thread:
+ QObject::connect(forwardUploadDevice, SIGNAL(wantData(qint64)),
+ this, SLOT(wantUploadDataSlot(qint64)));
+ QObject::connect(forwardUploadDevice, SIGNAL(processedData(qint64)),
+ this, SLOT(sentUploadDataSlot(qint64)));
+ connect(forwardUploadDevice, SIGNAL(resetData(bool*)),
+ this, SLOT(resetUploadDataSlot(bool*)),
+ Qt::BlockingQueuedConnection); // this is the only one with BlockingQueued!
+ }
+ } else if (isSynchronous()) {
+ connect(this, SIGNAL(startHttpRequestSynchronously()), delegate, SLOT(startRequestSynchronously()), Qt::BlockingQueuedConnection);
+
+ if (uploadByteDevice) {
+ // For the synchronous HTTP use case the use thread (this one here) is blocked
+ // so we cannot use the asynchronous upload architecture.
+ // We therefore won't use the QNonContiguousByteDeviceThreadForwardImpl but directly
+ // use the uploadByteDevice provided to us by the QNetworkReplyImpl.
+ // The code that is in QNetworkReplyImplPrivate::setup() makes sure it is safe to use from a thread
+ // since it only wraps a QRingBuffer
+ delegate->httpRequest.setUploadByteDevice(uploadByteDevice.data());
+ }
+ }
+
+
+ // Move the delegate to the http thread
+ delegate->moveToThread(thread);
+ // This call automatically moves the uploadDevice too for the asynchronous case.
+
+ // Send an signal to the delegate so it starts working in the other thread
+ if (isSynchronous()) {
+ emit startHttpRequestSynchronously(); // This one is BlockingQueuedConnection, so it will return when all work is done
+
+ if (delegate->incomingErrorCode != QNetworkReply::NoError) {
+ replyDownloadMetaData
+ (delegate->incomingHeaders,
+ delegate->incomingStatusCode,
+ delegate->incomingReasonPhrase,
+ delegate->isPipeliningUsed,
+ QSharedPointer<char>(),
+ delegate->incomingContentLength);
+ httpError(delegate->incomingErrorCode, delegate->incomingErrorDetail);
+ } else {
+ replyDownloadMetaData
+ (delegate->incomingHeaders,
+ delegate->incomingStatusCode,
+ delegate->incomingReasonPhrase,
+ delegate->isPipeliningUsed,
+ QSharedPointer<char>(),
+ delegate->incomingContentLength);
+ replyDownloadData(delegate->synchronousDownloadData);
+ }
+
+ // End the thread. It will delete itself from the finished() signal
+ thread->quit();
+
+ finished();
+ } else {
+ emit startHttpRequest(); // Signal to the HTTP thread and go back to user.
+ }
}
void QNetworkAccessHttpBackend::invalidateCache()
@@ -611,159 +676,52 @@ void QNetworkAccessHttpBackend::invalidateCache()
void QNetworkAccessHttpBackend::open()
{
- QUrl url = request().url();
- bool encrypt = url.scheme().toLower() == QLatin1String("https");
- setAttribute(QNetworkRequest::ConnectionEncryptedAttribute, encrypt);
-
- // set the port number in the reply if it wasn't set
- url.setPort(url.port(encrypt ? DefaultHttpsPort : DefaultHttpPort));
-
- QNetworkProxy *theProxy = 0;
-#ifndef QT_NO_NETWORKPROXY
- QNetworkProxy transparentProxy, cacheProxy;
-
- foreach (const QNetworkProxy &p, proxyList()) {
- // use the first proxy that works
- // for non-encrypted connections, any transparent or HTTP proxy
- // for encrypted, only transparent proxies
- if (!encrypt
- && (p.capabilities() & QNetworkProxy::CachingCapability)
- && (p.type() == QNetworkProxy::HttpProxy ||
- p.type() == QNetworkProxy::HttpCachingProxy)) {
- cacheProxy = p;
- transparentProxy = QNetworkProxy::NoProxy;
- theProxy = &cacheProxy;
- break;
- }
- if (p.isTransparentProxy()) {
- transparentProxy = p;
- cacheProxy = QNetworkProxy::NoProxy;
- theProxy = &transparentProxy;
- break;
- }
- }
-
- // check if at least one of the proxies
- if (transparentProxy.type() == QNetworkProxy::DefaultProxy &&
- cacheProxy.type() == QNetworkProxy::DefaultProxy) {
- // unsuitable proxies
- if (isSynchronous()) {
- error(QNetworkReply::ProxyNotFoundError, tr("No suitable proxy found"));
- finished();
- } else {
- QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
- Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProxyNotFoundError),
- Q_ARG(QString, tr("No suitable proxy found")));
- QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
- }
- return;
- }
-#endif
-
- if (isSynchronous()) {
- // for synchronous requests, we just create a new connection
- http = new QHttpNetworkConnection(1, url.host(), url.port(), encrypt, this);
-#ifndef QT_NO_NETWORKPROXY
- http->setTransparentProxy(transparentProxy);
- http->setCacheProxy(cacheProxy);
-#endif
- postRequest();
- processRequestSynchronously();
- } else {
- // check if we have an open connection to this host
- cacheKey = makeCacheKey(this, theProxy);
- QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getObjectCache(this);
- // the http object is actually a QHttpNetworkConnection
- http = static_cast<QNetworkAccessCachedHttpConnection *>(cache->requestEntryNow(cacheKey));
- if (http == 0) {
- // no entry in cache; create an object
- // the http object is actually a QHttpNetworkConnection
- http = new QNetworkAccessCachedHttpConnection(url.host(), url.port(), encrypt);
-
-#ifndef QT_NO_NETWORKPROXY
- http->setTransparentProxy(transparentProxy);
- http->setCacheProxy(cacheProxy);
-#endif
-
- // cache the QHttpNetworkConnection corresponding to this cache key
- cache->addEntry(cacheKey, static_cast<QNetworkAccessCachedHttpConnection *>(http.data()));
- }
- postRequest();
- }
+ postRequest();
}
void QNetworkAccessHttpBackend::closeDownstreamChannel()
{
- // this indicates that the user closed the stream while the reply isn't finished yet
+ // FIXME Maybe we can get rid of this whole architecture part
}
void QNetworkAccessHttpBackend::downstreamReadyWrite()
{
- readFromHttp();
- if (httpReply && httpReply->bytesAvailable() == 0 && httpReply->isFinished())
- replyFinished();
+ // FIXME Maybe we can get rid of this whole architecture part
}
void QNetworkAccessHttpBackend::setDownstreamLimited(bool b)
{
- if (httpReply)
- httpReply->setDownstreamLimited(b);
-}
-
-void QNetworkAccessHttpBackend::replyReadyRead()
-{
- readFromHttp();
+ Q_UNUSED(b);
+ // We know that readBuffer maximum size limiting is broken since quite a while.
+ // The task to fix this is QTBUG-15065
}
-void QNetworkAccessHttpBackend::readFromHttp()
+void QNetworkAccessHttpBackend::replyDownloadData(QByteArray d)
{
- if (!httpReply)
+ int pendingSignals = (int)pendingDownloadDataEmissions->fetchAndAddAcquire(-1) - 1;
+
+ if (pendingSignals > 0) {
+ // Some more signal emissions to this slot are pending.
+ // Instead of writing the downstream data, we wait
+ // and do it in the next call we get
+ // (signal comppression)
+ pendingDownloadData.append(d);
return;
-
- // We read possibly more than nextDownstreamBlockSize(), but
- // this is not a critical thing since it is already in the
- // memory anyway
-
- QByteDataBuffer list;
-
- while (httpReply->bytesAvailable() != 0 && nextDownstreamBlockSize() != 0 && nextDownstreamBlockSize() > list.byteAmount()) {
- list.append(httpReply->readAny());
}
- if (!list.isEmpty())
- writeDownstreamData(list);
+ pendingDownloadData.append(d);
+ d.clear();
+ writeDownstreamData(pendingDownloadData);
+ pendingDownloadData.clear();
}
void QNetworkAccessHttpBackend::replyFinished()
{
- if (httpReply->bytesAvailable())
- // we haven't read everything yet. Wait some more.
+ // We are already loading from cache, we still however
+ // got this signal because it was posted already
+ if (loadingFromCache)
return;
- int statusCode = httpReply->statusCode();
- if (statusCode >= 400) {
- // it's an error reply
- QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
- "Error downloading %1 - server replied: %2"));
- msg = msg.arg(url().toString(), httpReply->reasonPhrase());
- error(statusCodeFromHttp(httpReply->statusCode(), httpReply->url()), msg);
- }
-
-#ifndef QT_NO_OPENSSL
- // store the SSL configuration now
- // once we call finished(), we won't have access to httpReply anymore
- QSslConfiguration sslConfig = httpReply->sslConfiguration();
- if (pendingSslConfiguration) {
- *pendingSslConfiguration = sslConfig;
- } else if (!sslConfig.isNull()) {
- QT_TRY {
- pendingSslConfiguration = new QSslConfiguration(sslConfig);
- } QT_CATCH(...) {
- qWarning("QNetworkAccess: could not allocate a QSslConfiguration object for a SSL connection.");
- }
- }
-#endif
-
finished();
}
@@ -785,12 +743,27 @@ void QNetworkAccessHttpBackend::checkForRedirect(const int statusCode)
}
}
-void QNetworkAccessHttpBackend::replyHeaderChanged()
+void QNetworkAccessHttpBackend::replyDownloadMetaData
+ (QList<QPair<QByteArray,QByteArray> > hm,
+ int sc,QString rp,bool pu,
+ QSharedPointer<char> db,
+ qint64 contentLength)
{
- setAttribute(QNetworkRequest::HttpPipeliningWasUsedAttribute, httpReply->isPipeliningUsed());
+ statusCode = sc;
+ reasonPhrase = rp;
+
+ // Download buffer
+ if (!db.isNull()) {
+ reply->setDownloadBuffer(db, contentLength);
+ usingZerocopyDownloadBuffer = true;
+ } else {
+ usingZerocopyDownloadBuffer = false;
+ }
+
+ setAttribute(QNetworkRequest::HttpPipeliningWasUsedAttribute, pu);
// reconstruct the HTTP header
- QList<QPair<QByteArray, QByteArray> > headerMap = httpReply->header();
+ QList<QPair<QByteArray, QByteArray> > headerMap = hm;
QList<QPair<QByteArray, QByteArray> >::ConstIterator it = headerMap.constBegin(),
end = headerMap.constEnd();
QByteArray header;
@@ -807,11 +780,10 @@ void QNetworkAccessHttpBackend::replyHeaderChanged()
setRawHeader(it->first, value);
}
- setAttribute(QNetworkRequest::HttpStatusCodeAttribute, httpReply->statusCode());
- setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, httpReply->reasonPhrase());
+ setAttribute(QNetworkRequest::HttpStatusCodeAttribute, statusCode);
+ setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, reasonPhrase);
// is it a redirection?
- const int statusCode = httpReply->statusCode();
checkForRedirect(statusCode);
if (statusCode >= 500 && statusCode < 600) {
@@ -854,29 +826,21 @@ void QNetworkAccessHttpBackend::replyHeaderChanged()
setCachingEnabled(true);
}
- // Check if a download buffer is supported from the HTTP reply
- char *buf = 0;
- if (httpReply->supportsUserProvidedDownloadBuffer()) {
- // Check if a download buffer is supported by the user
- buf = getDownloadBuffer(httpReply->contentLength());
- if (buf) {
- httpReply->setUserProvidedDownloadBuffer(buf);
- // If there is a download buffer we react on the progress signal
- connect(httpReply, SIGNAL(dataReadProgress(int,int)), SLOT(replyDownloadProgressSlot(int,int)));
- }
- }
-
- // If there is no buffer, we react on the readyRead signal
- if (!buf) {
- connect(httpReply, SIGNAL(readyRead()), SLOT(replyReadyRead()));
- }
-
metaDataChanged();
}
-void QNetworkAccessHttpBackend::replyDownloadProgressSlot(int received, int total)
+void QNetworkAccessHttpBackend::replyDownloadProgressSlot(qint64 received, qint64 total)
{
// we can be sure here that there is a download buffer
+
+ int pendingSignals = (int)pendingDownloadProgressEmissions->fetchAndAddAcquire(-1) - 1;
+ if (pendingSignals > 0) {
+ // Let's ignore this signal and look at the next one coming in
+ // (signal comppression)
+ return;
+ }
+
+ // Now do the actual notification of new bytes
writeDownstreamDataDownloadBuffer(received, total);
}
@@ -886,20 +850,62 @@ void QNetworkAccessHttpBackend::httpAuthenticationRequired(const QHttpNetworkReq
authenticationRequired(auth);
}
-void QNetworkAccessHttpBackend::httpCacheCredentials(const QHttpNetworkRequest &,
- QAuthenticator *auth)
-{
- cacheCredentials(auth);
-}
-
void QNetworkAccessHttpBackend::httpError(QNetworkReply::NetworkError errorCode,
const QString &errorString)
{
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
qDebug() << "http error!" << errorCode << errorString;
#endif
+
error(errorCode, errorString);
- finished();
+}
+
+#ifndef QT_NO_OPENSSL
+void QNetworkAccessHttpBackend::replySslErrors(
+ const QList<QSslError> &list, bool *ignoreAll, QList<QSslError> *toBeIgnored)
+{
+ // Go to generic backend
+ sslErrors(list);
+ // Check if the callback set any ignore and return this here to http thread
+ if (pendingIgnoreAllSslErrors)
+ *ignoreAll = true;
+ if (!pendingIgnoreSslErrorsList.isEmpty())
+ *toBeIgnored = pendingIgnoreSslErrorsList;
+}
+
+void QNetworkAccessHttpBackend::replySslConfigurationChanged(const QSslConfiguration &c)
+{
+ // Receiving the used SSL configuration from the HTTP thread
+ if (pendingSslConfiguration)
+ *pendingSslConfiguration = c;
+ else if (!c.isNull())
+ pendingSslConfiguration = new QSslConfiguration(c);
+}
+#endif
+
+// Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread
+void QNetworkAccessHttpBackend::resetUploadDataSlot(bool *r)
+{
+ *r = uploadByteDevice->reset();
+}
+
+// Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread
+void QNetworkAccessHttpBackend::sentUploadDataSlot(qint64 amount)
+{
+ uploadByteDevice->advanceReadPointer(amount);
+}
+
+// Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread
+void QNetworkAccessHttpBackend::wantUploadDataSlot(qint64 maxSize)
+{
+ // call readPointer
+ qint64 currentUploadDataLength = 0;
+ char *data = const_cast<char*>(uploadByteDevice->readPointer(maxSize, currentUploadDataLength));
+ // Let's make a copy of this data
+ QByteArray dataArray(data, currentUploadDataLength);
+
+ // Communicate back to HTTP thread
+ emit haveUploadData(dataArray, uploadByteDevice->atEnd(), uploadByteDevice->size());
}
/*
@@ -950,8 +956,10 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
qDebug() << "Successfully sent cache:" << url() << contents->size() << "bytes";
#endif
- if (httpReply)
- disconnect(httpReply, SIGNAL(finished()), this, SLOT(replyFinished()));
+
+ // Set the following flag so we can ignore some signals from HTTP thread
+ // that would still come
+ loadingFromCache = true;
return true;
}
@@ -964,39 +972,29 @@ void QNetworkAccessHttpBackend::copyFinished(QIODevice *dev)
#ifndef QT_NO_OPENSSL
void QNetworkAccessHttpBackend::ignoreSslErrors()
{
- if (httpReply)
- httpReply->ignoreSslErrors();
- else
- pendingIgnoreAllSslErrors = true;
+ pendingIgnoreAllSslErrors = true;
}
void QNetworkAccessHttpBackend::ignoreSslErrors(const QList<QSslError> &errors)
{
- if (httpReply) {
- httpReply->ignoreSslErrors(errors);
- } else {
- // the pending list is set if QNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
- // is called before QNetworkAccessManager::get() (or post(), etc.)
- pendingIgnoreSslErrorsList = errors;
- }
+ // the pending list is set if QNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
+ // is called before QNetworkAccessManager::get() (or post(), etc.)
+ pendingIgnoreSslErrorsList = errors;
}
void QNetworkAccessHttpBackend::fetchSslConfiguration(QSslConfiguration &config) const
{
- if (httpReply)
- config = httpReply->sslConfiguration();
- else if (pendingSslConfiguration)
+ if (pendingSslConfiguration)
config = *pendingSslConfiguration;
+ else
+ config = request().sslConfiguration();
}
void QNetworkAccessHttpBackend::setSslConfiguration(const QSslConfiguration &newconfig)
{
- if (httpReply)
- httpReply->setSslConfiguration(newconfig);
- else if (pendingSslConfiguration)
- *pendingSslConfiguration = newconfig;
- else
- pendingSslConfiguration = new QSslConfiguration(newconfig);
+ // Setting a SSL configuration on a reply is not supported. The user needs to set
+ // her/his QSslConfiguration on the QNetworkRequest.
+ Q_UNUSED(newconfig);
}
#endif
@@ -1101,7 +1099,7 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo
bool canDiskCache;
// only cache GET replies by default, all other replies (POST, PUT, DELETE)
// are not cacheable by default (according to RFC 2616 section 9)
- if (httpReply->request().operation() == QHttpNetworkRequest::Get) {
+ if (httpRequest.operation() == QHttpNetworkRequest::Get) {
canDiskCache = true;
// 14.32
@@ -1119,7 +1117,7 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo
canDiskCache = false;
// responses to POST might be cacheable
- } else if (httpReply->request().operation() == QHttpNetworkRequest::Post) {
+ } else if (httpRequest.operation() == QHttpNetworkRequest::Post) {
canDiskCache = false;
// some pages contain "expires:" and "cache-control: no-cache" field,
@@ -1133,12 +1131,11 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo
}
metaData.setSaveToDisk(canDiskCache);
- int statusCode = httpReply->statusCode();
QNetworkCacheMetaData::AttributesMap attributes;
if (statusCode != 304) {
// update the status code
attributes.insert(QNetworkRequest::HttpStatusCodeAttribute, statusCode);
- attributes.insert(QNetworkRequest::HttpReasonPhraseAttribute, httpReply->reasonPhrase());
+ attributes.insert(QNetworkRequest::HttpReasonPhraseAttribute, reasonPhrase);
} else {
// this is a redirection, keep the attributes intact
attributes = oldMetaData.attributes();
@@ -1154,7 +1151,8 @@ bool QNetworkAccessHttpBackend::canResume() const
return false;
// Can only resume if server/resource supports Range header.
- if (httpReply->headerField("Accept-Ranges", "none") == "none")
+ QByteArray acceptRangesheaderName("Accept-Ranges");
+ if (!hasRawHeader(acceptRangesheaderName) || rawHeader(acceptRangesheaderName) == "none")
return false;
// We only support resuming for byte ranges.
@@ -1166,7 +1164,7 @@ bool QNetworkAccessHttpBackend::canResume() const
// If we're using a download buffer then we don't support resuming/migration
// right now. Too much trouble.
- if (httpReply->userProvidedDownloadBuffer())
+ if (usingZerocopyDownloadBuffer)
return false;
return true;
@@ -1177,87 +1175,6 @@ void QNetworkAccessHttpBackend::setResumeOffset(quint64 offset)
resumeOffset = offset;
}
-bool QNetworkAccessHttpBackend::processRequestSynchronously()
-{
- QHttpNetworkConnectionChannel *channel = &http->channels()[0];
-
- // Disconnect all socket signals. They will only confuse us when using waitFor*
- QObject::disconnect(channel->socket, 0, 0, 0);
-
- qint64 timeout = 20*1000; // 20 sec
- QElapsedTimer timeoutTimer;
-
- bool waitResult = channel->socket->waitForConnected(timeout);
- timeoutTimer.start();
-
- if (!waitResult || channel->socket->state() != QAbstractSocket::ConnectedState) {
- error(QNetworkReply::UnknownNetworkError, QLatin1String("could not connect"));
- return false;
- }
- channel->_q_connected(); // this will send the request (via sendRequest())
-
-#ifndef QT_NO_OPENSSL
- if (http->isSsl()) {
- qint64 remainingTimeEncrypted = timeout - timeoutTimer.elapsed();
- if (!static_cast<QSslSocket *>(channel->socket)->waitForEncrypted(remainingTimeEncrypted)) {
- error(QNetworkReply::SslHandshakeFailedError,
- QLatin1String("could not encrypt or timeout while encrypting"));
- return false;
- }
- channel->_q_encrypted();
- }
-#endif
-
- // if we get a 401 or 407, we might need to send the request twice, see below
- bool authenticating = false;
-
- do {
- channel->sendRequest();
-
- qint64 remainingTimeBytesWritten;
- while(channel->socket->bytesToWrite() > 0 ||
- channel->state == QHttpNetworkConnectionChannel::WritingState) {
- remainingTimeBytesWritten = timeout - timeoutTimer.elapsed();
- channel->sendRequest(); // triggers channel->socket->write()
- if (!channel->socket->waitForBytesWritten(remainingTimeBytesWritten)) {
- error(QNetworkReply::TimeoutError,
- QLatin1String("could not write bytes to socket or timeout while writing"));
- return false;
- }
- }
-
- qint64 remainingTimeBytesRead = timeout - timeoutTimer.elapsed();
- // Loop for at most remainingTime until either the socket disconnects
- // or the reply is finished
- do {
- waitResult = channel->socket->waitForReadyRead(remainingTimeBytesRead);
- remainingTimeBytesRead = timeout - timeoutTimer.elapsed();
- if (!waitResult || remainingTimeBytesRead <= 0
- || channel->socket->state() != QAbstractSocket::ConnectedState) {
- error(QNetworkReply::TimeoutError,
- QLatin1String("could not read from socket or timeout while reading"));
- return false;
- }
-
- if (channel->socket->bytesAvailable())
- channel->_q_readyRead();
-
- if (!httpReply)
- return false; // we got a 401 or 407 and cannot handle it (it might happen that
- // disconnectFromHttp() was called, in that case the reply is zero)
- // ### I am quite sure this does not work for NTLM
- // ### how about uploading to an auth / proxyAuth site?
-
- authenticating = (httpReply->statusCode() == 401 || httpReply->statusCode() == 407);
-
- if (httpReply->isFinished())
- break;
- } while (remainingTimeBytesRead > 0);
- } while (authenticating);
-
- return true;
-}
-
QT_END_NAMESPACE
#endif // QT_NO_HTTP
diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h
index 7064d4a..712dd2f 100644
--- a/src/network/access/qnetworkaccesshttpbackend_p.h
+++ b/src/network/access/qnetworkaccesshttpbackend_p.h
@@ -61,6 +61,8 @@
#include "QtCore/qpointer.h"
#include "QtCore/qdatetime.h"
+#include "QtCore/qsharedpointer.h"
+#include "qatomic.h"
#ifndef QT_NO_HTTP
@@ -99,24 +101,44 @@ public:
bool canResume() const;
void setResumeOffset(quint64 offset);
- virtual bool processRequestSynchronously();
+signals:
+ // To HTTP thread:
+ void startHttpRequest();
+ void abortHttpRequest();
+ void startHttpRequestSynchronously();
+
+ void haveUploadData(QByteArray dataArray, bool dataAtEnd, qint64 dataSize);
private slots:
- void replyReadyRead();
+ // From HTTP thread:
+ void replyDownloadData(QByteArray);
void replyFinished();
- void replyHeaderChanged();
- void replyDownloadProgressSlot(int,int);
+ void replyDownloadMetaData(QList<QPair<QByteArray,QByteArray> >,int,QString,bool,QSharedPointer<char>,qint64);
+ void replyDownloadProgressSlot(qint64,qint64);
void httpAuthenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *auth);
- void httpCacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *auth);
void httpError(QNetworkReply::NetworkError error, const QString &errorString);
+#ifndef QT_NO_OPENSSL
+ void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
+ void replySslConfigurationChanged(const QSslConfiguration&);
+#endif
+
+ // From QNonContiguousByteDeviceThreadForwardImpl in HTTP thread:
+ void resetUploadDataSlot(bool *r);
+ void wantUploadDataSlot(qint64);
+ void sentUploadDataSlot(qint64);
+
bool sendCacheContents(const QNetworkCacheMetaData &metaData);
- void finished(); // override
private:
- QHttpNetworkReply *httpReply;
- QPointer<QHttpNetworkConnection> http;
- QByteArray cacheKey;
- QNetworkAccessBackendUploadIODevice *uploadDevice;
+ QHttpNetworkRequest httpRequest; // There is also a copy in the HTTP thread
+ int statusCode;
+ QString reasonPhrase;
+ // Will be increased by HTTP thread:
+ QSharedPointer<QAtomicInt> pendingDownloadDataEmissions;
+ QSharedPointer<QAtomicInt> pendingDownloadProgressEmissions;
+ bool loadingFromCache;
+ QByteDataBuffer pendingDownloadData;
+ bool usingZerocopyDownloadBuffer;
#ifndef QT_NO_OPENSSL
QSslConfiguration *pendingSslConfiguration;
@@ -126,7 +148,6 @@ private:
quint64 resumeOffset;
- void disconnectFromHttp();
void validateCache(QHttpNetworkRequest &httpRequest, bool &loadedFromCache);
void invalidateCache();
void postRequest();
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index f1c4447..7e75045 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -65,6 +65,8 @@
#include "QtNetwork/qsslconfiguration.h"
#include "QtNetwork/qnetworkconfigmanager.h"
+#include "qthread.h"
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_HTTP
@@ -341,107 +343,6 @@ static void ensureInitialized()
QNetworkReply::sslConfiguration(), QNetworkReply::ignoreSslErrors()
*/
-class QNetworkAuthenticationCredential
-{
-public:
- QString domain;
- QString user;
- QString password;
-};
-Q_DECLARE_TYPEINFO(QNetworkAuthenticationCredential, Q_MOVABLE_TYPE);
-inline bool operator<(const QNetworkAuthenticationCredential &t1, const QString &t2)
-{ return t1.domain < t2; }
-
-class QNetworkAuthenticationCache: private QVector<QNetworkAuthenticationCredential>,
- public QNetworkAccessCache::CacheableObject
-{
-public:
- QNetworkAuthenticationCache()
- {
- setExpires(false);
- setShareable(true);
- reserve(1);
- }
-
- QNetworkAuthenticationCredential *findClosestMatch(const QString &domain)
- {
- iterator it = qLowerBound(begin(), end(), domain);
- if (it == end() && !isEmpty())
- --it;
- if (it == end() || !domain.startsWith(it->domain))
- return 0;
- return &*it;
- }
-
- void insert(const QString &domain, const QString &user, const QString &password)
- {
- QNetworkAuthenticationCredential *closestMatch = findClosestMatch(domain);
- if (closestMatch && closestMatch->domain == domain) {
- // we're overriding the current credentials
- closestMatch->user = user;
- closestMatch->password = password;
- } else {
- QNetworkAuthenticationCredential newCredential;
- newCredential.domain = domain;
- newCredential.user = user;
- newCredential.password = password;
-
- if (closestMatch)
- QVector<QNetworkAuthenticationCredential>::insert(++closestMatch, newCredential);
- else
- QVector<QNetworkAuthenticationCredential>::insert(end(), newCredential);
- }
- }
-
- virtual void dispose() { delete this; }
-};
-
-#ifndef QT_NO_NETWORKPROXY
-static QByteArray proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm)
-{
- QUrl key;
-
- switch (proxy.type()) {
- case QNetworkProxy::Socks5Proxy:
- key.setScheme(QLatin1String("proxy-socks5"));
- break;
-
- case QNetworkProxy::HttpProxy:
- case QNetworkProxy::HttpCachingProxy:
- key.setScheme(QLatin1String("proxy-http"));
- break;
-
- case QNetworkProxy::FtpCachingProxy:
- key.setScheme(QLatin1String("proxy-ftp"));
- break;
-
- case QNetworkProxy::DefaultProxy:
- case QNetworkProxy::NoProxy:
- // shouldn't happen
- return QByteArray();
-
- // no default:
- // let there be errors if a new proxy type is added in the future
- }
-
- if (key.scheme().isEmpty())
- // proxy type not handled
- return QByteArray();
-
- key.setUserName(proxy.user());
- key.setHost(proxy.hostName());
- key.setPort(proxy.port());
- key.setFragment(realm);
- return "auth:" + key.toEncoded();
-}
-#endif
-
-static inline QByteArray authenticationKey(const QUrl &url, const QString &realm)
-{
- QUrl copy = url;
- copy.setFragment(realm);
- return "auth:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery);
-}
/*!
Constructs a QNetworkAccessManager object that is the center of
@@ -1124,10 +1025,10 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QNetworkAccessBackend
// also called when last URL is empty, e.g. on first call
if (backend->reply->urlForLastAuthentication.isEmpty()
|| url != backend->reply->urlForLastAuthentication) {
- QNetworkAuthenticationCredential *cred = fetchCachedCredentials(url, authenticator);
- if (cred) {
- authenticator->setUser(cred->user);
- authenticator->setPassword(cred->password);
+ QNetworkAuthenticationCredential cred = authenticationManager->fetchCachedCredentials(url, authenticator);
+ if (!cred.isNull()) {
+ authenticator->setUser(cred.user);
+ authenticator->setPassword(cred.password);
backend->reply->urlForLastAuthentication = url;
return;
}
@@ -1140,7 +1041,7 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QNetworkAccessBackend
backend->reply->urlForLastAuthentication = url;
emit q->authenticationRequired(backend->reply->q_func(), authenticator);
- cacheCredentials(url, authenticator);
+ authenticationManager->cacheCredentials(url, authenticator);
}
#ifndef QT_NO_NETWORKPROXY
@@ -1157,10 +1058,10 @@ void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(QNetworkAccessBac
// possible solution: some tracking inside the authenticator
// or a new function proxyAuthenticationSucceeded(true|false)
if (proxy != backend->reply->lastProxyAuthentication) {
- QNetworkAuthenticationCredential *cred = fetchCachedProxyCredentials(proxy);
- if (cred) {
- authenticator->setUser(cred->user);
- authenticator->setPassword(cred->password);
+ QNetworkAuthenticationCredential cred = authenticationManager->fetchCachedProxyCredentials(proxy);
+ if (!cred.isNull()) {
+ authenticator->setUser(cred.user);
+ authenticator->setPassword(cred.password);
return;
}
}
@@ -1172,75 +1073,7 @@ void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(QNetworkAccessBac
backend->reply->lastProxyAuthentication = proxy;
emit q->proxyAuthenticationRequired(proxy, authenticator);
- cacheProxyCredentials(proxy, authenticator);
-}
-
-void QNetworkAccessManagerPrivate::cacheProxyCredentials(const QNetworkProxy &p,
- const QAuthenticator *authenticator)
-{
- Q_ASSERT(authenticator);
- Q_ASSERT(p.type() != QNetworkProxy::DefaultProxy);
- Q_ASSERT(p.type() != QNetworkProxy::NoProxy);
-
- QString realm = authenticator->realm();
- QNetworkProxy proxy = p;
- proxy.setUser(authenticator->user());
- // Set two credentials: one with the username and one without
- do {
- // Set two credentials actually: one with and one without the realm
- do {
- QByteArray cacheKey = proxyAuthenticationKey(proxy, realm);
- if (cacheKey.isEmpty())
- return; // should not happen
-
- QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache;
- auth->insert(QString(), authenticator->user(), authenticator->password());
- objectCache.addEntry(cacheKey, auth); // replace the existing one, if there's any
-
- if (realm.isEmpty()) {
- break;
- } else {
- realm.clear();
- }
- } while (true);
-
- if (proxy.user().isEmpty())
- break;
- else
- proxy.setUser(QString());
- } while (true);
-}
-
-QNetworkAuthenticationCredential *
-QNetworkAccessManagerPrivate::fetchCachedProxyCredentials(const QNetworkProxy &p,
- const QAuthenticator *authenticator)
-{
- QNetworkProxy proxy = p;
- if (proxy.type() == QNetworkProxy::DefaultProxy) {
- proxy = QNetworkProxy::applicationProxy();
- }
- if (!proxy.password().isEmpty())
- return 0; // no need to set credentials if it already has them
-
- QString realm;
- if (authenticator)
- realm = authenticator->realm();
-
- QByteArray cacheKey = proxyAuthenticationKey(proxy, realm);
- if (cacheKey.isEmpty())
- return 0;
- if (!objectCache.hasEntry(cacheKey))
- return 0;
-
- QNetworkAuthenticationCache *auth =
- static_cast<QNetworkAuthenticationCache *>(objectCache.requestEntryNow(cacheKey));
- QNetworkAuthenticationCredential *cred = auth->findClosestMatch(QString());
- objectCache.releaseEntry(cacheKey);
-
- // proxy cache credentials always have exactly one item
- Q_ASSERT_X(cred, "QNetworkAccessManager",
- "Internal inconsistency: found a cache key for a proxy, but it's empty");
- return cred;
+ authenticationManager->cacheProxyCredentials(proxy, authenticator);
}
QList<QNetworkProxy> QNetworkAccessManagerPrivate::queryProxy(const QNetworkProxyQuery &query)
@@ -1264,77 +1097,25 @@ QList<QNetworkProxy> QNetworkAccessManagerPrivate::queryProxy(const QNetworkProx
}
#endif
-void QNetworkAccessManagerPrivate::cacheCredentials(const QUrl &url,
- const QAuthenticator *authenticator)
-{
- Q_ASSERT(authenticator);
- QString domain = QString::fromLatin1("/"); // FIXME: make QAuthenticator return the domain
- QString realm = authenticator->realm();
-
- // Set two credentials actually: one with and one without the username in the URL
- QUrl copy = url;
- copy.setUserName(authenticator->user());
- do {
- QByteArray cacheKey = authenticationKey(copy, realm);
- if (objectCache.hasEntry(cacheKey)) {
- QNetworkAuthenticationCache *auth =
- static_cast<QNetworkAuthenticationCache *>(objectCache.requestEntryNow(cacheKey));
- auth->insert(domain, authenticator->user(), authenticator->password());
- objectCache.releaseEntry(cacheKey);
- } else {
- QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache;
- auth->insert(domain, authenticator->user(), authenticator->password());
- objectCache.addEntry(cacheKey, auth);
- }
-
- if (copy.userName().isEmpty()) {
- break;
- } else {
- copy.setUserName(QString());
- }
- } while (true);
-}
-
-/*!
- Fetch the credential data from the credential cache.
-
- If auth is 0 (as it is when called from createRequest()), this will try to
- look up with an empty realm. That fails in most cases for HTTP (because the
- realm is seldom empty for HTTP challenges). In any case, QHttpNetworkConnection
- never sends the credentials on the first attempt: it needs to find out what
- authentication methods the server supports.
-
- For FTP, realm is always empty.
-*/
-QNetworkAuthenticationCredential *
-QNetworkAccessManagerPrivate::fetchCachedCredentials(const QUrl &url,
- const QAuthenticator *authentication)
-{
- if (!url.password().isEmpty())
- return 0; // no need to set credentials if it already has them
-
- QString realm;
- if (authentication)
- realm = authentication->realm();
-
- QByteArray cacheKey = authenticationKey(url, realm);
- if (!objectCache.hasEntry(cacheKey))
- return 0;
-
- QNetworkAuthenticationCache *auth =
- static_cast<QNetworkAuthenticationCache *>(objectCache.requestEntryNow(cacheKey));
- QNetworkAuthenticationCredential *cred = auth->findClosestMatch(url.path());
- objectCache.releaseEntry(cacheKey);
- return cred;
-}
-
void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)
{
manager->d_func()->objectCache.clear();
+ manager->d_func()->authenticationManager->clearCache();
+
+ if (manager->d_func()->httpThread) {
+ // The thread will deleteLater() itself from its finished() signal
+ manager->d_func()->httpThread->quit();
+ manager->d_func()->httpThread = 0;
+ }
}
QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
{
+ if (httpThread) {
+ // The thread will deleteLater() itself from its finished() signal
+ httpThread->quit();
+ httpThread = 0;
+ }
}
#ifndef QT_NO_BEARERMANAGEMENT
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 7ef009f..d67b8ac 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -156,6 +156,8 @@ protected:
private:
friend class QNetworkReplyImplPrivate;
+ friend class QNetworkAccessHttpBackend;
+
Q_DECLARE_PRIVATE(QNetworkAccessManager)
Q_PRIVATE_SLOT(d_func(), void _q_replyFinished())
Q_PRIVATE_SLOT(d_func(), void _q_replySslErrors(QList<QSslError>))
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index cf4d2f3..ee6ad70 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -59,6 +59,7 @@
#include "private/qobject_p.h"
#include "QtNetwork/qnetworkproxy.h"
#include "QtNetwork/qnetworksession.h"
+#include "qnetworkaccessauthenticationmanager_p.h"
QT_BEGIN_NAMESPACE
@@ -72,6 +73,7 @@ class QNetworkAccessManagerPrivate: public QObjectPrivate
public:
QNetworkAccessManagerPrivate()
: networkCache(0), cookieJar(0),
+ httpThread(0),
#ifndef QT_NO_NETWORKPROXY
proxyFactory(0),
#endif
@@ -81,7 +83,8 @@ public:
online(false),
initializeSession(true),
#endif
- cookieJarCreated(false)
+ cookieJarCreated(false),
+ authenticationManager(new QNetworkAccessAuthenticationManager)
{ }
~QNetworkAccessManagerPrivate();
@@ -121,6 +124,8 @@ public:
QNetworkCookieJar *cookieJar;
+ QThread *httpThread;
+
#ifndef QT_NO_NETWORKPROXY
QNetworkProxy proxy;
@@ -137,6 +142,9 @@ public:
bool cookieJarCreated;
+ // The cache with authorization data:
+ QSharedPointer<QNetworkAccessAuthenticationManager> authenticationManager;
+
// this cache can be used by individual backends to cache e.g. their TCP connections to a server
// and use the connections for multiple requests.
QNetworkAccessCache objectCache;
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 70ea5c2..c2a6925 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -359,7 +359,7 @@ void QNetworkCookie::setValue(const QByteArray &value)
}
// ### move this to qnetworkcookie_p.h and share with qnetworkaccesshttpbackend
-static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position)
+static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position, bool isNameValue)
{
// format is one of:
// (1) token
@@ -394,13 +394,22 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi
// quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
// qdtext = <any TEXT except <">>
// quoted-pair = "\" CHAR
+
+ // If its NAME=VALUE, retain the value as is
+ // refer to ttp://bugreports.qt.nokia.com/browse/QTBUG-17746
+ if (isNameValue)
+ second += '"';
++i;
while (i < length) {
register char c = text.at(i);
if (c == '"') {
// end of quoted text
+ if (isNameValue)
+ second += '"';
break;
} else if (c == '\\') {
+ if (isNameValue)
+ second += '\\';
++i;
if (i >= length)
// broken line
@@ -476,10 +485,12 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const
result = d->name;
result += '=';
- if (d->value.contains(';') ||
+ if ((d->value.contains(';') ||
d->value.contains(',') ||
d->value.contains(' ') ||
- d->value.contains('"')) {
+ d->value.contains('"')) &&
+ (!d->value.startsWith('"') &&
+ !d->value.endsWith('"'))) {
result += '"';
QByteArray value = d->value;
@@ -947,7 +958,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
QNetworkCookie cookie;
// The first part is always the "NAME=VALUE" part
- QPair<QByteArray,QByteArray> field = nextField(cookieString, position);
+ QPair<QByteArray,QByteArray> field = nextField(cookieString, position, true);
if (field.first.isEmpty() || field.second.isNull())
// parsing error
break;
@@ -965,7 +976,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
case ';':
// new field in the cookie
- field = nextField(cookieString, position);
+ field = nextField(cookieString, position, false);
field.first = field.first.toLower(); // everything but the NAME=VALUE is case-insensitive
if (field.first == "expires") {
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index d35f0ce..2040b01 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -404,7 +404,7 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
// ### verify that QFile uses the fd size and not the file name
qint64 size = file->size() - file->pos();
const uchar *p = 0;
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_INTEGRITY)
p = file->map(file->pos(), size);
#endif
if (p) {
diff --git a/src/network/access/qnetworkreplydataimpl.cpp b/src/network/access/qnetworkreplydataimpl.cpp
index 52cfe95..a09ff5c 100644
--- a/src/network/access/qnetworkreplydataimpl.cpp
+++ b/src/network/access/qnetworkreplydataimpl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/network/access/qnetworkreplydataimpl_p.h b/src/network/access/qnetworkreplydataimpl_p.h
index 6c62d28..2048376 100644
--- a/src/network/access/qnetworkreplydataimpl_p.h
+++ b/src/network/access/qnetworkreplydataimpl_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/network/access/qnetworkreplyfileimpl.cpp b/src/network/access/qnetworkreplyfileimpl.cpp
index 686eb5f..babee32 100644
--- a/src/network/access/qnetworkreplyfileimpl.cpp
+++ b/src/network/access/qnetworkreplyfileimpl.cpp
@@ -49,15 +49,10 @@
QT_BEGIN_NAMESPACE
QNetworkReplyFileImplPrivate::QNetworkReplyFileImplPrivate()
- : QNetworkReplyPrivate(), fileEngine(0), fileSize(0), filePos(0)
+ : QNetworkReplyPrivate(), realFileSize(0)
{
}
-QNetworkReplyFileImplPrivate::~QNetworkReplyFileImplPrivate()
-{
- delete fileEngine;
-}
-
QNetworkReplyFileImpl::~QNetworkReplyFileImpl()
{
}
@@ -112,15 +107,15 @@ QNetworkReplyFileImpl::QNetworkReplyFileImpl(QObject *parent, const QNetworkRequ
return;
}
- d->fileEngine = QAbstractFileEngine::create(fileName);
- bool opened = d->fileEngine->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
+ d->realFile.setFileName(fileName);
+ bool opened = d->realFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
// could we open the file?
if (!opened) {
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend", "Error opening %1: %2")
- .arg(fileName, d->fileEngine->errorString());
+ .arg(d->realFile.fileName(), d->realFile.errorString());
- if (fi.exists()) {
+ if (d->realFile.exists()) {
setError(QNetworkReply::ContentAccessDenied, msg);
QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentAccessDenied));
@@ -133,13 +128,13 @@ QNetworkReplyFileImpl::QNetworkReplyFileImpl(QObject *parent, const QNetworkRequ
return;
}
- d->fileSize = fi.size();
setHeader(QNetworkRequest::LastModifiedHeader, fi.lastModified());
- setHeader(QNetworkRequest::ContentLengthHeader, d->fileSize);
+ d->realFileSize = fi.size();
+ setHeader(QNetworkRequest::ContentLengthHeader, d->realFileSize);
QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection,
- Q_ARG(qint64, d->fileSize), Q_ARG(qint64, d->fileSize));
+ Q_ARG(qint64, d->realFileSize), Q_ARG(qint64, d->realFileSize));
QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
}
@@ -147,25 +142,20 @@ void QNetworkReplyFileImpl::close()
{
Q_D(QNetworkReplyFileImpl);
QNetworkReply::close();
- if (d->fileEngine)
- d->fileEngine->close();
+ d->realFile.close();
}
void QNetworkReplyFileImpl::abort()
{
Q_D(QNetworkReplyFileImpl);
QNetworkReply::close();
- if (d->fileEngine)
- d->fileEngine->close();
+ d->realFile.close();
}
qint64 QNetworkReplyFileImpl::bytesAvailable() const
{
Q_D(const QNetworkReplyFileImpl);
- if (!d->fileEngine)
- return 0;
-
- return QNetworkReply::bytesAvailable() + d->fileSize - d->filePos;
+ return QNetworkReply::bytesAvailable() + d->realFile.bytesAvailable();
}
bool QNetworkReplyFileImpl::isSequential () const
@@ -176,7 +166,7 @@ bool QNetworkReplyFileImpl::isSequential () const
qint64 QNetworkReplyFileImpl::size() const
{
Q_D(const QNetworkReplyFileImpl);
- return d->fileSize;
+ return d->realFileSize;
}
/*!
@@ -185,17 +175,11 @@ qint64 QNetworkReplyFileImpl::size() const
qint64 QNetworkReplyFileImpl::readData(char *data, qint64 maxlen)
{
Q_D(QNetworkReplyFileImpl);
- if (!d->fileEngine)
+ qint64 ret = d->realFile.read(data, maxlen);
+ if (ret == 0 && bytesAvailable() == 0)
return -1;
-
- qint64 ret = d->fileEngine->read(data, maxlen);
- if (ret == 0 && bytesAvailable() == 0) {
- return -1; // everything had been read
- } else if (ret > 0) {
- d->filePos += ret;
- }
-
- return ret;
+ else
+ return ret;
}
diff --git a/src/network/access/qnetworkreplyfileimpl_p.h b/src/network/access/qnetworkreplyfileimpl_p.h
index 627363f..c5126de 100644
--- a/src/network/access/qnetworkreplyfileimpl_p.h
+++ b/src/network/access/qnetworkreplyfileimpl_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -86,11 +86,9 @@ class QNetworkReplyFileImplPrivate: public QNetworkReplyPrivate
{
public:
QNetworkReplyFileImplPrivate();
- ~QNetworkReplyFileImplPrivate();
- QAbstractFileEngine *fileEngine;
- qint64 fileSize;
- qint64 filePos;
+ QFile realFile;
+ qint64 realFileSize;
Q_DECLARE_PUBLIC(QNetworkReplyFileImpl)
};
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 41a6c62..485f449 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -57,7 +57,7 @@ Q_DECLARE_METATYPE(QSharedPointer<char>)
QT_BEGIN_NAMESPACE
inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate()
- : backend(0), outgoingData(0), outgoingDataBuffer(0),
+ : backend(0), outgoingData(0),
copyDevice(0),
cacheEnabled(false), cacheSaveDevice(0),
notificationHandlingPaused(false),
@@ -212,7 +212,7 @@ void QNetworkReplyImplPrivate::_q_bufferOutgoingData()
if (!outgoingDataBuffer) {
// first call, create our buffer
- outgoingDataBuffer = new QRingBuffer();
+ outgoingDataBuffer = QSharedPointer<QRingBuffer>(new QRingBuffer());
QObject::connect(outgoingData, SIGNAL(readyRead()), q, SLOT(_q_bufferOutgoingData()));
QObject::connect(outgoingData, SIGNAL(readChannelFinished()), q, SLOT(_q_bufferOutgoingDataFinished()));
@@ -306,20 +306,22 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const
// Internal code that does a HTTP reply for the synchronous Ajax
// in QtWebKit.
QVariant synchronousHttpAttribute = req.attribute(
- static_cast<QNetworkRequest::Attribute>(QNetworkRequest::DownloadBufferAttribute + 1));
- if (backend && synchronousHttpAttribute.toBool()) {
- backend->setSynchronous(true);
- if (outgoingData && outgoingData->isSequential()) {
- outgoingDataBuffer = new QRingBuffer();
- QByteArray data;
- do {
- data = outgoingData->readAll();
- if (data.isEmpty())
- break;
- outgoingDataBuffer->append(data);
- } while (1);
- }
+ static_cast<QNetworkRequest::Attribute>(QNetworkRequest::SynchronousRequestAttribute));
+ // The synchronous HTTP is a corner case, we will put all upload data in one big QByteArray in the outgoingDataBuffer.
+ // Yes, this is not the most efficient thing to do, but on the other hand synchronous XHR needs to die anyway.
+ if (synchronousHttpAttribute.toBool() && outgoingData) {
+ outgoingDataBuffer = QSharedPointer<QRingBuffer>(new QRingBuffer());
+ qint64 previousDataSize = 0;
+ do {
+ previousDataSize = outgoingDataBuffer->size();
+ outgoingDataBuffer->append(outgoingData->readAll());
+ } while (outgoingDataBuffer->size() != previousDataSize);
}
+
+ if (backend)
+ backend->setSynchronous(synchronousHttpAttribute.toBool());
+
+
if (outgoingData && backend && !backend->isSynchronous()) {
// there is data to be uploaded, e.g. HTTP POST.
@@ -349,10 +351,6 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const
}
}
} else {
- // No outgoing data (e.g. HTTP GET request)
- // or no backend
- // if no backend, _q_startOperation will handle the error of this
-
// for HTTP, we want to send out the request as fast as possible to the network, without
// invoking methods in a QueuedConnection
#ifndef QT_NO_HTTP
@@ -634,8 +632,9 @@ char* QNetworkReplyImplPrivate::getDownloadBuffer(qint64 size)
{
Q_Q(QNetworkReplyImpl);
- // Check attribute() if allocating a buffer of that size can be allowed
if (!downloadBuffer) {
+ // We are requested to create it
+ // Check attribute() if allocating a buffer of that size can be allowed
QVariant bufferAllocationPolicy = request.attribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute);
if (bufferAllocationPolicy.isValid() && bufferAllocationPolicy.toLongLong() >= size) {
downloadBufferCurrentSize = 0;
@@ -650,6 +649,18 @@ char* QNetworkReplyImplPrivate::getDownloadBuffer(qint64 size)
return downloadBuffer;
}
+void QNetworkReplyImplPrivate::setDownloadBuffer(QSharedPointer<char> sp, qint64 size)
+{
+ Q_Q(QNetworkReplyImpl);
+
+ downloadBufferPointer = sp;
+ downloadBuffer = downloadBufferPointer.data();
+ downloadBufferCurrentSize = 0;
+ downloadBufferMaximumSize = size;
+ q->setAttribute(QNetworkRequest::DownloadBufferAttribute, qVariantFromValue<QSharedPointer<char> > (downloadBufferPointer));
+}
+
+
void QNetworkReplyImplPrivate::appendDownstreamDataDownloadBuffer(qint64 bytesReceived, qint64 bytesTotal)
{
Q_Q(QNetworkReplyImpl);
@@ -746,6 +757,11 @@ void QNetworkReplyImplPrivate::finished()
void QNetworkReplyImplPrivate::error(QNetworkReplyImpl::NetworkError code, const QString &errorMessage)
{
Q_Q(QNetworkReplyImpl);
+ // Can't set and emit multiple errors.
+ if (errorCode != QNetworkReply::NoError) {
+ qWarning() << "QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.";
+ return;
+ }
errorCode = code;
q->setErrorString(errorMessage);
@@ -803,9 +819,6 @@ QNetworkReplyImpl::~QNetworkReplyImpl()
// save had been properly finished. So if it is still enabled it means we got deleted/aborted.
if (d->isCachingEnabled())
d->networkCache()->remove(url());
-
- if (d->outgoingDataBuffer)
- delete d->outgoingDataBuffer;
}
void QNetworkReplyImpl::abort()
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 238bee5..1a9ab7e 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -164,6 +164,7 @@ public:
void appendDownstreamData(QIODevice *data);
void appendDownstreamData(const QByteArray &data);
+ void setDownloadBuffer(QSharedPointer<char> sp, qint64 size);
char* getDownloadBuffer(qint64 size);
void appendDownstreamDataDownloadBuffer(qint64, qint64);
@@ -175,7 +176,7 @@ public:
QNetworkAccessBackend *backend;
QIODevice *outgoingData;
- QRingBuffer *outgoingDataBuffer;
+ QSharedPointer<QRingBuffer> outgoingDataBuffer;
QIODevice *copyDevice;
QAbstractNetworkCache *networkCache() const;
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index fc33e8d..a48a26f 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -226,6 +226,8 @@ QT_BEGIN_NAMESPACE
\omitvalue DownloadBufferAttribute
+ \omitvalue SynchronousRequestAttribute
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
@@ -529,8 +531,9 @@ QSslConfiguration QNetworkRequest::sslConfiguration() const
/*!
Sets this network request's SSL configuration to be \a config. The
settings that apply are the private key, the local certificate,
- the SSL protocol (SSLv2, SSLv3, TLSv1 where applicable) and the
- ciphers that the SSL backend is allowed to use.
+ the SSL protocol (SSLv2, SSLv3, TLSv1 where applicable), the CA
+ certificates and the ciphers that the SSL backend is allowed to
+ use.
By default, no SSL configuration is set, which allows the backends
to choose freely what configuration is best for them.
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index 586e6ff..b5ef109 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -84,9 +84,7 @@ public:
CookieSaveControlAttribute,
MaximumDownloadBufferSizeAttribute, // internal
DownloadBufferAttribute, // internal
-
- // (DownloadBufferAttribute + 1) is reserved internal for QSynchronousHttpNetworkReply
- // add the enum in 4.8
+ SynchronousRequestAttribute, // internal
User = 1000,
UserMax = 32767
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 9927f29..9e1eaea 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -52,21 +52,23 @@
QT_BEGIN_NAMESPACE
#define Q_GLOBAL_STATIC_QAPP_DESTRUCTION(TYPE, NAME) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
+ static QGlobalStatic<TYPE > this_##NAME \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
static void NAME##_cleanup() \
{ \
delete this_##NAME.pointer; \
this_##NAME.pointer = 0; \
- this_##NAME.destroyed = true; \
} \
static TYPE *NAME() \
{ \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
+ if (!this_##NAME.pointer) { \
TYPE *x = new TYPE; \
if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
delete x; \
- else \
+ else { \
qAddPostRoutine(NAME##_cleanup); \
+ this_##NAME.pointer->updateConfigurations(); \
+ } \
} \
return this_##NAME.pointer; \
}
@@ -75,15 +77,7 @@ Q_GLOBAL_STATIC_QAPP_DESTRUCTION(QNetworkConfigurationManagerPrivate, connManage
QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
{
- static bool initialized = false;
-
- QNetworkConfigurationManagerPrivate *m = connManager();
- if (!initialized) {
- initialized = true;
- m->updateConfigurations();
- }
-
- return m;
+ return connManager();
}
/*!
diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp
index 553410e..af60a43 100644
--- a/src/network/bearer/qnetworksession.cpp
+++ b/src/network/bearer/qnetworksession.cpp
@@ -680,7 +680,7 @@ void QNetworkSession::connectNotify(const char *signal)
//check for preferredConfigurationChanged() signal connect notification
//This is not required on all platforms
- if (QLatin1String(signal) == SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool)))
+ if (qstrcmp(signal, SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool))) == 0)
d->setALREnabled(true);
}
@@ -701,7 +701,7 @@ void QNetworkSession::disconnectNotify(const char *signal)
//check for preferredConfigurationChanged() signal disconnect notification
//This is not required on all platforms
- if (QLatin1String(signal) == SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool)))
+ if (qstrcmp(signal, SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool))) == 0)
d->setALREnabled(false);
}
diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h
index 59d048a..688f37e 100644
--- a/src/network/bearer/qnetworksession.h
+++ b/src/network/bearer/qnetworksession.h
@@ -142,13 +142,12 @@ private:
#ifndef QT_MOBILITY_BEARER
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QNetworkSession::State)
+Q_DECLARE_METATYPE(QNetworkSession::SessionError)
#else
QTM_END_NAMESPACE
#endif
-Q_DECLARE_METATYPE(QNetworkSession::State)
-Q_DECLARE_METATYPE(QNetworkSession::SessionError)
-
QT_END_HEADER
#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/network/bearer/qsharednetworksession.cpp b/src/network/bearer/qsharednetworksession.cpp
index 51b3a32..28ca173 100644
--- a/src/network/bearer/qsharednetworksession.cpp
+++ b/src/network/bearer/qsharednetworksession.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/network/bearer/qsharednetworksession_p.h b/src/network/bearer/qsharednetworksession_p.h
index dc84166..57b3a49 100644
--- a/src/network/bearer/qsharednetworksession_p.h
+++ b/src/network/bearer/qsharednetworksession_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 66e87c9..bd3e6ec 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -23,6 +23,7 @@ SOURCES += kernel/qauthenticator.cpp \
symbian: SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_symbian.cpp
unix:!symbian:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
win32:SOURCES += kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp
+integrity:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation
mac:SOURCES += kernel/qnetworkproxy_mac.cpp
diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp
index 03133d0..8e5db3c 100644
--- a/src/network/kernel/qnetworkinterface_symbian.cpp
+++ b/src/network/kernel/qnetworkinterface_symbian.cpp
@@ -43,7 +43,7 @@
#include "qnetworkinterface.h"
#include "qnetworkinterface_p.h"
-#include "../corelib/kernel/qcore_symbian_p.h"
+#include <private/qcore_symbian_p.h>
#ifndef QT_NO_NETWORKINTERFACE
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index ead9897..2a942cc 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2136,7 +2136,7 @@ qint64 QAbstractSocket::readData(char *data, qint64 maxSize)
qDebug("QAbstractSocket::readData(%p '%c (0x%.2x)', 1) == 1 [char buffer]",
data, isprint(int(uchar(*data))) ? *data : '?', *data);
#endif
- if (d->readBuffer.isEmpty() && d->socketEngine)
+ if (d->readBuffer.isEmpty() && d->socketEngine && d->socketEngine->isValid())
d->socketEngine->setReadNotificationEnabled(true);
return 1;
}
@@ -2148,7 +2148,8 @@ qint64 QAbstractSocket::readData(char *data, qint64 maxSize)
&& d->readBuffer.size() < maxSize
&& d->readBufferMaxSize > 0
&& maxSize < d->readBufferMaxSize
- && d->socketEngine) {
+ && d->socketEngine
+ && d->socketEngine->isValid()) {
// Our buffer is empty and a read() was requested for a byte amount that is smaller
// than the readBufferMaxSize. This means that we should fill our buffer since we want
// such small reads come from the buffer and not always go to the costly socket engine read()
@@ -2198,6 +2199,10 @@ qint64 QAbstractSocket::readData(char *data, qint64 maxSize)
if (!d->isBuffered) {
if (!d->socketEngine)
return -1; // no socket engine is probably EOF
+ if (!d->socketEngine->isValid())
+ return -1; // This is for unbuffered TCP when we already had been disconnected
+ if (d->state != QAbstractSocket::ConnectedState)
+ return -1; // This is for unbuffered TCP if we're not connected yet
qint64 readBytes = d->socketEngine->read(data, maxSize);
if (readBytes == -2) {
// -2 from the engine means no bytes available (EAGAIN) so read more later
@@ -2624,7 +2629,7 @@ void QAbstractSocket::setReadBufferSize(qint64 size)
// ensure that the read notification is enabled if we've now got
// room in the read buffer
// but only if we're not inside canReadNotification -- that will take care on its own
- if (size == 0 || d->readBuffer.size() < size)
+ if ((size == 0 || d->readBuffer.size() < size) && d->state == QAbstractSocket::ConnectedState) // Do not change the notifier unless we are connected.
d->socketEngine->setReadNotificationEnabled(true);
}
}
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 4e628f3..6a025f2 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -743,7 +743,10 @@ void QHttpSocketEngine::emitReadNotification()
{
Q_D(QHttpSocketEngine);
d->readNotificationActivated = true;
- if (d->readNotificationEnabled && !d->readNotificationPending) {
+ // if there is a connection notification pending we have to emit the readNotification
+ // incase there is connection error. This is only needed for Windows, but it does not
+ // hurt in other cases.
+ if ((d->readNotificationEnabled && !d->readNotificationPending) || d->connectionNotificationPending) {
d->readNotificationPending = true;
QMetaObject::invokeMethod(this, "emitPendingReadNotification", Qt::QueuedConnection);
}
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 8fa4b92..9a2b0ba 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -346,7 +346,7 @@ QLocalSocket::QLocalSocket(QObject * parent)
QLocalSocket::~QLocalSocket()
{
close();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP)
Q_D(QLocalSocket);
d->unixSocket.setParent(0);
#endif
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 76c9158..940569a 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -337,15 +337,17 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
}
#if !defined(Q_OS_WINCE)
- // enable new behavior using
- // SIO_UDP_CONNRESET
- DWORD dwBytesReturned = 0;
- int bNewBehavior = 1;
- if (::WSAIoctl(socket, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior),
- NULL, 0, &dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
- // not to worry isBogusUdpReadNotification() should handle this otherwise
- int err = WSAGetLastError();
- WS_ERROR_DEBUG(err);
+ if (socketType == QAbstractSocket::UdpSocket) {
+ // enable new behavior using
+ // SIO_UDP_CONNRESET
+ DWORD dwBytesReturned = 0;
+ int bNewBehavior = 1;
+ if (::WSAIoctl(socket, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior),
+ NULL, 0, &dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
+ // not to worry isBogusUdpReadNotification() should handle this otherwise
+ int err = WSAGetLastError();
+ WS_ERROR_DEBUG(err);
+ }
}
#endif
@@ -639,6 +641,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
socketState = QAbstractSocket::UnconnectedState;
break;
}
+ if (value == WSAEADDRNOTAVAIL) {
+ setError(QAbstractSocket::NetworkError, AddressNotAvailableErrorString);
+ socketState = QAbstractSocket::UnconnectedState;
+ break;
+ }
}
// fall through
}
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index 2bafe13..3ccc8e0 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -43,3 +43,13 @@ wince*: {
DEFINES += QT_LOCALSOCKET_TCP
}
+
+integrity: {
+ SOURCES -= socket/qlocalsocket_unix.cpp \
+ socket/qlocalserver_unix.cpp
+ SOURCES += socket/qlocalsocket_tcp.cpp \
+ socket/qlocalserver_tcp.cpp \
+ socket/qnativesocketengine_unix.cpp
+
+ DEFINES += QT_LOCALSOCKET_TCP
+}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 4252123..61f27fe 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -143,6 +143,15 @@
setDefaultCaCertificates().
\endlist
+ \note If available, root certificates on Unix (excluding Mac OS X) will be
+ loaded on demand from the standard certificate directories. If
+ you do not want to load root certificates on demand, you need to call either
+ the static function setDefaultCaCertificates() before the first SSL handshake
+ is made in your application, (e.g. via
+ "QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());"),
+ or call setCaCertificates() on your QSslSocket instance prior to the SSL
+ handshake.
+
For more information about ciphers and certificates, refer to QSslCipher and
QSslCertificate.
@@ -1249,6 +1258,7 @@ void QSslSocket::setCaCertificates(const QList<QSslCertificate> &certificates)
{
Q_D(QSslSocket);
d->configuration.caCertificates = certificates;
+ d->allowRootCertOnDemandLoading = false;
}
/*!
@@ -1258,6 +1268,9 @@ void QSslSocket::setCaCertificates(const QList<QSslCertificate> &certificates)
handshake with addCaCertificate(), addCaCertificates(), and
setCaCertificates().
+ \note On Unix, this method may return an empty list if the root
+ certificates are loaded on demand.
+
\sa addCaCertificate(), addCaCertificates(), setCaCertificates()
*/
QList<QSslCertificate> QSslSocket::caCertificates() const
@@ -1311,10 +1324,9 @@ void QSslSocket::addDefaultCaCertificates(const QList<QSslCertificate> &certific
/*!
Sets the default CA certificate database to \a certificates. The
default CA certificate database is originally set to your system's
- default CA certificate database. If no system default database is
- found, Qt will provide its own default database. You can override
- the default CA certificate database with your own CA certificate
- database using this function.
+ default CA certificate database. You can override the default CA
+ certificate database with your own CA certificate database using
+ this function.
Each SSL socket's CA certificate database is initialized to the
default CA certificate database.
@@ -1336,6 +1348,9 @@ void QSslSocket::setDefaultCaCertificates(const QList<QSslCertificate> &certific
Each SSL socket's CA certificate database is initialized to the
default CA certificate database.
+ \note On Unix, this method may return an empty list if the root
+ certificates are loaded on demand.
+
\sa caCertificates()
*/
QList<QSslCertificate> QSslSocket::defaultCaCertificates()
@@ -1803,6 +1818,7 @@ QSslSocketPrivate::QSslSocketPrivate()
, connectionEncrypted(false)
, ignoreAllSslErrors(false)
, readyReadEmittedPointer(0)
+ , allowRootCertOnDemandLoading(true)
, plainSocket(0)
{
QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration);
@@ -1879,6 +1895,7 @@ void QSslSocketPrivate::setDefaultSupportedCiphers(const QList<QSslCipher> &ciph
*/
QList<QSslCertificate> QSslSocketPrivate::defaultCaCertificates()
{
+ // ### Qt5: rename everything containing "caCertificates" to "rootCertificates" or similar
QSslSocketPrivate::ensureInitialized();
QMutexLocker locker(&globalData()->mutex);
return globalData()->config->caCertificates;
@@ -1893,6 +1910,9 @@ void QSslSocketPrivate::setDefaultCaCertificates(const QList<QSslCertificate> &c
QMutexLocker locker(&globalData()->mutex);
globalData()->config.detach();
globalData()->config->caCertificates = certs;
+ // when the certificates are set explicitly, we do not want to
+ // load the system certificates on demand
+ s_loadRootCertsOnDemand = false;
}
/*!
@@ -2192,6 +2212,20 @@ void QSslSocketPrivate::_q_flushReadBuffer()
transmit();
}
+/*!
+ \internal
+*/
+QList<QByteArray> QSslSocketPrivate::unixRootCertDirectories()
+{
+ return QList<QByteArray>() << "/etc/ssl/certs/" // (K)ubuntu, OpenSUSE, Mandriva, MeeGo ...
+ << "/usr/lib/ssl/certs/" // Gentoo, Mandrake
+ << "/usr/share/ssl/" // Centos, Redhat, SuSE
+ << "/usr/local/ssl/" // Normal OpenSSL Tarball
+ << "/var/ssl/certs/" // AIX
+ << "/usr/local/ssl/certs/" // Solaris
+ << "/opt/openssl/certs/"; // HP-UX
+}
+
QT_END_NAMESPACE
// For private slots
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 7d21bd3..83714ed 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -80,6 +80,7 @@ QT_BEGIN_NAMESPACE
bool QSslSocketPrivate::s_libraryLoaded = false;
bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
/* \internal
@@ -317,6 +318,13 @@ init_context:
q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
}
+ if (s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
+ // tell OpenSSL the directories where to look up the root certs on demand
+ QList<QByteArray> unixDirs = unixRootCertDirectories();
+ for (int a = 0; a < unixDirs.count(); ++a)
+ q_SSL_CTX_load_verify_locations(ctx, 0, unixDirs.at(a).constData());
+ }
+
// Register a custom callback to get all verification errors.
X509_STORE_set_verify_cb_func(ctx->cert_store, q_X509Callback);
@@ -517,8 +525,22 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
} else {
qWarning("could not load crypt32 library"); // should never happen
}
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_MAC)
+ // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
+ QList<QByteArray> dirs = unixRootCertDirectories();
+ QStringList symLinkFilter;
+ symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
+ for (int a = 0; a < dirs.count(); ++a) {
+ QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
+ if (iterator.hasNext()) {
+ s_loadRootCertsOnDemand = true;
+ break;
+ }
+ }
#endif
- setDefaultCaCertificates(systemCaCertificates());
+ // if on-demand loading was not enabled, load the certs now
+ if (!s_loadRootCertsOnDemand)
+ setDefaultCaCertificates(systemCaCertificates());
}
/*!
@@ -780,6 +802,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
systemCerts.append(QSslCertificate::fromData(rawCert, QSsl::Der));
}
}
+ CFRelease(cfCerts);
}
else {
// no detailed error handling here
@@ -813,15 +836,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
}
#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QSet<QString> certFiles;
- QList<QByteArray> directories;
- directories << "/etc/ssl/certs/"; // (K)ubuntu, OpenSUSE, Mandriva, MeeGo ...
- directories << "/usr/lib/ssl/certs/"; // Gentoo, Mandrake
- directories << "/usr/share/ssl/"; // Centos, Redhat, SuSE
- directories << "/usr/local/ssl/"; // Normal OpenSSL Tarball
- directories << "/var/ssl/certs/"; // AIX
- directories << "/usr/local/ssl/certs/"; // Solaris
- directories << "/opt/openssl/certs/"; // HP-UX
-
+ QList<QByteArray> directories = unixRootCertDirectories();
QDir currentDir;
QStringList nameFilters;
nameFilters << QLatin1String("*.pem") << QLatin1String("*.crt");
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 38598b6..b9a05f3 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -262,6 +262,7 @@ DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c,
#endif
DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
+DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
#ifdef Q_OS_SYMBIAN
#define RESOLVEFUNC(func, ordinal, lib) \
@@ -630,6 +631,7 @@ bool q_resolveOpenSslSymbols()
#endif
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf, 1153, libs.second )
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf, 1152, libs.second )
+ RESOLVEFUNC(SSL_CTX_load_verify_locations, 34, libs.second )
#else // Q_OS_SYMBIAN
#ifdef SSLEAY_MACROS
RESOLVEFUNC(ASN1_dup)
@@ -754,6 +756,7 @@ bool q_resolveOpenSslSymbols()
#endif
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
+ RESOLVEFUNC(SSL_CTX_load_verify_locations)
#endif // Q_OS_SYMBIAN
symbolsResolved = true;
delete libs.first;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 954ffba..c05dfe11 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -412,6 +412,7 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
#endif
void q_OPENSSL_add_all_algorithms_noconf();
void q_OPENSSL_add_all_algorithms_conf();
+int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
// Helper function
class QDateTime;
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 3a14488..7b92f95 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -112,6 +112,8 @@ public:
// that was used for connecting to.
QString verificationPeerName;
+ bool allowRootCertOnDemandLoading;
+
static bool supportsSsl();
static void ensureInitialized();
static void deinitialize();
@@ -168,6 +170,9 @@ private:
static bool s_libraryLoaded;
static bool s_loadedCiphersAndCerts;
+protected:
+ static bool s_loadRootCertsOnDemand;
+ static QList<QByteArray> unixRootCertDirectories();
};
QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qglshadercache_meego_p.h b/src/opengl/gl2paintengineex/qglshadercache_meego_p.h
index 5f51fc2..d20c731 100644
--- a/src/opengl/gl2paintengineex/qglshadercache_meego_p.h
+++ b/src/opengl/gl2paintengineex/qglshadercache_meego_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/gl2paintengineex/qglshadercache_p.h b/src/opengl/gl2paintengineex/qglshadercache_p.h
index 29616ae..6e496ab 100644
--- a/src/opengl/gl2paintengineex/qglshadercache_p.h
+++ b/src/opengl/gl2paintengineex/qglshadercache_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index bbb75bc..fa38b5d 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1623,8 +1623,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
if (c.isNull())
continue;
- int x = staticTextItem->glyphPositions[i].x.toInt() + c.baseLineX - margin;
- int y = staticTextItem->glyphPositions[i].y.toInt() - c.baseLineY - margin;
+ int x = qFloor(staticTextItem->glyphPositions[i].x) + c.baseLineX - margin;
+ int y = qFloor(staticTextItem->glyphPositions[i].y) - c.baseLineY - margin;
vertexCoordinates->addQuad(QRectF(x, y, c.w, c.h));
textureCoordinates->addQuad(QRectF(c.x*dx, c.y*dy, c.w * dx, c.h * dy));
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 0ec3a15..76621e9 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1791,7 +1791,7 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo
QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
{
- QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32
+ QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied
: QImage::Format_RGB32);
int w = size.width();
int h = size.height();
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 0f4b305..f7991b7 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index 8a544c1..29e32ff 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index 88f43c0..44d9bad 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/qglpixelbuffer_stub.cpp b/src/opengl/qglpixelbuffer_stub.cpp
index 2caef6b..98203fd 100644
--- a/src/opengl/qglpixelbuffer_stub.cpp
+++ b/src/opengl/qglpixelbuffer_stub.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp
index 79911fb..3574756 100644
--- a/src/opengl/qgraphicssystem_gl.cpp
+++ b/src/opengl/qgraphicssystem_gl.cpp
@@ -53,6 +53,10 @@
#include "private/qwindowsurface_x11gl_p.h"
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <QtGui/private/qapplication_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
extern QGLWidget *qt_gl_getShareWidget();
@@ -86,6 +90,14 @@ QWindowSurface *QGLGraphicsSystem::createWindowSurface(QWidget *widget) const
}
#endif
+#if defined(Q_OS_SYMBIAN)
+ if (!QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ QWidgetPrivate *d = qt_widget_private(widget);
+ if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
+ return d->createDefaultWindowSurface_sys();
+ }
+#endif
+
return new QGLWindowSurface(widget);
}
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 04de1bd..db9f8c8 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE
-extern const QGLContext* qt_gl_share_context();
+Q_OPENGL_EXPORT extern const QGLContext* qt_gl_share_context();
/*!
\class QGLFramebufferObjectPool
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index cdd3eb9..21b2f09 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -825,11 +825,7 @@ void QGLWindowSurface::updateGeometry() {
ctx->updatePaintDevice();
#endif
-#ifdef Q_WS_QPA
- QSize surfSize = size();
-#else
QSize surfSize = geometry().size();
-#endif
if (surfSize.width() <= 0 || surfSize.height() <= 0)
return;
diff --git a/src/opengl/util/meego/main.cpp b/src/opengl/util/meego/main.cpp
index 5522855..65d6e57 100644
--- a/src/opengl/util/meego/main.cpp
+++ b/src/opengl/util/meego/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index a15f0c3..3d50558 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -2201,6 +2201,12 @@ void QVGPaintEngine::updateScissor()
#if defined(QVG_SCISSOR_CLIP)
// Using the scissor to do clipping, so combine the systemClip
// with the current painting clipRegion.
+
+ if (d->maskValid) {
+ vgSeti(VG_MASKING, VG_FALSE);
+ d->maskValid = false;
+ }
+
QVGPainterState *s = state();
if (s->clipEnabled) {
if (region.isEmpty())
@@ -2250,8 +2256,33 @@ void QVGPaintEngine::updateScissor()
QVector<QRect> rects = region.rects();
int count = rects.count();
- if (count > d->maxScissorRects)
- count = d->maxScissorRects;
+ if (count > d->maxScissorRects) {
+#if !defined(QVG_SCISSOR_CLIP)
+ count = d->maxScissorRects;
+#else
+ // Use masking
+ int width = paintDevice()->width();
+ int height = paintDevice()->height();
+ vgMask(VG_INVALID_HANDLE, VG_CLEAR_MASK,
+ 0, 0, width, height);
+ for (int i = 0; i < rects.size(); ++i) {
+ vgMask(VG_INVALID_HANDLE, VG_FILL_MASK,
+ rects[i].x(), height - rects[i].y() - rects[i].height(),
+ rects[i].width(), rects[i].height());
+ }
+
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgSeti(VG_MASKING, VG_TRUE);
+ d->maskValid = true;
+ d->maskIsSet = false;
+ d->scissorMask = false;
+ d->scissorActive = false;
+ d->scissorDirty = false;
+ d->scissorRegion = region;
+ return;
+#endif
+ }
+
QVarLengthArray<VGint> params(count * 4);
int height = paintDevice()->height();
for (int i = 0; i < count; ++i) {
@@ -2302,6 +2333,7 @@ bool QVGPaintEngine::isDefaultClipRect(const QRect& rect)
void QVGPaintEngine::clipEnabledChanged()
{
#if defined(QVG_SCISSOR_CLIP)
+ vgSeti(VG_MASKING, VG_FALSE); // disable mask fallback
updateScissor();
#else
Q_D(QVGPaintEngine);
@@ -3103,9 +3135,13 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF
if (pm.size().width() <= screenSize.width()
&& pm.size().height() <= screenSize.height())
vgpd->failedToAlloc = false;
- }
- drawImage(r, *(pd->buffer()), sr, Qt::AutoColor);
+ vgpd->source.beginDataAccess();
+ drawImage(r, vgpd->source.imageRef(), sr, Qt::AutoColor);
+ vgpd->source.endDataAccess(true);
+ } else {
+ drawImage(r, *(pd->buffer()), sr, Qt::AutoColor);
+ }
}
void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
@@ -3131,9 +3167,13 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
if (pm.size().width() <= screenSize.width()
&& pm.size().height() <= screenSize.height())
vgpd->failedToAlloc = false;
- }
- drawImage(pos, *(pd->buffer()));
+ vgpd->source.beginDataAccess();
+ drawImage(pos, vgpd->source.imageRef());
+ vgpd->source.endDataAccess();
+ } else {
+ drawImage(pos, *(pd->buffer()));
+ }
}
void QVGPaintEngine::drawImage
@@ -3979,6 +4019,8 @@ VGImageFormat qt_vg_image_to_vg_format(QImage::Format format)
switch (format) {
case QImage::Format_MonoLSB:
return VG_BW_1;
+ case QImage::Format_Indexed8:
+ return VG_sL_8;
case QImage::Format_ARGB32_Premultiplied:
return VG_sARGB_8888_PRE;
case QImage::Format_RGB32:
@@ -3989,7 +4031,8 @@ VGImageFormat qt_vg_image_to_vg_format(QImage::Format format)
return VG_sRGB_565;
case QImage::Format_ARGB4444_Premultiplied:
return VG_sARGB_4444;
- default: break;
+ default:
+ break;
}
return VG_sARGB_8888; // XXX
}
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 85583cc..1e9103b 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-class QFixedPoint;
+struct QFixedPoint;
class QVGPaintEnginePrivate;
class QPixmapData;
class QVGEGLWindowSurfacePrivate;
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 732b484..3f67c79 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -50,6 +50,7 @@
#include <QBuffer>
#include <QImageReader>
#include <QtGui/private/qimage_p.h>
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
QT_BEGIN_NAMESPACE
@@ -66,11 +67,15 @@ QVGPixmapData::QVGPixmapData(PixelType type)
inImagePool = false;
inLRU = false;
failedToAlloc = false;
+#if defined(Q_OS_SYMBIAN)
+ nativeImageHandleProvider = 0;
+ nativeImageHandle = 0;
+#endif
#if !defined(QT_NO_EGL)
context = 0;
qt_vg_register_pixmap(this);
#endif
- setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
}
QVGPixmapData::~QVGPixmapData()
@@ -98,6 +103,10 @@ void QVGPixmapData::destroyImages()
vgImage = VG_INVALID_HANDLE;
vgImageOpacity = VG_INVALID_HANDLE;
inImagePool = false;
+
+#if defined(Q_OS_SYMBIAN)
+ releaseNativeImageHandle();
+#endif
}
void QVGPixmapData::destroyImageAndContext()
@@ -105,6 +114,8 @@ void QVGPixmapData::destroyImageAndContext()
if (vgImage != VG_INVALID_HANDLE) {
// We need to have a context current to destroy the image.
#if !defined(QT_NO_EGL)
+ if (!context)
+ context = qt_vg_create_context(0, QInternal::Pixmap);
if (context->isCurrent()) {
destroyImages();
} else {
@@ -118,6 +129,10 @@ void QVGPixmapData::destroyImageAndContext()
#else
destroyImages();
#endif
+ } else {
+#if defined(Q_OS_SYMBIAN)
+ releaseNativeImageHandle();
+#endif
}
#if !defined(QT_NO_EGL)
if (context) {
@@ -138,25 +153,31 @@ bool QVGPixmapData::isValid() const
return (w > 0 && h > 0);
}
+void QVGPixmapData::updateSerial()
+{
+ setSerialNumber(++qt_vg_pixmap_serial);
+}
+
void QVGPixmapData::resize(int wid, int ht)
{
- if (w == wid && h == ht)
+ if (w == wid && h == ht) {
+ updateSerial();
return;
+ }
w = wid;
h = ht;
d = 32; // We always use ARGB_Premultiplied for VG pixmaps.
is_null = (w <= 0 || h <= 0);
- source = QImage();
+ source = QVolatileImage();
recreate = true;
- setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
}
-void QVGPixmapData::fromImage
- (const QImage &image, Qt::ImageConversionFlags flags)
+void QVGPixmapData::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
{
- if(image.isNull())
+ if (image.isNull())
return;
QImage img = image;
@@ -200,33 +221,34 @@ bool QVGPixmapData::fromData(const uchar *buffer, uint len, const char *format,
return !isNull();
}
-/*!
- out-of-place conversion (inPlace == false) will always detach()
- */
-void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+QImage::Format QVGPixmapData::idealFormat(QImage *image, Qt::ImageConversionFlags flags) const
{
- if (image.size() == QSize(w, h))
- setSerialNumber(++qt_vg_pixmap_serial);
- else
- resize(image.width(), image.height());
-
QImage::Format format = sourceFormat();
- int d = image.depth();
- if (d == 1 || d == 16 || d == 24 || (d == 32 && !image.hasAlphaChannel()))
+ int d = image->depth();
+ if (d == 1 || d == 16 || d == 24 || (d == 32 && !image->hasAlphaChannel()))
format = QImage::Format_RGB32;
- else if (!(flags & Qt::NoOpaqueDetection) && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())
+ else if (!(flags & Qt::NoOpaqueDetection) && image->data_ptr()->checkForAlphaPixels())
format = sourceFormat();
else
- format = image.hasAlphaChannel() ? sourceFormat() : QImage::Format_RGB32;
+ format = image->hasAlphaChannel() ? sourceFormat() : QImage::Format_RGB32;
+ return format;
+}
+
+void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+{
+ resize(image.width(), image.height());
+
+ QImage::Format format = idealFormat(&image, flags);
if (inPlace && image.data_ptr()->convertInPlace(format, flags)) {
- source = image;
+ source = QVolatileImage(image);
} else {
- source = image.convertToFormat(format);
-
- // convertToFormat won't detach the image if format stays the same.
- if (image.format() == format)
- source.detach();
+ QImage convertedImage = image.convertToFormat(format);
+ // convertToFormat won't detach the image if format stays the
+ // same. Detaching is needed to prevent issues with painting
+ // onto this QPixmap later on.
+ convertedImage.detach();
+ source = QVolatileImage(convertedImage);
}
recreate = true;
@@ -236,27 +258,23 @@ void QVGPixmapData::fill(const QColor &color)
{
if (!isValid())
return;
-
- if (source.isNull())
- source = QImage(w, h, sourceFormat());
-
+ forceToImage();
if (source.depth() == 1) {
// Pick the best approximate color in the image's colortable.
int gray = qGray(color.rgba());
- if (qAbs(qGray(source.color(0)) - gray) < qAbs(qGray(source.color(1)) - gray))
+ if (qAbs(qGray(source.imageRef().color(0)) - gray)
+ < qAbs(qGray(source.imageRef().color(1)) - gray))
source.fill(0);
else
source.fill(1);
} else {
source.fill(PREMUL(color.rgba()));
}
-
- // Re-upload the image to VG the next time toVGImage() is called.
- recreate = true;
}
bool QVGPixmapData::hasAlphaChannel() const
{
+ ensureReadback(true);
if (!source.isNull())
return source.hasAlphaChannel();
else
@@ -265,27 +283,52 @@ bool QVGPixmapData::hasAlphaChannel() const
void QVGPixmapData::setAlphaChannel(const QPixmap &alphaChannel)
{
+ if (!isValid())
+ return;
forceToImage();
- source.setAlphaChannel(alphaChannel.toImage());
+ source.setAlphaChannel(alphaChannel);
}
QImage QVGPixmapData::toImage() const
{
if (!isValid())
return QImage();
-
+ ensureReadback(true);
if (source.isNull()) {
- source = QImage(w, h, sourceFormat());
+ source = QVolatileImage(w, h, sourceFormat());
recreate = true;
}
+ return source.toImage();
+}
- return source;
+void QVGPixmapData::copy(const QPixmapData *data, const QRect &rect)
+{
+ // toImage() is potentially expensive with QVolatileImage so provide a
+ // more efficient implementation of copy() that does not rely on it.
+ if (!data) {
+ return;
+ }
+ if (data->classId() != OpenVGClass) {
+ fromImage(data->toImage(rect), Qt::NoOpaqueDetection);
+ return;
+ }
+ const QVGPixmapData *pd = static_cast<const QVGPixmapData *>(data);
+ QRect r = rect;
+ if (r.isNull() || r.contains(QRect(0, 0, pd->w, pd->h))) {
+ r = QRect(0, 0, pd->w, pd->h);
+ }
+ resize(r.width(), r.height());
+ recreate = true;
+ if (!pd->source.isNull()) {
+ source = QVolatileImage(r.width(), r.height(), pd->source.format());
+ source.copyFrom(&pd->source, r);
+ }
}
QImage *QVGPixmapData::buffer()
{
- forceToImage();
- return &source;
+ // Cannot be safely implemented and QVGPixmapData is not (must not be) RasterClass anyway.
+ return 0;
}
QPaintEngine* QVGPixmapData::paintEngine() const
@@ -313,6 +356,12 @@ VGImage QVGPixmapData::toVGImage()
else if (recreate)
cachedOpacity = -1.0f; // Force opacity image to be refreshed later.
+#if defined(Q_OS_SYMBIAN)
+ if (recreate && nativeImageHandleProvider && !nativeImageHandle) {
+ createFromNativeImageHandleProvider();
+ }
+#endif
+
if (vgImage == VG_INVALID_HANDLE) {
vgImage = QVGImagePool::instance()->createImageForPixmap
(qt_vg_image_to_vg_format(source.format()), w, h, VG_IMAGE_QUALITY_FASTER, this);
@@ -329,10 +378,12 @@ VGImage QVGPixmapData::toVGImage()
}
if (!source.isNull() && recreate) {
+ source.beginDataAccess();
vgImageSubData
(vgImage,
source.constBits(), source.bytesPerLine(),
qt_vg_image_to_vg_format(source.format()), 0, 0, w, h);
+ source.endDataAccess(true);
}
recreate = false;
@@ -395,9 +446,16 @@ void QVGPixmapData::detachImageFromPool()
void QVGPixmapData::hibernate()
{
- // If the image was imported (e.g, from an SgImage under Symbian),
- // then we cannot copy it back to main memory for storage.
- if (vgImage != VG_INVALID_HANDLE && source.isNull())
+ // If the image was imported (e.g, from an SgImage under Symbian), then
+ // skip the hibernation, there is no sense in copying it back to main
+ // memory because the data is most likely shared between several processes.
+ bool skipHibernate = (vgImage != VG_INVALID_HANDLE && source.isNull());
+#if defined(Q_OS_SYMBIAN)
+ // However we have to proceed normally if the image was retrieved via
+ // a handle provider.
+ skipHibernate &= !nativeImageHandleProvider;
+#endif
+ if (skipHibernate)
return;
forceToImage();
@@ -442,18 +500,47 @@ int QVGPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
}
}
-// Force the pixmap data to be in QImage format.
+// Ensures that the pixmap is backed by some valid data and forces the data to
+// be re-uploaded to the VGImage when toVGImage() is called next time.
void QVGPixmapData::forceToImage()
{
if (!isValid())
return;
+ ensureReadback(false);
+
if (source.isNull())
- source = QImage(w, h, sourceFormat());
+ source = QVolatileImage(w, h, sourceFormat());
recreate = true;
}
+void QVGPixmapData::ensureReadback(bool readOnly) const
+{
+ if (vgImage != VG_INVALID_HANDLE && source.isNull()) {
+ source = QVolatileImage(w, h, sourceFormat());
+ source.beginDataAccess();
+ vgGetImageSubData(vgImage, source.bits(), source.bytesPerLine(),
+ qt_vg_image_to_vg_format(source.format()),
+ 0, 0, w, h);
+ source.endDataAccess();
+ if (readOnly) {
+ recreate = false;
+ } else {
+ // Once we did a readback, the original VGImage must be destroyed
+ // because it may be shared (e.g. created via SgImage) and a subsequent
+ // upload of the image data may produce unexpected results.
+ const_cast<QVGPixmapData *>(this)->destroyImages();
+#if defined(Q_OS_SYMBIAN)
+ // There is now an own copy of the data so drop the handle provider,
+ // otherwise toVGImage() would request the handle again, which is wrong.
+ nativeImageHandleProvider = 0;
+#endif
+ recreate = true;
+ }
+ }
+}
+
QImage::Format QVGPixmapData::sourceFormat() const
{
return QImage::Format_ARGB32_Premultiplied;
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index 58e69db..15ff889 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -54,7 +54,8 @@
//
#include <QtGui/private/qpixmap_raster_p.h>
-#include <private/qvg_p.h>
+#include <QtGui/private/qvolatileimage_p.h>
+#include "qvg_p.h"
#if defined(Q_OS_SYMBIAN)
class RSGImage;
@@ -75,6 +76,8 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd);
void qt_vg_hibernate_pixmaps(QVGSharedContext *context);
#endif
+class QNativeImageHandleProvider;
+
class Q_OPENVG_EXPORT QVGPixmapData : public QPixmapData
{
public:
@@ -99,6 +102,7 @@ public:
bool hasAlphaChannel() const;
void setAlphaChannel(const QPixmap &alphaChannel);
QImage toImage() const;
+ void copy(const QPixmapData *data, const QRect &rect);
QImage *buffer();
QPaintEngine* paintEngine() const;
@@ -124,11 +128,21 @@ public:
// VGImage objects to reuse storage.
virtual void reclaimImages();
+ // If vgImage is valid but source is null, copies pixel data from GPU back
+ // into main memory and destroys vgImage. For a normal pixmap this function
+ // does nothing, however if the pixmap was created directly from a VGImage
+ // (e.g. via SgImage on Symbian) then by doing the readback this ensures
+ // that QImage-based functions can operate too.
+ virtual void ensureReadback(bool readOnly) const;
+
QSize size() const { return QSize(w, h); }
#if defined(Q_OS_SYMBIAN)
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
+ bool initFromNativeImageHandle(void *handle, const QString &type);
+ void createFromNativeImageHandleProvider();
+ void releaseNativeImageHandle();
#endif
protected:
@@ -161,15 +175,23 @@ protected:
VGImage vgImage;
VGImage vgImageOpacity;
qreal cachedOpacity;
- mutable QImage source;
+ mutable QVolatileImage source;
mutable bool recreate;
bool inImagePool;
#if !defined(QT_NO_EGL)
mutable QEglContext *context;
#endif
+#if defined(Q_OS_SYMBIAN)
+ mutable QNativeImageHandleProvider *nativeImageHandleProvider;
+ void *nativeImageHandle;
+ QString nativeImageType;
+#endif
+
void forceToImage();
QImage::Format sourceFormat() const;
+ QImage::Format idealFormat(QImage *image, Qt::ImageConversionFlags flags) const;
+ void updateSerial();
void destroyImageAndContext();
void destroyImages();
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp
index ff0ab13..2924d41 100644
--- a/src/openvg/qvg_symbian.cpp
+++ b/src/openvg/qvg_symbian.cpp
@@ -41,10 +41,10 @@
#include "qpixmapdata_vg_p.h"
#include "qvgfontglyphcache_p.h"
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
#include <private/qt_s60_p.h>
#include <fbs.h>
-#include <bitdev.h>
#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
# include <sgresource/sgimage.h>
@@ -75,34 +75,6 @@ VGImage QVG::vgCreateEGLImageTargetKHR(VGeglImageKHR eglImage)
extern int qt_vg_pixmap_serial;
-static CFbsBitmap* createBlitCopy(CFbsBitmap* bitmap)
-{
- CFbsBitmap *copy = new CFbsBitmap;
- Q_CHECK_PTR(copy);
- if(!copy)
- return 0;
-
- if (copy->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()) != KErrNone) {
- delete copy;
- copy = 0;
-
- return 0;
- }
-
- CFbsBitmapDevice* bitmapDevice = 0;
- CFbsBitGc *bitmapGc = 0;
- QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(copy));
- QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
- bitmapGc->Activate(bitmapDevice);
-
- bitmapGc->BitBlt(TPoint(), bitmap);
-
- delete bitmapGc;
- delete bitmapDevice;
-
- return copy;
-}
-
#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
static VGImage sgImageToVGImage(QEglContext *context, const RSgImage &sgImage)
{
@@ -137,7 +109,59 @@ void QVGPixmapData::cleanup()
{
is_null = w = h = 0;
recreate = false;
- source = QImage();
+ source = QVolatileImage();
+}
+
+bool QVGPixmapData::initFromNativeImageHandle(void *handle, const QString &type)
+{
+ if (type == QLatin1String("RSgImage")) {
+ fromNativeType(handle, QPixmapData::SgImage);
+ return true;
+ } else if (type == QLatin1String("CFbsBitmap")) {
+ fromNativeType(handle, QPixmapData::FbsBitmap);
+ return true;
+ }
+ return false;
+}
+
+void QVGPixmapData::createFromNativeImageHandleProvider()
+{
+ void *handle = 0;
+ QString type;
+ nativeImageHandleProvider->get(&handle, &type);
+ if (handle) {
+ if (initFromNativeImageHandle(handle, type)) {
+ nativeImageHandle = handle;
+ nativeImageType = type;
+ } else {
+ qWarning("QVGPixmapData: Unknown native image type '%s'", qPrintable(type));
+ }
+ } else {
+ qWarning("QVGPixmapData: Native handle is null");
+ }
+}
+
+void QVGPixmapData::releaseNativeImageHandle()
+{
+ if (nativeImageHandleProvider && nativeImageHandle) {
+ nativeImageHandleProvider->release(nativeImageHandle, nativeImageType);
+ nativeImageHandle = 0;
+ nativeImageType = QString();
+ }
+}
+
+static inline bool conversionLessFormat(QImage::Format format)
+{
+ switch (format) {
+ case QImage::Format_RGB16: // EColor64K
+ case QImage::Format_RGB32: // EColor16MU
+ case QImage::Format_ARGB32: // EColor16MA
+ case QImage::Format_ARGB32_Premultiplied: // EColor16MAP
+ case QImage::Format_Indexed8: // EGray256, EColor256
+ return true;
+ default:
+ return false;
+ }
}
void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
@@ -156,55 +180,35 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
}
is_null = (w <= 0 || h <= 0);
- source = QImage(); // vgGetImageSubData() some day?
+ source = QVolatileImage(); // readback will be done later, only when needed
recreate = false;
prevSize = QSize(w, h);
- //setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
#endif
- } else if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
-
- bool deleteSourceBitmap = false;
-#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
-
- // Rasterize extended bitmaps
-
- TUid extendedBitmapType = bitmap->ExtendedBitmapType();
- if (extendedBitmapType != KNullUid) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
+ } else if (type == QPixmapData::FbsBitmap && pixmap) {
+ CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap *>(pixmap);
+ QSize size(bitmap->SizeInPixels().iWidth, bitmap->SizeInPixels().iHeight);
+ resize(size.width(), size.height());
+ source = QVolatileImage(bitmap); // duplicates only, if possible
+ if (source.isNull())
+ return;
+ if (!conversionLessFormat(source.format())) {
+ // Here we may need to copy if the formats do not match.
+ // (e.g. for display modes other than EColor16MAP and EColor16MU)
+ source.ensureFormat(idealFormat(&source.imageRef(), Qt::AutoColor));
}
-#endif
-
- if (bitmap->IsCompressedInRAM()) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
- }
-
- TDisplayMode displayMode = bitmap->DisplayMode();
- QImage::Format format = qt_TDisplayMode2Format(displayMode);
-
- TSize size = bitmap->SizeInPixels();
- int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode);
-
- bitmap->BeginDataAccess();
- uchar *bytes = (uchar*)bitmap->DataAddress();
- QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format);
- img = img.copy();
- bitmap->EndDataAccess();
-
- if(displayMode == EGray2) {
- //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid
- //So invert mono bitmaps so that masks work correctly.
- img.invertPixels();
- } else if(displayMode == EColor16M) {
- img = img.rgbSwapped(); // EColor16M is BGR
- }
-
- fromImage(img, Qt::AutoColor);
-
- if(deleteSourceBitmap)
- delete bitmap;
+ recreate = true;
+ } else if (type == QPixmapData::VolatileImage && pixmap) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(pixmap);
+ resize(img->width(), img->height());
+ source = *img;
+ source.ensureFormat(idealFormat(&source.imageRef(), Qt::AutoColor));
+ recreate = true;
+ } else if (type == QPixmapData::NativeImageHandleProvider && pixmap) {
+ destroyImages();
+ nativeImageHandleProvider = static_cast<QNativeImageHandleProvider *>(pixmap);
+ // Cannot defer the retrieval, we need at least the size right away.
+ createFromNativeImageHandleProvider();
}
}
@@ -271,27 +275,15 @@ void* QVGPixmapData::toNativeType(NativeType type)
driver.Close();
return reinterpret_cast<void*>(sgImage.take());
#endif
- } else if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = new CFbsBitmap;
- Q_CHECK_PTR(bitmap);
-
- if (bitmap) {
- if (bitmap->Create(TSize(source.width(), source.height()),
- EColor16MAP) == KErrNone) {
- const uchar *sptr = const_cast<const QImage&>(source).bits();
- bitmap->BeginDataAccess();
-
- uchar *dptr = (uchar*)bitmap->DataAddress();
- Mem::Copy(dptr, sptr, source.byteCount());
-
- bitmap->EndDataAccess();
- } else {
- delete bitmap;
- bitmap = 0;
- }
+ } else if (type == QPixmapData::FbsBitmap && isValid()) {
+ ensureReadback(true);
+ if (source.isNull()) {
+ source = QVolatileImage(w, h, sourceFormat());
}
-
- return reinterpret_cast<void*>(bitmap);
+ // Just duplicate the bitmap handle, no data copying happens.
+ return source.duplicateNativeImage();
+ } else if (type == QPixmapData::VolatileImage) {
+ return &source;
}
return 0;
}
diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h
index 9a105ec..ce12301 100644
--- a/src/openvg/qvgfontglyphcache_p.h
+++ b/src/openvg/qvgfontglyphcache_p.h
@@ -56,7 +56,7 @@
#include <QtCore/qvarlengtharray.h>
#include <QtGui/private/qfontengine_p.h>
-#include <qvg_p.h>
+#include "qvg_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp
index a2b1c4e..7a7ec78 100644
--- a/src/openvg/qvgimagepool.cpp
+++ b/src/openvg/qvgimagepool.cpp
@@ -175,8 +175,19 @@ bool QVGImagePool::reclaimSpace(VGImageFormat format,
void QVGImagePool::hibernate()
{
- // Nothing to do here at the moment since the pool does not
- // retain VGImage's after they have been released.
+ Q_D(QVGImagePool);
+ QVGPixmapData *pd = d->lruLast;
+ while (pd) {
+ QVGPixmapData *prevLRU = pd->prevLRU;
+ pd->inImagePool = false;
+ pd->inLRU = false;
+ pd->nextLRU = 0;
+ pd->prevLRU = 0;
+ pd->hibernate();
+ pd = prevLRU;
+ }
+ d->lruFirst = 0;
+ d->lruLast = 0;
}
void QVGImagePool::moveToHeadOfLRU(QVGPixmapData *data)
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index c6db869..866453f 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -267,10 +267,7 @@ static QEglContext *createContext(QPaintDevice *device)
int redSize = configProps.value(EGL_RED_SIZE);
if (redSize == EGL_DONT_CARE || redSize == 0)
configProps.setPixelFormat(QImage::Format_ARGB32); // XXX
-#ifndef QVG_SCISSOR_CLIP
- // If we are using the mask to clip, then explicitly request a mask.
configProps.setValue(EGL_ALPHA_MASK_SIZE, 1);
-#endif
#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT |
EGL_VG_ALPHA_FORMAT_PRE_BIT);
@@ -771,6 +768,11 @@ bool QVGEGLWindowSurfaceDirect::scroll(QWidget *widget, const QRegion& area, int
context->lazyDoneCurrent();
return true;
}
+#else
+ Q_UNUSED(widget);
+ Q_UNUSED(area);
+ Q_UNUSED(dx);
+ Q_UNUSED(dy);
#endif
return false;
}
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index 30d6b50..6b37b38 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -213,6 +213,11 @@ void QNetworkManagerEngine::connectToId(const QString &id)
dbusDevicePath = devicePath.path();
break;
}
+ else if (device.deviceType() == DEVICE_TYPE_GSM &&
+ connectionType == QLatin1String("gsm")) {
+ dbusDevicePath = devicePath.path();
+ break;
+ }
}
const QString service = connection->connectionInterface()->service();
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index fc480c2..f367c26 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -150,16 +150,15 @@ SymbianEngine::~SymbianEngine()
iConnectionMonitor.CancelNotifications();
iConnectionMonitor.Close();
-
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE
- iCmManager.Close();
-#endif
-
- // CCommsDatabase destructor uses cleanup stack. Since QNetworkConfigurationManager
+
+ // CCommsDatabase destructor and RCmManager.Close() use cleanup stack. Since QNetworkConfigurationManager
// is a global static, but the time we are here, E32Main() has been exited already and
// the thread's default cleanup stack has been deleted. Without this line, a
// 'E32USER-CBase 69' -panic will occur.
CTrapCleanup* cleanup = CTrapCleanup::New();
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ iCmManager.Close();
+#endif
delete ipCommsDB;
delete cleanup;
}
@@ -829,6 +828,7 @@ void SymbianEngine::updateStatesToSnaps()
discovered = true;
}
}
+ snapConfigLocker.unlock();
if (active) {
changeConfigurationStateTo(ptr, QNetworkConfiguration::Active);
} else if (discovered) {
diff --git a/src/plugins/generic/tslib/main.cpp b/src/plugins/generic/tslib/main.cpp
index 502c6a0..3c2d21c 100644
--- a/src/plugins/generic/tslib/main.cpp
+++ b/src/plugins/generic/tslib/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/generic/tslib/qtslib.cpp b/src/plugins/generic/tslib/qtslib.cpp
index 12963a0..0143db4 100644
--- a/src/plugins/generic/tslib/qtslib.cpp
+++ b/src/plugins/generic/tslib/qtslib.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/generic/tslib/qtslib.h b/src/plugins/generic/tslib/qtslib.h
index 5eab8b9..4309185 100644
--- a/src/plugins/generic/tslib/qtslib.h
+++ b/src/plugins/generic/tslib/qtslib.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 50e0f5f..eaff74a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -245,10 +245,9 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
QDirectFBPointer<IDirectFBDataBuffer> dataBuffer(dataBufferPtr);
IDirectFBImageProvider *providerPtr;
- if ((result = dataBuffer->CreateImageProvider(dataBuffer.data(), &providerPtr)) != DFB_OK) {
- DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't create image provider", result);
+ if ((result = dataBuffer->CreateImageProvider(dataBuffer.data(), &providerPtr)) != DFB_OK)
return false;
- }
+
QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr);
DFBImageDescription imageDescription;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 09cc465..ff15078 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1285,7 +1285,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h);
#elif (Q_DIRECTFB_VERSION >= 0x010000)
IDirectFBSurface *layerSurface;
- if (d_ptr->dfbLayer->GetSurface(d_ptr->dfbLayer, &layerSurface) != DFB_OK) {
+ if (d_ptr->dfbLayer->GetSurface(d_ptr->dfbLayer, &layerSurface) == DFB_OK) {
result = layerSurface->GetSize(layerSurface, &w, &h);
layerSurface->Release(layerSurface);
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index d0056a7..3d8cf50 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -55,7 +55,6 @@ QT_BEGIN_NAMESPACE
QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr)
: QDirectFBPaintDevice(scr)
- , sibling(0)
#ifndef QT_NO_DIRECTFB_WM
, dfbWindow(0)
#endif
@@ -75,7 +74,6 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr, QWidget *widget)
: QWSWindowSurface(widget), QDirectFBPaintDevice(scr)
- , sibling(0)
#ifndef QT_NO_DIRECTFB_WM
, dfbWindow(0)
#endif
@@ -123,7 +121,7 @@ void QDirectFBWindowSurface::raise()
IDirectFBWindow *QDirectFBWindowSurface::directFBWindow() const
{
- return (dfbWindow ? dfbWindow : (sibling ? sibling->dfbWindow : 0));
+ return dfbWindow;
}
void QDirectFBWindowSurface::createWindow(const QRect &rect)
@@ -287,17 +285,40 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
QByteArray QDirectFBWindowSurface::permanentState() const
{
- QByteArray state(sizeof(this), 0);
- *reinterpret_cast<const QDirectFBWindowSurface**>(state.data()) = this;
+ QByteArray state(sizeof(SurfaceFlags) + sizeof(DFBWindowID), 0);
+ char *ptr = state.data();
+ SurfaceFlags flags = surfaceFlags();
+ memcpy(ptr, &flags, sizeof(SurfaceFlags));
+ ptr += sizeof(SurfaceFlags);
+ DFBWindowID did = (DFBWindowID)(-1);
+ if (dfbWindow)
+ dfbWindow->GetID(dfbWindow, &did);
+ memcpy(ptr, &did, sizeof(DFBWindowID));
return state;
}
void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
{
- if (state.size() == sizeof(this)) {
- sibling = *reinterpret_cast<QDirectFBWindowSurface *const*>(state.constData());
- Q_ASSERT(sibling);
- setSurfaceFlags(sibling->surfaceFlags());
+ const char *ptr = state.constData();
+ IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
+ SurfaceFlags flags;
+ memcpy(&flags, ptr, sizeof(SurfaceFlags));
+
+ setSurfaceFlags(flags);
+ ptr += sizeof(SurfaceFlags);
+ DFBWindowID id;
+ memcpy(&id, ptr, sizeof(DFBWindowID));
+ if (dfbSurface)
+ dfbSurface->Release(dfbSurface);
+ if (id != (DFBWindowID)-1) {
+ IDirectFBWindow *dw;
+ layer->GetWindow(layer, id, &dw);
+ if (dw->GetSurface(dw, &dfbSurface) != DFB_OK)
+ dfbSurface = 0;
+ dw->Release(dw);
+ }
+ else {
+ dfbSurface = 0;
}
}
@@ -406,8 +427,6 @@ void QDirectFBWindowSurface::endPaint(const QRegion &)
IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const
{
- if (!dfbSurface && sibling && sibling->dfbSurface)
- return sibling->dfbSurface;
return dfbSurface;
}
@@ -415,11 +434,8 @@ IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const
IDirectFBSurface *QDirectFBWindowSurface::surfaceForWidget(const QWidget *widget, QRect *rect) const
{
Q_ASSERT(widget);
- if (!dfbSurface) {
- if (sibling && (!sibling->sibling || sibling->dfbSurface))
- return sibling->surfaceForWidget(widget, rect);
+ if (!dfbSurface)
return 0;
- }
QWidget *win = window();
Q_ASSERT(win);
if (rect) {
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index f683fc8..75d462b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -100,7 +100,6 @@ private:
void updateIsOpaque();
void setOpaque(bool opaque);
void releaseSurface();
- QDirectFBWindowSurface *sibling;
#ifdef QT_DIRECTFB_WM
void createWindow(const QRect &rect);
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.cpp b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.cpp
index b8ea5d5..d090e85 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.cpp
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.h b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.h
index 7f794bc..08ba2fa 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.h
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreen.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.cpp b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.cpp
index 67b3f56..f708033 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.cpp
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.h b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.h
index 84f0699..64a3623 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.h
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwsscreenplugin.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.cpp b/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.cpp
index da4b728..8af4d40 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.cpp
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.h b/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.h
index b730415..793d325 100644
--- a/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.h
+++ b/src/plugins/gfxdrivers/eglnullws/eglnullwswindowsurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/graphicssystems/meego/dithering.cpp b/src/plugins/graphicssystems/meego/dithering.cpp
index 91e3337..2561c22 100644
--- a/src/plugins/graphicssystems/meego/dithering.cpp
+++ b/src/plugins/graphicssystems/meego/dithering.cpp
@@ -39,15 +39,22 @@
**
****************************************************************************/
-// This is an implementation of the 32bit => 16bit Floyd-Steinberg dithering.
+// Implements two dithering methods:
+//
+// * convertRGBA32_to_RGB565
+//
+// This is implemented using Ordered Bayer Dithering. The code has been adapted
+// from QX11PixmapData::fromImage. This method was originally implemented using
+// Floyd-Steinberg dithering but was later changed to Ordered Dithering because
+// of the better quality of the results.
+//
+// * convertRGBA32_to_RGBA4444
+//
+// This is implemented using Floyd-Steinberg dithering.
+//
// The alghorithm used here is not the fastest possible but it's prolly fast enough:
// uses look-up tables, integer-only arthmetics and works in one pass on two lines
// at a time. It's a high-quality dithering using 1/8 diffusion precission.
-// Two functions here to look at:
-//
-// * convertRGBA32_to_RGB565
-// * convertRGBA32_to_RGBA4444
-//
// Each channel (RGBA) is diffused independently and alpha is dithered too.
#include <string.h>
@@ -76,113 +83,63 @@
// Converts incoming RGB32 (QImage::Format_RGB32) to RGB565. Returns the newly allocated data.
unsigned short* convertRGB32_to_RGB565(const unsigned char *in, int width, int height, int stride)
{
+ static bool thresholdMapInitialized = false;
+ static int thresholdMap[16][16];
+
+ if (!thresholdMapInitialized) {
+ int i;
+ int j;
+ int n;
+
+ thresholdMap[0][0] = 0;
+ thresholdMap[1][0] = 2;
+ thresholdMap[0][1] = 3;
+ thresholdMap[1][1] = 1;
+
+ for (n=2; n<16; n*=2) {
+ for (i=0; i<n; i++) {
+ for (j=0; j<n; j++) {
+ thresholdMap[i][j] *= 4;
+ thresholdMap[i+n][j] = thresholdMap[i][j] + 2;
+ thresholdMap[i][j+n] = thresholdMap[i][j] + 3;
+ thresholdMap[i+n][j+n] = thresholdMap[i][j] + 1;
+ }
+ }
+ }
+
+ thresholdMapInitialized = true;
+ }
+
// Output line stride. Aligned to 4 bytes.
int alignedWidth = width;
if (alignedWidth % 2 > 0)
alignedWidth++;
// Will store output
- unsigned short *out = (unsigned short *) malloc(alignedWidth * height * 2);
-
- // Lookup tables for the 8bit => 6bit and 8bit => 5bit conversion
- unsigned char lookup_8bit_to_5bit[256];
- short lookup_8bit_to_5bit_diff[256];
- unsigned char lookup_8bit_to_6bit[256];
- short lookup_8bit_to_6bit_diff[256];
-
- // Macros for the conversion using the lookup table.
- #define CONVERT_8BIT_TO_5BIT(v) (lookup_8bit_to_5bit[v])
- #define DIFF_8BIT_TO_5BIT(v) (lookup_8bit_to_5bit_diff[v])
-
- #define CONVERT_8BIT_TO_6BIT(v) (lookup_8bit_to_6bit[v])
- #define DIFF_8BIT_TO_6BIT(v) (lookup_8bit_to_6bit_diff[v])
-
- int i;
- int x, y, c; // Pixel we're processing. c is component number (0, 1, 2 for r, b, b)
- short component[3]; // Stores the new components (r, g, b) for pixel produced during conversion
- short diff; // The difference between the converted value and the original one. To be accumulated.
- QVarLengthArray <short> accumulatorData(3 * width * 2); // Data for three acumulators for r, g, b. Each accumulator is two lines.
- short *accumulator[3]; // Helper for accessing the accumulator on a per-channel basis more easily.
- accumulator[0] = accumulatorData.data();
- accumulator[1] = accumulatorData.data() + width;
- accumulator[2] = accumulatorData.data() + (width * 2);
-
- // Produce the conversion lookup tables.
- for (i = 0; i < 256; i++) {
- lookup_8bit_to_5bit[i] = round(i / 8.0);
-
- // Before bitshifts: (i * 8) - (... * 8 * 8)
- lookup_8bit_to_5bit_diff[i] = (i << 3) - (lookup_8bit_to_5bit[i] << 6);
- if (lookup_8bit_to_5bit[i] > 31)
- lookup_8bit_to_5bit[i] -= 1;
-
- lookup_8bit_to_6bit[i] = round(i / 4.0);
-
- // Before bitshifts: (i * 8) - (... * 4 * 8)
- lookup_8bit_to_6bit_diff[i] = (i << 3) - (lookup_8bit_to_6bit[i] << 5);
- if (lookup_8bit_to_6bit[i] > 63)
- lookup_8bit_to_6bit[i] -= 1;
- }
+ unsigned short *out = (unsigned short *)malloc (alignedWidth * height * 2);
- // Clear the accumulators
- memset(accumulator[0], 0, width * 4);
- memset(accumulator[1], 0, width * 4);
- memset(accumulator[2], 0, width * 4);
+ int x;
+ int y;
+ int threshold;
// For each line...
for (y = 0; y < height; y++) {
- // For each accumulator, move the second line (index 1) to replace the first line (index 0).
- // Clear the second line (index 1)
- memcpy(accumulator[0], accumulator[0] + width, width * 2);
- memset(accumulator[0] + width, 0, width * 2);
-
- memcpy(accumulator[1], accumulator[1] + width, width * 2);
- memset(accumulator[1] + width, 0, width * 2);
-
- memcpy(accumulator[2], accumulator[2] + width, width * 2);
- memset(accumulator[2] + width, 0, width * 2);
-
// For each column....
for (x = 0; x < width; x++) {
- // For each component (r, g, b)...
- for (c = 0; c < 3; c++) {
+ int r = GET_RGBA_COMPONENT(in, x, y, stride, 0);
+ int g = GET_RGBA_COMPONENT(in, x, y, stride, 1);
+ int b = GET_RGBA_COMPONENT(in, x, y, stride, 2);
- // Get the 8bit value from the original image
- component[c] = GET_RGBA_COMPONENT(in, x, y, stride, c);
-
- // Add the diffusion for this pixel we stored in the accumulator.
- // >> 7 because the values in accumulator are stored * 128
- if (x != 0 && x != (width - 1)) {
- if (accumulator[c][x] >> 7 != 0)
- component[c] += rand() % accumulator[c][x] >> 7;
- }
-
- // Make sure we're not over the boundaries.
- CLAMP_256(component[c]);
-
- // For green component we use 6 bits. Otherwise 5 bits.
- // Store the difference from converting 8bit => 6 bit and the orig pixel.
- // Convert 8bit => 6(5) bit.
- if (c == 1) {
- diff = DIFF_8BIT_TO_6BIT(component[c]);
- component[c] = CONVERT_8BIT_TO_6BIT(component[c]);
- } else {
- diff = DIFF_8BIT_TO_5BIT(component[c]);
- component[c] = CONVERT_8BIT_TO_5BIT(component[c]);
- }
+ threshold = thresholdMap[x%16][y%16];
- // Distribute the difference according to the matrix in the
- // accumulation bufffer.
- ACCUMULATE(accumulator[c], x + 1, 0, width, diff * 3);
- ACCUMULATE(accumulator[c], x - 1, 1, width, diff * 5);
- ACCUMULATE(accumulator[c], x, 1, width, diff * 5);
- ACCUMULATE(accumulator[c], x + 1, 1, width, diff * 3);
- }
+ if (r <= (255-(1<<3)) && ((r<<5) & 255) > threshold) r += (1<<3);
+ if (g <= (255-(1<<2)) && ((g<<6) & 255) > threshold) g += (1<<2);
+ if (b <= (255-(1<<3)) && ((b<<5) & 255) > threshold) b += (1<<3);
// Write the newly produced pixel
- PUT_565(out, x, y, alignedWidth, component[2], component[1], component[0]);
+ PUT_565(out, x, y, alignedWidth, ((b >> 3) & 0x1f), ((g >> 2) & 0x3f), ((r >> 3) & 0x1f));
}
}
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index a70d232..13eab7f 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -171,7 +171,7 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl
return QMeeGoGraphicsSystem::wrapPixmapData(pmd);
} else {
QRasterPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType);
- pmd->fromImage(softImage, Qt::NoOpaqueDetection);
+ pmd->fromImage(softImage, Qt::NoFormatConversion);
// Make sure that the image was not converted in any way
if (pmd->buffer()->data_ptr()->data !=
@@ -335,3 +335,8 @@ void qt_meego_destroy_fence_sync(void* fs)
{
return QMeeGoGraphicsSystem::destroyFenceSync(fs);
}
+
+void qt_meego_invalidate_live_surfaces(void)
+{
+ return QMeeGoLivePixmapData::invalidateSurfaces();
+}
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
index 323ce1f..27a4e7a 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
@@ -103,6 +103,7 @@ extern "C" {
Q_DECL_EXPORT Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap);
Q_DECL_EXPORT void* qt_meego_create_fence_sync(void);
Q_DECL_EXPORT void qt_meego_destroy_fence_sync(void* fs);
+ Q_DECL_EXPORT void qt_meego_invalidate_live_surfaces(void);
}
#endif
diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
index e4f1900..2a2a098 100644
--- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
@@ -49,6 +49,8 @@
#include <private/qpixmap_x11_p.h>
#include <stdio.h>
+static QMeeGoLivePixmapDataList all_live_pixmaps;
+
static EGLint lock_attribs[] = {
EGL_MAP_PRESERVE_PIXELS_KHR, EGL_TRUE,
EGL_LOCK_USAGE_HINT_KHR, EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR,
@@ -118,21 +120,29 @@ QMeeGoLivePixmapData::QMeeGoLivePixmapData(int w, int h, QImage::Format format)
backingX11Pixmap = new QPixmap(pmd);
initializeThroughEGLImage();
+
+ pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this);
}
QMeeGoLivePixmapData::QMeeGoLivePixmapData(Qt::HANDLE h) : QGLPixmapData(QPixmapData::PixmapType)
{
backingX11Pixmap = new QPixmap(QPixmap::fromX11Pixmap(h));
initializeThroughEGLImage();
+
+ pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this);
}
QMeeGoLivePixmapData::~QMeeGoLivePixmapData()
{
delete backingX11Pixmap;
+ all_live_pixmaps.erase(pos);
}
void QMeeGoLivePixmapData::initializeThroughEGLImage()
{
+ if (texture()->id != 0)
+ return;
+
QGLShareContextScope ctx(qt_gl_share_widget()->context());
QMeeGoExtensions::ensureInitialized();
@@ -245,6 +255,8 @@ bool QMeeGoLivePixmapData::scroll(int dx, int dy, const QRect &rect)
EGLSurface QMeeGoLivePixmapData::getSurfaceForBackingPixmap()
{
+ initializeThroughEGLImage();
+
// This code is a crative remix of the stuff that can be found in the
// Qt's TFP implementation in /src/opengl/qgl_x11egl.cpp ::bindiTextureFromNativePixmap
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(backingX11Pixmap->data_ptr().data());
@@ -290,3 +302,12 @@ void QMeeGoLivePixmapData::destroySurfaceForPixmapData(QPixmapData* pmd)
pixmapData->gl_surface = 0;
}
}
+
+void QMeeGoLivePixmapData::invalidateSurfaces()
+{
+ foreach (QMeeGoLivePixmapData *data, all_live_pixmaps) {
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(data->backingX11Pixmap->data_ptr().data());
+ *data->texture() = QGLTexture();
+ pixmapData->gl_surface = 0;
+ }
+}
diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
index 484028e..616b33c 100644
--- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
+++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
@@ -42,9 +42,13 @@
#ifndef MLIVEPIXMAPDATA_H
#define MLIVEPIXMAPDATA_H
+#include <QLinkedList>
#include <private/qpixmapdata_gl_p.h>
#include "qmeegoextensions.h"
+class QMeeGoLivePixmapData;
+typedef QLinkedList<QMeeGoLivePixmapData *> QMeeGoLivePixmapDataList;
+
class QMeeGoLivePixmapData : public QGLPixmapData
{
public:
@@ -66,6 +70,9 @@ public:
QPixmap *backingX11Pixmap;
QImage lockedImage;
+ QMeeGoLivePixmapDataList::Iterator pos;
+
+ static void invalidateSurfaces();
};
#endif
diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
index 0c107b5..4b4f677 100644
--- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
+++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
@@ -42,7 +42,8 @@
#include "qgraphicssystem_vg_p.h"
#include <QtOpenVG/private/qpixmapdata_vg_p.h>
#include <QtOpenVG/private/qwindowsurface_vg_p.h>
-#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
+#include <QtOpenVG/private/qvgimagepool_p.h>
+#if defined(Q_OS_SYMBIAN)
#include <QtGui/private/qwidget_p.h>
#endif
#include <QtGui/private/qapplication_p.h>
@@ -69,12 +70,19 @@ QPixmapData *QVGGraphicsSystem::createPixmapData(QPixmapData::PixelType type) co
QWindowSurface *QVGGraphicsSystem::createWindowSurface(QWidget *widget) const
{
-#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
- QWidgetPrivate *d = qt_widget_private(widget);
- if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
- return d->createDefaultWindowSurface_sys();
+#if defined(Q_OS_SYMBIAN)
+ if (!QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ QWidgetPrivate *d = qt_widget_private(widget);
+ if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
+ return d->createDefaultWindowSurface_sys();
+ }
#endif
return new QVGWindowSurface(widget);
}
+void QVGGraphicsSystem::releaseCachedResources()
+{
+ QVGImagePool::instance()->hibernate();
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
index d1bce28..9c9b3e2 100644
--- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
+++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
@@ -64,6 +64,8 @@ public:
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
QWindowSurface *createWindowSurface(QWidget *widget) const;
+
+ void releaseCachedResources();
};
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 5aa26d3..701207d 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -559,6 +559,8 @@ QImage ICOReader::iconAt(int index)
icoAttrib.ncolors = 0;
else // # colors used
icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
+ if (icoAttrib.ncolors > 256) //color table can't be more than 256
+ return img;
icoAttrib.w = iconEntry.bWidth;
if (icoAttrib.w == 0)
icoAttrib.w = header.biWidth;
diff --git a/src/plugins/platforms/directfb/qdirectfbblitter.cpp b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
index d379b65..19998ce 100644
--- a/src/plugins/platforms/directfb/qdirectfbblitter.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbblitter.h b/src/plugins/platforms/directfb/qdirectfbblitter.h
index 1e874ba..bd5dbda 100644
--- a/src/plugins/platforms/directfb/qdirectfbblitter.h
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
index 91a1b3a..01cef83 100644
--- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.h b/src/plugins/platforms/directfb/qdirectfbconvenience.h
index 3669159..e85c502 100644
--- a/src/plugins/platforms/directfb/qdirectfbconvenience.h
+++ b/src/plugins/platforms/directfb/qdirectfbconvenience.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
index 51502f8..3cd81ac 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h
index ea8b7b0..f37bbed 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.h
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
index 033ff1e..ee46691 100644
--- a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.h b/src/plugins/platforms/directfb/qdirectfbglcontext.h
index 1785666..f25b1a7 100644
--- a/src/plugins/platforms/directfb/qdirectfbglcontext.h
+++ b/src/plugins/platforms/directfb/qdirectfbglcontext.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.cpp b/src/plugins/platforms/directfb/qdirectfbinput.cpp
index 9d2a8a8..30654bf 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbinput.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h
index bca155f..35a345c 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.h
+++ b/src/plugins/platforms/directfb/qdirectfbinput.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index 8639bdb..52b7774 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.h b/src/plugins/platforms/directfb/qdirectfbintegration.h
index 965bdd2..bfd4af4 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.h
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
index 1cd23ad..040580b 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h
index 19491c5..4c6476a 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp
index b1a8899..81f989d 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/directfb/qdirectfbwindowsurface.h b/src/plugins/platforms/directfb/qdirectfbwindowsurface.h
index aaa74d4..a762bf6 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindowsurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
index 1612f79..24c21e6 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.h b/src/plugins/platforms/eglconvenience/qeglconvenience.h
index 98c30b8..f624e97 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.h
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
index 4b83a22..126dc74 100644
--- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
+++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
index ac53559..4b98619 100644
--- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
+++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/main.cpp b/src/plugins/platforms/eglfs/main.cpp
index d0a82b7..c07e546 100644
--- a/src/plugins/platforms/eglfs/main.cpp
+++ b/src/plugins/platforms/eglfs/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index a48fde8..f4a97fc 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h
index 0342539..c199653 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
index db90ff2..2200d1d 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h
index bfbfa62..6a2a504 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.h
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index b5b7e05..2ef12aa 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h
index 43f185b..ad51114 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.h
+++ b/src/plugins/platforms/eglfs/qeglfswindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp b/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp
index ebc04bd..393e646 100644
--- a/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/eglfs/qeglfswindowsurface.h b/src/plugins/platforms/eglfs/qeglfswindowsurface.h
index f8aca40..2fa655b 100644
--- a/src/plugins/platforms/eglfs/qeglfswindowsurface.h
+++ b/src/plugins/platforms/eglfs/qeglfswindowsurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fb_base/fb_base.cpp b/src/plugins/platforms/fb_base/fb_base.cpp
index b000a18..e118ce8 100644
--- a/src/plugins/platforms/fb_base/fb_base.cpp
+++ b/src/plugins/platforms/fb_base/fb_base.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fb_base/fb_base.h b/src/plugins/platforms/fb_base/fb_base.h
index 45a5663..c5ae378 100644
--- a/src/plugins/platforms/fb_base/fb_base.h
+++ b/src/plugins/platforms/fb_base/fb_base.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp b/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp
index ee520be..895f8af 100644
--- a/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp
+++ b/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.h b/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.h
index 0af118d..f04d453 100644
--- a/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.h
+++ b/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 9b9be07..2a3fd5a 100644
--- a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h
index cf62b88..ee441f7 100644
--- a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h
+++ b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/fontdatabases/genericunix/qgenericunixfontdatabase.h b/src/plugins/platforms/fontdatabases/genericunix/qgenericunixfontdatabase.h
index 327c8f5..bfe014a 100644
--- a/src/plugins/platforms/fontdatabases/genericunix/qgenericunixfontdatabase.h
+++ b/src/plugins/platforms/fontdatabases/genericunix/qgenericunixfontdatabase.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/minimal/main.cpp b/src/plugins/platforms/minimal/main.cpp
index 82c15c2..b15f183 100644
--- a/src/plugins/platforms/minimal/main.cpp
+++ b/src/plugins/platforms/minimal/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index c90e92e..f72fadb 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h
index 95b952e..133feee 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.h
+++ b/src/plugins/platforms/minimal/qminimalintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/minimal/qminimalwindowsurface.cpp b/src/plugins/platforms/minimal/qminimalwindowsurface.cpp
index acf0e6e..dd8c9b7 100644
--- a/src/plugins/platforms/minimal/qminimalwindowsurface.cpp
+++ b/src/plugins/platforms/minimal/qminimalwindowsurface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/minimal/qminimalwindowsurface.h b/src/plugins/platforms/minimal/qminimalwindowsurface.h
index 98b26f6..bfeeaca 100644
--- a/src/plugins/platforms/minimal/qminimalwindowsurface.h
+++ b/src/plugins/platforms/minimal/qminimalwindowsurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/main.cpp b/src/plugins/platforms/openkode/main.cpp
index 527747e..ead17a4 100644
--- a/src/plugins/platforms/openkode/main.cpp
+++ b/src/plugins/platforms/openkode/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/openkodekeytranslator.h b/src/plugins/platforms/openkode/openkodekeytranslator.h
index 0070edc..502bf03 100644
--- a/src/plugins/platforms/openkode/openkodekeytranslator.h
+++ b/src/plugins/platforms/openkode/openkodekeytranslator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp
index aefabf0..4ca82db 100644
--- a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp
+++ b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.h b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.h
index 73b287f..cef3465 100644
--- a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.h
+++ b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.cpp b/src/plugins/platforms/openkode/qopenkodeintegration.cpp
index 763e69e..5176397 100644
--- a/src/plugins/platforms/openkode/qopenkodeintegration.cpp
+++ b/src/plugins/platforms/openkode/qopenkodeintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.h b/src/plugins/platforms/openkode/qopenkodeintegration.h
index a067491..ade3366 100644
--- a/src/plugins/platforms/openkode/qopenkodeintegration.h
+++ b/src/plugins/platforms/openkode/qopenkodeintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodewindow.cpp b/src/plugins/platforms/openkode/qopenkodewindow.cpp
index 01f8d21..66530a5 100644
--- a/src/plugins/platforms/openkode/qopenkodewindow.cpp
+++ b/src/plugins/platforms/openkode/qopenkodewindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/qopenkodewindow.h b/src/plugins/platforms/openkode/qopenkodewindow.h
index 4992807..83b04b4 100644
--- a/src/plugins/platforms/openkode/qopenkodewindow.h
+++ b/src/plugins/platforms/openkode/qopenkodewindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/platforms/openkode/shaders/frag.glslf b/src/plugins/platforms/openkode/shaders/frag.glslf
index c768437..ceac785 100644
--- a/src/plugins/platforms/openkode/shaders/frag.glslf
+++ b/src/plugins/platforms/openkode/shaders/frag.glslf
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 5859574..3e7da0e 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -15,4 +15,4 @@ symbian:SUBDIRS += s60
contains(QT_CONFIG, phonon): SUBDIRS *= phonon
contains(QT_CONFIG, multimedia): SUBDIRS *= audio
qpa:SUBDIRS += platforms
-contains(QT_CONFIG, declarative): SUBDIRS *= qmldebugging
+contains(QT_CONFIG, declarative): SUBDIRS *= qmltooling
diff --git a/src/plugins/qmldebugging/qmldebugging.pro b/src/plugins/qmltooling/qmltooling.pro
index 01cf1a9..01cf1a9 100644
--- a/src/plugins/qmldebugging/qmldebugging.pro
+++ b/src/plugins/qmltooling/qmltooling.pro
diff --git a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp b/src/plugins/qmltooling/tcpserver/qtcpserverconnection.cpp
index 69c1ef5..e1298e8 100644
--- a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/tcpserver/qtcpserverconnection.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h b/src/plugins/qmltooling/tcpserver/qtcpserverconnection.h
index a6e17e6..66a10e1 100644
--- a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h
+++ b/src/plugins/qmltooling/tcpserver/qtcpserverconnection.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/plugins/qmldebugging/tcpserver/tcpserver.pro b/src/plugins/qmltooling/tcpserver/tcpserver.pro
index e90fb34..f4f2666 100644
--- a/src/plugins/qmldebugging/tcpserver/tcpserver.pro
+++ b/src/plugins/qmltooling/tcpserver/tcpserver.pro
@@ -3,7 +3,7 @@ QT += declarative network
include(../../qpluginbase.pri)
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmldebugging
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
SOURCES += \
@@ -12,7 +12,7 @@ SOURCES += \
HEADERS += \
qtcpserverconnection.h
-target.path += $$[QT_INSTALL_PLUGINS]/qmldebugging
+target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
INSTALLS += target
symbian:TARGET.UID3=0x20031E90 \ No newline at end of file
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
index ebeccc9..b7a87f3 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
@@ -34,6 +34,12 @@
silent:symbian_sqlite3_dso.commands = @echo unzipping $@ && $$symbian_sqlite3_dso.commands
QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso
+ # Workaround for the fact that make doesn't understand that sqlite3.dso
+ # is the same as $OBJECTS_DIR/sqlite3.dso
+ symbian_sqlite3_dso_standalone.target = sqlite3.dso
+ symbian_sqlite3_dso_standalone.depends = $$symbian_sqlite3_dso.output
+ QMAKE_EXTRA_TARGETS += symbian_sqlite3_dso_standalone
+
symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file
symbian_sqlite3_ver_dso.output = sqlite3{00060003}.dso
!isEmpty(OBJECTS_DIR):symbian_sqlite3_ver_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_ver_dso.output
diff --git a/src/qbase.pri b/src/qbase.pri
index 4d835bd..ce69757 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -197,7 +197,7 @@ symbian {
# Partial upgrade SIS file
vendorinfo = \
"; Localised Vendor name" \
- "%{\"Nokia, Qt\"}" \
+ "%{\"Nokia\"}" \
" " \
"; Unique Vendor name" \
":\"Nokia, Qt\"" \
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index dd7d588..5579e5a 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -1380,7 +1380,7 @@ EXPORTS
?create@QAbstractFileEngine@@SAPAV1@ABVQString@@@Z @ 1379 NONAME ; class QAbstractFileEngine * QAbstractFileEngine::create(class QString const &)
?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@PAVQByteArray@@@Z @ 1380 NONAME ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QByteArray *)
?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@PAVQIODevice@@@Z @ 1381 NONAME ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QIODevice *)
- ?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@PAVQRingBuffer@@@Z @ 1382 NONAME ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QRingBuffer *)
+ ?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@PAVQRingBuffer@@@Z @ 1382 NONAME ABSENT ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QRingBuffer *)
?create@QSharedMemory@@QAE_NHW4AccessMode@1@@Z @ 1383 NONAME ; bool QSharedMemory::create(int, enum QSharedMemory::AccessMode)
?create@QTextCodecPlugin@@EAEPAVQTextCodec@@ABVQString@@@Z @ 1384 NONAME ; class QTextCodec * QTextCodecPlugin::create(class QString const &)
?create@QVariant@@IAEXHPBX@Z @ 1385 NONAME ; void QVariant::create(int, void const *)
@@ -4605,4 +4605,8 @@ EXPORTS
?hasError@QXmlStreamWriter@@QBE_NXZ @ 4604 NONAME ; bool QXmlStreamWriter::hasError(void) const
?revision@QMetaProperty@@QBEHXZ @ 4605 NONAME ; int QMetaProperty::revision(void) const
?revision@QMetaMethod@@QBEHXZ @ 4606 NONAME ; int QMetaMethod::revision(void) const
+ ?started@QAnimationDriver@@MAEXXZ @ 4607 NONAME ; void QAnimationDriver::started(void)
+ ?stopped@QAnimationDriver@@MAEXXZ @ 4608 NONAME ; void QAnimationDriver::stopped(void)
+ ?isResetDisabled@QNonContiguousByteDevice@@QAE_NXZ @ 4609 NONAME ; bool QNonContiguousByteDevice::isResetDisabled(void)
+ ?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@V?$QSharedPointer@VQRingBuffer@@@@@Z @ 4610 NONAME ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QSharedPointer<class QRingBuffer>)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 7d0a83e..5490f0d 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -3,7 +3,7 @@ EXPORTS
?setStored@QMetaPropertyBuilder@@QAEX_N@Z @ 2 NONAME ABSENT ; void QMetaPropertyBuilder::setStored(bool)
?trUtf8@QDeclarativeExpression@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString QDeclarativeExpression::trUtf8(char const *, char const *, int)
?qt_metacast@QDeclarativeComponent@@UAEPAXPBD@Z @ 4 NONAME ; void * QDeclarativeComponent::qt_metacast(char const *)
- ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ABSENT ; class QString QDeclarativeDebugService::name(void) const
+ ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ; class QString QDeclarativeDebugService::name(void) const
?debugId@QDeclarativeDebugObjectReference@@QBEHXZ @ 6 NONAME ABSENT ; int QDeclarativeDebugObjectReference::debugId(void) const
?addPluginPath@QDeclarativeEngine@@QAEXABVQString@@@Z @ 7 NONAME ; void QDeclarativeEngine::addPluginPath(class QString const &)
?name@QMetaPropertyBuilder@@QBE?AVQByteArray@@XZ @ 8 NONAME ABSENT ; class QByteArray QMetaPropertyBuilder::name(void) const
@@ -11,7 +11,7 @@ EXPORTS
?propertyOffset@QDeclarativeOpenMetaObjectType@@QBEHXZ @ 10 NONAME ABSENT ; int QDeclarativeOpenMetaObjectType::propertyOffset(void) const
??0QDeclarativeText@@QAE@PAVQDeclarativeItem@@@Z @ 11 NONAME ABSENT ; QDeclarativeText::QDeclarativeText(class QDeclarativeItem *)
?propertyTypeName@QDeclarativeProperty@@QBEPBDXZ @ 12 NONAME ; char const * QDeclarativeProperty::propertyTypeName(void) const
- ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
+ ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
?setLeft@QDeclarativeAnchors@@QAEXABVQDeclarativeAnchorLine@@@Z @ 14 NONAME ABSENT ; void QDeclarativeAnchors::setLeft(class QDeclarativeAnchorLine const &)
?qt_metacall@QDeclarativeExpression@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 15 NONAME ; int QDeclarativeExpression::qt_metacall(enum QMetaObject::Call, int, void * *)
?staticMetaObject@QDeclarativePen@@2UQMetaObject@@B @ 16 NONAME ABSENT ; struct QMetaObject const QDeclarativePen::staticMetaObject
@@ -145,7 +145,7 @@ EXPORTS
?isConnected@QDeclarativeDebugClient@@QBE_NXZ @ 144 NONAME ABSENT ; bool QDeclarativeDebugClient::isConnected(void) const
?enabled@QDeclarativeBinding@@QBE_NXZ @ 145 NONAME ABSENT ; bool QDeclarativeBinding::enabled(void) const
?setSource@QDeclarativeView@@QAEXABVQUrl@@@Z @ 146 NONAME ; void QDeclarativeView::setSource(class QUrl const &)
- ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int)
+ ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int)
??0QDeclarativeDomDynamicProperty@@QAE@ABV0@@Z @ 148 NONAME ABSENT ; QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty(class QDeclarativeDomDynamicProperty const &)
?className@QDeclarativeDebugObjectReference@@QBE?AVQString@@XZ @ 149 NONAME ABSENT ; class QString QDeclarativeDebugObjectReference::className(void) const
?indexOfSlot@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 150 NONAME ABSENT ; int QMetaObjectBuilder::indexOfSlot(class QByteArray const &)
@@ -294,7 +294,7 @@ EXPORTS
?attachedPropertiesType@QDeclarativeType@@QBEPBUQMetaObject@@XZ @ 293 NONAME ABSENT ; struct QMetaObject const * QDeclarativeType::attachedPropertiesType(void) const
?setName@QDeclarativeState@@QAEXABVQString@@@Z @ 294 NONAME ; void QDeclarativeState::setName(class QString const &)
?setReversed@QDeclarativeTransition@@QAEX_N@Z @ 295 NONAME ; void QDeclarativeTransition::setReversed(bool)
- ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ABSENT ; int QDeclarativeDebugService::idForObject(class QObject *)
+ ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ; int QDeclarativeDebugService::idForObject(class QObject *)
?qt_metacall@QDeclarativeDebugWatch@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 297 NONAME ABSENT ; int QDeclarativeDebugWatch::qt_metacall(enum QMetaObject::Call, int, void * *)
?fromState@QDeclarativeTransition@@QBE?AVQString@@XZ @ 298 NONAME ; class QString QDeclarativeTransition::fromState(void) const
??1QDeclarativeExpression@@UAE@XZ @ 299 NONAME ; QDeclarativeExpression::~QDeclarativeExpression(void)
@@ -332,7 +332,7 @@ EXPORTS
??0QDeclarativeCustomParserNode@@QAE@ABV0@@Z @ 331 NONAME ; QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(class QDeclarativeCustomParserNode const &)
??1QDeclarativeImageProvider@@UAE@XZ @ 332 NONAME ; QDeclarativeImageProvider::~QDeclarativeImageProvider(void)
?sync@QDeclarativeListModel@@QAEXXZ @ 333 NONAME ABSENT ; void QDeclarativeListModel::sync(void)
- ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ABSENT ; class QObject * QDeclarativeDebugService::objectForId(int)
+ ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ; class QObject * QDeclarativeDebugService::objectForId(int)
?hasFocus@QDeclarativeItem@@QBE_NXZ @ 335 NONAME ; bool QDeclarativeItem::hasFocus(void) const
??1QDeclarativeExtensionPlugin@@UAE@XZ @ 336 NONAME ; QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin(void)
?qt_metacall@QDeclarativeBehavior@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 337 NONAME ABSENT ; int QDeclarativeBehavior::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -482,7 +482,7 @@ EXPORTS
?pluginPathList@QDeclarativeEngine@@QBE?AVQStringList@@XZ @ 481 NONAME ; class QStringList QDeclarativeEngine::pluginPathList(void) const
?parentContext@QDeclarativeContext@@QBEPAV1@XZ @ 482 NONAME ; class QDeclarativeContext * QDeclarativeContext::parentContext(void) const
?leftMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 483 NONAME ABSENT ; void QDeclarativeAnchors::leftMarginChanged(void)
- ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ABSENT ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject
+ ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject
?topMargin@QDeclarativeAnchors@@QBEMXZ @ 485 NONAME ABSENT ; float QDeclarativeAnchors::topMargin(void) const
??0QDeclarativeDebugExpressionQuery@@AAE@PAVQObject@@@Z @ 486 NONAME ABSENT ; QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(class QObject *)
??0QPacket@@IAE@ABVQByteArray@@@Z @ 487 NONAME ; QPacket::QPacket(class QByteArray const &)
@@ -559,7 +559,7 @@ EXPORTS
?metaObject@QDeclarativeEngine@@UBEPBUQMetaObject@@XZ @ 558 NONAME ; struct QMetaObject const * QDeclarativeEngine::metaObject(void) const
??_EQDeclarativeDebugContextReference@@QAE@I@Z @ 559 NONAME ABSENT ; QDeclarativeDebugContextReference::~QDeclarativeDebugContextReference(unsigned int)
?propertyWrite@QDeclarativeOpenMetaObject@@MAEXH@Z @ 560 NONAME ABSENT ; void QDeclarativeOpenMetaObject::propertyWrite(int)
- ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ABSENT ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *)
?setVerticalCenterOffset@QDeclarativeAnchors@@QAEXM@Z @ 562 NONAME ABSENT ; void QDeclarativeAnchors::setVerticalCenterOffset(float)
??1QDeclarativeDebugWatch@@UAE@XZ @ 563 NONAME ABSENT ; QDeclarativeDebugWatch::~QDeclarativeDebugWatch(void)
??1QPacketAutoSend@@UAE@XZ @ 564 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(void)
@@ -641,7 +641,7 @@ EXPORTS
?d_func@QDeclarativeItem@@AAEPAVQDeclarativeItemPrivate@@XZ @ 640 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItem::d_func(void)
?binding@QDeclarativeDomValueBinding@@QBE?AVQString@@XZ @ 641 NONAME ABSENT ; class QString QDeclarativeDomValueBinding::binding(void) const
?updateAutoState@QDeclarativeStateGroup@@AAE_NXZ @ 642 NONAME ; bool QDeclarativeStateGroup::updateAutoState(void)
- ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *)
+ ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *)
?tr@QDeclarativeComponent@@SA?AVQString@@PBD0H@Z @ 644 NONAME ; class QString QDeclarativeComponent::tr(char const *, char const *, int)
??1QDeclarativeProperty@@QAE@XZ @ 645 NONAME ; QDeclarativeProperty::~QDeclarativeProperty(void)
?fontChanged@QDeclarativeText@@IAEXABVQFont@@@Z @ 646 NONAME ABSENT ; void QDeclarativeText::fontChanged(class QFont const &)
@@ -667,14 +667,14 @@ EXPORTS
?getStaticMetaObject@QDeclarativeListModel@@SAABUQMetaObject@@XZ @ 666 NONAME ABSENT ; struct QMetaObject const & QDeclarativeListModel::getStaticMetaObject(void)
?setStdCppSet@QMetaPropertyBuilder@@QAEX_N@Z @ 667 NONAME ABSENT ; void QMetaPropertyBuilder::setStdCppSet(bool)
??0QDeclarativeItemPrivate@@QAE@XZ @ 668 NONAME ; QDeclarativeItemPrivate::QDeclarativeItemPrivate(void)
- ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ABSENT ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *)
+ ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *)
?load@QDeclarativePixmap@@QAEXPAVQDeclarativeEngine@@ABVQUrl@@_N@Z @ 670 NONAME ABSENT ; void QDeclarativePixmap::load(class QDeclarativeEngine *, class QUrl const &, bool)
??_EQPacketAutoSend@@UAE@I@Z @ 671 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(unsigned int)
?saveValueType@QDeclarativePropertyPrivate@@SA?AVQByteArray@@PBUQMetaObject@@H0H@Z @ 672 NONAME ABSENT ; class QByteArray QDeclarativePropertyPrivate::saveValueType(struct QMetaObject const *, int, struct QMetaObject const *, int)
?resetHeight@QDeclarativeItem@@QAEXXZ @ 673 NONAME ; void QDeclarativeItem::resetHeight(void)
?setVAlign@QDeclarativeText@@QAEXW4VAlignment@1@@Z @ 674 NONAME ABSENT ; void QDeclarativeText::setVAlign(enum QDeclarativeText::VAlignment)
- ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(void)
- ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int)
+ ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(void)
+ ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int)
?elideMode@QDeclarativeText@@QBE?AW4TextElideMode@1@XZ @ 677 NONAME ABSENT ; enum QDeclarativeText::TextElideMode QDeclarativeText::elideMode(void) const
?baseUrl@QDeclarativeContext@@QBE?AVQUrl@@XZ @ 678 NONAME ; class QUrl QDeclarativeContext::baseUrl(void) const
?qt_metacall@QDeclarativeDebugRootContextQuery@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 679 NONAME ABSENT ; int QDeclarativeDebugRootContextQuery::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -849,7 +849,7 @@ EXPORTS
??1QDeclarativeBehavior@@UAE@XZ @ 848 NONAME ABSENT ; QDeclarativeBehavior::~QDeclarativeBehavior(void)
?qmlInfo@@YA?AVQDeclarativeInfo@@PBVQObject@@@Z @ 849 NONAME ; class QDeclarativeInfo qmlInfo(class QObject const *)
?qt_metacall@QDeclarativeDebugClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 850 NONAME ABSENT ; int QDeclarativeDebugClient::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ABSENT ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const
+ ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const
??1QDeclarativeDebugQuery@@UAE@XZ @ 852 NONAME ABSENT ; QDeclarativeDebugQuery::~QDeclarativeDebugQuery(void)
?data_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 853 NONAME ; void QDeclarativeItemPrivate::data_append(class QDeclarativeListProperty<class QObject> *, class QObject *)
?tr@QDeclarativeState@@SA?AVQString@@PBD0@Z @ 854 NONAME ; class QString QDeclarativeState::tr(char const *, char const *)
@@ -1120,7 +1120,7 @@ EXPORTS
?expression@QDeclarativeDebugExpressionQuery@@QBE?AVQVariant@@XZ @ 1119 NONAME ABSENT ; class QVariant QDeclarativeDebugExpressionQuery::expression(void) const
??4QDeclarativeDomList@@QAEAAV0@ABV0@@Z @ 1120 NONAME ABSENT ; class QDeclarativeDomList & QDeclarativeDomList::operator=(class QDeclarativeDomList const &)
?qt_metacall@QDeclarativeComponent@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1121 NONAME ; int QDeclarativeComponent::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *, int)
+ ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *, int)
?staticMetaObject@QDeclarativeEngine@@2UQMetaObject@@B @ 1123 NONAME ; struct QMetaObject const QDeclarativeEngine::staticMetaObject
?staticMetaObject@QDeclarativeStateOperation@@2UQMetaObject@@B @ 1124 NONAME ; struct QMetaObject const QDeclarativeStateOperation::staticMetaObject
?actions@QDeclarativeStateOperation@@UAE?AV?$QList@VQDeclarativeAction@@@@XZ @ 1125 NONAME ; class QList<class QDeclarativeAction> QDeclarativeStateOperation::actions(void)
@@ -1145,7 +1145,7 @@ EXPORTS
?sourceFile@QDeclarativeExpression@@QBE?AVQString@@XZ @ 1144 NONAME ; class QString QDeclarativeExpression::sourceFile(void) const
??_EQDeclarativeAnchors@@UAE@I@Z @ 1145 NONAME ABSENT ; QDeclarativeAnchors::~QDeclarativeAnchors(unsigned int)
?removeNotifySignal@QMetaPropertyBuilder@@QAEXXZ @ 1146 NONAME ABSENT ; void QMetaPropertyBuilder::removeNotifySignal(void)
- ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *)
+ ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *)
?setImportPathList@QDeclarativeEngine@@QAEXABVQStringList@@@Z @ 1148 NONAME ; void QDeclarativeEngine::setImportPathList(class QStringList const &)
?enabledChanged@QDeclarativeDebugService@@MAEX_N@Z @ 1149 NONAME ABSENT ; void QDeclarativeDebugService::enabledChanged(bool)
?addWatch@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugWatch@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1150 NONAME ABSENT ; class QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch(class QDeclarativeDebugObjectReference const &, class QObject *)
@@ -1176,7 +1176,7 @@ EXPORTS
?paint@QDeclarativeRectangle@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 1175 NONAME ABSENT ; void QDeclarativeRectangle::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
??6QDeclarativeState@@QAEAAV0@PAVQDeclarativeStateOperation@@@Z @ 1176 NONAME ; class QDeclarativeState & QDeclarativeState::operator<<(class QDeclarativeStateOperation *)
?destroy@QDeclarativeAbstractBinding@@UAEXXZ @ 1177 NONAME ABSENT ; void QDeclarativeAbstractBinding::destroy(void)
- ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ABSENT ; void * QDeclarativeDebugService::qt_metacast(char const *)
+ ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ; void * QDeclarativeDebugService::qt_metacast(char const *)
?qt_metacast@QDeclarativeValueType@@UAEPAXPBD@Z @ 1179 NONAME ABSENT ; void * QDeclarativeValueType::qt_metacast(char const *)
?childAt@QDeclarativeItem@@QBEPAV1@MM@Z @ 1180 NONAME ; class QDeclarativeItem * QDeclarativeItem::childAt(float, float) const
?paintedWidth@QDeclarativeText@@QBEMXZ @ 1181 NONAME ABSENT ; float QDeclarativeText::paintedWidth(void) const
@@ -1297,7 +1297,7 @@ EXPORTS
?value@QDeclarativeOpenMetaObject@@QBE?AVQVariant@@H@Z @ 1296 NONAME ABSENT ; class QVariant QDeclarativeOpenMetaObject::value(int) const
?tr@QDeclarativeDebugRootContextQuery@@SA?AVQString@@PBD0H@Z @ 1297 NONAME ABSENT ; class QString QDeclarativeDebugRootContextQuery::tr(char const *, char const *, int)
?setFromState@QDeclarativeTransition@@QAEXABVQString@@@Z @ 1298 NONAME ; void QDeclarativeTransition::setFromState(class QString const &)
- ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ABSENT ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const
+ ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const
?state@QDeclarativeDebugQuery@@QBE?AW4State@1@XZ @ 1300 NONAME ABSENT ; enum QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state(void) const
?setBottom@QDeclarativeScaleGrid@@QAEXH@Z @ 1301 NONAME ABSENT ; void QDeclarativeScaleGrid::setBottom(int)
?topMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 1302 NONAME ABSENT ; void QDeclarativeAnchors::topMarginChanged(void)
@@ -1305,7 +1305,7 @@ EXPORTS
?position@QDeclarativeDomObject@@QBEHXZ @ 1304 NONAME ABSENT ; int QDeclarativeDomObject::position(void) const
?update@QDeclarativeBinding@@UAEXV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 1305 NONAME ABSENT ; void QDeclarativeBinding::update(class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
?tr@QDeclarativeBehavior@@SA?AVQString@@PBD0@Z @ 1306 NONAME ABSENT ; class QString QDeclarativeBehavior::tr(char const *, char const *)
- ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ABSENT ; bool QDeclarativeDebugService::isDebuggingEnabled(void)
+ ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ; bool QDeclarativeDebugService::isDebuggingEnabled(void)
?tr@QDeclarativeText@@SA?AVQString@@PBD0H@Z @ 1308 NONAME ABSENT ; class QString QDeclarativeText::tr(char const *, char const *, int)
?reset@QDeclarativeProperty@@QBE_NXZ @ 1309 NONAME ; bool QDeclarativeProperty::reset(void) const
?objectDebugId@QDeclarativeDebugWatch@@QBEHXZ @ 1310 NONAME ABSENT ; int QDeclarativeDebugWatch::objectDebugId(void) const
@@ -1344,7 +1344,7 @@ EXPORTS
?maximumPacketSize@QPacketProtocol@@QBEHXZ @ 1343 NONAME ; int QPacketProtocol::maximumPacketSize(void) const
??_EQDeclarativeDebuggerStatus@@UAE@I@Z @ 1344 NONAME ABSENT ; QDeclarativeDebuggerStatus::~QDeclarativeDebuggerStatus(unsigned int)
?error@QDeclarativeCustomParser@@IAEXABVQString@@@Z @ 1345 NONAME ; void QDeclarativeCustomParser::error(class QString const &)
- ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ABSENT ; void QDeclarativeDebugService::messageReceived(class QByteArray const &)
+ ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ; void QDeclarativeDebugService::messageReceived(class QByteArray const &)
??0QDeclarativeParserStatus@@QAE@XZ @ 1347 NONAME ; QDeclarativeParserStatus::QDeclarativeParserStatus(void)
?isNumber@Variant@QDeclarativeParser@@QBE_NXZ @ 1348 NONAME ; bool QDeclarativeParser::Variant::isNumber(void) const
?getStaticMetaObject@QDeclarativeEngineDebug@@SAABUQMetaObject@@XZ @ 1349 NONAME ABSENT ; struct QMetaObject const & QDeclarativeEngineDebug::getStaticMetaObject(void)
@@ -1475,7 +1475,7 @@ EXPORTS
?packetWritten@QPacketProtocol@@IAEXXZ @ 1474 NONAME ; void QPacketProtocol::packetWritten(void)
?getStaticMetaObject@QDeclarativeDebugObjectQuery@@SAABUQMetaObject@@XZ @ 1475 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugObjectQuery::getStaticMetaObject(void)
?isSignalProperty@QDeclarativeProperty@@QBE_NXZ @ 1476 NONAME ; bool QDeclarativeProperty::isSignalProperty(void) const
- ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ABSENT ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void)
+ ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void)
?qmlTypeNames@QDeclarativeMetaType@@SA?AV?$QList@VQByteArray@@@@XZ @ 1478 NONAME ABSENT ; class QList<class QByteArray> QDeclarativeMetaType::qmlTypeNames(void)
?componentComplete@QDeclarativeItem@@MAEXXZ @ 1479 NONAME ; void QDeclarativeItem::componentComplete(void)
?creationContext@QDeclarativeComponent@@QBEPAVQDeclarativeContext@@XZ @ 1480 NONAME ; class QDeclarativeContext * QDeclarativeComponent::creationContext(void) const
@@ -1575,7 +1575,7 @@ EXPORTS
?keyCount@QMetaEnumBuilder@@QBEHXZ @ 1574 NONAME ABSENT ; int QMetaEnumBuilder::keyCount(void) const
??1QDeclarativeDomProperty@@QAE@XZ @ 1575 NONAME ABSENT ; QDeclarativeDomProperty::~QDeclarativeDomProperty(void)
?url@QDeclarativePixmap@@QBEABVQUrl@@XZ @ 1576 NONAME ; class QUrl const & QDeclarativePixmap::url(void) const
- ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ABSENT ; void QDeclarativeDebugService::sendMessage(class QByteArray const &)
+ ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ; void QDeclarativeDebugService::sendMessage(class QByteArray const &)
?context@QDeclarativeScriptString@@QBEPAVQDeclarativeContext@@XZ @ 1578 NONAME ; class QDeclarativeContext * QDeclarativeScriptString::context(void) const
?queryObject@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugObjectQuery@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1579 NONAME ABSENT ; class QDeclarativeDebugObjectQuery * QDeclarativeEngineDebug::queryObject(class QDeclarativeDebugObjectReference const &, class QObject *)
?tr@QDeclarativePropertyMap@@SA?AVQString@@PBD0H@Z @ 1580 NONAME ; class QString QDeclarativePropertyMap::tr(char const *, char const *, int)
@@ -1608,7 +1608,7 @@ EXPORTS
??_EQDeclarativeComponent@@UAE@I@Z @ 1607 NONAME ; QDeclarativeComponent::~QDeclarativeComponent(unsigned int)
?get@QDeclarativeItemPrivate@@SAPAV1@PAVQDeclarativeItem@@@Z @ 1608 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItemPrivate::get(class QDeclarativeItem *)
?staticMetaObject@QDeclarativeView@@2UQMetaObject@@B @ 1609 NONAME ; struct QMetaObject const QDeclarativeView::staticMetaObject
- ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ABSENT ; class QString QDeclarativeDebugService::objectToString(class QObject *)
+ ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ; class QString QDeclarativeDebugService::objectToString(class QObject *)
?defaultValue@QDeclarativeDomDynamicProperty@@QBE?AVQDeclarativeDomProperty@@XZ @ 1611 NONAME ABSENT ; class QDeclarativeDomProperty QDeclarativeDomDynamicProperty::defaultValue(void) const
?relatedMetaObject@QMetaObjectBuilder@@QBEPBUQMetaObject@@H@Z @ 1612 NONAME ABSENT ; struct QMetaObject const * QMetaObjectBuilder::relatedMetaObject(int) const
?addKey@QMetaEnumBuilder@@QAEHABVQByteArray@@H@Z @ 1613 NONAME ABSENT ; int QMetaEnumBuilder::addKey(class QByteArray const &, int)
@@ -1633,7 +1633,7 @@ EXPORTS
?tr@QDeclarativeView@@SA?AVQString@@PBD0@Z @ 1632 NONAME ; class QString QDeclarativeView::tr(char const *, char const *)
?qt_metacall@QPacketProtocol@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1633 NONAME ; int QPacketProtocol::qt_metacall(enum QMetaObject::Call, int, void * *)
??0QDeclarativeItem@@QAE@PAV0@@Z @ 1634 NONAME ; QDeclarativeItem::QDeclarativeItem(class QDeclarativeItem *)
- ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ABSENT ; bool QDeclarativeDebugService::hasDebuggingClient(void)
+ ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ; bool QDeclarativeDebugService::hasDebuggingClient(void)
?staticMetaObject@QDeclarativeContext@@2UQMetaObject@@B @ 1636 NONAME ; struct QMetaObject const QDeclarativeContext::staticMetaObject
?setContextForObject@QDeclarativeEngine@@SAXPAVQObject@@PAVQDeclarativeContext@@@Z @ 1637 NONAME ; void QDeclarativeEngine::setContextForObject(class QObject *, class QDeclarativeContext *)
?baselineOffsetChanged@QDeclarativeItem@@IAEXM@Z @ 1638 NONAME ; void QDeclarativeItem::baselineOffsetChanged(float)
@@ -1733,7 +1733,7 @@ EXPORTS
?start@QDeclarativeTimer@@QAEXXZ @ 1732 NONAME ABSENT ; void QDeclarativeTimer::start(void)
?transition@QDeclarativeAbstractAnimation@@UAEXAAV?$QList@VQDeclarativeAction@@@@AAV?$QList@VQDeclarativeProperty@@@@W4TransitionDirection@1@@Z @ 1733 NONAME ABSENT ; void QDeclarativeAbstractAnimation::transition(class QList<class QDeclarativeAction> &, class QList<class QDeclarativeProperty> &, enum QDeclarativeAbstractAnimation::TransitionDirection)
?componentComplete@QDeclarativeAbstractAnimation@@UAEXXZ @ 1734 NONAME ABSENT ; void QDeclarativeAbstractAnimation::componentComplete(void)
- ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ABSENT ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status)
+ ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status)
?runningChanged@QDeclarativeAbstractAnimation@@IAEX_N@Z @ 1736 NONAME ABSENT ; void QDeclarativeAbstractAnimation::runningChanged(bool)
?trUtf8@QDeclarativeAbstractAnimation@@SA?AVQString@@PBD0H@Z @ 1737 NONAME ABSENT ; class QString QDeclarativeAbstractAnimation::trUtf8(char const *, char const *, int)
??_EQDeclarativeBasePositioner@@UAE@I@Z @ 1738 NONAME ABSENT ; QDeclarativeBasePositioner::~QDeclarativeBasePositioner(unsigned int)
@@ -1813,7 +1813,7 @@ EXPORTS
?setTarget@QDeclarativeAbstractAnimation@@EAEXABVQDeclarativeProperty@@@Z @ 1812 NONAME ABSENT ; void QDeclarativeAbstractAnimation::setTarget(class QDeclarativeProperty const &)
?alwaysRunToEnd@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1813 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::alwaysRunToEnd(void) const
?tr@QDeclarativeTimer@@SA?AVQString@@PBD0H@Z @ 1814 NONAME ABSENT ; class QString QDeclarativeTimer::tr(char const *, char const *, int)
- ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ABSENT ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const
+ ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const
?intervalChanged@QDeclarativeTimer@@IAEXXZ @ 1816 NONAME ABSENT ; void QDeclarativeTimer::intervalChanged(void)
?isPaused@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1817 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::isPaused(void) const
?getStaticMetaObject@QDeclarativeAbstractAnimation@@SAABUQMetaObject@@XZ @ 1818 NONAME ABSENT ; struct QMetaObject const & QDeclarativeAbstractAnimation::getStaticMetaObject(void)
@@ -1888,4 +1888,9 @@ EXPORTS
??1QDeclarativeRefCount@@UAE@XZ @ 1887 NONAME ; QDeclarativeRefCount::~QDeclarativeRefCount(void)
?addref@QDeclarativeRefCount@@QAEXXZ @ 1888 NONAME ; void QDeclarativeRefCount::addref(void)
?release@QDeclarativeRefCount@@QAEXXZ @ 1889 NONAME ; void QDeclarativeRefCount::release(void)
+ ?resolveLayoutMirror@QDeclarativeItemPrivate@@QAEXXZ @ 1890 NONAME ; void QDeclarativeItemPrivate::resolveLayoutMirror(void)
+ ?mirrorChange@QDeclarativeItemPrivate@@UAEXXZ @ 1891 NONAME ; void QDeclarativeItemPrivate::mirrorChange(void)
+ ?setLayoutMirror@QDeclarativeItemPrivate@@QAEX_N@Z @ 1892 NONAME ; void QDeclarativeItemPrivate::setLayoutMirror(bool)
+ ?setImplicitLayoutMirror@QDeclarativeItemPrivate@@QAEX_N0@Z @ 1893 NONAME ; void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool, bool)
+ ?isMirrored@QDeclarativeItemPrivate@@QBE_NXZ @ 1894 NONAME ; bool QDeclarativeItemPrivate::isMirrored(void) const
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 057238c..a1f1b50 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -13146,4 +13146,61 @@ EXPORTS
?setWordSelectionEnabled@QTextControl@@QAEX_N@Z @ 13145 NONAME ; void QTextControl::setWordSelectionEnabled(bool)
?setDragEnabled@QTextControl@@QAEX_N@Z @ 13146 NONAME ; void QTextControl::setDragEnabled(bool)
?isWordSelectionEnabled@QTextControl@@QBE_NXZ @ 13147 NONAME ; bool QTextControl::isWordSelectionEnabled(void) const
+ ?ProcessCommandParametersL@QS60MainAppUi@@UAEHW4TApaCommand@@AAV?$TBuf@$0BAA@@@ABVTDesC8@@@Z @ 13148 NONAME ; int QS60MainAppUi::ProcessCommandParametersL(enum TApaCommand, class TBuf<256> &, class TDesC8 const &)
+ ?openFile@QFileOpenEvent@@QBE_NAAVQFile@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13149 NONAME ; bool QFileOpenEvent::openFile(class QFile &, class QFlags<enum QIODevice::OpenModeFlag>) const
+ ??0QFileOpenEvent@@QAE@ABVRFile@@@Z @ 13150 NONAME ; QFileOpenEvent::QFileOpenEvent(class RFile const &)
+ ?beginDataAccess@QVolatileImage@@QBEXXZ @ 13151 NONAME ; void QVolatileImage::beginDataAccess(void) const
+ ??1QVolatileImage@@QAE@XZ @ 13152 NONAME ; QVolatileImage::~QVolatileImage(void)
+ ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13153 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *)
+ ??0QVolatileImage@@QAE@HHW4Format@QImage@@@Z @ 13154 NONAME ; QVolatileImage::QVolatileImage(int, int, enum QImage::Format)
+ ?ensureFormat@QVolatileImage@@QAE_NW4Format@QImage@@@Z @ 13155 NONAME ; bool QVolatileImage::ensureFormat(enum QImage::Format)
+ ?fill@QVolatileImage@@QAEXI@Z @ 13156 NONAME ; void QVolatileImage::fill(unsigned int)
+ ?assignedInputContext@QWidgetPrivate@@QBEPAVQInputContext@@XZ @ 13157 NONAME ; class QInputContext * QWidgetPrivate::assignedInputContext(void) const
+ ?retrieveData@QInternalMimeData@@MBE?AVQVariant@@ABVQString@@W4Type@2@@Z @ 13158 NONAME ; class QVariant QInternalMimeData::retrieveData(class QString const &, enum QVariant::Type) const
+ ?formats@QInternalMimeData@@UBE?AVQStringList@@XZ @ 13159 NONAME ; class QStringList QInternalMimeData::formats(void) const
+ ?isNull@QVolatileImage@@QBE_NXZ @ 13160 NONAME ; bool QVolatileImage::isNull(void) const
+ ?toImage@QVolatileImage@@QBE?AVQImage@@XZ @ 13161 NONAME ; class QImage QVolatileImage::toImage(void) const
+ ??0QVolatileImage@@QAE@ABVQImage@@@Z @ 13162 NONAME ; QVolatileImage::QVolatileImage(class QImage const &)
+ ?tr@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13163 NONAME ; class QString QInternalMimeData::tr(char const *, char const *, int)
+ ?resolveFontFamilyAlias@QFontDatabase@@CA?AVQString@@ABV2@@Z @ 13164 NONAME ; class QString QFontDatabase::resolveFontFamilyAlias(class QString const &)
+ ?hasFormat@QInternalMimeData@@UBE_NABVQString@@@Z @ 13165 NONAME ; bool QInternalMimeData::hasFormat(class QString const &) const
+ ?format@QVolatileImage@@QBE?AW4Format@QImage@@XZ @ 13166 NONAME ; enum QImage::Format QVolatileImage::format(void) const
+ ?renderDataHelper@QInternalMimeData@@SA?AVQByteArray@@ABVQString@@PBVQMimeData@@@Z @ 13167 NONAME ; class QByteArray QInternalMimeData::renderDataHelper(class QString const &, class QMimeData const *)
+ ?endDataAccess@QVolatileImage@@QBEX_N@Z @ 13168 NONAME ; void QVolatileImage::endDataAccess(bool) const
+ ?constBits@QVolatileImage@@QBEPBEXZ @ 13169 NONAME ; unsigned char const * QVolatileImage::constBits(void) const
+ ?updateMicroFocus@QLineControl@@IAEXXZ @ 13170 NONAME ; void QLineControl::updateMicroFocus(void)
+ ?height@QVolatileImage@@QBEHXZ @ 13171 NONAME ; int QVolatileImage::height(void) const
+ ?duplicateNativeImage@QVolatileImage@@QBEPAXXZ @ 13172 NONAME ; void * QVolatileImage::duplicateNativeImage(void) const
+ ?formatsHelper@QInternalMimeData@@SA?AVQStringList@@PBVQMimeData@@@Z @ 13173 NONAME ; class QStringList QInternalMimeData::formatsHelper(class QMimeData const *)
+ ?qt_metacast@QInternalMimeData@@UAEPAXPBD@Z @ 13174 NONAME ; void * QInternalMimeData::qt_metacast(char const *)
+ ?bits@QVolatileImage@@QAEPAEXZ @ 13175 NONAME ; unsigned char * QVolatileImage::bits(void)
+ ?paintEngine@QVolatileImage@@QAEPAVQPaintEngine@@XZ @ 13176 NONAME ; class QPaintEngine * QVolatileImage::paintEngine(void)
+ ?bytesPerLine@QVolatileImage@@QBEHXZ @ 13177 NONAME ; int QVolatileImage::bytesPerLine(void) const
+ ?width@QVolatileImage@@QBEHXZ @ 13178 NONAME ; int QVolatileImage::width(void) const
+ ?qt_metacall@QInternalMimeData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13179 NONAME ; int QInternalMimeData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?lineHeightType@QTextBlockFormat@@QBEHXZ @ 13180 NONAME ; int QTextBlockFormat::lineHeightType(void) const
+ ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13181 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *, int)
+ ?copyFrom@QVolatileImage@@QAEXPAV1@ABVQRect@@@Z @ 13182 NONAME ; void QVolatileImage::copyFrom(class QVolatileImage *, class QRect const &)
+ ?lineHeight@QTextBlockFormat@@QBEMMM@Z @ 13183 NONAME ; float QTextBlockFormat::lineHeight(float, float) const
+ ?canReadData@QInternalMimeData@@SA_NABVQString@@@Z @ 13184 NONAME ; bool QInternalMimeData::canReadData(class QString const &)
+ ?releaseCachedResources@QGraphicsSystem@@UAEXXZ @ 13185 NONAME ; void QGraphicsSystem::releaseCachedResources(void)
+ ??0QInternalMimeData@@QAE@XZ @ 13186 NONAME ; QInternalMimeData::QInternalMimeData(void)
+ ?setLineHeight@QTextBlockFormat@@QAEXMH@Z @ 13187 NONAME ; void QTextBlockFormat::setLineHeight(float, int)
+ ?imageRef@QVolatileImage@@QAEAAVQImage@@XZ @ 13188 NONAME ; class QImage & QVolatileImage::imageRef(void)
+ ??0QVolatileImage@@QAE@PAX0@Z @ 13189 NONAME ; QVolatileImage::QVolatileImage(void *, void *)
+ ??4QVolatileImage@@QAEAAV0@ABV0@@Z @ 13190 NONAME ; class QVolatileImage & QVolatileImage::operator=(class QVolatileImage const &)
+ ??0QVolatileImage@@QAE@XZ @ 13191 NONAME ; QVolatileImage::QVolatileImage(void)
+ ?getStaticMetaObject@QInternalMimeData@@SAABUQMetaObject@@XZ @ 13192 NONAME ; struct QMetaObject const & QInternalMimeData::getStaticMetaObject(void)
+ ?lineHeight@QTextBlockFormat@@QBEMXZ @ 13193 NONAME ; float QTextBlockFormat::lineHeight(void) const
+ ?tr@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13194 NONAME ; class QString QInternalMimeData::tr(char const *, char const *)
+ ?hasAlphaChannel@QVolatileImage@@QBE_NXZ @ 13195 NONAME ; bool QVolatileImage::hasAlphaChannel(void) const
+ ?setAlphaChannel@QVolatileImage@@QAEXABVQPixmap@@@Z @ 13196 NONAME ; void QVolatileImage::setAlphaChannel(class QPixmap const &)
+ ??_EQInternalMimeData@@UAE@I@Z @ 13197 NONAME ; QInternalMimeData::~QInternalMimeData(unsigned int)
+ ?byteCount@QVolatileImage@@QBEHXZ @ 13198 NONAME ; int QVolatileImage::byteCount(void) const
+ ??0QVolatileImage@@QAE@ABV0@@Z @ 13199 NONAME ; QVolatileImage::QVolatileImage(class QVolatileImage const &)
+ ?metaObject@QInternalMimeData@@UBEPBUQMetaObject@@XZ @ 13200 NONAME ; struct QMetaObject const * QInternalMimeData::metaObject(void) const
+ ?depth@QVolatileImage@@QBEHXZ @ 13201 NONAME ; int QVolatileImage::depth(void) const
+ ?hasFormatHelper@QInternalMimeData@@SA_NABVQString@@PBVQMimeData@@@Z @ 13202 NONAME ; bool QInternalMimeData::hasFormatHelper(class QString const &, class QMimeData const *)
+ ??1QInternalMimeData@@UAE@XZ @ 13203 NONAME ; QInternalMimeData::~QInternalMimeData(void)
+ ?staticMetaObject@QInternalMimeData@@2UQMetaObject@@B @ 13204 NONAME ; struct QMetaObject const QInternalMimeData::staticMetaObject
diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def
index 6ea8635..d16ff06 100644
--- a/src/s60installs/bwins/QtOpenGLu.def
+++ b/src/s60installs/bwins/QtOpenGLu.def
@@ -703,3 +703,134 @@ EXPORTS
?maxTextureWidth@QGLTextureGlyphCache@@UBEHXZ @ 702 NONAME ; int QGLTextureGlyphCache::maxTextureWidth(void) const
?filterMode@QGLTextureGlyphCache@@QBE?AW4FilterMode@1@XZ @ 703 NONAME ; enum QGLTextureGlyphCache::FilterMode QGLTextureGlyphCache::filterMode(void) const
?setFilterMode@QGLTextureGlyphCache@@QAEXW4FilterMode@1@@Z @ 704 NONAME ; void QGLTextureGlyphCache::setFilterMode(enum QGLTextureGlyphCache::FilterMode)
+ ?glVertexAttrib3f@QGLFunctions@@QAEXIMMM@Z @ 705 NONAME ; void QGLFunctions::glVertexAttrib3f(unsigned int, float, float, float)
+ ?glVertexAttrib1fv@QGLFunctions@@QAEXIPBM@Z @ 706 NONAME ; void QGLFunctions::glVertexAttrib1fv(unsigned int, float const *)
+ ?glIsBuffer@QGLFunctions@@QAEEI@Z @ 707 NONAME ; unsigned char QGLFunctions::glIsBuffer(unsigned int)
+ ?glGetActiveAttrib@QGLFunctions@@QAEXIIHPAH0PAIPAD@Z @ 708 NONAME ; void QGLFunctions::glGetActiveAttrib(unsigned int, unsigned int, int, int *, int *, unsigned int *, char *)
+ ?glBindFramebuffer@QGLFunctions@@QAEXII@Z @ 709 NONAME ; void QGLFunctions::glBindFramebuffer(unsigned int, unsigned int)
+ ?glBufferData@QGLFunctions@@QAEXIHPBXI@Z @ 710 NONAME ; void QGLFunctions::glBufferData(unsigned int, int, void const *, unsigned int)
+ ?glValidateProgram@QGLFunctions@@QAEXI@Z @ 711 NONAME ; void QGLFunctions::glValidateProgram(unsigned int)
+ ?glUniform1f@QGLFunctions@@QAEXHM@Z @ 712 NONAME ; void QGLFunctions::glUniform1f(int, float)
+ ?glDetachShader@QGLFunctions@@QAEXII@Z @ 713 NONAME ; void QGLFunctions::glDetachShader(unsigned int, unsigned int)
+ ?glDeleteProgram@QGLFunctions@@QAEXI@Z @ 714 NONAME ; void QGLFunctions::glDeleteProgram(unsigned int)
+ ??_EQGLContextResourceBase@@UAE@I@Z @ 715 NONAME ; QGLContextResourceBase::~QGLContextResourceBase(unsigned int)
+ ?glUniform2f@QGLFunctions@@QAEXHMM@Z @ 716 NONAME ; void QGLFunctions::glUniform2f(int, float, float)
+ ?glIsProgram@QGLFunctions@@QAEEI@Z @ 717 NONAME ; unsigned char QGLFunctions::glIsProgram(unsigned int)
+ ?openGLFeatures@QGLFunctions@@QBE?AV?$QFlags@W4OpenGLFeature@QGLFunctions@@@@XZ @ 718 NONAME ; class QFlags<enum QGLFunctions::OpenGLFeature> QGLFunctions::openGLFeatures(void) const
+ ?toNativeType@QGLPixmapData@@UAEPAXW4NativeType@QPixmapData@@@Z @ 719 NONAME ; void * QGLPixmapData::toNativeType(enum QPixmapData::NativeType)
+ ?glReleaseShaderCompiler@QGLFunctions@@QAEXXZ @ 720 NONAME ; void QGLFunctions::glReleaseShaderCompiler(void)
+ ??0QGLTextureGlyphCache@@QAE@PBVQGLContext@@W4Type@QFontEngineGlyphCache@@ABVQTransform@@@Z @ 721 NONAME ; QGLTextureGlyphCache::QGLTextureGlyphCache(class QGLContext const *, enum QFontEngineGlyphCache::Type, class QTransform const &)
+ ?context@QGLTextureGlyphCache@@QBEPBVQGLContext@@XZ @ 722 NONAME ; class QGLContext const * QGLTextureGlyphCache::context(void) const
+ ?glGenRenderbuffers@QGLFunctions@@QAEXHPAI@Z @ 723 NONAME ; void QGLFunctions::glGenRenderbuffers(int, unsigned int *)
+ ?glBindBuffer@QGLFunctions@@QAEXII@Z @ 724 NONAME ; void QGLFunctions::glBindBuffer(unsigned int, unsigned int)
+ ?glUniformMatrix3fv@QGLFunctions@@QAEXHHEPBM@Z @ 725 NONAME ; void QGLFunctions::glUniformMatrix3fv(int, int, unsigned char, float const *)
+ ?glGenerateMipmap@QGLFunctions@@QAEXI@Z @ 726 NONAME ; void QGLFunctions::glGenerateMipmap(unsigned int)
+ ?hasOpenGLFeature@QGLFunctions@@QBE_NW4OpenGLFeature@1@@Z @ 727 NONAME ; bool QGLFunctions::hasOpenGLFeature(enum QGLFunctions::OpenGLFeature) const
+ ?glGetAttachedShaders@QGLFunctions@@QAEXIHPAHPAI@Z @ 728 NONAME ; void QGLFunctions::glGetAttachedShaders(unsigned int, int, int *, unsigned int *)
+ ?glDeleteShader@QGLFunctions@@QAEXI@Z @ 729 NONAME ; void QGLFunctions::glDeleteShader(unsigned int)
+ ?glLinkProgram@QGLFunctions@@QAEXI@Z @ 730 NONAME ; void QGLFunctions::glLinkProgram(unsigned int)
+ ?glUseProgram@QGLFunctions@@QAEXI@Z @ 731 NONAME ; void QGLFunctions::glUseProgram(unsigned int)
+ ??0QGLFunctions@@QAE@PBVQGLContext@@@Z @ 732 NONAME ; QGLFunctions::QGLFunctions(class QGLContext const *)
+ ?glGetBufferParameteriv@QGLFunctions@@QAEXIIPAH@Z @ 733 NONAME ; void QGLFunctions::glGetBufferParameteriv(unsigned int, unsigned int, int *)
+ ?glGenBuffers@QGLFunctions@@QAEXHPAI@Z @ 734 NONAME ; void QGLFunctions::glGenBuffers(int, unsigned int *)
+ ?glGetShaderiv@QGLFunctions@@QAEXIIPAH@Z @ 735 NONAME ; void QGLFunctions::glGetShaderiv(unsigned int, unsigned int, int *)
+ ?fillTexture@QGLTextureGlyphCache@@UAEXABUCoord@QTextureGlyphCache@@IUQFixed@@@Z @ 736 NONAME ; void QGLTextureGlyphCache::fillTexture(struct QTextureGlyphCache::Coord const &, unsigned int, struct QFixed)
+ ?glUniform2fv@QGLFunctions@@QAEXHHPBM@Z @ 737 NONAME ; void QGLFunctions::glUniform2fv(int, int, float const *)
+ ?fromNativeType@QGLPixmapData@@UAEXPAXW4NativeType@QPixmapData@@@Z @ 738 NONAME ; void QGLPixmapData::fromNativeType(void *, enum QPixmapData::NativeType)
+ ??0QGLContextGroupResourceBase@@QAE@XZ @ 739 NONAME ; QGLContextGroupResourceBase::QGLContextGroupResourceBase(void)
+ ?glGetFramebufferAttachmentParameteriv@QGLFunctions@@QAEXIIIPAH@Z @ 740 NONAME ; void QGLFunctions::glGetFramebufferAttachmentParameteriv(unsigned int, unsigned int, unsigned int, int *)
+ ?cleanup@QGLContextGroupResourceBase@@QAEXPBVQGLContext@@PAX@Z @ 741 NONAME ; void QGLContextGroupResourceBase::cleanup(class QGLContext const *, void *)
+ ?glUniform2iv@QGLFunctions@@QAEXHHPBH@Z @ 742 NONAME ; void QGLFunctions::glUniform2iv(int, int, int const *)
+ ?glCompileShader@QGLFunctions@@QAEXI@Z @ 743 NONAME ; void QGLFunctions::glCompileShader(unsigned int)
+ ?isFlipped@QGLPaintDevice@@UBE_NXZ @ 744 NONAME ; bool QGLPaintDevice::isFlipped(void) const
+ ?glGetProgramiv@QGLFunctions@@QAEXIIPAH@Z @ 745 NONAME ; void QGLFunctions::glGetProgramiv(unsigned int, unsigned int, int *)
+ ?glClearDepthf@QGLFunctions@@QAEXM@Z @ 746 NONAME ; void QGLFunctions::glClearDepthf(float)
+ ?glIsFramebuffer@QGLFunctions@@QAEEI@Z @ 747 NONAME ; unsigned char QGLFunctions::glIsFramebuffer(unsigned int)
+ ?glUniform4f@QGLFunctions@@QAEXHMMMM@Z @ 748 NONAME ; void QGLFunctions::glUniform4f(int, float, float, float, float)
+ ?glUniform3f@QGLFunctions@@QAEXHMMM@Z @ 749 NONAME ; void QGLFunctions::glUniform3f(int, float, float, float)
+ ?glDeleteRenderbuffers@QGLFunctions@@QAEXHPBI@Z @ 750 NONAME ; void QGLFunctions::glDeleteRenderbuffers(int, unsigned int const *)
+ ?glVertexAttrib1f@QGLFunctions@@QAEXIM@Z @ 751 NONAME ; void QGLFunctions::glVertexAttrib1f(unsigned int, float)
+ ?glVertexAttrib4f@QGLFunctions@@QAEXIMMMM@Z @ 752 NONAME ; void QGLFunctions::glVertexAttrib4f(unsigned int, float, float, float, float)
+ ?glSampleCoverage@QGLFunctions@@QAEXME@Z @ 753 NONAME ; void QGLFunctions::glSampleCoverage(float, unsigned char)
+ ?glGetActiveUniform@QGLFunctions@@QAEXIIHPAH0PAIPAD@Z @ 754 NONAME ; void QGLFunctions::glGetActiveUniform(unsigned int, unsigned int, int, int *, int *, unsigned int *, char *)
+ ??_EQGLContextGroupResourceBase@@UAE@I@Z @ 755 NONAME ; QGLContextGroupResourceBase::~QGLContextGroupResourceBase(unsigned int)
+ ?glStencilOpSeparate@QGLFunctions@@QAEXIIII@Z @ 756 NONAME ; void QGLFunctions::glStencilOpSeparate(unsigned int, unsigned int, unsigned int, unsigned int)
+ ?glCheckFramebufferStatus@QGLFunctions@@QAEII@Z @ 757 NONAME ; unsigned int QGLFunctions::glCheckFramebufferStatus(unsigned int)
+ ?glDepthRangef@QGLFunctions@@QAEXMM@Z @ 758 NONAME ; void QGLFunctions::glDepthRangef(float, float)
+ ??1QGLFunctions@@QAE@XZ @ 759 NONAME ; QGLFunctions::~QGLFunctions(void)
+ ?glStencilMaskSeparate@QGLFunctions@@QAEXII@Z @ 760 NONAME ; void QGLFunctions::glStencilMaskSeparate(unsigned int, unsigned int)
+ ?glBlendColor@QGLFunctions@@QAEXMMMM@Z @ 761 NONAME ; void QGLFunctions::glBlendColor(float, float, float, float)
+ ?glUniform1fv@QGLFunctions@@QAEXHHPBM@Z @ 762 NONAME ; void QGLFunctions::glUniform1fv(int, int, float const *)
+ ??1QGLContextResourceBase@@UAE@XZ @ 763 NONAME ; QGLContextResourceBase::~QGLContextResourceBase(void)
+ ?glCreateProgram@QGLFunctions@@QAEIXZ @ 764 NONAME ; unsigned int QGLFunctions::glCreateProgram(void)
+ ?glVertexAttrib2f@QGLFunctions@@QAEXIMM@Z @ 765 NONAME ; void QGLFunctions::glVertexAttrib2f(unsigned int, float, float)
+ ?glUniformMatrix2fv@QGLFunctions@@QAEXHHEPBM@Z @ 766 NONAME ; void QGLFunctions::glUniformMatrix2fv(int, int, unsigned char, float const *)
+ ?glBufferSubData@QGLFunctions@@QAEXIHHPBX@Z @ 767 NONAME ; void QGLFunctions::glBufferSubData(unsigned int, int, int, void const *)
+ ?glUniform1iv@QGLFunctions@@QAEXHHPBH@Z @ 768 NONAME ; void QGLFunctions::glUniform1iv(int, int, int const *)
+ ?qt_resolve_buffer_extensions@@YA_NPAVQGLContext@@@Z @ 769 NONAME ; bool qt_resolve_buffer_extensions(class QGLContext *)
+ ?glUniform1i@QGLFunctions@@QAEXHH@Z @ 770 NONAME ; void QGLFunctions::glUniform1i(int, int)
+ ?glVertexAttrib4fv@QGLFunctions@@QAEXIPBM@Z @ 771 NONAME ; void QGLFunctions::glVertexAttrib4fv(unsigned int, float const *)
+ ?glDeleteFramebuffers@QGLFunctions@@QAEXHPBI@Z @ 772 NONAME ; void QGLFunctions::glDeleteFramebuffers(int, unsigned int const *)
+ ?glGetVertexAttribfv@QGLFunctions@@QAEXIIPAM@Z @ 773 NONAME ; void QGLFunctions::glGetVertexAttribfv(unsigned int, unsigned int, float *)
+ ?glGetProgramInfoLog@QGLFunctions@@QAEXIHPAHPAD@Z @ 774 NONAME ; void QGLFunctions::glGetProgramInfoLog(unsigned int, int, int *, char *)
+ ?glGetShaderInfoLog@QGLFunctions@@QAEXIHPAHPAD@Z @ 775 NONAME ; void QGLFunctions::glGetShaderInfoLog(unsigned int, int, int *, char *)
+ ?glEnableVertexAttribArray@QGLFunctions@@QAEXI@Z @ 776 NONAME ; void QGLFunctions::glEnableVertexAttribArray(unsigned int)
+ ?glGetVertexAttribiv@QGLFunctions@@QAEXIIPAH@Z @ 777 NONAME ; void QGLFunctions::glGetVertexAttribiv(unsigned int, unsigned int, int *)
+ ?swapBehavior@QGLWindowSurface@@2W4SwapMode@1@A @ 778 NONAME ; enum QGLWindowSurface::SwapMode QGLWindowSurface::swapBehavior
+ ?glCompressedTexImage2D@QGLFunctions@@QAEXIHIHHHHPBX@Z @ 779 NONAME ; void QGLFunctions::glCompressedTexImage2D(unsigned int, int, unsigned int, int, int, int, int, void const *)
+ ?glGetAttribLocation@QGLFunctions@@QAEHIPBD@Z @ 780 NONAME ; int QGLFunctions::glGetAttribLocation(unsigned int, char const *)
+ ?glActiveTexture@QGLFunctions@@QAEXI@Z @ 781 NONAME ; void QGLFunctions::glActiveTexture(unsigned int)
+ ?glUniform4fv@QGLFunctions@@QAEXHHPBM@Z @ 782 NONAME ; void QGLFunctions::glUniform4fv(int, int, float const *)
+ ?glCreateShader@QGLFunctions@@QAEII@Z @ 783 NONAME ; unsigned int QGLFunctions::glCreateShader(unsigned int)
+ ?glAttachShader@QGLFunctions@@QAEXII@Z @ 784 NONAME ; void QGLFunctions::glAttachShader(unsigned int, unsigned int)
+ ?glRenderbufferStorage@QGLFunctions@@QAEXIIHH@Z @ 785 NONAME ; void QGLFunctions::glRenderbufferStorage(unsigned int, unsigned int, int, int)
+ ?glVertexAttribPointer@QGLFunctions@@QAEXIHIEHPBX@Z @ 786 NONAME ; void QGLFunctions::glVertexAttribPointer(unsigned int, int, unsigned int, unsigned char, int, void const *)
+ ?glUniform4iv@QGLFunctions@@QAEXHHPBH@Z @ 787 NONAME ; void QGLFunctions::glUniform4iv(int, int, int const *)
+ ?glDisableVertexAttribArray@QGLFunctions@@QAEXI@Z @ 788 NONAME ; void QGLFunctions::glDisableVertexAttribArray(unsigned int)
+ ?glIsShader@QGLFunctions@@QAEEI@Z @ 789 NONAME ; unsigned char QGLFunctions::glIsShader(unsigned int)
+ ?glShaderBinary@QGLFunctions@@QAEXHPBIIPBXH@Z @ 790 NONAME ; void QGLFunctions::glShaderBinary(int, unsigned int const *, unsigned int, void const *, int)
+ ?glGenFramebuffers@QGLFunctions@@QAEXHPAI@Z @ 791 NONAME ; void QGLFunctions::glGenFramebuffers(int, unsigned int *)
+ ?glVertexAttrib3fv@QGLFunctions@@QAEXIPBM@Z @ 792 NONAME ; void QGLFunctions::glVertexAttrib3fv(unsigned int, float const *)
+ ?glGetVertexAttribPointerv@QGLFunctions@@QAEXIIPAPAX@Z @ 793 NONAME ; void QGLFunctions::glGetVertexAttribPointerv(unsigned int, unsigned int, void * *)
+ ?glUniformMatrix4fv@QGLFunctions@@QAEXHHEPBM@Z @ 794 NONAME ; void QGLFunctions::glUniformMatrix4fv(int, int, unsigned char, float const *)
+ ?setContext@QGLTextureGlyphCache@@QAEXPBVQGLContext@@@Z @ 795 NONAME ; void QGLTextureGlyphCache::setContext(class QGLContext const *)
+ ?glDeleteBuffers@QGLFunctions@@QAEXHPBI@Z @ 796 NONAME ; void QGLFunctions::glDeleteBuffers(int, unsigned int const *)
+ ?glBindRenderbuffer@QGLFunctions@@QAEXII@Z @ 797 NONAME ; void QGLFunctions::glBindRenderbuffer(unsigned int, unsigned int)
+ ?glStencilFuncSeparate@QGLFunctions@@QAEXIIHI@Z @ 798 NONAME ; void QGLFunctions::glStencilFuncSeparate(unsigned int, unsigned int, int, unsigned int)
+ ?createPixmapForImage@QGLPixmapData@@AAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 799 NONAME ; void QGLPixmapData::createPixmapForImage(class QImage &, class QFlags<enum Qt::ImageConversionFlag>, bool)
+ ?glGetUniformLocation@QGLFunctions@@QAEHIPBD@Z @ 800 NONAME ; int QGLFunctions::glGetUniformLocation(unsigned int, char const *)
+ ?glGetRenderbufferParameteriv@QGLFunctions@@QAEXIIPAH@Z @ 801 NONAME ; void QGLFunctions::glGetRenderbufferParameteriv(unsigned int, unsigned int, int *)
+ ?glBindAttribLocation@QGLFunctions@@QAEXIIPBD@Z @ 802 NONAME ; void QGLFunctions::glBindAttribLocation(unsigned int, unsigned int, char const *)
+ ?glGetShaderSource@QGLFunctions@@QAEXIHPAHPAD@Z @ 803 NONAME ; void QGLFunctions::glGetShaderSource(unsigned int, int, int *, char *)
+ ?setMipmap@QGLFramebufferObjectFormat@@QAEX_N@Z @ 804 NONAME ; void QGLFramebufferObjectFormat::setMipmap(bool)
+ ??1QGLContextGroupResourceBase@@UAE@XZ @ 805 NONAME ; QGLContextGroupResourceBase::~QGLContextGroupResourceBase(void)
+ ?glFramebufferTexture2D@QGLFunctions@@QAEXIIIIH@Z @ 806 NONAME ; void QGLFunctions::glFramebufferTexture2D(unsigned int, unsigned int, unsigned int, unsigned int, int)
+ ?glBlendEquationSeparate@QGLFunctions@@QAEXII@Z @ 807 NONAME ; void QGLFunctions::glBlendEquationSeparate(unsigned int, unsigned int)
+ ?insert@QGLContextResourceBase@@QAEXPBVQGLContext@@PAX@Z @ 808 NONAME ; void QGLContextResourceBase::insert(class QGLContext const *, void *)
+ ?glUniform2i@QGLFunctions@@QAEXHHH@Z @ 809 NONAME ; void QGLFunctions::glUniform2i(int, int, int)
+ ?glGetUniformfv@QGLFunctions@@QAEXIHPAM@Z @ 810 NONAME ; void QGLFunctions::glGetUniformfv(unsigned int, int, float *)
+ ?glUniform3i@QGLFunctions@@QAEXHHHH@Z @ 811 NONAME ; void QGLFunctions::glUniform3i(int, int, int, int)
+ ?glIsRenderbuffer@QGLFunctions@@QAEEI@Z @ 812 NONAME ; unsigned char QGLFunctions::glIsRenderbuffer(unsigned int)
+ ?initializeGLFunctions@QGLFunctions@@QAEXPBVQGLContext@@@Z @ 813 NONAME ; void QGLFunctions::initializeGLFunctions(class QGLContext const *)
+ ??0QGLFunctions@@QAE@XZ @ 814 NONAME ; QGLFunctions::QGLFunctions(void)
+ ?glVertexAttrib2fv@QGLFunctions@@QAEXIPBM@Z @ 815 NONAME ; void QGLFunctions::glVertexAttrib2fv(unsigned int, float const *)
+ ?isInitialized@QGLFunctions@@CA_NPBUQGLFunctionsPrivate@@@Z @ 816 NONAME ; bool QGLFunctions::isInitialized(struct QGLFunctionsPrivate const *)
+ ?glGetUniformiv@QGLFunctions@@QAEXIHPAH@Z @ 817 NONAME ; void QGLFunctions::glGetUniformiv(unsigned int, int, int *)
+ ?glBlendEquation@QGLFunctions@@QAEXI@Z @ 818 NONAME ; void QGLFunctions::glBlendEquation(unsigned int)
+ ?glFramebufferRenderbuffer@QGLFunctions@@QAEXIIII@Z @ 819 NONAME ; void QGLFunctions::glFramebufferRenderbuffer(unsigned int, unsigned int, unsigned int, unsigned int)
+ ?glUniform4i@QGLFunctions@@QAEXHHHHH@Z @ 820 NONAME ; void QGLFunctions::glUniform4i(int, int, int, int, int)
+ ?glUniform3fv@QGLFunctions@@QAEXHHPBM@Z @ 821 NONAME ; void QGLFunctions::glUniform3fv(int, int, float const *)
+ ?value@QGLContextResourceBase@@QAEPAXPBVQGLContext@@@Z @ 822 NONAME ; void * QGLContextResourceBase::value(class QGLContext const *)
+ ?glBlendFuncSeparate@QGLFunctions@@QAEXIIII@Z @ 823 NONAME ; void QGLFunctions::glBlendFuncSeparate(unsigned int, unsigned int, unsigned int, unsigned int)
+ ?glCompressedTexSubImage2D@QGLFunctions@@QAEXIHHHHHIHPBX@Z @ 824 NONAME ; void QGLFunctions::glCompressedTexSubImage2D(unsigned int, int, int, int, int, int, unsigned int, int, void const *)
+ ?freeResource@QGLTextureGlyphCache@@UAEXPAX@Z @ 825 NONAME ; void QGLTextureGlyphCache::freeResource(void *)
+ ?value@QGLContextGroupResourceBase@@QAEPAXPBVQGLContext@@@Z @ 826 NONAME ; void * QGLContextGroupResourceBase::value(class QGLContext const *)
+ ?glUniform3iv@QGLFunctions@@QAEXHHPBH@Z @ 827 NONAME ; void QGLFunctions::glUniform3iv(int, int, int const *)
+ ?mipmap@QGLFramebufferObjectFormat@@QBE_NXZ @ 828 NONAME ; bool QGLFramebufferObjectFormat::mipmap(void) const
+ ?serialNumber@QGLTextureGlyphCache@@QBEHXZ @ 829 NONAME ; int QGLTextureGlyphCache::serialNumber(void) const
+ ?fromImageReader@QGLPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 830 NONAME ; void QGLPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>)
+ ?qt_extensionFuncs@QGLContextPrivate@@2UQGLExtensionFuncs@@A @ 831 NONAME ; struct QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs
+ ?glShaderSource@QGLFunctions@@QAEXIHPAPBDPBH@Z @ 832 NONAME ; void QGLFunctions::glShaderSource(unsigned int, int, char const * *, int const *)
+ ?glGetShaderPrecisionFormat@QGLFunctions@@QAEXIIPAH0@Z @ 833 NONAME ; void QGLFunctions::glGetShaderPrecisionFormat(unsigned int, unsigned int, int *, int *)
+ ?insert@QGLContextGroupResourceBase@@QAEXPBVQGLContext@@PAX@Z @ 834 NONAME ; void QGLContextGroupResourceBase::insert(class QGLContext const *, void *)
+
diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def
index 87b9c7f..18f576b 100644
--- a/src/s60installs/bwins/QtOpenVGu.def
+++ b/src/s60installs/bwins/QtOpenVGu.def
@@ -176,4 +176,11 @@ EXPORTS
?fromData@QVGPixmapData@@UAE_NPBEIPBDV?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 175 NONAME ; bool QVGPixmapData::fromData(unsigned char const *, unsigned int, char const *, class QFlags<enum Qt::ImageConversionFlag>)
?fromImageReader@QVGPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 176 NONAME ; void QVGPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>)
?canVgWritePixels@QVGPaintEngine@@ABE_NABVQImage@@@Z @ 177 NONAME ; bool QVGPaintEngine::canVgWritePixels(class QImage const &) const
+ ?updateSerial@QVGPixmapData@@IAEXXZ @ 178 NONAME ; void QVGPixmapData::updateSerial(void)
+ ?copy@QVGPixmapData@@UAEXPBVQPixmapData@@ABVQRect@@@Z @ 179 NONAME ; void QVGPixmapData::copy(class QPixmapData const *, class QRect const &)
+ ?idealFormat@QVGPixmapData@@IBE?AW4Format@QImage@@PAV3@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 180 NONAME ; enum QImage::Format QVGPixmapData::idealFormat(class QImage *, class QFlags<enum Qt::ImageConversionFlag>) const
+ ?ensureReadback@QVGPixmapData@@UBEX_N@Z @ 181 NONAME ; void QVGPixmapData::ensureReadback(bool) const
+ ?initFromNativeImageHandle@QVGPixmapData@@QAE_NPAXABVQString@@@Z @ 182 NONAME ; bool QVGPixmapData::initFromNativeImageHandle(void *, class QString const &)
+ ?createFromNativeImageHandleProvider@QVGPixmapData@@QAEXXZ @ 183 NONAME ; void QVGPixmapData::createFromNativeImageHandleProvider(void)
+ ?releaseNativeImageHandle@QVGPixmapData@@QAEXXZ @ 184 NONAME ; void QVGPixmapData::releaseNativeImageHandle(void)
diff --git a/src/s60installs/bwins/QtTestu.def b/src/s60installs/bwins/QtTestu.def
index a7bb9cd..60a7a4c 100644
--- a/src/s60installs/bwins/QtTestu.def
+++ b/src/s60installs/bwins/QtTestu.def
@@ -77,4 +77,93 @@ EXPORTS
?staticMetaObject@QTestEventLoop@@2UQMetaObject@@B @ 76 NONAME ; struct QMetaObject const QTestEventLoop::staticMetaObject
?setBenchmarkResult@QTest@@YAXMW4QBenchmarkMetric@1@@Z @ 77 NONAME ; void QTest::setBenchmarkResult(float, enum QTest::QBenchmarkMetric)
?endBenchmarkMeasurement@QTest@@YA_KXZ @ 78 NONAME ; unsigned long long QTest::endBenchmarkMeasurement(void)
+ ?addBenchmarkResult@QTestLog@@SAXABVQBenchmarkResult@@@Z @ 79 NONAME ; void QTestLog::addBenchmarkResult(class QBenchmarkResult const &)
+ ?currentTestLocation@QTestResult@@SA?AW4TestLocation@1@XZ @ 80 NONAME ; enum QTestResult::TestLocation QTestResult::currentTestLocation(void)
+ ?setCurrentTestLocation@QTestResult@@SAXW4TestLocation@1@@Z @ 81 NONAME ; void QTestResult::setCurrentTestLocation(enum QTestResult::TestLocation)
+ ?testFailed@QTestResult@@SA_NXZ @ 82 NONAME ; bool QTestResult::testFailed(void)
+ ?setVerboseLevel@QTestLog@@SAXH@Z @ 83 NONAME ; void QTestLog::setVerboseLevel(int)
+ ?setCurrentTestObject@QTestResult@@SAXPBD@Z @ 84 NONAME ; void QTestResult::setCurrentTestObject(char const *)
+ ?isEmpty@QTestTable@@QBE_NXZ @ 85 NONAME ; bool QTestTable::isEmpty(void) const
+ ?reset@QTestResult@@SAXXZ @ 86 NONAME ; void QTestResult::reset(void)
+ ?info@QTestLog@@SAXPBD0H@Z @ 87 NONAME ; void QTestLog::info(char const *, char const *, int)
+ ?adjustMedianIterationCount@QBenchmarkGlobalData@@QAEHXZ @ 88 NONAME ; int QBenchmarkGlobalData::adjustMedianIterationCount(void)
+ ?addColumn@QTestTable@@QAEXHPBD@Z @ 89 NONAME ; void QTestTable::addColumn(int, char const *)
+ ?setMode@QBenchmarkGlobalData@@QAEXW4Mode@1@@Z @ 90 NONAME ; void QBenchmarkGlobalData::setMode(enum QBenchmarkGlobalData::Mode)
+ ?addFailure@QTestResult@@SAXPBD0H@Z @ 91 NONAME ; void QTestResult::addFailure(char const *, char const *, int)
+ ?indexOf@QTestTable@@QBEHPBD@Z @ 92 NONAME ; int QTestTable::indexOf(char const *) const
+ ?warn@QTestLog@@SAXPBD@Z @ 93 NONAME ; void QTestLog::warn(char const *)
+ ?currentTestData@QTestResult@@SAPAVQTestData@@XZ @ 94 NONAME ; class QTestData * QTestResult::currentTestData(void)
+ ?startLogging@QTestLog@@SAXI@Z @ 95 NONAME ; void QTestLog::startLogging(unsigned int)
+ ?endDataRun@QBenchmarkTestMethodData@@QAEXXZ @ 96 NONAME ; void QBenchmarkTestMethodData::endDataRun(void)
+ ?globalTestTable@QTestTable@@SAPAV1@XZ @ 97 NONAME ; class QTestTable * QTestTable::globalTestTable(void)
+ ?elementCount@QTestTable@@QBEHXZ @ 98 NONAME ; int QTestTable::elementCount(void) const
+ ??0QTestLog@@AAE@XZ @ 99 NONAME ; QTestLog::QTestLog(void)
+ ?allDataPassed@QTestResult@@SA_NXZ @ 100 NONAME ; bool QTestResult::allDataPassed(void)
+ ??0QBenchmarkTestMethodData@@QAE@XZ @ 101 NONAME ; QBenchmarkTestMethodData::QBenchmarkTestMethodData(void)
+ ?qtest_qParseArgs@QTest@@YAXHQAPAD_N@Z @ 102 NONAME ; void QTest::qtest_qParseArgs(int, char * * const, bool)
+ ?unhandledIgnoreMessages@QTestLog@@SAHXZ @ 103 NONAME ; int QTestLog::unhandledIgnoreMessages(void)
+ ?setCurrentTestFunction@QTestResult@@SAXPBD@Z @ 104 NONAME ; void QTestResult::setCurrentTestFunction(char const *)
+ ?enterTestFunction@QTestLog@@SAXPBD@Z @ 105 NONAME ; void QTestLog::enterTestFunction(char const *)
+ ?testFunctions@QTest@@3VQStringList@@A @ 106 NONAME ; class QStringList QTest::testFunctions
+ ?addSkip@QTestResult@@SAXPBDW4SkipMode@QTest@@0H@Z @ 107 NONAME ; void QTestResult::addSkip(char const *, enum QTest::SkipMode, char const *, int)
+ ?currentGlobalDataTag@QTestResult@@SAPBDXZ @ 108 NONAME ; char const * QTestResult::currentGlobalDataTag(void)
+ ?stopLogging@QTestLog@@SAXXZ @ 109 NONAME ; void QTestLog::stopLogging(void)
+ ??1QTestLog@@AAE@XZ @ 110 NONAME ; QTestLog::~QTestLog(void)
+ ?skipCount@QTestResult@@SAHXZ @ 111 NONAME ; int QTestResult::skipCount(void)
+ ?setCurrentGlobalTestData@QTestResult@@SAXPAVQTestData@@@Z @ 112 NONAME ; void QTestResult::setCurrentGlobalTestData(class QTestData *)
+ ?elementTypeId@QTestTable@@QBEHH@Z @ 113 NONAME ; int QTestTable::elementTypeId(int) const
+ ?dataTag@QTestTable@@QBEPBDH@Z @ 114 NONAME ; char const * QTestTable::dataTag(int) const
+ ?dataCount@QTestTable@@QBEHXZ @ 115 NONAME ; int QTestTable::dataCount(void) const
+ ?printUnhandledIgnoreMessages@QTestLog@@SAXXZ @ 116 NONAME ; void QTestLog::printUnhandledIgnoreMessages(void)
+ ??1QBenchmarkTestMethodData@@QAE@XZ @ 117 NONAME ; QBenchmarkTestMethodData::~QBenchmarkTestMethodData(void)
+ ??1QTestTable@@QAE@XZ @ 118 NONAME ; QTestTable::~QTestTable(void)
+ ?current@QBenchmarkGlobalData@@2PAV1@A @ 119 NONAME ; class QBenchmarkGlobalData * QBenchmarkGlobalData::current
+ ?setFlushMode@QTestLog@@SAXW4FlushMode@1@@Z @ 120 NONAME ; void QTestLog::setFlushMode(enum QTestLog::FlushMode)
+ ?ignoreMessage@QTestResult@@SAXW4QtMsgType@@PBD@Z @ 121 NONAME ; void QTestResult::ignoreMessage(enum QtMsgType, char const *)
+ ?failCount@QTestResult@@SAHXZ @ 122 NONAME ; int QTestResult::failCount(void)
+ ?mode@QBenchmarkGlobalData@@QBE?AW4Mode@1@XZ @ 123 NONAME ; enum QBenchmarkGlobalData::Mode QBenchmarkGlobalData::mode(void) const
+ ?addSkip@QTestLog@@SAXPBDW4SkipMode@QTest@@0H@Z @ 124 NONAME ; void QTestLog::addSkip(char const *, enum QTest::SkipMode, char const *, int)
+ ?outputFileName@QTestLog@@SAPBDXZ @ 125 NONAME ; char const * QTestLog::outputFileName(void)
+ ?expectFail@QTestResult@@SA_NPBD0W4TestFailMode@QTest@@0H@Z @ 126 NONAME ; bool QTestResult::expectFail(char const *, char const *, enum QTest::TestFailMode, char const *, int)
+ ?passCount@QTestResult@@SAHXZ @ 127 NONAME ; int QTestResult::passCount(void)
+ ?logMode@QTestLog@@SA?AW4LogMode@1@XZ @ 128 NONAME ; enum QTestLog::LogMode QTestLog::logMode(void)
+ ?skipCurrentTest@QTestResult@@SA_NXZ @ 129 NONAME ; bool QTestResult::skipCurrentTest(void)
+ ?addXPass@QTestLog@@SAXPBD0H@Z @ 130 NONAME ; void QTestLog::addXPass(char const *, char const *, int)
+ ?testTags@QTest@@3VQStringList@@A @ 131 NONAME ; class QStringList QTest::testTags
+ ?isBenchmark@QBenchmarkTestMethodData@@QBE_NXZ @ 132 NONAME ; bool QBenchmarkTestMethodData::isBenchmark(void) const
+ ?adjustIterationCount@QBenchmarkTestMethodData@@QAEHH@Z @ 133 NONAME ; int QBenchmarkTestMethodData::adjustIterationCount(int)
+ ??1QBenchmarkGlobalData@@QAE@XZ @ 134 NONAME ; QBenchmarkGlobalData::~QBenchmarkGlobalData(void)
+ ?printAvailableFunctions@QTest@@3_NA @ 135 NONAME ; bool QTest::printAvailableFunctions
+ ?testData@QTestTable@@QBEPAVQTestData@@H@Z @ 136 NONAME ; class QTestData * QTestTable::testData(int) const
+ ?setCurrentTestData@QTestResult@@SAXPAVQTestData@@@Z @ 137 NONAME ; void QTestResult::setCurrentTestData(class QTestData *)
+ ?compare@QTestResult@@SA_N_NPBD1H@Z @ 138 NONAME ; bool QTestResult::compare(bool, char const *, char const *, int)
+ ?currentTestFailed@QTestResult@@SA_NXZ @ 139 NONAME ; bool QTestResult::currentTestFailed(void)
+ ?compare@QTestResult@@SA_N_NPBDPAD2111H@Z @ 140 NONAME ; bool QTestResult::compare(bool, char const *, char *, char *, char const *, char const *, char const *, int)
+ ?addXFail@QTestLog@@SAXPBD0H@Z @ 141 NONAME ; void QTestLog::addXFail(char const *, char const *, int)
+ ??0QBenchmarkGlobalData@@QAE@XZ @ 142 NONAME ; QBenchmarkGlobalData::QBenchmarkGlobalData(void)
+ ?beginDataRun@QBenchmarkTestMethodData@@QAEXXZ @ 143 NONAME ; void QBenchmarkTestMethodData::beginDataRun(void)
+ ?resultsAccepted@QBenchmarkTestMethodData@@QBE_NXZ @ 144 NONAME ; bool QBenchmarkTestMethodData::resultsAccepted(void) const
+ ?addIgnoreMessage@QTestLog@@SAXW4QtMsgType@@PBD@Z @ 145 NONAME ; void QTestLog::addIgnoreMessage(enum QtMsgType, char const *)
+ ?startLogging@QTestLog@@SAXXZ @ 146 NONAME ; void QTestLog::startLogging(void)
+ ?currentDataTag@QTestResult@@SAPBDXZ @ 147 NONAME ; char const * QTestResult::currentDataTag(void)
+ ?redirectOutput@QTestLog@@SAXPBD@Z @ 148 NONAME ; void QTestLog::redirectOutput(char const *)
+ ?currentTestObjectName@QTestResult@@SAPBDXZ @ 149 NONAME ; char const * QTestResult::currentTestObjectName(void)
+ ?newData@QTestTable@@QAEPAVQTestData@@PBD@Z @ 150 NONAME ; class QTestData * QTestTable::newData(char const *)
+ ?addPass@QTestLog@@SAXPBD@Z @ 151 NONAME ; void QTestLog::addPass(char const *)
+ ?verboseLevel@QTestLog@@SAHXZ @ 152 NONAME ; int QTestLog::verboseLevel(void)
+ ?createMeasurer@QBenchmarkGlobalData@@QAEPAVQBenchmarkMeasurerBase@@XZ @ 153 NONAME ; class QBenchmarkMeasurerBase * QBenchmarkGlobalData::createMeasurer(void)
+ ?currentGlobalTestData@QTestResult@@SAPAVQTestData@@XZ @ 154 NONAME ; class QTestData * QTestResult::currentGlobalTestData(void)
+ ?setSkipCurrentTest@QTestResult@@SAX_N@Z @ 155 NONAME ; void QTestResult::setSkipCurrentTest(bool)
+ ?setResult@QBenchmarkTestMethodData@@QAEXMW4QBenchmarkMetric@QTest@@_N@Z @ 156 NONAME ; void QBenchmarkTestMethodData::setResult(float, enum QTest::QBenchmarkMetric, bool)
+ ?verify@QTestResult@@SA_N_NPBD11H@Z @ 157 NONAME ; bool QTestResult::verify(bool, char const *, char const *, char const *, int)
+ ?leaveTestFunction@QTestLog@@SAXXZ @ 158 NONAME ; void QTestLog::leaveTestFunction(void)
+ ?finishedCurrentTestFunction@QTestResult@@SAXXZ @ 159 NONAME ; void QTestResult::finishedCurrentTestFunction(void)
+ ?currentTestTable@QTestTable@@SAPAV1@XZ @ 160 NONAME ; class QTestTable * QTestTable::currentTestTable(void)
+ ?currentTestFunction@QTestResult@@SAPBDXZ @ 161 NONAME ; char const * QTestResult::currentTestFunction(void)
+ ?setLogMode@QTestLog@@SAXW4LogMode@1@@Z @ 162 NONAME ; void QTestLog::setLogMode(enum QTestLog::LogMode)
+ ?clearGlobalTestTable@QTestTable@@SAXXZ @ 163 NONAME ; void QTestTable::clearGlobalTestTable(void)
+ ?addFail@QTestLog@@SAXPBD0H@Z @ 164 NONAME ; void QTestLog::addFail(char const *, char const *, int)
+ ??0QTestTable@@QAE@XZ @ 165 NONAME ; QTestTable::QTestTable(void)
+ ?setMaxWarnings@QTestLog@@SAXH@Z @ 166 NONAME ; void QTestLog::setMaxWarnings(int)
+ ?current@QBenchmarkTestMethodData@@2PAV1@A @ 167 NONAME ; class QBenchmarkTestMethodData * QBenchmarkTestMethodData::current
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 207447f..cfdd9ee 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -1439,7 +1439,7 @@ EXPORTS
_ZN31QAbstractEventDispatcherPrivate4initEv @ 1438 NONAME
_ZN31QNonContiguousByteDeviceFactory4wrapEP24QNonContiguousByteDevice @ 1439 NONAME
_ZN31QNonContiguousByteDeviceFactory6createEP10QByteArray @ 1440 NONAME
- _ZN31QNonContiguousByteDeviceFactory6createEP11QRingBuffer @ 1441 NONAME
+ _ZN31QNonContiguousByteDeviceFactory6createEP11QRingBuffer @ 1441 NONAME ABSENT
_ZN31QNonContiguousByteDeviceFactory6createEP9QIODevice @ 1442 NONAME
_ZN4QDir10setCurrentERK7QString @ 1443 NONAME
_ZN4QDir10setSortingE6QFlagsINS_8SortFlagEE @ 1444 NONAME
@@ -3806,4 +3806,7 @@ EXPORTS
_ZNK13QElapsedTimer12nsecsElapsedEv @ 3805 NONAME
_ZNK11QMetaMethod8revisionEv @ 3806 NONAME
_ZNK13QMetaProperty8revisionEv @ 3807 NONAME
+ _ZN16QAnimationDriverC1EP7QObject @ 3808 NONAME
+ _ZN16QAnimationDriverC1ER23QAnimationDriverPrivateP7QObject @ 3809 NONAME
+ _ZN31QNonContiguousByteDeviceFactory6createE14QSharedPointerI11QRingBufferE @ 3810 NONAME
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 95180d4..2849068 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -761,20 +761,20 @@ EXPORTS
_ZN24QDeclarativeCustomParser5errorERK28QDeclarativeCustomParserNodeRK7QString @ 760 NONAME
_ZN24QDeclarativeCustomParser5errorERK32QDeclarativeCustomParserPropertyRK7QString @ 761 NONAME
_ZN24QDeclarativeCustomParser5errorERK7QString @ 762 NONAME
- _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME ABSENT
- _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME ABSENT
- _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME ABSENT
- _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME ABSENT
- _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME ABSENT
+ _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME
+ _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME
+ _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME
+ _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME
+ _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME
_ZN24QDeclarativeDebugService14enabledChangedEb @ 768 NONAME ABSENT
- _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME ABSENT
- _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME ABSENT
- _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16 ABSENT
- _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME ABSENT
- _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME ABSENT
- _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME ABSENT
+ _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME
+ _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME
+ _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16
+ _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME
+ _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME
+ _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME
+ _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME
+ _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME
_ZN24QDeclarativeDomComponentC1ERKS_ @ 777 NONAME ABSENT
_ZN24QDeclarativeDomComponentC1Ev @ 778 NONAME ABSENT
_ZN24QDeclarativeDomComponentC2ERKS_ @ 779 NONAME ABSENT
@@ -1425,8 +1425,8 @@ EXPORTS
_ZNK23QDeclarativePropertyMapixERK7QString @ 1424 NONAME
_ZNK24QDeclarativeCustomParser11resolveTypeERK10QByteArray @ 1425 NONAME
_ZNK24QDeclarativeCustomParser12evaluateEnumERK10QByteArray @ 1426 NONAME
- _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME ABSENT
- _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME ABSENT
+ _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME
+ _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME
_ZNK24QDeclarativeDebugService9isEnabledEv @ 1429 NONAME ABSENT
_ZNK24QDeclarativeDomComponent13componentRootEv @ 1430 NONAME ABSENT
_ZNK24QDeclarativeScriptString11scopeObjectEv @ 1431 NONAME
@@ -1554,7 +1554,7 @@ EXPORTS
_ZTI23QDeclarativeItemPrivate @ 1553 NONAME
_ZTI23QDeclarativePropertyMap @ 1554 NONAME
_ZTI24QDeclarativeCustomParser @ 1555 NONAME
- _ZTI24QDeclarativeDebugService @ 1556 NONAME ABSENT
+ _ZTI24QDeclarativeDebugService @ 1556 NONAME
_ZTI24QDeclarativeParserStatus @ 1557 NONAME
_ZTI25QDeclarativeImageProvider @ 1558 NONAME
_ZTI26QDeclarativeDebuggerStatus @ 1559 NONAME ABSENT
@@ -1604,7 +1604,7 @@ EXPORTS
_ZTV23QDeclarativeItemPrivate @ 1603 NONAME
_ZTV23QDeclarativePropertyMap @ 1604 NONAME
_ZTV24QDeclarativeCustomParser @ 1605 NONAME
- _ZTV24QDeclarativeDebugService @ 1606 NONAME ABSENT
+ _ZTV24QDeclarativeDebugService @ 1606 NONAME
_ZTV24QDeclarativeParserStatus @ 1607 NONAME
_ZTV25QDeclarativeImageProvider @ 1608 NONAME
_ZTV26QDeclarativeDebuggerStatus @ 1609 NONAME ABSENT
@@ -1777,10 +1777,10 @@ EXPORTS
_ZN23QDeclarativeDebugClientD1Ev @ 1776 NONAME ABSENT
_ZN23QDeclarativeDebugClientD2Ev @ 1777 NONAME ABSENT
_ZN23QDeclarativeEngineDebug13statusChangedENS_6StatusE @ 1778 NONAME ABSENT
- _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME ABSENT
+ _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME
+ _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME
+ _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME
+ _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME
_ZN26QDeclarativeBasePositioner10addChangedEv @ 1783 NONAME ABSENT
_ZN26QDeclarativeBasePositioner10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 1784 NONAME ABSENT
_ZN26QDeclarativeBasePositioner10setSpacingEi @ 1785 NONAME ABSENT
@@ -1851,7 +1851,7 @@ EXPORTS
_ZNK17QDeclarativeTimer9isRunningEv @ 1850 NONAME ABSENT
_ZNK23QDeclarativeDebugClient6statusEv @ 1851 NONAME ABSENT
_ZNK23QDeclarativeEngineDebug6statusEv @ 1852 NONAME ABSENT
- _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME ABSENT
+ _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME
_ZNK26QDeclarativeBasePositioner10metaObjectEv @ 1854 NONAME ABSENT
_ZNK26QDeclarativeBasePositioner3addEv @ 1855 NONAME ABSENT
_ZNK26QDeclarativeBasePositioner4moveEv @ 1856 NONAME ABSENT
@@ -1930,4 +1930,7 @@ EXPORTS
_ZN20QDeclarativeRefCountD2Ev @ 1929 NONAME
_ZTI20QDeclarativeRefCount @ 1930 NONAME
_ZTV20QDeclarativeRefCount @ 1931 NONAME
+ _ZN23QDeclarativeItemPrivate15setLayoutMirrorEb @ 1932 NONAME
+ _ZN23QDeclarativeItemPrivate19resolveLayoutMirrorEv @ 1933 NONAME
+ _ZN23QDeclarativeItemPrivate23setImplicitLayoutMirrorEbb @ 1934 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index e52b504..ef1d67c 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12227,10 +12227,10 @@ EXPORTS
_ZTV19QBlitterPaintEngine @ 12226 NONAME
_ZTV20QBlittablePixmapData @ 12227 NONAME
_Zls6QDebugPK13QSymbianEvent @ 12228 NONAME
- _ZN13QS60MainAppUi25ProcessCommandParametersLE11TApaCommandR4TBufILi256EERK6TDesC8 @ 12229 NONAME ABSENT
- _ZN14QFileOpenEventC1ERK5RFile @ 12230 NONAME ABSENT
- _ZN14QFileOpenEventC2ERK5RFile @ 12231 NONAME ABSENT
- _ZNK14QFileOpenEvent8openFileER5QFile6QFlagsIN9QIODevice12OpenModeFlagEE @ 12232 NONAME ABSENT
+ _ZN13QS60MainAppUi25ProcessCommandParametersLE11TApaCommandR4TBufILi256EERK6TDesC8 @ 12229 NONAME
+ _ZN14QFileOpenEventC1ERK5RFile @ 12230 NONAME
+ _ZN14QFileOpenEventC2ERK5RFile @ 12231 NONAME
+ _ZNK14QFileOpenEvent8openFileER5QFile6QFlagsIN9QIODevice12OpenModeFlagEE @ 12232 NONAME
_ZN11QFontEngine16alphaMapForGlyphEj6QFixed @ 12233 NONAME
_ZN11QFontEngine16alphaMapForGlyphEj6QFixedRK10QTransform @ 12234 NONAME
_Z32qGamma_correct_back_to_linear_csP6QImage @ 12235 NONAME
@@ -12337,4 +12337,59 @@ EXPORTS
_ZN12QTextControl23setWordSelectionEnabledEb @ 12336 NONAME
_ZNK12QTextControl13isDragEnabledEv @ 12337 NONAME
_ZNK12QTextControl22isWordSelectionEnabledEv @ 12338 NONAME
+ _ZN12QLineControl16updateMicroFocusEv @ 12339 NONAME
+ _ZN13QFontDatabase22resolveFontFamilyAliasERK7QString @ 12340 NONAME
+ _ZN14QVolatileImage11paintEngineEv @ 12341 NONAME
+ _ZN14QVolatileImage12ensureFormatEN6QImage6FormatE @ 12342 NONAME
+ _ZN14QVolatileImage15setAlphaChannelERK7QPixmap @ 12343 NONAME
+ _ZN14QVolatileImage4bitsEv @ 12344 NONAME
+ _ZN14QVolatileImage4fillEj @ 12345 NONAME
+ _ZN14QVolatileImage8copyFromEPS_RK5QRect @ 12346 NONAME
+ _ZN14QVolatileImage8imageRefEv @ 12347 NONAME
+ _ZN14QVolatileImageC1EPvS0_ @ 12348 NONAME
+ _ZN14QVolatileImageC1ERK6QImage @ 12349 NONAME
+ _ZN14QVolatileImageC1ERKS_ @ 12350 NONAME
+ _ZN14QVolatileImageC1EiiN6QImage6FormatE @ 12351 NONAME
+ _ZN14QVolatileImageC1Ev @ 12352 NONAME
+ _ZN14QVolatileImageC2EPvS0_ @ 12353 NONAME
+ _ZN14QVolatileImageC2ERK6QImage @ 12354 NONAME
+ _ZN14QVolatileImageC2ERKS_ @ 12355 NONAME
+ _ZN14QVolatileImageC2EiiN6QImage6FormatE @ 12356 NONAME
+ _ZN14QVolatileImageC2Ev @ 12357 NONAME
+ _ZN14QVolatileImageD1Ev @ 12358 NONAME
+ _ZN14QVolatileImageD2Ev @ 12359 NONAME
+ _ZN14QVolatileImageaSERKS_ @ 12360 NONAME
+ _ZN15QGraphicsSystem22releaseCachedResourcesEv @ 12361 NONAME
+ _ZN17QInternalMimeData11canReadDataERK7QString @ 12362 NONAME
+ _ZN17QInternalMimeData11qt_metacallEN11QMetaObject4CallEiPPv @ 12363 NONAME
+ _ZN17QInternalMimeData11qt_metacastEPKc @ 12364 NONAME
+ _ZN17QInternalMimeData13formatsHelperEPK9QMimeData @ 12365 NONAME
+ _ZN17QInternalMimeData15hasFormatHelperERK7QStringPK9QMimeData @ 12366 NONAME
+ _ZN17QInternalMimeData16renderDataHelperERK7QStringPK9QMimeData @ 12367 NONAME
+ _ZN17QInternalMimeData16staticMetaObjectE @ 12368 NONAME DATA 16
+ _ZN17QInternalMimeData19getStaticMetaObjectEv @ 12369 NONAME
+ _ZN17QInternalMimeDataC2Ev @ 12370 NONAME
+ _ZN17QInternalMimeDataD0Ev @ 12371 NONAME
+ _ZN17QInternalMimeDataD1Ev @ 12372 NONAME
+ _ZN17QInternalMimeDataD2Ev @ 12373 NONAME
+ _ZNK14QVolatileImage12bytesPerLineEv @ 12374 NONAME
+ _ZNK14QVolatileImage13endDataAccessEb @ 12375 NONAME
+ _ZNK14QVolatileImage15beginDataAccessEv @ 12376 NONAME
+ _ZNK14QVolatileImage15hasAlphaChannelEv @ 12377 NONAME
+ _ZNK14QVolatileImage20duplicateNativeImageEv @ 12378 NONAME
+ _ZNK14QVolatileImage5depthEv @ 12379 NONAME
+ _ZNK14QVolatileImage5widthEv @ 12380 NONAME
+ _ZNK14QVolatileImage6formatEv @ 12381 NONAME
+ _ZNK14QVolatileImage6heightEv @ 12382 NONAME
+ _ZNK14QVolatileImage6isNullEv @ 12383 NONAME
+ _ZNK14QVolatileImage7toImageEv @ 12384 NONAME
+ _ZNK14QVolatileImage9byteCountEv @ 12385 NONAME
+ _ZNK14QVolatileImage9constBitsEv @ 12386 NONAME
+ _ZNK14QWidgetPrivate20assignedInputContextEv @ 12387 NONAME
+ _ZNK17QInternalMimeData10metaObjectEv @ 12388 NONAME
+ _ZNK17QInternalMimeData12retrieveDataERK7QStringN8QVariant4TypeE @ 12389 NONAME
+ _ZNK17QInternalMimeData7formatsEv @ 12390 NONAME
+ _ZNK17QInternalMimeData9hasFormatERK7QString @ 12391 NONAME
+ _ZTI17QInternalMimeData @ 12392 NONAME
+ _ZTV17QInternalMimeData @ 12393 NONAME
diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def
index 794d43d..4977959 100644
--- a/src/s60installs/eabi/QtOpenGLu.def
+++ b/src/s60installs/eabi/QtOpenGLu.def
@@ -707,4 +707,36 @@ EXPORTS
_ZNK20QGLTextureGlyphCache16maxTextureHeightEv @ 706 NONAME
_ZThn8_NK20QGLTextureGlyphCache15maxTextureWidthEv @ 707 NONAME ABSENT
_ZThn8_NK20QGLTextureGlyphCache16maxTextureHeightEv @ 708 NONAME ABSENT
+ _Z28qt_resolve_buffer_extensionsP10QGLContext @ 709 NONAME
+ _ZN12QGLFunctions21initializeGLFunctionsEPK10QGLContext @ 710 NONAME
+ _ZN12QGLFunctionsC1EPK10QGLContext @ 711 NONAME
+ _ZN12QGLFunctionsC1Ev @ 712 NONAME
+ _ZN12QGLFunctionsC2EPK10QGLContext @ 713 NONAME
+ _ZN12QGLFunctionsC2Ev @ 714 NONAME
+ _ZN13QGLPixmapData12toNativeTypeEN11QPixmapData10NativeTypeE @ 715 NONAME
+ _ZN13QGLPixmapData14fromNativeTypeEPvN11QPixmapData10NativeTypeE @ 716 NONAME
+ _ZN13QGLPixmapData15fromImageReaderEP12QImageReader6QFlagsIN2Qt19ImageConversionFlagEE @ 717 NONAME
+ _ZN13QGLPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 718 NONAME
+ _ZN16QGLWindowSurface12swapBehaviorE @ 719 NONAME DATA 4
+ _ZN17QGLContextPrivate17qt_extensionFuncsE @ 720 NONAME DATA 60
+ _ZN20QGLTextureGlyphCache10setContextEPK10QGLContext @ 721 NONAME
+ _ZN20QGLTextureGlyphCache11fillTextureERKN18QTextureGlyphCache5CoordEj6QFixed @ 722 NONAME
+ _ZN20QGLTextureGlyphCacheC1EPK10QGLContextN21QFontEngineGlyphCache4TypeERK10QTransform @ 723 NONAME
+ _ZN20QGLTextureGlyphCacheC2EPK10QGLContextN21QFontEngineGlyphCache4TypeERK10QTransform @ 724 NONAME
+ _ZN26QGLFramebufferObjectFormat9setMipmapEb @ 725 NONAME
+ _ZN27QGLContextGroupResourceBase5valueEPK10QGLContext @ 726 NONAME
+ _ZN27QGLContextGroupResourceBase6insertEPK10QGLContextPv @ 727 NONAME
+ _ZN27QGLContextGroupResourceBase7cleanupEPK10QGLContextPv @ 728 NONAME
+ _ZN27QGLContextGroupResourceBaseC2Ev @ 729 NONAME
+ _ZN27QGLContextGroupResourceBaseD0Ev @ 730 NONAME
+ _ZN27QGLContextGroupResourceBaseD1Ev @ 731 NONAME
+ _ZN27QGLContextGroupResourceBaseD2Ev @ 732 NONAME
+ _ZNK12QGLFunctions14openGLFeaturesEv @ 733 NONAME
+ _ZNK12QGLFunctions16hasOpenGLFeatureENS_13OpenGLFeatureE @ 734 NONAME
+ _ZNK14QGLPaintDevice9isFlippedEv @ 735 NONAME
+ _ZNK26QGLFramebufferObjectFormat6mipmapEv @ 736 NONAME
+ _ZTI27QGLContextGroupResourceBase @ 737 NONAME
+ _ZTV27QGLContextGroupResourceBase @ 738 NONAME
+ _ZThn104_N20QGLTextureGlyphCacheD0Ev @ 739 NONAME
+ _ZThn104_N20QGLTextureGlyphCacheD1Ev @ 740 NONAME
diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def
index e1828c1..e05cc79 100644
--- a/src/s60installs/eabi/QtOpenVGu.def
+++ b/src/s60installs/eabi/QtOpenVGu.def
@@ -206,4 +206,7 @@ EXPORTS
_ZN13QVGPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 205 NONAME
_ZN13QVGPixmapData8fromFileERK7QStringPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 206 NONAME
_ZNK14QVGPaintEngine16canVgWritePixelsERK6QImage @ 207 NONAME
+ _ZN13QVGPixmapData12updateSerialEv @ 208 NONAME ABSENT
+ _ZN13QVGPixmapData4copyEPK11QPixmapDataRK5QRect @ 209 NONAME ABSENT
+ _ZNK13QVGPixmapData11idealFormatEP6QImage6QFlagsIN2Qt19ImageConversionFlagEE @ 210 NONAME ABSENT
diff --git a/src/s60installs/eabi/QtTestu.def b/src/s60installs/eabi/QtTestu.def
index 5cb95ba..370466b 100644
--- a/src/s60installs/eabi/QtTestu.def
+++ b/src/s60installs/eabi/QtTestu.def
@@ -70,4 +70,98 @@ EXPORTS
_ZTI14QTestEventLoop @ 69 NONAME
_ZTV14QTestEventLoop @ 70 NONAME
_ZN5QTest18setBenchmarkResultEfNS_16QBenchmarkMetricE @ 71 NONAME
+ _ZN10QTestTable15globalTestTableEv @ 72 NONAME
+ _ZN10QTestTable16currentTestTableEv @ 73 NONAME
+ _ZN10QTestTable20clearGlobalTestTableEv @ 74 NONAME
+ _ZN10QTestTable7newDataEPKc @ 75 NONAME
+ _ZN10QTestTable9addColumnEiPKc @ 76 NONAME
+ _ZN10QTestTableC1Ev @ 77 NONAME
+ _ZN10QTestTableC2Ev @ 78 NONAME
+ _ZN10QTestTableD1Ev @ 79 NONAME
+ _ZN10QTestTableD2Ev @ 80 NONAME
+ _ZN11QTestResult10addFailureEPKcS1_i @ 81 NONAME
+ _ZN11QTestResult10expectFailEPKcS1_N5QTest12TestFailModeES1_i @ 82 NONAME
+ _ZN11QTestResult10testFailedEv @ 83 NONAME
+ _ZN11QTestResult13allDataPassedEv @ 84 NONAME
+ _ZN11QTestResult13ignoreMessageE9QtMsgTypePKc @ 85 NONAME
+ _ZN11QTestResult14currentDataTagEv @ 86 NONAME
+ _ZN11QTestResult15currentTestDataEv @ 87 NONAME
+ _ZN11QTestResult15skipCurrentTestEv @ 88 NONAME
+ _ZN11QTestResult17currentTestFailedEv @ 89 NONAME
+ _ZN11QTestResult18setCurrentTestDataEP9QTestData @ 90 NONAME
+ _ZN11QTestResult18setSkipCurrentTestEb @ 91 NONAME
+ _ZN11QTestResult19currentTestFunctionEv @ 92 NONAME
+ _ZN11QTestResult19currentTestLocationEv @ 93 NONAME
+ _ZN11QTestResult20currentGlobalDataTagEv @ 94 NONAME
+ _ZN11QTestResult20setCurrentTestObjectEPKc @ 95 NONAME
+ _ZN11QTestResult21currentGlobalTestDataEv @ 96 NONAME
+ _ZN11QTestResult21currentTestObjectNameEv @ 97 NONAME
+ _ZN11QTestResult22setCurrentTestFunctionEPKc @ 98 NONAME
+ _ZN11QTestResult22setCurrentTestLocationENS_12TestLocationE @ 99 NONAME
+ _ZN11QTestResult24setCurrentGlobalTestDataEP9QTestData @ 100 NONAME
+ _ZN11QTestResult27finishedCurrentTestFunctionEv @ 101 NONAME
+ _ZN11QTestResult5resetEv @ 102 NONAME
+ _ZN11QTestResult6verifyEbPKcS1_S1_i @ 103 NONAME
+ _ZN11QTestResult7addSkipEPKcN5QTest8SkipModeES1_i @ 104 NONAME
+ _ZN11QTestResult7compareEbPKcPcS2_S1_S1_S1_i @ 105 NONAME
+ _ZN11QTestResult7compareEbPKcS1_i @ 106 NONAME
+ _ZN11QTestResult9failCountEv @ 107 NONAME
+ _ZN11QTestResult9passCountEv @ 108 NONAME
+ _ZN11QTestResult9skipCountEv @ 109 NONAME
+ _ZN20QBenchmarkGlobalData14createMeasurerEv @ 110 NONAME
+ _ZN20QBenchmarkGlobalData26adjustMedianIterationCountEv @ 111 NONAME
+ _ZN20QBenchmarkGlobalData7currentE @ 112 NONAME DATA 4
+ _ZN20QBenchmarkGlobalData7setModeENS_4ModeE @ 113 NONAME
+ _ZN20QBenchmarkGlobalDataC1Ev @ 114 NONAME
+ _ZN20QBenchmarkGlobalDataC2Ev @ 115 NONAME
+ _ZN20QBenchmarkGlobalDataD1Ev @ 116 NONAME
+ _ZN20QBenchmarkGlobalDataD2Ev @ 117 NONAME
+ _ZN24QBenchmarkTestMethodData10endDataRunEv @ 118 NONAME
+ _ZN24QBenchmarkTestMethodData12beginDataRunEv @ 119 NONAME
+ _ZN24QBenchmarkTestMethodData20adjustIterationCountEi @ 120 NONAME
+ _ZN24QBenchmarkTestMethodData7currentE @ 121 NONAME DATA 4
+ _ZN24QBenchmarkTestMethodData9setResultEfN5QTest16QBenchmarkMetricEb @ 122 NONAME
+ _ZN24QBenchmarkTestMethodDataC1Ev @ 123 NONAME
+ _ZN24QBenchmarkTestMethodDataC2Ev @ 124 NONAME
+ _ZN24QBenchmarkTestMethodDataD1Ev @ 125 NONAME
+ _ZN24QBenchmarkTestMethodDataD2Ev @ 126 NONAME
+ _ZN5QTest13testFunctionsE @ 127 NONAME DATA 4
+ _ZN5QTest16qtest_qParseArgsEiPPcb @ 128 NONAME
+ _ZN5QTest23printAvailableFunctionsE @ 129 NONAME DATA 1
+ _ZN5QTest8testTagsE @ 130 NONAME DATA 4
+ _ZN8QTestLog10setLogModeENS_7LogModeE @ 131 NONAME
+ _ZN8QTestLog11stopLoggingEv @ 132 NONAME
+ _ZN8QTestLog12setFlushModeENS_9FlushModeE @ 133 NONAME
+ _ZN8QTestLog12startLoggingEj @ 134 NONAME
+ _ZN8QTestLog12startLoggingEv @ 135 NONAME
+ _ZN8QTestLog12verboseLevelEv @ 136 NONAME
+ _ZN8QTestLog14outputFileNameEv @ 137 NONAME
+ _ZN8QTestLog14redirectOutputEPKc @ 138 NONAME
+ _ZN8QTestLog14setMaxWarningsEi @ 139 NONAME
+ _ZN8QTestLog15setVerboseLevelEi @ 140 NONAME
+ _ZN8QTestLog16addIgnoreMessageE9QtMsgTypePKc @ 141 NONAME
+ _ZN8QTestLog17enterTestFunctionEPKc @ 142 NONAME
+ _ZN8QTestLog17leaveTestFunctionEv @ 143 NONAME
+ _ZN8QTestLog18addBenchmarkResultERK16QBenchmarkResult @ 144 NONAME
+ _ZN8QTestLog23unhandledIgnoreMessagesEv @ 145 NONAME
+ _ZN8QTestLog28printUnhandledIgnoreMessagesEv @ 146 NONAME
+ _ZN8QTestLog4infoEPKcS1_i @ 147 NONAME
+ _ZN8QTestLog4warnEPKc @ 148 NONAME
+ _ZN8QTestLog7addFailEPKcS1_i @ 149 NONAME
+ _ZN8QTestLog7addPassEPKc @ 150 NONAME
+ _ZN8QTestLog7addSkipEPKcN5QTest8SkipModeES1_i @ 151 NONAME
+ _ZN8QTestLog7logModeEv @ 152 NONAME
+ _ZN8QTestLog8addXFailEPKcS1_i @ 153 NONAME
+ _ZN8QTestLog8addXPassEPKcS1_i @ 154 NONAME
+ _ZN8QTestLogC1Ev @ 155 NONAME
+ _ZN8QTestLogC2Ev @ 156 NONAME
+ _ZN8QTestLogD1Ev @ 157 NONAME
+ _ZN8QTestLogD2Ev @ 158 NONAME
+ _ZNK10QTestTable12elementCountEv @ 159 NONAME
+ _ZNK10QTestTable13elementTypeIdEi @ 160 NONAME
+ _ZNK10QTestTable7dataTagEi @ 161 NONAME
+ _ZNK10QTestTable7indexOfEPKc @ 162 NONAME
+ _ZNK10QTestTable7isEmptyEv @ 163 NONAME
+ _ZNK10QTestTable8testDataEi @ 164 NONAME
+ _ZNK10QTestTable9dataCountEv @ 165 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 0a2f614..1c91422 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -11,23 +11,6 @@ symbian: {
isEmpty(QT_LIBINFIX) {
TARGET.UID3 = 0x2001E61C
-
- # Sqlite3 is expected to be already found on phone if infixed configuration is built.
- # It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- BLD_INF_RULES.prj_exports += \
- "sqlite3.sis /epoc32/data/qt/sis/sqlite3.sis"
- symbian-abld|symbian-sbsv2 {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
- } else {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${PWD}/sqlite3.sis\", (0x2002af5f)"
- }
- qtlibraries.pkg_postrules += sqlitedeployment
- }
} else {
# Always use experimental UID for infixed configuration to avoid UID clash
TARGET.UID3 = 0xE001E61C
@@ -92,7 +75,7 @@ symbian: {
vendorinfo = \
"; Localised Vendor name" \
- "%{\"Nokia, Qt\"}" \
+ "%{\"Nokia\"}" \
" " \
"; Unique Vendor name" \
":\"Nokia, Qt\"" \
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 2468a46..5454df5 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -268,8 +268,14 @@ QScriptValue QScriptContext::argument(int index) const
QScriptValue QScriptContext::callee() const
{
const JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this);
- QScript::APIShim shim(QScript::scriptEngineFromExec(frame));
- return QScript::scriptEngineFromExec(frame)->scriptValueFromJSCValue(frame->callee());
+ QScriptEnginePrivate *eng = QScript::scriptEngineFromExec(frame);
+ QScript::APIShim shim(eng);
+ if (frame->callee() == eng->originalGlobalObject()) {
+ // This is a pushContext()-created context; the callee is a lie.
+ Q_ASSERT(QScriptEnginePrivate::contextFlags(const_cast<JSC::CallFrame*>(frame)) & QScriptEnginePrivate::NativeContext);
+ return QScriptValue();
+ }
+ return eng->scriptValueFromJSCValue(frame->callee());
}
/*!
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp
index 0f9de1d..182bc4a 100644
--- a/src/script/api/qscriptcontextinfo.cpp
+++ b/src/script/api/qscriptcontextinfo.cpp
@@ -159,12 +159,20 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte
JSC::CodeBlock *codeBlock = frame->codeBlock();
if (returnPC && codeBlock && QScriptEnginePrivate::hasValidCodeBlockRegister(frame)) {
#if ENABLE(JIT)
- unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC));
+ JSC::JITCode code = codeBlock->getJITCode();
+ unsigned jitOffset = code.offsetOf(JSC::ReturnAddressPtr(returnPC).value());
+ // We can only use the JIT code offset if it's smaller than the JIT size;
+ // otherwise calling getBytecodeIndex() is meaningless.
+ if (jitOffset < code.size()) {
+ unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC));
#else
unsigned bytecodeOffset = returnPC - codeBlock->instructions().begin();
#endif
bytecodeOffset--; //because returnPC is on the next instruction. We want the current one
lineNumber = codeBlock->lineNumberForBytecodeOffset(const_cast<JSC::ExecState *>(frame), bytecodeOffset);
+#if ENABLE(JIT)
+ }
+#endif
}
}
}
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 9f36953..ceb1b03 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -955,8 +955,11 @@ static QScriptValue __setupPackage__(QScriptContext *ctx, QScriptEngine *eng)
} // namespace QScript
QScriptEnginePrivate::QScriptEnginePrivate()
- : registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0),
- registeredScriptStrings(0), inEval(false)
+ : originalGlobalObjectProxy(0), currentFrame(0),
+ qobjectPrototype(0), qmetaobjectPrototype(0), variantPrototype(0),
+ activeAgent(0), agentLineNumber(-1),
+ registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0),
+ registeredScriptStrings(0), processEventsInterval(-1), inEval(false)
{
qMetaTypeId<QScriptValue>();
qMetaTypeId<QList<int> >();
@@ -1002,10 +1005,6 @@ QScriptEnginePrivate::QScriptEnginePrivate()
currentFrame = exec;
- originalGlobalObjectProxy = 0;
- activeAgent = 0;
- agentLineNumber = -1;
- processEventsInterval = -1;
cachedTranslationUrl = JSC::UString();
cachedTranslationContext = JSC::UString();
JSC::setCurrentIdentifierTable(oldTable);
@@ -1253,10 +1252,12 @@ void QScriptEnginePrivate::mark(JSC::MarkStack& markStack)
{
Q_Q(QScriptEngine);
- markStack.append(originalGlobalObject());
- markStack.append(globalObject());
- if (originalGlobalObjectProxy)
- markStack.append(originalGlobalObjectProxy);
+ if (originalGlobalObject()) {
+ markStack.append(originalGlobalObject());
+ markStack.append(globalObject());
+ if (originalGlobalObjectProxy)
+ markStack.append(originalGlobalObjectProxy);
+ }
if (qobjectPrototype)
markStack.append(qobjectPrototype);
@@ -1281,7 +1282,7 @@ void QScriptEnginePrivate::mark(JSC::MarkStack& markStack)
}
}
- {
+ if (q) {
QScriptContext *context = q->currentContext();
while (context) {
@@ -2728,6 +2729,14 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV
bool clearScopeChain)
{
JSC::JSValue thisObject = _thisObject;
+ if (!callee) {
+ // callee can't be zero, as this can cause JSC to crash during GC
+ // marking phase if the context's Arguments object has been created.
+ // Fake it by using the global object. Note that this is also handled
+ // in QScriptContext::callee(), as that function should still return
+ // an invalid value.
+ callee = originalGlobalObject();
+ }
if (calledAsConstructor) {
//JSC doesn't create default created object for native functions. so we do it
JSC::JSValue prototype = callee->get(exec, exec->propertyNames().prototype);
@@ -2763,9 +2772,7 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV
if (!clearScopeChain) {
newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags | ShouldRestoreCallFrame, argc, callee);
} else {
- JSC::JSObject *jscObject = originalGlobalObject();
- JSC::ScopeChainNode *scn = new JSC::ScopeChainNode(0, jscObject, &exec->globalData(), exec->lexicalGlobalObject(), jscObject);
- newCallFrame->init(0, /*vPC=*/0, scn, exec, flags | ShouldRestoreCallFrame, argc, callee);
+ newCallFrame->init(0, /*vPC=*/0, globalExec()->scopeChain(), exec, flags | ShouldRestoreCallFrame, argc, callee);
}
} else {
setContextFlags(newCallFrame, flags);
diff --git a/src/script/api/qscriptprogram.cpp b/src/script/api/qscriptprogram.cpp
index 31af9a0..c0e2656 100644
--- a/src/script/api/qscriptprogram.cpp
+++ b/src/script/api/qscriptprogram.cpp
@@ -27,6 +27,7 @@
#include "qscriptengine.h"
#include "qscriptengine_p.h"
+#include "SamplingTool.h"
#include "Executable.h"
QT_BEGIN_NAMESPACE
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index e0dc385..91ce9c8 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -145,11 +145,11 @@
\value PropertySetter The property is defined by a function which will be called to set the property value.
- \value QObjectMember This flag is used to indicate that an existing property is a QObject member (a property or method).
+ \omitvalue QObjectMember This flag is used to indicate that an existing property is a QObject member (a property or method).
\value KeepExistingFlags This value is used to indicate to setProperty() that the property's flags should be left unchanged. If the property doesn't exist, the default flags (0) will be used.
- \value UserRange Flags in this range are not used by Qt Script, and can be used for custom purposes.
+ \omitvalue UserRange Flags in this range are not used by Qt Script, and can be used for custom purposes.
*/
/*!
@@ -254,6 +254,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val)
: d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
if (engine) {
+ QScript::APIShim shim(d_ptr->engine);
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
} else
@@ -271,6 +272,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val)
: d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
if (engine) {
+ QScript::APIShim shim(d_ptr->engine);
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
} else
@@ -288,6 +290,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val)
: d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
if (engine) {
+ QScript::APIShim shim(d_ptr->engine);
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
} else
@@ -305,6 +308,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val)
: d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
if (engine) {
+ QScript::APIShim shim(d_ptr->engine);
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsString(exec, val));
} else {
@@ -325,6 +329,7 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const char *val)
: d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
if (engine) {
+ QScript::APIShim shim(d_ptr->engine);
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsString(exec, val));
} else {
@@ -531,7 +536,12 @@ void QScriptValue::setPrototype(const QScriptValue &prototype)
Q_D(QScriptValue);
if (!d || !d->isObject())
return;
- if (prototype.isValid() && QScriptValuePrivate::getEngine(prototype)
+
+ JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype);
+ if (!other || !(other.isObject() || other.isNull()))
+ return;
+
+ if (QScriptValuePrivate::getEngine(prototype)
&& (QScriptValuePrivate::getEngine(prototype) != d->engine)) {
qWarning("QScriptValue::setPrototype() failed: "
"cannot set a prototype created in "
@@ -539,7 +549,6 @@ void QScriptValue::setPrototype(const QScriptValue &prototype)
return;
}
JSC::JSObject *thisObject = JSC::asObject(d->jscValue);
- JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype);
// check for cycle
JSC::JSValue nextPrototypeValue = other;
diff --git a/src/script/script.pro b/src/script/script.pro
index 162eb9c..c558ba8 100644
--- a/src/script/script.pro
+++ b/src/script/script.pro
@@ -73,7 +73,7 @@ INCLUDEPATH += $$WEBKITDIR/JavaScriptCore/generated
# This line copied from WebCore.pro
DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1
-DEFINES += NDEBUG
+CONFIG(release, debug|release):DEFINES += NDEBUG
solaris-g++:isEqual(QT_ARCH,sparc) {
CONFIG -= separate_debug_info
@@ -101,5 +101,9 @@ symbian {
QMAKE_CXXFLAGS.ARMCC += -OTime -O3
}
+integrity {
+ CFLAGS += --diag_remark=236,82
+}
+
# WebKit doesn't compile in C++0x mode
*-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 4df1d63..bf7c0aa 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -657,7 +657,7 @@ bool QSqlTableModel::insertRowIntoTable(const QSqlRecord &values)
return false;
}
- return d->exec(stmt, prepStatement, rec);
+ return d->exec(stmt, prepStatement, rec, QSqlRecord() /* no where values */);
}
/*!
@@ -695,7 +695,7 @@ bool QSqlTableModel::deleteRowFromTable(int row)
}
stmt.append(QLatin1Char(' ')).append(where);
- return d->exec(stmt, prepStatement, whereValues);
+ return d->exec(stmt, prepStatement, QSqlRecord() /* no new values */, whereValues);
}
/*!
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index d2b96e6..f4f3811 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -75,7 +75,7 @@ public:
QSqlRecord record(const QVector<QVariant> &values) const;
bool exec(const QString &stmt, bool prepStatement,
- const QSqlRecord &rec, const QSqlRecord &whereValues = QSqlRecord());
+ const QSqlRecord &rec, const QSqlRecord &whereValues);
virtual void revertCachedRow(int row);
void revertInsertedRow();
bool setRecord(int row, const QSqlRecord &record);
diff --git a/src/src.pro b/src/src.pro
index c07d399..0908911 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -109,10 +109,11 @@ src_webkit_declarative.target = sub-webkitdeclarative
src_phonon.depends = src_gui
src_multimedia.depends = src_gui
contains(QT_CONFIG, opengl):src_multimedia.depends += src_opengl
- src_tools_activeqt.depends = src_tools_idc src_gui
+ src_activeqt.depends = src_tools_idc src_gui
src_declarative.depends = src_gui src_script src_network
src_plugins.depends = src_gui src_sql src_svg
contains(QT_CONFIG, multimedia):src_plugins.depends += src_multimedia
+ contains(QT_CONFIG, declarative):src_plugins.depends += src_declarative
src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS
src_s60installs.depends -= src_s60installs
src_imports.depends = src_gui src_declarative
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index 9a83a1a..ace17db 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -130,7 +130,7 @@ public:
QBenchmarkGlobalData:current is created at the beginning of qExec()
and cleared at the end.
*/
-class QBenchmarkGlobalData
+class Q_TESTLIB_EXPORT QBenchmarkGlobalData
{
public:
static QBenchmarkGlobalData *current;
@@ -161,7 +161,7 @@ private:
created at the beginning of qInvokeTestMethod() and cleared at
the end.
*/
-class QBenchmarkTestMethodData
+class Q_TESTLIB_EXPORT QBenchmarkTestMethodData
{
public:
static QBenchmarkTestMethodData *current;
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 55f5fbe..287d8e6 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1014,6 +1014,10 @@ static bool isValidSlot(const QMetaMethod &sl)
return true;
}
+Q_TESTLIB_EXPORT bool printAvailableFunctions = false;
+Q_TESTLIB_EXPORT QStringList testFunctions;
+Q_TESTLIB_EXPORT QStringList testTags;
+
static void qPrintTestSlots()
{
for (int i = 0; i < QTest::currentTestObject->metaObject()->methodCount(); ++i) {
@@ -1034,7 +1038,7 @@ static int qToInt(char *str)
return l;
}
-static void qParseArgs(int argc, char *argv[])
+Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
{
const char *testOptions =
" options:\n"
@@ -1084,8 +1088,12 @@ static void qParseArgs(int argc, char *argv[])
"%s", argv[0], testOptions);
exit(0);
} else if (strcmp(argv[i], "-functions") == 0) {
- qPrintTestSlots();
- exit(0);
+ if (qml) {
+ QTest::printAvailableFunctions = true;
+ } else {
+ qPrintTestSlots();
+ exit(0);
+ }
} else if(strcmp(argv[i], "-xunitxml") == 0){
QTestLog::setLogMode(QTestLog::XunitXML);
} else if (strcmp(argv[i], "-xml") == 0) {
@@ -1221,6 +1229,32 @@ static void qParseArgs(int argc, char *argv[])
} else if (argv[i][0] == '-') {
printf("Unknown option: '%s'\n\n%s", argv[i], testOptions);
exit(1);
+ } else if (qml) {
+ // We can't check the availability of test functions until
+ // we load the QML files. So just store the data for now.
+ int colon = -1;
+ int offset;
+ for(offset = 0; *(argv[i]+offset); ++offset) {
+ if (*(argv[i]+offset) == ':') {
+ if (*(argv[i]+offset+1) == ':') {
+ // "::" is used as a test name separator.
+ // e.g. "ClickTests::test_click:row1".
+ ++offset;
+ } else {
+ colon = offset;
+ break;
+ }
+ }
+ }
+ if (colon == -1) {
+ QTest::testFunctions += QString::fromLatin1(argv[i]);
+ QTest::testTags += QString();
+ } else {
+ QTest::testFunctions +=
+ QString::fromLatin1(argv[i], colon);
+ QTest::testTags +=
+ QString::fromLatin1(argv[i] + colon + 1);
+ }
} else {
if (!QTest::testFuncs) {
QTest::testFuncs = new QTest::TestFunction[512];
@@ -1625,6 +1659,14 @@ private:
void FatalSignalHandler::signal(int signum)
{
qFatal("Received signal %d", signum);
+#if defined(Q_OS_INTEGRITY)
+ {
+ struct sigaction act;
+ memset(&act, 0, sizeof(struct sigaction));
+ act.sa_handler = SIG_DFL;
+ sigaction(signum, &act, NULL);
+ }
+#endif
}
FatalSignalHandler::FatalSignalHandler()
@@ -1639,8 +1681,9 @@ FatalSignalHandler::FatalSignalHandler()
act.sa_handler = FatalSignalHandler::signal;
// Remove the handler after it is invoked.
+#if !defined(Q_OS_INTEGRITY)
act.sa_flags = SA_RESETHAND;
-
+#endif
// Block all fatal signals in our signal handler so we don't try to close
// the testlog twice.
sigemptyset(&act.sa_mask);
@@ -1785,7 +1828,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
QTEST_ASSERT(metaObject);
QTestResult::setCurrentTestObject(metaObject->className());
- qParseArgs(argc, argv);
+ qtest_qParseArgs(argc, argv, false);
if (QTest::randomOrder) {
seedRandom();
}
diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h
index 59282fd..a892d3d 100644
--- a/src/testlib/qtestlog_p.h
+++ b/src/testlib/qtestlog_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class QBenchmarkResult;
-class QTestLog
+class Q_TESTLIB_EXPORT QTestLog
{
public:
enum LogMode { Plain = 0, XML, LightXML, XunitXML };
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h
index 15523f5..7ff120a 100644
--- a/src/testlib/qtestresult_p.h
+++ b/src/testlib/qtestresult_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QTestResultPrivate;
class QTestData;
-class QTestResult
+class Q_TESTLIB_EXPORT QTestResult
{
public:
enum TestLocation { NoWhere = 0, DataFunc = 1, InitFunc = 2, Func = 3, CleanupFunc = 4 };
diff --git a/src/testlib/qtesttable_p.h b/src/testlib/qtesttable_p.h
index d085b57..f835506 100644
--- a/src/testlib/qtesttable_p.h
+++ b/src/testlib/qtesttable_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QTestData;
class QTestTablePrivate;
-class QTestTable
+class Q_TESTLIB_EXPORT QTestTable
{
public:
QTestTable();
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index 1ecb7e5..ecff105 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -111,6 +111,7 @@ void error(const char *msg = "Invalid argument")
" -i do not generate an #include statement\n"
" -p<path> path prefix for included file\n"
" -f[<file>] force #include, optional file name\n"
+ " -nn do not display notes\n"
" -nw do not display warnings\n"
" @<file> read additional options from file\n"
" -v display version of moc\n");
@@ -333,9 +334,12 @@ int runMoc(int _argc, char **_argv)
case 'n': // don't display warnings
if (ignoreConflictingOptions)
break;
- if (opt != "nw")
+ if (opt == "nw")
+ moc.displayWarnings = moc.displayNotes = false;
+ else if (opt == "nn")
+ moc.displayNotes = false;
+ else
error();
- moc.displayWarnings = false;
break;
case 'h': // help
if (more && opt != "help")
@@ -425,7 +429,7 @@ int runMoc(int _argc, char **_argv)
fprintf(out, "%s\n", composePreprocessorOutput(moc.symbols).constData());
} else {
if (moc.classList.isEmpty())
- moc.warning("No relevant classes found. No output generated.");
+ moc.note("No relevant classes found. No output generated.");
else
moc.generate(out);
}
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 2cf2412..74b1ace 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -685,10 +685,13 @@ void Moc::parse()
if (parseEnum(&enumDef))
def.enumList += enumDef;
} break;
+ case SEMIC:
+ case COLON:
+ break;
default:
FunctionDef funcDef;
funcDef.access = access;
- int rewind = index;
+ int rewind = index--;
if (parseMaybeFunction(&def, &funcDef)) {
if (funcDef.isConstructor) {
if ((access == FunctionDef::Public) && funcDef.isInvokable) {
diff --git a/src/tools/moc/parser.cpp b/src/tools/moc/parser.cpp
index 1fa1401..b6f0837 100644
--- a/src/tools/moc/parser.cpp
+++ b/src/tools/moc/parser.cpp
@@ -78,4 +78,10 @@ void Parser::warning(const char *msg) {
currentFilenames.top().constData(), qMax(0, index > 0 ? symbol().lineNum : 0), msg);
}
+void Parser::note(const char *msg) {
+ if (displayNotes && msg)
+ fprintf(stderr, ErrorFormatString "Note: %s\n",
+ currentFilenames.top().constData(), qMax(0, index > 0 ? symbol().lineNum : 0), msg);
+}
+
QT_END_NAMESPACE
diff --git a/src/tools/moc/parser.h b/src/tools/moc/parser.h
index 8356449..a874248 100644
--- a/src/tools/moc/parser.h
+++ b/src/tools/moc/parser.h
@@ -50,10 +50,11 @@ QT_BEGIN_NAMESPACE
class Parser
{
public:
- Parser():index(0), displayWarnings(true){}
+ Parser():index(0), displayWarnings(true), displayNotes(true) {}
Symbols symbols;
int index;
bool displayWarnings;
+ bool displayNotes;
QStack<QByteArray> currentFilenames;
@@ -73,6 +74,7 @@ public:
void error(int rollback);
void error(const char *msg = 0);
void warning(const char * = 0);
+ void note(const char * = 0);
};
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp
index 8aaa8ff..0c0871a 100644
--- a/tests/arthur/baselineserver/src/baselineserver.cpp
+++ b/tests/arthur/baselineserver/src/baselineserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -178,7 +178,7 @@ bool BaselineHandler::establishConnection()
if (branch.isEmpty()) {
// Not run by Pulse, i.e. ad hoc run: Ok.
}
- else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration"))) {
+ else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration"))) {
qDebug() << runId << logtime() << "Did not pass branch/staging repo filter, disconnecting.";
proto.sendBlock(BaselineProtocol::Abort, QByteArray("This branch/staging repo is not assigned to be tested."));
proto.socket.disconnectFromHost();
@@ -426,27 +426,25 @@ QString BaselineHandler::clearAllBaselines(const QString &context)
return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context;
}
-QString BaselineHandler::updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline)
+QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile)
{
- QString res;
- QString basePath(BaselineServer::storagePath() + QLC('/'));
- QString srcBase(basePath + newBaseline.left(newBaseline.length() - 3));
- QString dstDir(basePath + oldBaseline.left(oldBaseline.lastIndexOf(QLC('/'))));
-
- QProcess proc;
- proc.setProcessChannelMode(QProcess::MergedChannels);
- proc.start(QLS("cp"), QStringList() << QLS("-f") << srcBase + QLS(FileFormat) << srcBase + QLS(MetadataFileExt) << dstDir);
- proc.waitForFinished();
- if (proc.exitCode() == 0)
- res = QString("Successfully updated '%1'").arg(oldBaseline);
- else
- res = QString("Error updating baseline: %1<br>"
- "Command output: <pre>%2</pre>").arg(proc.errorString(), proc.readAll().constData());
-
- return res;
+ int tot = 0;
+ int failed = 0;
+ QString storagePrefix = BaselineServer::storagePath() + QLC('/');
+ // If itemId is set, update just that one, otherwise, update all:
+ QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile;
+ QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt));
+ while (it.hasNext()) {
+ tot++;
+ it.next();
+ QString oldFile = storagePrefix + context + QLC('/') + it.fileName();
+ QFile::remove(oldFile); // Remove existing baseline file
+ if (!QFile::copy(it.filePath(), oldFile)) // and replace it with the mismatch
+ failed++;
+ }
+ return QString(QLS("%1 of %2 baselines updated in context %3 from context %4")).arg((tot-failed)/2).arg(tot/2).arg(context, mismatchContext);
}
-
QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist)
{
QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h
index a5683b2..cae490f 100644
--- a/tests/arthur/baselineserver/src/baselineserver.h
+++ b/tests/arthur/baselineserver/src/baselineserver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -109,7 +109,7 @@ public:
// CGI callbacks:
static QString view(const QString &baseline, const QString &rendered, const QString &compared);
static QString clearAllBaselines(const QString &context);
- static QString updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline);
+ static QString updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile);
static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false);
private slots:
diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp
index 02fc2fa..3a03b2f 100644
--- a/tests/arthur/baselineserver/src/main.cpp
+++ b/tests/arthur/baselineserver/src/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/arthur/baselineserver/src/report.cpp b/tests/arthur/baselineserver/src/report.cpp
index c85f144..5854706 100644
--- a/tests/arthur/baselineserver/src/report.cpp
+++ b/tests/arthur/baselineserver/src/report.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -154,10 +154,14 @@ void Report::writeFunctionResults(const ImageItemList &list)
QString testFunction = list.at(0).testFunction;
QString pageUrl = BaselineServer::baseUrl() + path;
QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2);
+ QString misCtx = handler->pathForItem(list.at(0), false, false).section(QLC('/'), 0, -2);
+
out << "\n<p>&nbsp;</p><h3>Test function: " << testFunction << "</h3>\n";
out << "<p><a href=\"/cgi-bin/server.cgi?cmd=clearAllBaselines&context=" << ctx << "&url=" << pageUrl
- << "\"><b><big>Clear all baselines</big></b></a></h3> (They will be recreated by the next run)</p>\n\n";
+ << "\"><b>Clear all baselines</b></a> for this testfunction (They will be recreated by the next run)</p>\n";
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&context=" << ctx << "&mismatchContext=" << misCtx << "&url=" << pageUrl
+ << "\"><b>Let these mismatching images be the new baselines</b></a> for this testfunction</p>\n\n";
out << "<table border=\"2\">\n"
"<tr>\n"
@@ -176,7 +180,8 @@ void Report::writeFunctionResults(const ImageItemList &list)
QString metadata = prefix + QLS(MetadataFileExt);
if (item.status == ImageItem::Mismatch) {
QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat);
- writeItem(baseline, rendered, item, ctx, metadata);
+ QString itemFile = prefix.section(QLC('/'), -1);
+ writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata);
}
else {
out << "<td align=center><a href=\"/" << baseline << "\">image</a> <a href=\"/" << metadata << "\">info</a></td>\n"
@@ -207,7 +212,8 @@ void Report::writeFunctionResults(const ImageItemList &list)
out << "</table>\n";
}
-void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx, const QString &metadata)
+void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata)
{
QString compared = generateCompared(baseline, rendered);
QString pageUrl = BaselineServer::baseUrl() + path;
@@ -219,8 +225,8 @@ void Report::writeItem(const QString &baseline, const QString &rendered, const I
out << "<td align=center>\n"
<< "<p><span style=\"color:red\">Mismatch reported</span></p>\n"
<< "<p><a href=\"/" << metadata << "\">Baseline Info</a>\n"
- << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&oldBaseline=" << baseline
- << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Replace baseline with rendered</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&context=" << ctx << "&mismatchContext=" << misCtx
+ << "&itemFile=" << itemFile << "&url=" << pageUrl << "\">Let this be the new baseline</a></p>\n"
<< "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx
<< "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n"
<< "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered
@@ -280,8 +286,13 @@ void Report::handleCGIQuery(const QString &query)
cgiUrl.queryItemValue(QLS("compared")));
}
else if (command == QLS("updateSingleBaseline")) {
- s << BaselineHandler::updateSingleBaseline(cgiUrl.queryItemValue(QLS("oldBaseline")),
- cgiUrl.queryItemValue(QLS("newBaseline")));
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ cgiUrl.queryItemValue(QLS("itemFile")));
+ } else if (command == QLS("updateAllBaselines")) {
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ QString());
} else if (command == QLS("clearAllBaselines")) {
s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context")));
} else if (command == QLS("blacklist")) {
diff --git a/tests/arthur/baselineserver/src/report.h b/tests/arthur/baselineserver/src/report.h
index a56aafb..d549a72 100644
--- a/tests/arthur/baselineserver/src/report.h
+++ b/tests/arthur/baselineserver/src/report.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -67,7 +67,8 @@ public:
private:
void write();
void writeFunctionResults(const ImageItemList &list);
- void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx, const QString &metadata);
+ void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata);
void writeHeader();
void writeFooter();
QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false);
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
index e4445bd..0e7e507 100644
--- a/tests/arthur/common/baselineprotocol.cpp
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -310,7 +310,7 @@ bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
}
if (cmd == Abort) {
- errMsg += QLS("Server aborted connection. Reason: ") + QString::fromLatin1(block);
+ errMsg += QLS("Server rejected connection. Reason: ") + QString::fromLatin1(block);
return false;
}
diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h
index 2315bc3..259555d 100644
--- a/tests/arthur/common/baselineprotocol.h
+++ b/tests/arthur/common/baselineprotocol.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/arthur/common/lookup3.cpp b/tests/arthur/common/lookup3.cpp
index 8cdc64b..1aa501f 100644
--- a/tests/arthur/common/lookup3.cpp
+++ b/tests/arthur/common/lookup3.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/arthur/common/qbaselinetest.cpp b/tests/arthur/common/qbaselinetest.cpp
index 79241d5..1d028f8 100644
--- a/tests/arthur/common/qbaselinetest.cpp
+++ b/tests/arthur/common/qbaselinetest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/arthur/common/qbaselinetest.h b/tests/arthur/common/qbaselinetest.h
index e27cda2..dc32109 100644
--- a/tests/arthur/common/qbaselinetest.h
+++ b/tests/arthur/common/qbaselinetest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/baselineexample/baselineexample.pro b/tests/auto/baselineexample/baselineexample.pro
index 30feecc..13f03b8 100644
--- a/tests/auto/baselineexample/baselineexample.pro
+++ b/tests/auto/baselineexample/baselineexample.pro
@@ -15,4 +15,4 @@ TEMPLATE = app
SOURCES += tst_baselineexample.cpp
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
+include($$PWD/../../arthur/common/qbaselinetest.pri)
diff --git a/tests/auto/baselineexample/tst_baselineexample.cpp b/tests/auto/baselineexample/tst_baselineexample.cpp
index b97cc63..02af816 100644
--- a/tests/auto/baselineexample/tst_baselineexample.cpp
+++ b/tests/auto/baselineexample/tst_baselineexample.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro
index 3451b53..6810f76 100644
--- a/tests/auto/corelib.pro
+++ b/tests/auto/corelib.pro
@@ -59,6 +59,7 @@ SUBDIRS=\
qresourceengine \
qringbuffer \
qscopedpointer \
+ qscopedvaluerollback \
qsemaphore \
qsequentialanimationgroup \
qset \
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
index 50fbbe0..ff19675 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
+++ b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
@@ -6,9 +6,9 @@ Rectangle {
objectName: "filler"
width: 50; height: 50; color: "blue"
anchors.fill: parent;
- anchors.leftMargin: 10;
- anchors.rightMargin: 20;
- anchors.topMargin: 30;
- anchors.bottomMargin: 40;
+ anchors.leftMargin: 10;
+ anchors.rightMargin: 20;
+ anchors.topMargin: 30;
+ anchors.bottomMargin: 40;
}
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
index dace9c0..685346a 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
+++ b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
@@ -6,8 +6,8 @@ Rectangle {
objectName: "filler"
width: 50; height: 50; color: "blue"
anchors.fill: parent;
- anchors.margins: 10
- anchors.leftMargin: 5
- anchors.topMargin: 6
+ anchors.margins: 10
+ anchors.leftMargin: 5
+ anchors.topMargin: 6
}
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index e880857..0442350 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -65,13 +65,10 @@ class tst_qdeclarativeanchors : public QObject
public:
tst_qdeclarativeanchors() {}
- template<typename T>
- T *findItem(QGraphicsObject *parent, const QString &id);
- QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName);
-
private slots:
void basicAnchors();
void basicAnchorsQGraphicsWidget();
+ void basicAnchorsRTL();
void loops();
void illegalSets();
void illegalSets_data();
@@ -82,16 +79,20 @@ private slots:
void nullItem_data();
void crash1();
void centerIn();
+ void centerInRTL();
void hvCenter();
+ void hvCenterRTL();
void fill();
+ void fillRTL();
void margins();
+ void marginsRTL();
};
/*
Find an item with the specified id.
*/
template<typename T>
-T *tst_qdeclarativeanchors::findItem(QGraphicsObject *parent, const QString &objectName)
+T *findItem(QGraphicsObject *parent, const QString &objectName)
{
const QMetaObject &mo = T::staticMetaObject;
QList<QGraphicsItem *> children = parent->childItems();
@@ -110,7 +111,7 @@ T *tst_qdeclarativeanchors::findItem(QGraphicsObject *parent, const QString &obj
return 0;
}
-QGraphicsObject *tst_qdeclarativeanchors::findObject(QGraphicsObject *parent, const QString &objectName)
+QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName)
{
QList<QGraphicsItem *> children = parent->childItems();
for (int i = 0; i < children.count(); ++i) {
@@ -263,6 +264,105 @@ void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
delete view;
}
+QDeclarativeItem* childItem(QDeclarativeItem *parentItem, const char * itemString) {
+ return findItem<QDeclarativeItem>(parentItem, QLatin1String(itemString));
+}
+
+qreal offsetMasterRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ QDeclarativeItem* masterItem = findItem<QDeclarativeItem>(rootItem, QLatin1String("masterRect"));
+ return masterItem->width()+2*masterItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+qreal offsetParentRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ return rootItem->width()+2*rootItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+void tst_qdeclarativeanchors::basicAnchorsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
+
+ qApp->processEvents();
+
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(view->rootObject());
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ QCOMPARE(mirrored, false);
+ }
+
+ foreach(QObject *child, rootItem->children())
+ mirrorAnchors(qobject_cast<QDeclarativeItem*>(child));
+
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ QCOMPARE(mirrored, true);
+ }
+
+ //sibling horizontal
+ QCOMPARE(childItem(rootItem, "rect1")->x(), offsetMasterRTL(rootItem, "rect1")-26.0);
+ QCOMPARE(childItem(rootItem, "rect2")->x(), offsetMasterRTL(rootItem, "rect2")-122.0);
+ QCOMPARE(childItem(rootItem, "rect3")->x(), offsetMasterRTL(rootItem, "rect3")-74.0);
+ QCOMPARE(childItem(rootItem, "rect4")->x(), offsetMasterRTL(rootItem, "rect4")-16.0);
+ QCOMPARE(childItem(rootItem, "rect5")->x(), offsetMasterRTL(rootItem, "rect5")-112.0);
+ QCOMPARE(childItem(rootItem, "rect6")->x(), offsetMasterRTL(rootItem, "rect6")-64.0);
+
+ //parent horizontal
+ QCOMPARE(childItem(rootItem, "rect7")->x(), offsetParentRTL(rootItem, "rect7")-0.0);
+ QCOMPARE(childItem(rootItem, "rect8")->x(), offsetParentRTL(rootItem, "rect8")-240.0);
+ QCOMPARE(childItem(rootItem, "rect9")->x(), offsetParentRTL(rootItem, "rect9")-120.0);
+ QCOMPARE(childItem(rootItem, "rect10")->x(), offsetParentRTL(rootItem, "rect10")+10.0);
+ QCOMPARE(childItem(rootItem, "rect11")->x(), offsetParentRTL(rootItem, "rect11")-230.0);
+ QCOMPARE(childItem(rootItem, "rect12")->x(), offsetParentRTL(rootItem, "rect12")-110.0);
+
+ //vertical
+ QCOMPARE(childItem(rootItem, "rect13")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect14")->y(), 155.0);
+
+ //stretch
+ QCOMPARE(childItem(rootItem, "rect15")->x(), offsetMasterRTL(rootItem, "rect15")-26.0);
+ QCOMPARE(childItem(rootItem, "rect15")->width(), 96.0);
+ QCOMPARE(childItem(rootItem, "rect16")->x(), offsetMasterRTL(rootItem, "rect16")-26.0);
+ QCOMPARE(childItem(rootItem, "rect16")->width(), 192.0);
+ QCOMPARE(childItem(rootItem, "rect17")->x(), offsetMasterRTL(rootItem, "rect17")+70.0);
+ QCOMPARE(childItem(rootItem, "rect17")->width(), 192.0);
+
+ //vertical stretch
+ QCOMPARE(childItem(rootItem, "rect18")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect18")->height(), 40.0);
+
+ //more parent horizontal
+ QCOMPARE(childItem(rootItem, "rect19")->x(), offsetParentRTL(rootItem, "rect19")-115.0);
+ QCOMPARE(childItem(rootItem, "rect20")->x(), offsetParentRTL(rootItem, "rect20")-235.0);
+ QCOMPARE(childItem(rootItem, "rect21")->x(), offsetParentRTL(rootItem, "rect21")+5.0);
+
+ //centerIn
+ QCOMPARE(childItem(rootItem, "rect22")->x(), offsetMasterRTL(rootItem, "rect22")-69.0);
+ QCOMPARE(childItem(rootItem, "rect22")->y(), 5.0);
+
+ //margins
+ QCOMPARE(childItem(rootItem, "rect23")->x(), offsetMasterRTL(rootItem, "rect23")-31.0);
+ QCOMPARE(childItem(rootItem, "rect23")->y(), 5.0);
+ QCOMPARE(childItem(rootItem, "rect23")->width(), 86.0);
+ QCOMPARE(childItem(rootItem, "rect23")->height(), 10.0);
+
+ // offsets
+ QCOMPARE(childItem(rootItem, "rect24")->x(), offsetMasterRTL(rootItem, "rect24")-26.0);
+ QCOMPARE(childItem(rootItem, "rect25")->y(), 60.0);
+ QCOMPARE(childItem(rootItem, "rect26")->y(), 5.0);
+
+ //baseline
+ QDeclarativeText *text1 = findItem<QDeclarativeText>(rootItem, QLatin1String("text1"));
+ QDeclarativeText *text2 = findItem<QDeclarativeText>(rootItem, QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
+ delete view;
+}
+
// mostly testing that we don't crash
void tst_qdeclarativeanchors::loops()
{
@@ -514,6 +614,31 @@ void tst_qdeclarativeanchors::fill()
delete view;
}
+void tst_qdeclarativeanchors::fillRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 0.0 + 20.0);
+ QCOMPARE(rect->y(), 0.0 + 30.0);
+ QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setLeftMargin(20.0);
+ rectPrivate->anchors()->setRightMargin(0.0);
+ rectPrivate->anchors()->setBottomMargin(0.0);
+ rectPrivate->anchors()->setTopMargin(10.0);
+ QCOMPARE(rect->x(), 0.0 + 0.0);
+ QCOMPARE(rect->y(), 0.0 + 10.0);
+ QCOMPARE(rect->width(), 200.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 10.0);
+
+ delete view;
+}
void tst_qdeclarativeanchors::centerIn()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
@@ -521,6 +646,7 @@ void tst_qdeclarativeanchors::centerIn()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
QCOMPARE(rect->x(), 75.0 + 10);
QCOMPARE(rect->y(), 75.0 + 30);
//Alter Offsets (tests QTBUG-6631)
@@ -532,6 +658,27 @@ void tst_qdeclarativeanchors::centerIn()
delete view;
}
+
+void tst_qdeclarativeanchors::centerInRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 75.0 - 10);
+ QCOMPARE(rect->y(), 75.0 + 30);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setHorizontalCenterOffset(-20.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(-10.0);
+ QCOMPARE(rect->x(), 75.0 + 20.0);
+ QCOMPARE(rect->y(), 75.0 - 10.0);
+
+ delete view;
+}
+
void tst_qdeclarativeanchors::hvCenter()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
@@ -539,12 +686,39 @@ void tst_qdeclarativeanchors::hvCenter()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
// test QTBUG-10999
QCOMPARE(rect->x(), 10.0);
QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 - 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
delete view;
}
+void tst_qdeclarativeanchors::hvCenterRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ // test QTBUG-10999
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 + 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
+ delete view;
+}
void tst_qdeclarativeanchors::margins()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
@@ -568,6 +742,31 @@ void tst_qdeclarativeanchors::margins()
delete view;
}
+void tst_qdeclarativeanchors::marginsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
+
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 6.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
+ QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
+
+ rectPrivate->anchors()->setTopMargin(0.0);
+ rectPrivate->anchors()->setMargins(20.0);
+
+ QCOMPARE(rect->x(), 20.0);
+ QCOMPARE(rect->y(), 20.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 20.0 - 20.0);
+
+ delete view;
+}
+
+
QTEST_MAIN(tst_qdeclarativeanchors)
#include "tst_qdeclarativeanchors.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
index 104ee15..7d1b807 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
@@ -46,6 +46,7 @@
#include <private/qdeclarativeimage_p.h>
#include <private/qdeclarativeanimatedimage_p.h>
#include <QSignalSpy>
+#include <QtDeclarative/qdeclarativecontext.h>
#include "../shared/testhttpserver.h"
#include "../../../shared/util.h"
@@ -76,6 +77,7 @@ private slots:
void sourceSizeReadOnly();
void invalidSource();
void qtbug_16520();
+ void progressAndStatusChanges();
private:
QPixmap grabScene(QGraphicsScene *scene, int width, int height);
@@ -333,6 +335,53 @@ void tst_qdeclarativeanimatedimage::qtbug_16520()
delete anim;
}
+void tst_qdeclarativeanimatedimage::progressAndStatusChanges()
+{
+ TestHTTPServer server(14449);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nAnimatedImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+
+ QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
+ QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+
+ // Loading local file
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.gif"));
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 1);
+ QTRY_COMPARE(progressSpy.count(), 0);
+ QTRY_COMPARE(statusSpy.count(), 0);
+
+ // Loading remote file
+ ctxt->setContextProperty("srcImage", "http://127.0.0.1:14449/stickman.gif");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 2);
+ QTRY_VERIFY(progressSpy.count() > 1);
+ QTRY_COMPARE(statusSpy.count(), 2);
+
+ ctxt->setContextProperty("srcImage", "");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Null);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_COMPARE(sourceSpy.count(), 3);
+ QTRY_VERIFY(progressSpy.count() > 2);
+ QTRY_COMPARE(statusSpy.count(), 3);
+}
+
QTEST_MAIN(tst_qdeclarativeanimatedimage)
#include "tst_qdeclarativeanimatedimage.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
new file mode 100644
index 0000000..b247fce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ property bool on: false
+ border.color: "#ffffff"
+ color: "green"
+ width: 50
+ height: 50
+ NumberAnimation on x {
+ objectName: "animation"
+ running: container.on; from: 0; to: 600; loops: Animation.Infinite; duration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
new file mode 100644
index 0000000..f0fdf9c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+
+ Double { id: dub; on: parent.width < 800 }
+ Component.onCompleted: dub.on = false
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
new file mode 100644
index 0000000..7dc29f9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 200
+ height: 200
+
+ property bool animating: true
+ property int value: 0
+
+ NumberAnimation {
+ target: rect
+ property: "value"
+ running: rect.animating
+ to: 100
+ duration: 50
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index 6f71dec..e2a54c0 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -85,6 +85,9 @@ private slots:
void rotation();
void runningTrueBug();
void nonTransitionBug();
+ void registrationBug();
+ void doubleRegistrationBug();
+ void alwaysRunToEndRestartBug();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -793,6 +796,54 @@ void tst_qdeclarativeanimations::nonTransitionBug()
QCOMPARE(mover->x(), qreal(100));
}
+//QTBUG-14042
+void tst_qdeclarativeanimations::registrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/registrationBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QTRY_COMPARE(rect->property("value"), QVariant(int(100)));
+}
+
+void tst_qdeclarativeanimations::doubleRegistrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation");
+ QVERIFY(anim != 0);
+ QTRY_COMPARE(anim->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
+//QTBUG-16736
+void tst_qdeclarativeanimations::alwaysRunToEndRestartBug()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(1000);
+ animation.setLoops(-1);
+ animation.setAlwaysRunToEnd(true);
+ QVERIFY(animation.loops() == -1);
+ QVERIFY(animation.alwaysRunToEnd() == true);
+ animation.start();
+ animation.stop();
+ animation.start();
+ animation.stop();
+ QTest::qWait(500);
+ QVERIFY(rect.x() != qreal(200));
+ QTest::qWait(800);
+ QTIMED_COMPARE(rect.x(), qreal(200));
+ QCOMPARE(static_cast<QDeclarativeAbstractAnimation*>(&animation)->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
QTEST_MAIN(tst_qdeclarativeanimations)
#include "tst_qdeclarativeanimations.moc"
diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
index 64f327b..1168471 100644
--- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
+++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index 9a15575..6bcb4eb 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -167,8 +167,8 @@ void tst_QDeclarativeDebug::recursiveObjectTest(QObject *o, const QDeclarativeDe
{
const QMetaObject *meta = o->metaObject();
- QDeclarativeType *type = QDeclarativeMetaType::qmlType(o->metaObject());
- QString className = type ? type->qmlTypeName() : QString();
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(meta);
+ QString className = type ? QString(type->qmlTypeName()) : QString(meta->className());
className = className.mid(className.lastIndexOf(QLatin1Char('/'))+1);
QCOMPARE(oref.debugId(), QDeclarativeDebugService::idForObject(o));
@@ -293,12 +293,21 @@ void tst_QDeclarativeDebug::initTestCase()
QList<QByteArray> qml;
qml << "import QtQuick 1.0\n"
"Item {"
+ "id: root\n"
"width: 10; height: 20; scale: blueRect.scale;"
"Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
"Text { color: blueRect.color; }"
"MouseArea {"
"onEntered: { console.log('hello') }"
"}"
+ "property variant varObj\n"
+ "property variant varObjList: []\n"
+ "Component.onCompleted: {\n"
+ "varObj = blueRect;\n"
+ "var list = varObjList;\n"
+ "list[0] = blueRect;\n"
+ "varObjList = list;\n"
+ "}\n"
"}";
// add second component to test multiple root contexts
@@ -742,7 +751,6 @@ void tst_QDeclarativeDebug::queryObject()
QCOMPARE(findProperty(rect.properties(), "color").value(), qVariantFromValue(QColor("blue")));
QCOMPARE(findProperty(text.properties(), "color").value(), qVariantFromValue(QColor("blue")));
-
} else {
foreach(const QDeclarativeDebugObjectReference &child, obj.children())
QCOMPARE(child.properties().count(), 0);
@@ -799,6 +807,8 @@ void tst_QDeclarativeDebug::queryExpressionResult_data()
QTest::newRow("width + 50") << "width + 50" << qVariantFromValue(60);
QTest::newRow("blueRect.width") << "blueRect.width" << qVariantFromValue(500);
QTest::newRow("bad expr") << "aeaef" << qVariantFromValue(QString("<undefined>"));
+ QTest::newRow("QObject*") << "varObj" << qVariantFromValue(QString("<unnamed object>"));
+ QTest::newRow("list of QObject*") << "varObjList" << qVariantFromValue(QString("<unknown value>"));
}
void tst_QDeclarativeDebug::tst_QDeclarativeDebugFileReference()
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index b19b3c9..40b0e1b 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -50,6 +50,7 @@
#include <QtCore/qnumeric.h>
#include <private/qdeclarativeengine_p.h>
#include <private/qdeclarativeglobalscriptclass_p.h>
+#include <private/qscriptdeclarativeclass_p.h>
#include "testtypes.h"
#include "testhttpserver.h"
#include "../../../shared/util.h"
@@ -174,6 +175,7 @@ private slots:
void aliasBindingsAssignCorrectly();
void aliasBindingsOverrideTarget();
void aliasWritesOverrideBindings();
+ void pushCleanContext();
void include();
@@ -3015,6 +3017,44 @@ void tst_qdeclarativeecmascript::revision()
}
}
+// Test for QScriptDeclarativeClass::pushCleanContext()
+void tst_qdeclarativeecmascript::pushCleanContext()
+{
+ QScriptEngine engine;
+ engine.globalObject().setProperty("a", 6);
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+
+ // First confirm pushContext() behaves as we expect
+ QScriptValue object = engine.newObject();
+ object.setProperty("a", 15);
+ QScriptContext *context1 = engine.pushContext();
+ context1->pushScope(object);
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ QScriptContext *context2 = engine.pushContext();
+ Q_UNUSED(context2);
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+ QScriptValue func1 = engine.evaluate("(function() { return a; })");
+
+ // Now check that pushCleanContext() works
+ QScriptDeclarativeClass::pushCleanContext(&engine);
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+ QScriptValue func2 = engine.evaluate("(function() { return a; })");
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+
+ // Check that function objects created in these contexts work
+ QCOMPARE(func1.call().toInt32(), 15);
+ QCOMPARE(func2.call().toInt32(), 6);
+}
+
QTEST_MAIN(tst_qdeclarativeecmascript)
#include "tst_qdeclarativeecmascript.moc"
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml b/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml
new file mode 100644
index 0000000..d0ee545
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Flickable {
+ property bool pressed: ma.pressed
+ width: 240
+ height: 320
+ contentWidth: 480
+ contentHeight: 320
+ flickableDirection: Flickable.HorizontalFlick
+ pressDelay: 50
+ Flickable {
+ objectName: "innerFlickable"
+ flickableDirection: Flickable.VerticalFlick
+ width: 480
+ height: 320
+ contentWidth: 480
+ contentHeight: 400
+ pressDelay: 10000
+ Rectangle {
+ y: 100
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 240
+ height: 100
+ color: ma.pressed ? 'blue' : 'green'
+ MouseArea {
+ id: ma
+ objectName: "mouseArea"
+ anchors.fill: parent
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index f4bec8f..65ba316 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -69,6 +69,7 @@ private slots:
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
+ void nestedPressDelay();
void flickableDirection();
void qgraphicswidget();
void resizeContent();
@@ -246,6 +247,34 @@ void tst_qdeclarativeflickable::pressDelay()
QCOMPARE(spy.count(),1);
}
+// QTBUG-17361
+void tst_qdeclarativeflickable::nestedPressDelay()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/nestedPressDelay.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *outer = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(outer != 0);
+
+ QDeclarativeFlickable *inner = canvas->rootObject()->findChild<QDeclarativeFlickable*>("innerFlickable");
+ QVERIFY(inner != 0);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
+ // the MouseArea is not pressed immediately
+ QVERIFY(outer->property("pressed").toBool() == false);
+
+ // The outer pressDelay will prevail (50ms, vs. 10sec)
+ // QTRY_VERIFY() has 5sec timeout, so will timeout well within 10sec.
+ QTRY_VERIFY(outer->property("pressed").toBool() == true);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
+
+ delete canvas;
+}
+
void tst_qdeclarativeflickable::flickableDirection()
{
QDeclarativeComponent component(&engine);
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
index a62ea31..ffd5d38 100644
--- a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
@@ -62,14 +62,24 @@ class tst_qdeclarativefolderlistmodel : public QObject
{
Q_OBJECT
public:
- tst_qdeclarativefolderlistmodel() {}
+ tst_qdeclarativefolderlistmodel() : removeStart(0), removeEnd(0) {}
+
+public slots:
+ void removed(const QModelIndex &, int start, int end) {
+ removeStart = start;
+ removeEnd = end;
+ }
private slots:
void basicProperties();
+ void refresh();
private:
void checkNoErrors(const QDeclarativeComponent& component);
QDeclarativeEngine engine;
+
+ int removeStart;
+ int removeEnd;
};
void tst_qdeclarativefolderlistmodel::checkNoErrors(const QDeclarativeComponent& component)
@@ -115,6 +125,28 @@ void tst_qdeclarativefolderlistmodel::basicProperties()
QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(""));
}
+void tst_qdeclarativefolderlistmodel::refresh()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml"));
+ checkNoErrors(component);
+
+ QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
+ QVERIFY(flm != 0);
+
+ flm->setProperty("folder",QUrl::fromLocalFile(SRCDIR "/data"));
+ QTRY_COMPARE(flm->property("count").toInt(),2); // wait for refresh
+
+ int count = flm->rowCount();
+
+ connect(flm, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
+ this, SLOT(removed(const QModelIndex&,int,int)));
+
+ flm->setProperty("sortReversed", true);
+
+ QCOMPARE(removeStart, 0);
+ QCOMPARE(removeEnd, count-1);
+}
+
QTEST_MAIN(tst_qdeclarativefolderlistmodel)
#include "tst_qdeclarativefolderlistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
index 5719f43..69eaa47 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
width: 240
@@ -48,6 +48,8 @@ Rectangle {
model: testModel
delegate: myDelegate
highlight: myHighlight
+ flow: (testTopToBottom == true) ? GridView.TopToBottom : GridView.LeftToRight
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
preferredHighlightBegin: 100
preferredHighlightEnd: 100
highlightRangeMode: "StrictlyEnforceRange"
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
index e4e699c..caa28d6 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
id: root
@@ -55,7 +55,8 @@ Rectangle {
height: 320
cellWidth: 80
cellHeight: 60
- flow: (testTopToBottom == false) ? "LeftToRight" : "TopToBottom"
+ flow: (testTopToBottom == false) ? GridView.LeftToRight : GridView.TopToBottom
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
model: testModel
delegate: myDelegate
header: root.showHeader ? headerFooter : null
diff --git a/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
new file mode 100644
index 0000000..54de16b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
@@ -0,0 +1,43 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 340
+ height: 370
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: 110; width: 120; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: 130; width: 150; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: 170; width: 190; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ GridView {
+ id: view
+ objectName: "view"
+ cellWidth: 190
+ cellHeight: 170
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ flow: GridView.TopToBottom
+ flickDeceleration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 79189a7..5ced02b 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -46,6 +46,7 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <QtDeclarative/private/qlistmodelinterface_p.h>
#include <QtDeclarative/private/qdeclarativegridview_p.h>
#include <QtDeclarative/private/qdeclarativetext_p.h>
@@ -78,9 +79,12 @@ private slots:
void componentChanges();
void modelChanges();
void positionViewAtIndex();
+ void positionViewAtIndex_rightToLeft();
+ void mirroring();
void snapping();
void resetModel();
void enforceRange();
+ void enforceRange_rightToLeft();
void QTBUG_8456();
void manualHighlight();
void footer();
@@ -203,6 +207,7 @@ void tst_QDeclarativeGridView::items()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -251,6 +256,7 @@ void tst_QDeclarativeGridView::changed()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -284,6 +290,7 @@ void tst_QDeclarativeGridView::inserted()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -360,6 +367,7 @@ void tst_QDeclarativeGridView::removed()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -503,6 +511,7 @@ void tst_QDeclarativeGridView::moved()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -726,6 +735,58 @@ void tst_QDeclarativeGridView::currentIndex()
QVERIFY(!gridview->highlightItem());
QVERIFY(!gridview->currentItem());
+ gridview->setHighlightFollowsCurrentItem(true);
+
+ gridview->setFlow(QDeclarativeGridView::LeftToRight);
+ gridview->setLayoutDirection(Qt::RightToLeft);
+
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ gridview->setCurrentIndex(35);
+
+ QTest::keyClick(canvas, Qt::Key_Right);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(gridview->currentIndex(), 37);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Left);
+ QCOMPARE(gridview->currentIndex(), 35);
+
+
+ // turn off auto highlight
+ gridview->setHighlightFollowsCurrentItem(false);
+ QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+ QVERIFY(gridview->highlightItem());
+ hlPosX = gridview->highlightItem()->x();
+ hlPosY = gridview->highlightItem()->y();
+
+ gridview->setCurrentIndex(5);
+ QTRY_COMPARE(gridview->highlightItem()->x(), hlPosX);
+ QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY);
+
+ // insert item before currentIndex
+ gridview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QTRY_COMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
+ // check removing highlight by setting currentIndex to -1;
+ gridview->setCurrentIndex(-1);
+
+ QCOMPARE(gridview->currentIndex(), -1);
+ QVERIFY(!gridview->highlightItem());
+ QVERIFY(!gridview->currentItem());
+
delete canvas;
}
@@ -774,6 +835,7 @@ void tst_QDeclarativeGridView::changeFlow()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -819,6 +881,44 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_COMPARE(number->text(), model.number(i));
}
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80 - item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+ gridview->setContentX(100);
+ QTRY_COMPARE(gridview->contentX(), 100.);
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ QTRY_COMPARE(gridview->contentX(), 0.);
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(240 - (i%3+1)*80));
+ QTRY_COMPARE(item->y(), qreal((i/3)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
delete canvas;
}
@@ -879,6 +979,7 @@ void tst_QDeclarativeGridView::propertyChanges()
QSignalSpy keyNavigationWrapsSpy(gridView, SIGNAL(keyNavigationWrapsChanged()));
QSignalSpy cacheBufferSpy(gridView, SIGNAL(cacheBufferChanged()));
+ QSignalSpy layoutSpy(gridView, SIGNAL(layoutDirectionChanged()));
QSignalSpy flowSpy(gridView, SIGNAL(flowChanged()));
QTRY_COMPARE(gridView->isWrapEnabled(), true);
@@ -905,6 +1006,38 @@ void tst_QDeclarativeGridView::propertyChanges()
QTRY_COMPARE(cacheBufferSpy.count(),1);
QTRY_COMPARE(flowSpy.count(),1);
+ gridView->setFlow(QDeclarativeGridView::LeftToRight);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(gridView->isWrapEnabled(), true);
+ QTRY_COMPARE(gridView->cacheBuffer(), 5);
+ QTRY_COMPARE(gridView->layoutDirection(), Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
delete canvas;
}
@@ -992,6 +1125,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -1185,6 +1319,7 @@ void tst_QDeclarativeGridView::snapping()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
@@ -1211,6 +1346,200 @@ void tst_QDeclarativeGridView::snapping()
QCOMPARE(gridview->contentY(), 120.);
delete canvas;
+
+}
+
+void tst_QDeclarativeGridView::mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewA = findItem<QDeclarativeGridView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewB = findItem<QDeclarativeGridView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(gridviewA->layoutDirection(), gridviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ QVERIFY(gridviewB->layoutDirection() == gridviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(gridviewB)->setLayoutMirror(true);
+ QVERIFY(gridviewB->layoutDirection() != gridviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
+void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on a currently visible item
+ gridview->positionViewAtIndex(6, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item beyond the visible items
+ gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item that would leave empty space if positioned at the top
+ gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -639.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at the beginning again
+ gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -240.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-555.);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -555.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Ensure completely visible
+ gridview->setContentX(-400);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-315);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ delete canvas;
}
void tst_QDeclarativeGridView::resetModel()
@@ -1264,9 +1593,12 @@ void tst_QDeclarativeGridView::enforceRange()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
@@ -1307,6 +1639,64 @@ void tst_QDeclarativeGridView::enforceRange()
delete canvas;
}
+void tst_QDeclarativeGridView::enforceRange_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
+ qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
+ QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(gridview->contentX(), -100.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when contentItem moves
+ gridview->setContentX(-200);
+ QTRY_COMPARE(gridview->currentIndex(), 3);
+
+ gridview->setCurrentIndex(7);
+ QTRY_COMPARE(gridview->contentX(), -300.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+ QCOMPARE(gridview->count(), 5);
+
+ delete canvas;
+}
+
void tst_QDeclarativeGridView::QTBUG_8456()
{
QDeclarativeView *canvas = createView();
@@ -1475,6 +1865,7 @@ void tst_QDeclarativeGridView::indexAt()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
diff --git a/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
new file mode 100644
index 0000000..866b615
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.1
+
+Item {
+ property bool childrenInherit: true
+ Item {
+ objectName: "mirrored1"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: parent.childrenInherit
+ Item {
+ Item {
+ objectName: "notMirrored1"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror1"
+ }
+ }
+ Item {
+ objectName: "inheritedMirror2"
+ }
+ }
+ }
+ Item {
+ objectName: "mirrored2"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: false
+ Item {
+ objectName: "notMirrored2"
+ }
+ }
+ Item {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ Loader {
+ id: loader
+ }
+ }
+ states: State {
+ name: "newContent"
+ PropertyChanges {
+ target: loader
+ sourceComponent: component
+ }
+ }
+ Component {
+ id: component
+ Item {
+ objectName: "notMirrored3"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror3"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 137522d..52c9a72 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -65,7 +65,10 @@ private slots:
void keys();
void keysProcessingOrder();
void keyNavigation();
+ void keyNavigation_RightToLeft();
void keyNavigation_skipNotVisible();
+ void layoutMirroring();
+ void layoutMirroringIllegalParent();
void smooth();
void clip();
void mapCoordinates();
@@ -87,13 +90,33 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
void qtbug_16871();
-
private:
- template<typename T>
- T *findItem(QGraphicsObject *parent, const QString &objectName);
QDeclarativeEngine engine;
};
+template<typename T>
+T *findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ if (!parent)
+ return 0;
+
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ return static_cast<T*>(item);
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
class KeysTestObject : public QObject
{
Q_OBJECT
@@ -380,6 +403,165 @@ void tst_QDeclarativeItem::keysProcessingOrder()
delete testObject;
}
+QDeclarativeItemPrivate *childPrivate(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate;
+}
+
+QVariant childProperty(QGraphicsObject *rootItem, const char * itemString, const char * property)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ return item->property(property);
+}
+
+bool anchorsMirrored(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate->anchors()->mirrored();
+}
+
+void tst_QDeclarativeItem::layoutMirroring()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/layoutmirroring.qml"));
+ canvas->show();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate *rootPrivate = QDeclarativeItemPrivate::get(rootItem);
+ QVERIFY(rootPrivate);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored2"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored1"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored2"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror2"), true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromItem, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromItem, false);
+
+ // load dynamic content using Loader that needs to inherit mirroring
+ rootItem->setProperty("state", "newContent");
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->effectiveLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+
+ // disable inheritance
+ rootItem->setProperty("childrenInherit", false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, false);
+
+ // re-enable inheritance
+ rootItem->setProperty("childrenInherit", true);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+
+ //
+ // dynamic parenting
+ //
+ QDeclarativeItem *parentItem1 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem1)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem1)->isMirrorImplicit = false;
+ QDeclarativeItemPrivate::get(parentItem1)->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ QDeclarativeItemPrivate::get(parentItem1)->resolveLayoutMirror();
+
+ // inherit in constructor
+ QDeclarativeItem *childItem1 = new QDeclarativeItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->inheritMirrorFromParent, true);
+
+ // inherit through a parent change
+ QDeclarativeItem *childItem2 = new QDeclarativeItem();
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+ childItem2->setParentItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, true);
+
+ // stop inherting through a parent change
+ QDeclarativeItem *parentItem2 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem2)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem2)->resolveLayoutMirror();
+ childItem2->setParentItem(parentItem2);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+
+ delete parentItem1;
+ delete parentItem2;
+}
+
+void tst_QDeclarativeItem::layoutMirroringIllegalParent()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.1; QtObject { LayoutMirroring.enabled: true; LayoutMirroring.childrenInherit: true }", QUrl::fromLocalFile(""));
+ QTest::ignoreMessage(QtWarningMsg, "file::1:21: QML QtObject: LayoutDirection attached property only works with Items");
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
void tst_QDeclarativeItem::keyNavigation()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -460,6 +642,59 @@ void tst_QDeclarativeItem::keyNavigation()
delete canvas;
}
+void tst_QDeclarativeItem::keyNavigation_RightToLeft()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate* rootItemPrivate = QDeclarativeItemPrivate::get(rootItem);
+
+ rootItemPrivate->effectiveLayoutMirror = true; // LayoutMirroring.mirror: true
+ rootItemPrivate->isMirrorImplicit = false;
+ rootItemPrivate->inheritMirrorFromItem = true; // LayoutMirroring.inherit: true
+ rootItemPrivate->resolveLayoutMirror();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ QVariant result;
+ QVERIFY(QMetaObject::invokeMethod(canvas->rootObject(), "verify",
+ Q_RETURN_ARG(QVariant, result)));
+ QVERIFY(result.toBool());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // left
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete canvas;
+}
+
void tst_QDeclarativeItem::keyNavigation_skipNotVisible()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -1003,32 +1238,6 @@ void tst_QDeclarativeItem::qtbug_16871()
delete o;
}
-
-template<typename T>
-T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
-{
- if (!parent)
- return 0;
-
- const QMetaObject &mo = T::staticMetaObject;
- //qDebug() << parent->QGraphicsObject::children().count() << "children";
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
- if(!item)
- continue;
- //qDebug() << "try" << item;
- if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
- return static_cast<T*>(item);
- item = findItem<T>(item, objectName);
- if (item)
- return static_cast<T*>(item);
- }
-
- return 0;
-}
-
-
-
QTEST_MAIN(tst_QDeclarativeItem)
#include "tst_qdeclarativeitem.moc"
diff --git a/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
new file mode 100644
index 0000000..5633831
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.1
+
+ListView {
+ id: view
+ property bool horizontal: false
+ property bool rtl: false
+ width: 240
+ height: 320
+
+ orientation: horizontal ? ListView.Horizontal : ListView.Vertical
+ header: Rectangle {
+ objectName: "header"
+ width: horizontal ? 20 : view.width
+ height: horizontal ? view.height : 20
+ color: "red"
+ }
+ footer: Rectangle {
+ objectName: "footer"
+ width: horizontal ? 30 : view.width
+ height: horizontal ? view.height : 30
+ color: "blue"
+ }
+// model: testModel
+ delegate: Text { width: 30; height: 30; text: index + "(" + x + ")" }
+ layoutDirection: rtl ? Qt.RightToLeft : Qt.LeftToRight
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
index 35a398b..b2d9213 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
@@ -1,6 +1,7 @@
import QtQuick 1.0
Rectangle {
+ property string sectionProperty: "number"
width: 240
height: 320
color: "#ffffff"
@@ -41,6 +42,11 @@ Rectangle {
text: wrapper.y
}
}
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 100; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
+ }
}
}
]
@@ -51,7 +57,7 @@ Rectangle {
height: 320
model: testModel
delegate: myDelegate
- section.property: "number"
+ section.property: sectionProperty
section.delegate: Rectangle {
objectName: "sect_" + section
color: "#99bb99"
diff --git a/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
new file mode 100644
index 0000000..1e92bb3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
@@ -0,0 +1,42 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 640
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: view.height; width: 100; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: view.height; width: 200; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: view.height; width: 240; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Horizontal
+ flickDeceleration: 2000
+ layoutDirection: Qt.RightToLeft
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index f358625..c87318e 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -45,6 +45,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <QtDeclarative/private/qdeclarativelistview_p.h>
#include <QtDeclarative/private/qdeclarativetext_p.h>
#include <QtDeclarative/private/qdeclarativevisualitemmodel_p.h>
@@ -102,6 +103,7 @@ private slots:
void QTBUG_11105();
void header();
void footer();
+ void headerFooter();
void resizeView();
void sizeLessThan1();
void QTBUG_14821();
@@ -115,6 +117,8 @@ private slots:
void onRemove_data();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void rightToLeft();
+ void test_mirroring();
private:
template <class T> void items();
@@ -1078,6 +1082,65 @@ void tst_QDeclarativeListView::sectionsDelegate()
QTRY_COMPARE(item->y(), qreal(i*20*6));
}
+ // remove section boundary
+ model.removeItem(5);
+ qApp->processEvents();
+ for (int i = 0; i < 3; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + (i == 0 ? QString("aaa") : QString::number(i)));
+ QVERIFY(item);
+ }
+
+ // QTBUG-17606
+ QList<QDeclarativeItem*> items = findItems<QDeclarativeItem>(contentItem, "sect_1");
+ QCOMPARE(items.count(), 1);
+
+ // QTBUG-17759
+ model.modifyItem(0, "One", "aaa");
+ model.modifyItem(1, "One", "aaa");
+ model.modifyItem(2, "One", "aaa");
+ model.modifyItem(3, "Four", "aaa");
+ model.modifyItem(4, "Four", "aaa");
+ model.modifyItem(5, "Four", "aaa");
+ model.modifyItem(6, "Five", "aaa");
+ model.modifyItem(7, "Five", "aaa");
+ model.modifyItem(8, "Five", "aaa");
+ model.modifyItem(9, "Two", "aaa");
+ model.modifyItem(10, "Two", "aaa");
+ model.modifyItem(11, "Two", "aaa");
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_aaa").count(), 1);
+ canvas->rootObject()->setProperty("sectionProperty", "name");
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_Four").count(), 1);
+ for (int i = 0; i < 4; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + model.name(i*3));
+ QVERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20*4));
+ }
+
+ // QTBUG-17769
+ model.removeItems(10, 20);
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "wrapper").count(), 10);
+ // Drag view up beyond bounds
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,20)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,0)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-50)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-200)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,-200)));
+ // view should settle back at 0
+ QTRY_COMPARE(listview->contentY(), 0.0);
+
delete canvas;
}
@@ -1696,8 +1759,6 @@ void tst_QDeclarativeListView::manualHighlight()
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
- QDeclarativeContext *ctxt = canvas->rootContext();
-
QString filename(SRCDIR "/data/manual-highlight.qml");
canvas->setSource(QUrl::fromLocalFile(filename));
@@ -1828,8 +1889,6 @@ void tst_QDeclarativeListView::header()
TestModel model;
- QDeclarativeContext *ctxt = canvas->rootContext();
-
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header1.qml"));
qApp->processEvents();
@@ -1900,6 +1959,112 @@ void tst_QDeclarativeListView::footer()
delete canvas;
}
+class LVAccessor : public QDeclarativeListView
+{
+public:
+ qreal minY() const { return minYExtent(); }
+ qreal maxY() const { return maxYExtent(); }
+ qreal minX() const { return minXExtent(); }
+ qreal maxX() const { return maxXExtent(); }
+};
+
+void tst_QDeclarativeListView::headerFooter()
+{
+ {
+ // Vertical
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->y(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minY() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxY() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minX() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxX() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal RTL
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ canvas->rootObject()->setProperty("rtl", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), -20.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), -50.0);
+
+ QCOMPARE(static_cast<LVAccessor*>(listview)->minX(), 240.);
+ QCOMPARE(static_cast<LVAccessor*>(listview)->maxX(), 240.);
+
+ delete canvas;
+ }
+}
+
void tst_QDeclarativeListView::resizeView()
{
QDeclarativeView *canvas = createView();
@@ -2299,6 +2464,118 @@ void tst_QDeclarativeListView::testQtQuick11Attributes_data()
<< "";
}
+void tst_QDeclarativeListView::rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(640,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ qApp->processEvents();
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QTRY_VERIFY(model != 0);
+
+ QTRY_VERIFY(model->count() == 3);
+ QTRY_COMPARE(listview->currentIndex(), 0);
+
+ // initial position at first item, right edge aligned
+ QCOMPARE(listview->contentX(), -640.);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "item1");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -100.0);
+ QCOMPARE(item->height(), listview->height());
+
+ QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
+
+ listview->setCurrentIndex(2);
+
+ item = findItem<QDeclarativeItem>(contentItem, "item3");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -540.0);
+
+ text = findItem<QDeclarativeText>(contentItem, "text3");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
+
+ QCOMPARE(listview->contentX(), -640.);
+
+ // Ensure resizing maintains position relative to right edge
+ qobject_cast<QDeclarativeItem*>(canvas->rootObject())->setWidth(600);
+ QTRY_COMPARE(listview->contentX(), -600.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::test_mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewA = findItem<QDeclarativeListView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewB = findItem<QDeclarativeListView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(listviewA->layoutDirection(), listviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ QVERIFY(listviewB->layoutDirection() == listviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(listviewB)->setLayoutMirror(true);
+ QVERIFY(listviewB->layoutDirection() != listviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
void tst_QDeclarativeListView::qListModelInterface_items()
{
items<TestModel>();
@@ -2408,7 +2685,7 @@ QList<T*> tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QSt
//qDebug() << parent->childItems().count() << "children";
for (int i = 0; i < parent->childItems().count(); ++i) {
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
- if(!item)
+ if(!item || !item->isVisible())
continue;
//qDebug() << "try" << item;
if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
new file mode 100644
index 0000000..70b2bfd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
@@ -0,0 +1,21 @@
+import com.nokia.AutoTestQmlMixedPluginType 1.5
+import QtQuick 1.0
+
+Item {
+ property bool test: false
+ property bool test2: false
+
+ Bar {
+ id: bar
+ }
+
+ Foo {
+ id: foo
+ }
+
+ Component.onCompleted: {
+ test = (bar.value == 16);
+ test2 = (foo.value == 89);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
new file mode 100644
index 0000000..da6ff46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
@@ -0,0 +1,13 @@
+import com.nokia.AutoTestQmlMixedPluginType 1.0
+import QtQuick 1.0
+
+Item {
+ property bool test: false
+ Bar {
+ id: bar
+ }
+
+ Component.onCompleted: {
+ test = (bar.value == 16);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt
new file mode 100644
index 0000000..a40c1c8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt
@@ -0,0 +1 @@
+1:1:module "com.nokia.AutoTestQmlVersionPluginType" version 1.9 is not installed
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
new file mode 100644
index 0000000..59fd084
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
@@ -0,0 +1,5 @@
+import com.nokia.AutoTestQmlVersionPluginType 1.9
+import QtQuick 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt
new file mode 100644
index 0000000..2634223
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt
@@ -0,0 +1 @@
+1:1:module "com.nokia.AutoTestQmlVersionPluginType" version 1.1 is not installed
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
new file mode 100644
index 0000000..2065c07
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
@@ -0,0 +1,6 @@
+import com.nokia.AutoTestQmlVersionPluginType 1.1
+import QtQuick 1.0
+
+QtObject {
+}
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
new file mode 100644
index 0000000..ce51cbd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ property int value: 89
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir
new file mode 100644
index 0000000..065dc3b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir
@@ -0,0 +1,2 @@
+plugin pluginMixed
+Foo 1.5 Foo.qml
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir
new file mode 100644
index 0000000..640967f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir
@@ -0,0 +1 @@
+plugin pluginVersion
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp
new file mode 100644
index 0000000..c7796e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class BarPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value);
+
+public:
+ int value() const { return 16; }
+};
+
+
+class MyMixedPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyMixedPlugin()
+ {
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlMixedPluginType");
+ qmlRegisterType<BarPluginType>(uri, 1, 0, "Bar");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyMixedPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro
new file mode 100644
index 0000000..9766003
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlMixedPluginType
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp
new file mode 100644
index 0000000..27a6341
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class FloorPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value);
+
+public:
+ int value() const { return 16; }
+};
+
+
+class MyMixedPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyMixedPlugin()
+ {
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlVersionPluginType");
+ qmlRegisterType<FloorPluginType>(uri, 1, 4, "Floor");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyMixedPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro
new file mode 100644
index 0000000..70a38b9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlVersionPluginType
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro
index 9d0e94e..6e72d98 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro
@@ -1,6 +1,6 @@
QT = core
TEMPLATE = subdirs
-SUBDIRS = plugin plugin.2 plugin.2.1 pluginWrongCase pluginWithQmlFile
+SUBDIRS = plugin plugin.2 plugin.2.1 pluginWrongCase pluginWithQmlFile pluginMixed pluginVersion
tst_qdeclarativemoduleplugin_pro.depends += plugin
SUBDIRS += tst_qdeclarativemoduleplugin.pro
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index 9ec0f84..dc104e2 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -63,10 +63,13 @@ private slots:
void importsPlugin();
void importsPlugin2();
void importsPlugin21();
+ void importsMixedQmlCppPlugin();
void incorrectPluginCase();
void importPluginWithQmlFile();
void remoteImportWithQuotedUrl();
void remoteImportWithUnquotedUri();
+ void versionNotInstalled();
+ void versionNotInstalled_data();
};
#ifdef Q_OS_SYMBIAN
@@ -191,8 +194,18 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase()
void tst_qdeclarativemoduleplugin::importPluginWithQmlFile()
{
+ QString path = QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports");
+
+ // QTBUG-16885: adding an import path with a lower-case "c:" causes assert failure
+ // (this only happens if the plugin includes pure QML files)
+ #ifdef Q_OS_WIN
+ QVERIFY(path.at(0).isUpper() && path.at(1) == QLatin1Char(':'));
+ path = path.at(0).toLower() + path.mid(1);
+ #endif
+
QDeclarativeEngine engine;
- engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+ engine.addImportPath(path);
+
QDeclarativeComponent component(&engine, TEST_FILE("data/pluginWithQmlFile.qml"));
foreach (QDeclarativeError err, component.errors())
qWarning() << err;
@@ -246,6 +259,55 @@ void tst_qdeclarativemoduleplugin::remoteImportWithUnquotedUri()
VERIFY_ERRORS(0);
}
+// QTBUG-17324
+void tst_qdeclarativemoduleplugin::importsMixedQmlCppPlugin()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("data/importsMixedQmlCppPlugin.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("data/importsMixedQmlCppPlugin.2.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ delete o;
+ }
+
+
+}
+
+void tst_qdeclarativemoduleplugin::versionNotInstalled_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("errorFile");
+
+ QTest::newRow("versionNotInstalled") << "data/versionNotInstalled.qml" << "versionNotInstalled.errors.txt";
+ QTest::newRow("versionNotInstalled") << "data/versionNotInstalled.2.qml" << "versionNotInstalled.2.errors.txt";
+}
+
+void tst_qdeclarativemoduleplugin::versionNotInstalled()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, errorFile);
+
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ QDeclarativeComponent component(&engine, TEST_FILE(file));
+ VERIFY_ERRORS(errorFile.toLatin1().constData());
+}
+
QTEST_MAIN(tst_qdeclarativemoduleplugin)
#include "tst_qdeclarativemoduleplugin.moc"
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml b/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml
new file mode 100644
index 0000000..11553fa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.1
+
+Flickable {
+ property bool stealing: true
+ width: 200
+ height: 200
+ contentWidth: 400
+ contentHeight: 400
+ Rectangle {
+ color: "black"
+ width: 400
+ height: 400
+ Rectangle {
+ x: 50; y: 50
+ width: 100; height: 100
+ color: "steelblue"
+ MouseArea {
+ objectName: "mousearea"
+ anchors.fill: parent
+ preventStealing: stealing
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index 845d6bb..e1c34fc 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -43,8 +43,10 @@
#include <QtTest/QSignalSpy>
#include <private/qdeclarativemousearea_p.h>
#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeflickable_p.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeengine.h>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -65,6 +67,9 @@ private slots:
void doubleClick();
void clickTwice();
void pressedOrdering();
+ void preventStealing();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
private:
QDeclarativeView *createView();
@@ -356,6 +361,8 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
QVERIFY(!canvas->rootObject()->property("clicked").toBool());
QVERIFY(canvas->rootObject()->property("held").toBool());
+
+ delete canvas;
}
void tst_QDeclarativeMouseArea::onMousePressRejected()
@@ -399,6 +406,8 @@ void tst_QDeclarativeMouseArea::onMousePressRejected()
QVERIFY(canvas->rootObject()->property("mr1_released").toBool());
QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+
+ delete canvas;
}
void tst_QDeclarativeMouseArea::doubleClick()
@@ -436,6 +445,7 @@ void tst_QDeclarativeMouseArea::doubleClick()
QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1);
QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
+ delete canvas;
}
// QTBUG-14832
@@ -476,6 +486,8 @@ void tst_QDeclarativeMouseArea::clickTwice()
QCOMPARE(canvas->rootObject()->property("pressed").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 2);
+
+ delete canvas;
}
void tst_QDeclarativeMouseArea::pressedOrdering()
@@ -512,6 +524,119 @@ void tst_QDeclarativeMouseArea::pressedOrdering()
delete canvas;
}
+void tst_QDeclarativeMouseArea::preventStealing()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/preventstealing.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(flickable != 0);
+
+ QDeclarativeMouseArea *mouseArea = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mousearea");
+ QVERIFY(mouseArea != 0);
+
+ QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QDeclarativeMouseEvent*)));
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(80, 80)));
+
+ // Without preventStealing, mouse movement over MouseArea would
+ // cause the Flickable to steal mouse and trigger content movement.
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent moveEvent(QEvent::GraphicsSceneMouseMove);
+ moveEvent.setScenePos(QPointF(70, 70));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(60, 60));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(50, 50));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ // We should have received all three move events
+ QCOMPARE(mousePositionSpy.count(), 3);
+ QVERIFY(mouseArea->pressed());
+
+ // Flickable content should not have moved.
+ QCOMPARE(flickable->contentX(), 0.);
+ QCOMPARE(flickable->contentY(), 0.);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+
+ // Now allow stealing and confirm Flickable does its thing.
+ canvas->rootObject()->setProperty("stealing", false);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(80, 80)));
+
+ // Without preventStealing, mouse movement over MouseArea would
+ // cause the Flickable to steal mouse and trigger content movement.
+ moveEvent.setScenePos(QPointF(70, 70));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(60, 60));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(50, 50));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ // We should only have received the first move event
+ QCOMPARE(mousePositionSpy.count(), 4);
+ // Our press should be taken away
+ QVERIFY(!mouseArea->pressed());
+
+ // Flickable content should have moved.
+ QCOMPARE(flickable->contentX(), 10.);
+ QCOMPARE(flickable->contentY(), 10.);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; MouseArea { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; MouseArea { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativeMouseArea::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("preventStealing") << "preventStealing: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"MouseArea.preventStealing\" is not available in QtQuick 1.0.\n";
+}
+
QTEST_MAIN(tst_QDeclarativeMouseArea)
#include "tst_qdeclarativemousearea.moc"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml
deleted file mode 100644
index 0ec1f37..0000000
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-import QtQuick 1.1
-
-Item {
- width: 640
- height: 480
- Grid {
- objectName: "grid"
- columns: 3
- layoutDirection: Qt.RightToLeft
- Rectangle {
- objectName: "one"
- color: "red"
- width: 50
- height: 50
- }
- Rectangle {
- objectName: "two"
- color: "green"
- width: 20
- height: 50
- }
- Rectangle {
- objectName: "three"
- color: "blue"
- width: 50
- height: 20
- }
- Rectangle {
- objectName: "four"
- color: "cyan"
- width: 50
- height: 50
- }
- Rectangle {
- objectName: "five"
- color: "magenta"
- width: 10
- height: 10
- }
- }
-}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
index f3b17dd..929b726 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
@@ -1,9 +1,11 @@
-import QtQuick 1.0
+import QtQuick 1.1
Item {
width: 640
height: 480
+ property bool testRightToLeft: false
Grid {
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
objectName: "grid"
columns: 3
Rectangle {
@@ -21,7 +23,7 @@ Item {
Rectangle {
objectName: "three"
color: "blue"
- width: 50
+ width: 30
height: 20
}
Rectangle {
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
index e1a9652..d35c02d 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
@@ -4,7 +4,6 @@ Item {
width: 640
height: 480
property bool testRightToLeft: false
-
Row {
objectName: "row"
layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 40e533d..92ab722 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -45,6 +45,7 @@
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativepositioners_p.h>
#include <private/qdeclarativetransition_p.h>
+#include <private/qdeclarativeitem_p.h>
#include <qdeclarativeexpression.h>
#include <QtGui/qgraphicswidget.h>
#include "../../../shared/util.h"
@@ -87,6 +88,7 @@ private slots:
void test_flow_implicit_resize();
void test_conflictinganchors();
void test_vertical_qgraphicswidget();
+ void test_mirroring();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
private:
@@ -452,7 +454,7 @@ void tst_QDeclarativePositioners::test_grid()
QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight);
- QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
delete canvas;
@@ -494,7 +496,9 @@ void tst_QDeclarativePositioners::test_grid_topToBottom()
void tst_QDeclarativePositioners::test_grid_rightToLeft()
{
- QDeclarativeView *canvas = createView(SRCDIR "/data/grid-righttoleft.qml");
+ QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
QVERIFY(one != 0);
@@ -507,20 +511,20 @@ void tst_QDeclarativePositioners::test_grid_rightToLeft()
QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
QVERIFY(five != 0);
- QCOMPARE(one->x(), 70.0);
+ QCOMPARE(one->x(), 50.0);
QCOMPARE(one->y(), 0.0);
- QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->x(), 30.0);
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 0.0);
- QCOMPARE(four->x(), 70.0);
+ QCOMPARE(four->x(), 50.0);
QCOMPARE(four->y(), 50.0);
- QCOMPARE(five->x(), 60.0);
+ QCOMPARE(five->x(), 40.0);
QCOMPARE(five->y(), 50.0);
QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
QCOMPARE(grid->layoutDirection(), Qt::RightToLeft);
- QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
delete canvas;
@@ -1198,6 +1202,66 @@ void tst_QDeclarativePositioners::test_vertical_qgraphicswidget()
delete canvas;
}
+void tst_QDeclarativePositioners::test_mirroring()
+{
+ QList<QString> qmlFiles;
+ qmlFiles << "horizontal.qml" << "gridtest.qml" << "flowtest.qml";
+ QList<QString> objectNames;
+ objectNames << "one" << "two" << "three" << "four" << "five";
+
+ foreach(const QString qmlFile, qmlFiles) {
+ QDeclarativeView *canvasA = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootA = qobject_cast<QDeclarativeItem*>(canvasA->rootObject());
+
+ QDeclarativeView *canvasB = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootB = qobject_cast<QDeclarativeItem*>(canvasB->rootObject());
+
+ rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QVERIFY(itemA->x() != itemB->x());
+ }
+
+ QDeclarativeItemPrivate* rootPrivateB = QDeclarativeItemPrivate::get(rootB);
+
+ rootPrivateB->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ rootPrivateB->isMirrorImplicit = false;
+ rootPrivateB->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ rootPrivateB->resolveLayoutMirror();
+
+ // RTL == mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+
+ rootA->setProperty("testRightToLeft", false); // layoutDirection: Qt.LeftToRight
+ rootB->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR == RTL + mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+ delete canvasA;
+ delete canvasB;
+ }
+}
+
void tst_QDeclarativePositioners::testQtQuick11Attributes()
{
QFETCH(QString, code);
diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
index 7d746a7..e3a4723 100644
--- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
+++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
@@ -76,6 +76,40 @@ void tst_QDeclarativePropertyMap::insert()
map.insert(QLatin1String("key1"),"Hello World");
QCOMPARE(map.value(QLatin1String("key1")), QVariant("Hello World"));
+
+ //inserting property names same with existing method(signal, slot, method) names is not allowed
+ //QDeclarativePropertyMap has an invokable keys() method
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"keys\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("keys"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("keys")));
+ QVERIFY(map.value(QLatin1String("keys")).isNull());
+
+ //QDeclarativePropertyMap has a deleteLater() slot
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"deleteLater\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("deleteLater"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("deleteLater")));
+ QVERIFY(map.value(QLatin1String("deleteLater")).isNull());
+
+ //QDeclarativePropertyMap has an valueChanged() signal
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"valueChanged\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("valueChanged"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("valueChanged")));
+ QVERIFY(map.value(QLatin1String("valueChanged")).isNull());
+
+ //but 'valueChange' should be ok
+ map.insert(QLatin1String("valueChange"), 1);
+ QVERIFY(map.keys().count() == 3);
+ QVERIFY(map.contains(QLatin1String("valueChange")));
+ QCOMPARE(map.value(QLatin1String("valueChange")), QVariant(1));
+
+ //'valueCHANGED' should be ok, too
+ map.insert(QLatin1String("valueCHANGED"), 1);
+ QVERIFY(map.keys().count() == 4);
+ QVERIFY(map.contains(QLatin1String("valueCHANGED")));
+ QCOMPARE(map.value(QLatin1String("valueCHANGED")), QVariant(1));
}
void tst_QDeclarativePropertyMap::operatorInsert()
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 56bed30..20e2640 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -120,6 +120,9 @@ private slots:
void anchorChanges3();
void anchorChanges4();
void anchorChanges5();
+ void anchorChangesRTL();
+ void anchorChangesRTL2();
+ void anchorChangesRTL3();
void anchorChangesCrash();
void anchorRewindBug();
void anchorRewindBug2();
@@ -813,6 +816,125 @@ void tst_qdeclarativestates::anchorChanges5()
delete rect;
}
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+qreal offsetRTL(QDeclarativeItem *anchorItem, QDeclarativeItem *item) {
+ return anchorItem->width()+2*anchorItem->x()-item->width();
+}
+
+void tst_qdeclarativestates::anchorChangesRTL()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ // between left side of parent and leftGuideline.x: 10, which has width 0
+ QCOMPARE(innerRect->width(), qreal(10));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ // between right side of parent and left side of rightGuideline.x: 150, which has width 0
+ QCOMPARE(innerRect->width(), qreal(50));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
//QTBUG-9609
void tst_qdeclarativestates::anchorChangesCrash()
{
diff --git a/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
new file mode 100644
index 0000000..bd07d66
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+
+ Text {
+ text: "í "
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index a3bba3b..8841aa3 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -109,6 +109,7 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void qtbug_14734();
private:
QStringList standard;
QStringList richText;
@@ -517,20 +518,112 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
QDeclarativeTextPrivate *textPrivate = QDeclarativeTextPrivate::get(text);
QVERIFY(textPrivate != 0);
- QVERIFY(textPrivate->layout.lineAt(0).x() > canvas->width()/2);
+ // implicit alignment should follow the reading direction of RTL text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // explicitly left aligned text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // explicitly right aligned text
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
- // "Right" aligned
+ // change to rich text
+ QString textString = text->text();
+ text->setText(QString("<i>") + textString + QString("</i>"));
+ text->setTextFormat(QDeclarativeText::RichText);
+ text->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ // explicitly left aligned rich text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignRight);
+
+ // explicitly right aligned rich text
text->setHAlign(QDeclarativeText::AlignRight);
QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
- QVERIFY(textPrivate->layout.lineAt(0).x() < canvas->width()/2);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ text->setText(textString);
+ text->setTextFormat(QDeclarativeText::PlainText);
- // Center aligned
+ // explicitly center aligned
text->setHAlign(QDeclarativeText::AlignHCenter);
QCOMPARE(text->hAlign(), QDeclarativeText::AlignHCenter);
- QVERIFY(textPrivate->layout.lineAt(0).x() < canvas->width()/2);
- QVERIFY(textPrivate->layout.lineAt(0).x() + textPrivate->layout.lineAt(0).width() > canvas->width()/2);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().right() > canvas->width()/2);
+
+ // reseted alignment should go back to following the text reading direction
+ text->resetHAlign();
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(false);
+ text->resetHAlign();
+
+ // English text should be implicitly left aligned
+ text->setText("Hello world!");
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ text->setText("");
+ QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+#endif
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of Text with no text set to it
+ QString componentStr = "import QtQuick 1.0\nText {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetext::verticalAlignment()
@@ -1204,6 +1297,19 @@ void tst_qdeclarativetext::testQtQuick11Attributes_data()
<< "";
}
+void tst_qdeclarativetext::qtbug_14734()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/qtbug_14734.qml");
+ QVERIFY(canvas);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ delete canvas;
+}
+
QTEST_MAIN(tst_qdeclarativetext)
#include "tst_qdeclarativetext.moc"
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
new file mode 100644
index 0000000..22a9871
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
new file mode 100644
index 0000000..d61da46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
index 9ee8a93..0e1caf6 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
@@ -15,6 +15,7 @@ Rectangle {
KeyNavigation.right: lastItem
KeyNavigation.up: firstItem
KeyNavigation.down: lastItem
+ text: "a"
}
Item {
id: lastItem
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
new file mode 100644
index 0000000..e010135
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ objectName: "myInput"
+ width: 50
+ height: 25
+ text: "This is\n a long piece of text"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 7d5101c..f62c2c5 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -110,6 +110,9 @@ private slots:
void persistentSelection();
void focusOnPress();
void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
+ void keySelection();
void moveCursorSelection_data();
void moveCursorSelection();
void moveCursorSelectionSequence_data();
@@ -121,12 +124,17 @@ private slots:
void dragMouseSelection();
void inputMethodHints();
+ void positionAt();
+
void cursorDelegate();
+ void cursorVisible();
void delegateLoading_data();
void delegateLoading();
void navigation();
void readOnly();
void copyAndPaste();
+ void canPaste();
+ void canPasteEmpty();
void textInput();
void openInputPanelOnClick();
void openInputPanelOnFocus();
@@ -137,8 +145,12 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void preeditMicroFocus();
+ void inputContextMouseHandler();
+ void inputMethodComposing();
+
private:
- void simulateKey(QDeclarativeView *, int key);
+ void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0);
QDeclarativeView *createView(const QString &filename);
QStringList standard;
@@ -436,21 +448,109 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
QVERIFY(textEdit != 0);
canvas->show();
+ // implicit alignment should follow the reading direction of text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
- // "Right" align
+ // explicitly left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // explicitly right aligned
textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ QString textString = textEdit->text();
+ textEdit->setText(QString("<i>") + textString + QString("</i>"));
+ textEdit->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of RTL text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // explicitly left aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
- // Center align
- // Note that position 0 is on the right-hand side
+ // explicitly right aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ textEdit->setText(textString);
+
+ // explicitly center aligned
textEdit->setHAlign(QDeclarativeTextEdit::AlignHCenter);
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignHCenter);
- QVERIFY(textEdit->positionToRectangle(0).x() - textEdit->width() < canvas->width()/2);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+ // reseted alignment should go back to following the text reading direction
+ textEdit->resetHAlign();
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(false);
+ textEdit->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textEdit->setText("Hello world!");
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textEdit->setText("");
+ QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+ else
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+#endif
+
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextEdit with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextEdit {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetextedit::vAlign()
@@ -753,6 +853,113 @@ void tst_qdeclarativetextedit::selection()
QVERIFY(textEditObject->selectedText().isNull());
}
+void tst_qdeclarativetextedit::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextedit::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextEdit textEdit;
+ textEdit.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textEdit.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textEdit.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textEdit.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
+void tst_qdeclarativetextedit::keySelection()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextEdit *input = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ QSignalSpy spy(input, SIGNAL(selectionChanged()));
+
+ simulateKey(canvas, Qt::Key_Right, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 1);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Left, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 3);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextedit::moveCursorSelection_data()
{
QTest::addColumn<QString>("testStr");
@@ -1098,6 +1305,8 @@ void tst_qdeclarativetextedit::mouseSelection_data()
QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << true;
QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << false;
QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << false;
+ QTest::newRow("on word selection") << SRCDIR "/data/mouseselection_true_words.qml" << true;
+ QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << false;
}
void tst_qdeclarativetextedit::mouseSelection()
@@ -1177,6 +1386,8 @@ void tst_qdeclarativetextedit::dragMouseSelection()
QVERIFY(str2.length() > 3);
QVERIFY(str1 != str2); // Verify the second press and drag is a new selection and doesn't not the first moved.
+
+ delete canvas;
}
void tst_qdeclarativetextedit::mouseSelectionMode_data()
@@ -1244,6 +1455,56 @@ void tst_qdeclarativetextedit::inputMethodHints()
delete canvas;
}
+void tst_qdeclarativetextedit::positionAt()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(texteditObject != 0);
+
+ QFontMetrics fm(texteditObject->font());
+ const int y0 = fm.height() / 2;
+ const int y1 = fm.height() * 3 / 2;
+
+ int pos = texteditObject->positionAt(texteditObject->width()/2, y0);
+ int diff = abs(int(fm.width(texteditObject->text().left(pos))-texteditObject->width()/2));
+
+ // some tollerance for different fonts.
+#ifdef Q_OS_LINUX
+ QVERIFY(diff < 2);
+#else
+ QVERIFY(diff < 5);
+#endif
+
+ const qreal x0 = texteditObject->positionToRectangle(pos).x();
+ const qreal x1 = texteditObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = texteditObject->text().mid(0, pos);
+ texteditObject->setText(texteditObject->text().mid(pos));
+ texteditObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(texteditObject->positionAt(0, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0 / 2, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0, y0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(texteditObject->positionAt(x1, y0), 1);
+ QCOMPARE(texteditObject->positionToRectangle(1).x(), x1);
+
+ QVERIFY(texteditObject->positionAt(x0 / 2, y1) > 0);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextedit::cursorDelegate()
{
QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
@@ -1272,6 +1533,76 @@ void tst_qdeclarativetextedit::cursorDelegate()
delete view;
}
+void tst_qdeclarativetextedit::cursorVisible()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ view.setFocus();
+
+ QDeclarativeTextEdit edit;
+ QSignalSpy spy(&edit, SIGNAL(cursorVisibleChanged(bool)));
+
+ QCOMPARE(edit.isCursorVisible(), false);
+
+ edit.setCursorVisible(true);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 1);
+
+ edit.setCursorVisible(false);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ edit.setFocus(true);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ scene.addItem(&edit);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 3);
+
+ edit.setFocus(false);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 4);
+
+ edit.setFocus(true);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 5);
+
+ scene.clearFocus();
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 6);
+
+ scene.setFocus();
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 7);
+
+ view.clearFocus();
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 8);
+
+ view.setFocus();
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 9);
+
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(0));
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 10);
+
+ QApplication::setActiveWindow(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 11);
+#endif
+}
+
void tst_qdeclarativetextedit::delegateLoading_data()
{
QTest::addColumn<QString>("qmlfile");
@@ -1349,6 +1680,8 @@ void tst_qdeclarativetextedit::navigation()
simulateKey(canvas, Qt::Key_Right);
QVERIFY(input->hasActiveFocus() == true);
simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Right);
QVERIFY(input->hasActiveFocus() == false);
simulateKey(canvas, Qt::Key_Left);
QVERIFY(input->hasActiveFocus() == true);
@@ -1416,6 +1749,42 @@ void tst_qdeclarativetextedit::copyAndPaste() {
#endif
}
+void tst_qdeclarativetextedit::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
+void tst_qdeclarativetextedit::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
void tst_qdeclarativetextedit::readOnly()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
@@ -1440,10 +1809,10 @@ void tst_qdeclarativetextedit::readOnly()
delete canvas;
}
-void tst_qdeclarativetextedit::simulateKey(QDeclarativeView *view, int key)
+void tst_qdeclarativetextedit::simulateKey(QDeclarativeView *view, int key, Qt::KeyboardModifiers modifiers)
{
- QKeyEvent press(QKeyEvent::KeyPress, key, 0);
- QKeyEvent release(QKeyEvent::KeyRelease, key, 0);
+ QKeyEvent press(QKeyEvent::KeyPress, key, modifiers);
+ QKeyEvent release(QKeyEvent::KeyRelease, key, modifiers);
QApplication::sendEvent(view, &press);
QApplication::sendEvent(view, &release);
@@ -1460,7 +1829,7 @@ QDeclarativeView *tst_qdeclarativetextedit::createView(const QString &filename)
class MyInputContext : public QInputContext
{
public:
- MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false) {}
+ MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {}
~MyInputContext() {}
QString identifierName() { return QString(); }
@@ -1478,8 +1847,40 @@ public:
closeInputPanelReceived = true;
return QInputContext::filterEvent(event);
}
+
+ void update() { updateReceived = true; }
+
+ void sendPreeditText(const QString &text, int cursor)
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(QInputMethodEvent::Attribute(
+ QInputMethodEvent::Cursor, cursor, text.length(), QVariant()));
+
+ QInputMethodEvent event(text, attributes);
+ sendEvent(event);
+ }
+
+ void mouseHandler(int x, QMouseEvent *event)
+ {
+ cursor = x;
+ eventType = event->type();
+ eventPosition = event->pos();
+ eventGlobalPosition = event->globalPos();
+ eventButton = event->button();
+ eventButtons = event->buttons();
+ eventModifiers = event->modifiers();
+ }
+
bool openInputPanelReceived;
bool closeInputPanelReceived;
+ bool updateReceived;
+ int cursor;
+ QEvent::Type eventType;
+ QPoint eventPosition;
+ QPoint eventGlobalPosition;
+ Qt::MouseButton eventButton;
+ Qt::MouseButtons eventButtons;
+ Qt::KeyboardModifiers eventModifiers;
};
void tst_qdeclarativetextedit::textInput()
@@ -1797,6 +2198,217 @@ void tst_qdeclarativetextedit::testQtQuick11Attributes_data()
<< ":1 \"TextEdit.onLinkActivated\" is not available in QtQuick 1.0.\n";
}
+void tst_qdeclarativetextedit::preeditMicroFocus()
+{
+ QString preeditText = "super";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QRect currentRect;
+ QRect previousRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+
+ // Verify that the micro focus rect is positioned the same for position 0 as
+ // it would be if there was no preedit text.
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, 0);
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+
+ // Verify that the micro focus rect moves to the left as the cursor position
+ // is incremented.
+ for (int i = 1; i <= 5; ++i) {
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, i);
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QVERIFY(previousRect.left() < currentRect.left());
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+ previousRect = currentRect;
+ }
+
+ // Verify that if there is no preedit cursor then the micro focus rect is the
+ // same as it would be if it were positioned at the end of the preedit text.
+ ic.sendPreeditText(preeditText, 0);
+ ic.updateReceived = false;
+ ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+}
+
+void tst_qdeclarativetextedit::inputContextMouseHandler()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setPos(0, 0);
+ edit.setWidth(200);
+ edit.setText(text.mid(0, 12));
+ edit.setPos(0, 0);
+ edit.setCursorPosition(12);
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ view.setFocus();
+
+ QFontMetricsF fm(edit.font());
+ const qreal y = fm.height() / 2;
+
+ QPoint position2 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 2)), y)));
+ QPoint position8 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 8)), y)));
+ QPoint position20 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 20)), y)));
+ QPoint position27 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 27)), y)));
+ QPoint globalPosition2 = view.viewport()->mapToGlobal(position2);
+ QPoint globalposition8 = view.viewport()->mapToGlobal(position8);
+ QPoint globalposition20 = view.viewport()->mapToGlobal(position20);
+ QPoint globalposition27 = view.viewport()->mapToGlobal(position27);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one.
+ ic.eventType = QEvent::None;
+
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ // And in the other direction.
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position20);
+ QCOMPARE(ic.eventGlobalPosition, globalposition20);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 7 && ic.cursor <= 9);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+}
+
+void tst_qdeclarativetextedit::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setWidth(200);
+ edit.setText(text.mid(0, 12));
+ edit.setCursorPosition(12);
+ edit.setPos(0, 0);
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&edit, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(edit.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(edit.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
QTEST_MAIN(tst_qdeclarativetextedit)
#include "tst_qdeclarativetextedit.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index a6d30a5..45f38a4 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -89,6 +89,8 @@ private slots:
void font();
void color();
void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
void moveCursorSelection_data();
void moveCursorSelection();
void moveCursorSelectionSequence_data();
@@ -110,8 +112,13 @@ private slots:
void passwordCharacter();
void cursorDelegate();
+ void cursorVisible();
+ void cursorRectangle();
void navigation();
+ void navigation_RTL();
void copyAndPaste();
+ void canPasteEmpty();
+ void canPaste();
void readOnly();
void openInputPanelOnClick();
@@ -125,6 +132,9 @@ private slots:
void testQtQuick11Attributes_data();
void preeditAutoScroll();
+ void preeditMicroFocus();
+ void inputContextMouseHandler();
+ void inputMethodComposing();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -140,7 +150,8 @@ tst_qdeclarativetextinput::tst_qdeclarativetextinput()
standard << "the quick brown fox jumped over the lazy dog"
<< "It's supercalifragisiticexpialidocious!"
<< "Hello, world!"
- << "!dlrow ,olleH";
+ << "!dlrow ,olleH"
+ << " spacey text ";
colorStrings << "aliceblue"
<< "antiquewhite"
@@ -431,6 +442,63 @@ void tst_qdeclarativetextinput::selection()
delete textinputObject;
}
+void tst_qdeclarativetextinput::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextinput::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextInput textInput;
+ textInput.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textInput.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textInput.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textInput.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
void tst_qdeclarativetextinput::moveCursorSelection_data()
{
QTest::addColumn<QString>("testStr");
@@ -441,6 +509,9 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
QTest::addColumn<int>("selectionEnd");
QTest::addColumn<bool>("reversible");
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+
QTest::newRow("(t)he|characters")
<< standard[0] << 0 << 1 << QDeclarativeTextInput::SelectCharacters << 0 << 1 << true;
QTest::newRow("do(g)|characters")
@@ -578,6 +649,24 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
<< standard[3] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
QTest::newRow("!<()>dlrow|words")
<< standard[3] << 1 << 1 << QDeclarativeTextInput::SelectWords << 1 << 1 << true;
+
+ QTest::newRow(" <s(pac)ey> text |words")
+ << standard[4] << 1 << 4 << QDeclarativeTextInput::SelectWords << 1 << 7 << true;
+ QTest::newRow(" spacey <t(ex)t> |words")
+ << standard[4] << 11 << 13 << QDeclarativeTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365
+ QTest::newRow("<( )>spacey text |words|ltr")
+ << standard[4] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << false;
+ QTest::newRow("<( )spacey> text |words|rtl")
+ << standard[4] << 1 << 0 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ QTest::newRow("spacey <text( )>|words|ltr")
+ << standard[4] << 14 << 15 << QDeclarativeTextInput::SelectWords << 10 << 15 << false;
+// QTBUG-11365
+// QTest::newRow("spacey text<( )>|words|rtl")
+// << standard[4] << 15 << 14 << QDeclarativeTextInput::SelectWords << 14 << 15 << false;
+ QTest::newRow("<()> spacey text |words")
+ << standard[4] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << false;
+ QTest::newRow(" spacey text <()>|words")
+ << standard[4] << 15 << 15 << QDeclarativeTextInput::SelectWords << 15 << 15 << false;
}
void tst_qdeclarativetextinput::moveCursorSelection()
@@ -624,6 +713,11 @@ void tst_qdeclarativetextinput::moveCursorSelectionSequence_data()
QTest::addColumn<int>("selection2Start");
QTest::addColumn<int>("selection2End");
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+ // ^ is the revised cursor position.
+ // {} contains the revised selection.
+
QTest::newRow("the {<quick( bro)wn> f^ox} jumped|ltr")
<< standard[0]
<< 9 << 13 << 17
@@ -736,6 +830,50 @@ void tst_qdeclarativetextinput::moveCursorSelectionSequence_data()
<< 11 << 9 << 5
<< 8 << 13
<< 1 << 13;
+
+ QTest::newRow("{<(^} sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 0
+ << 0 << 7
+ << 0 << 0;
+ QTest::newRow("{<( ^}sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 1
+ << 0 << 7
+ << 0 << 1;
+ QTest::newRow("<( {s^p)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 2
+ << 0 << 7
+ << 1 << 7;
+ QTest::newRow("<( {^sp)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 1
+ << 0 << 7
+ << 1 << 7;
+
+ QTest::newRow(" spacey <te(xt {^)>}|rtl")
+ << standard[4]
+ << 15 << 12 << 15
+ << 10 << 15
+ << 15 << 15;
+// QTBUG-11365
+// QTest::newRow(" spacey <te(xt{^ )>}|rtl")
+// << standard[4]
+// << 15 << 12 << 14
+// << 10 << 15
+// << 14 << 15;
+ QTest::newRow(" spacey {<te(x^t} )>|ltr")
+ << standard[4]
+ << 12 << 15 << 13
+ << 10 << 15
+ << 10 << 14;
+// QTBUG-11365
+// QTest::newRow(" spacey {<te(xt^} )>|ltr")
+// << standard[4]
+// << 12 << 15 << 14
+// << 10 << 15
+// << 10 << 14;
}
void tst_qdeclarativetextinput::moveCursorSelectionSequence()
@@ -913,18 +1051,93 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QVERIFY(textInputPrivate != 0);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
- // "Right" Align
- textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ // implicit alignment should follow the reading direction of RTL text
QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
- // Center Align
+ // explicitly right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly center aligned
textInput->setHAlign(QDeclarativeTextInput::AlignHCenter);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignHCenter);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
QVERIFY(-textInputPrivate->hscroll + textInputPrivate->width() > canvas->width()/2);
+ // reseted alignment should go back to following the text reading direction
+ textInput->resetHAlign();
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly right aligned behaves as left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(false);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ textInput->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textInput->setText("Hello world!");
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textInput->setText("");
+ QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+ else
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+#endif
+
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextInput with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextInput {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextInput *textObject = qobject_cast<QDeclarativeTextInput*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetextinput::positionAt()
@@ -952,6 +1165,10 @@ void tst_qdeclarativetextinput::positionAt()
QVERIFY(diff < 5);
#endif
+ int x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
// Check without autoscroll...
textinputObject->setAutoScroll(false);
pos = textinputObject->positionAt(textinputObject->width()/2);
@@ -964,6 +1181,29 @@ void tst_qdeclarativetextinput::positionAt()
QVERIFY(diff < 5);
#endif
+ x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
+ const qreal x0 = textinputObject->positionToRectangle(pos).x();
+ const qreal x1 = textinputObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = textinputObject->text().mid(0, pos);
+ textinputObject->setText(textinputObject->text().mid(pos));
+ textinputObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(textinputObject->positionAt(0), 0);
+ QCOMPARE(textinputObject->positionAt(x0 / 2), 0);
+ QCOMPARE(textinputObject->positionAt(x0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(textinputObject->positionAt(x1), 1);
+ QCOMPARE(textinputObject->positionToRectangle(1).x(), x1);
+
delete canvas;
}
@@ -1142,6 +1382,24 @@ void tst_qdeclarativetextinput::inputMethods()
QApplication::sendEvent(canvas, &event);
QCOMPARE(input->text(), QString("My Hello world!"));
+ input->setCursorPosition(2);
+ event.setCommitString("Your", -2, 2);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Hello world!"));
+ QCOMPARE(input->cursorPosition(), 4);
+
+ input->setCursorPosition(7);
+ event.setCommitString("Goodbye", -2, 5);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 12);
+
+ input->setCursorPosition(8);
+ event.setCommitString("Our", -8, 4);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Our Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 7);
+
delete canvas;
}
@@ -1191,6 +1449,45 @@ void tst_qdeclarativetextinput::navigation()
delete canvas;
}
+void tst_qdeclarativetextinput::navigation_RTL()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ input->setText(QString::fromUtf16(arabic_str, 11));
+
+ input->setCursorPosition(0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ input->setCursorPosition(input->text().length());
+ QVERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextinput::copyAndPaste() {
#ifndef QT_NO_CLIPBOARD
@@ -1270,6 +1567,42 @@ void tst_qdeclarativetextinput::copyAndPaste() {
#endif
}
+void tst_qdeclarativetextinput::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
+void tst_qdeclarativetextinput::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
void tst_qdeclarativetextinput::passwordCharacter()
{
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }";
@@ -1314,6 +1647,114 @@ void tst_qdeclarativetextinput::cursorDelegate()
delete view;
}
+void tst_qdeclarativetextinput::cursorVisible()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeTextInput input;
+ QSignalSpy spy(&input, SIGNAL(cursorVisibleChanged(bool)));
+
+ QCOMPARE(input.isCursorVisible(), false);
+
+ input.setCursorVisible(true);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 1);
+
+ input.setCursorVisible(false);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ input.setFocus(true);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ scene.addItem(&input);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 3);
+
+ input.setFocus(false);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 4);
+
+ input.setFocus(true);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 5);
+
+ scene.clearFocus();
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 6);
+
+ scene.setFocus();
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 7);
+
+ view.clearFocus();
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 8);
+
+ view.setFocus();
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 9);
+
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(0));
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 10);
+
+ QApplication::setActiveWindow(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 11);
+#endif
+}
+
+void tst_qdeclarativetextinput::cursorRectangle()
+{
+ QString text = "Hello World!";
+
+ QDeclarativeTextInput input;
+ input.setText(text);
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(text.mid(0, 5)));
+
+ QRect r;
+
+ for (int i = 0; i <= 5; ++i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ int textWidth = fm.width(text.mid(0, i));
+
+ QVERIFY(r.left() < textWidth);
+ QVERIFY(r.right() > textWidth);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ // Check the cursor rectangle remains within the input bounding rect when auto scrolling.
+ QVERIFY(r.left() < input.boundingRect().width());
+ QVERIFY(r.right() >= input.width());
+
+ for (int i = 6; i < text.length(); ++i) {
+ input.setCursorPosition(i);
+ QCOMPARE(r, input.cursorRectangle());
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ for (int i = text.length() - 2; i >= 0; --i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ QVERIFY(r.right() >= 0);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+}
+
void tst_qdeclarativetextinput::readOnly()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
@@ -1388,13 +1829,23 @@ void tst_qdeclarativetextinput::echoMode()
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->text(), initial);
QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("QQQQQQQQ"));
QTest::keyPress(canvas, Qt::Key_A);//Clearing previous entry is part of PasswordEchoOnEdit
QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
QCOMPARE(input->text(), QLatin1String("a"));
QCOMPARE(input->displayText(), QLatin1String("a"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("a"));
input->setFocus(false);
QVERIFY(input->hasActiveFocus() == false);
QCOMPARE(input->displayText(), QLatin1String("Q"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("Q"));
+ input->setFocus(true);
+ QInputMethodEvent inputEvent;
+ inputEvent.setCommitString(initial);
+ QApplication::sendEvent(canvas, &inputEvent);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), initial);
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), initial);
delete canvas;
}
@@ -1419,7 +1870,7 @@ QDeclarativeView *tst_qdeclarativetextinput::createView(const QString &filename)
class MyInputContext : public QInputContext
{
public:
- MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false) {}
+ MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {}
~MyInputContext() {}
QString identifierName() { return QString(); }
@@ -1438,6 +1889,19 @@ public:
return QInputContext::filterEvent(event);
}
+ void update() { updateReceived = true; }
+
+ void mouseHandler(int x, QMouseEvent *event)
+ {
+ cursor = x;
+ eventType = event->type();
+ eventPosition = event->pos();
+ eventGlobalPosition = event->globalPos();
+ eventButton = event->button();
+ eventButtons = event->buttons();
+ eventModifiers = event->modifiers();
+ }
+
void sendPreeditText(const QString &text, int cursor)
{
QList<QInputMethodEvent::Attribute> attributes;
@@ -1450,6 +1914,14 @@ public:
bool openInputPanelReceived;
bool closeInputPanelReceived;
+ bool updateReceived;
+ int cursor;
+ QEvent::Type eventType;
+ QPoint eventPosition;
+ QPoint eventGlobalPosition;
+ Qt::MouseButton eventButton;
+ Qt::MouseButtons eventButtons;
+ Qt::KeyboardModifiers eventModifiers;
};
void tst_qdeclarativetextinput::openInputPanelOnClick()
@@ -1747,7 +2219,8 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
MyInputContext ic;
view.setInputContext(&ic);
QDeclarativeTextInput input;
- input.setWidth(QFontMetricsF(input.font()).width(committedText));
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(committedText));
input.setText(committedText);
input.setPos(0, 0);
input.setFocus(true);
@@ -1760,7 +2233,7 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
// test the text is scrolled so the preedit is visible.
ic.sendPreeditText(preeditText.mid(0, 3), 1);
QVERIFY(input.positionAt(0) != 0);
- QCOMPARE(input.positionAt(input.width()), 8);
+ QVERIFY(input.cursorRectangle().left() < input.boundingRect().width());
// test the text is scrolled back when the preedit is removed.
ic.sendEvent(QInputMethodEvent());
@@ -1769,26 +2242,31 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
// test if the preedit is larger than the text input that the
// character preceding the cursor is still visible.
+ qreal x = input.positionToRectangle(0).x();
for (int i = 0; i < 3; ++i) {
ic.sendPreeditText(preeditText, i + 1);
- QCOMPARE(input.positionAt(0), 5 + i);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)));
+ QVERIFY(input.positionToRectangle(0).x() < x);
+ x = input.positionToRectangle(0).x();
}
for (int i = 1; i >= 0; --i) {
ic.sendPreeditText(preeditText, i + 1);
- QCOMPARE(input.positionAt(0), 5 + i);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)));
+ QVERIFY(input.positionToRectangle(0).x() > x);
+ x = input.positionToRectangle(0).x();
}
// Test incrementing the preedit cursor doesn't cause further
// scrolling when right most text is visible.
ic.sendPreeditText(preeditText, preeditText.length() - 3);
- int position = input.positionAt(0);
+ x = input.positionToRectangle(0).x();
for (int i = 2; i >= 0; --i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
- QCOMPARE(input.positionAt(0), position);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
}
for (int i = 1; i < 3; ++i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
- QCOMPARE(input.positionAt(0), position);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
}
// Test disabling auto scroll.
@@ -1800,6 +2278,217 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
QCOMPARE(input.positionAt(input.width()), 5);
}
+void tst_qdeclarativetextinput::preeditMicroFocus()
+{
+ QString preeditText = "super";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setPos(0, 0);
+ input.setAutoScroll(false);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QRect currentRect;
+ QRect previousRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+
+ // Verify that the micro focus rect is positioned the same for position 0 as
+ // it would be if there was no preedit text.
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, 0);
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+
+ // Verify that the micro focus rect moves to the left as the cursor position
+ // is incremented.
+ for (int i = 1; i <= 5; ++i) {
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, i);
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QVERIFY(previousRect.left() < currentRect.left());
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+ previousRect = currentRect;
+ }
+
+ // Verify that if there is no preedit cursor then the micro focus rect is the
+ // same as it would be if it were positioned at the end of the preedit text.
+ ic.sendPreeditText(preeditText, 0);
+ ic.updateReceived = false;
+ ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+}
+
+void tst_qdeclarativetextinput::inputContextMouseHandler()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setWidth(200);
+ input.setText(text.mid(0, 12));
+ input.setCursorPosition(12);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QFontMetricsF fm(input.font());
+ const qreal y = fm.height() / 2;
+
+ QPoint position2 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 2)), y)));
+ QPoint position8 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 8)), y)));
+ QPoint position20 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 20)), y)));
+ QPoint position27 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 27)), y)));
+ QPoint globalPosition2 = view.viewport()->mapToGlobal(position2);
+ QPoint globalposition8 = view.viewport()->mapToGlobal(position8);
+ QPoint globalposition20 = view.viewport()->mapToGlobal(position20);
+ QPoint globalposition27 = view.viewport()->mapToGlobal(position27);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one.
+ ic.eventType = QEvent::None;
+
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ // And in the other direction.
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position20);
+ QCOMPARE(ic.eventGlobalPosition, globalposition20);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 7 && ic.cursor <= 9);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+}
+
+void tst_qdeclarativetextinput::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setWidth(200);
+ input.setText(text.mid(0, 12));
+ input.setCursorPosition(12);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&input, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(input.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(input.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js
new file mode 100644
index 0000000..f589b0e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js
@@ -0,0 +1,6 @@
+WorkerScript.onMessage = function(msg) {
+ var a = 123
+ var b = 345
+ var f = getData()
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js
new file mode 100644
index 0000000..1d6eab2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js
@@ -0,0 +1,5 @@
+WorkerScript.onMessage = function(msg) {
+ var a = 123
+ aoij awef aljfaow eij
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
new file mode 100644
index 0000000..90c4617
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_error_onCall.js"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
new file mode 100644
index 0000000..0b9d21d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_error_onLoad.js"
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
index aaedd82..4b922fb 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -41,6 +41,8 @@
#include <qtest.h>
#include <QtCore/qdebug.h>
#include <QtCore/qtimer.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
#include <QtScript/qscriptengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
@@ -58,6 +60,13 @@ Q_DECLARE_METATYPE(QScriptValue)
#define SRCDIR "."
#endif
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(filename));
+}
+
+
class tst_QDeclarativeWorkerScript : public QObject
{
Q_OBJECT
@@ -70,6 +79,8 @@ private slots:
void messaging_sendQObjectList();
void messaging_sendJsObject();
void script_with_pragma();
+ void scriptError_onLoad();
+ void scriptError_onCall();
private:
void waitForEchoMessage(QDeclarativeWorkerScript *worker) {
@@ -215,6 +226,47 @@ void tst_QDeclarativeWorkerScript::script_with_pragma()
delete worker;
}
+static QString qdeclarativeworkerscript_lastWarning;
+static void qdeclarativeworkerscript_warningsHandler(QtMsgType type, const char *msg)
+{
+ if (type == QtWarningMsg)
+ qdeclarativeworkerscript_lastWarning = QString::fromUtf8(msg);
+}
+
+void tst_QDeclarativeWorkerScript::scriptError_onLoad()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_error_onLoad.qml");
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler);
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QTRY_COMPARE(qdeclarativeworkerscript_lastWarning,
+ TEST_FILE("data/script_error_onLoad.js").toString() + QLatin1String(":3: SyntaxError: Parse error"));
+
+ qInstallMsgHandler(previousMsgHandler);
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::scriptError_onCall()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_error_onCall.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler);
+ QVariant value;
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+
+ QTRY_COMPARE(qdeclarativeworkerscript_lastWarning,
+ TEST_FILE("data/script_error_onCall.js").toString() + QLatin1String(":4: ReferenceError: Can't find variable: getData"));
+
+ qInstallMsgHandler(previousMsgHandler);
+ qApp->processEvents();
+ delete worker;
+}
+
QTEST_MAIN(tst_QDeclarativeWorkerScript)
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
index 19d7967..af54008 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
@@ -569,6 +569,11 @@ void tst_qdeclarativexmllistmodel::reload()
QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
QSignalSpy spyCount(model, SIGNAL(countChanged()));
+ //reload multiple times to test the xml query aborting
+ model->reload();
+ model->reload();
+ QCoreApplication::processEvents();
+ model->reload();
model->reload();
QTRY_COMPARE(spyCount.count(), 1);
QTRY_COMPARE(spyInsert.count(), 1);
@@ -839,9 +844,27 @@ void tst_qdeclarativexmllistmodel::threading()
data3 += "name=C" + QString::number(i) + ",age=3" + QString::number(i) + ",sport=Curling;";
}
+ //Set the xml data multiple times with randomized order and mixed with multiple event loops
+ //to test the xml query reloading/aborting, the result should be stable.
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
m1->setXml(makeItemXmlAndData(data1));
m2->setXml(makeItemXmlAndData(data2));
+ QCoreApplication::processEvents();
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
QTRY_VERIFY(m1->count() == dataCount && m2->count() == dataCount && m3->count() == dataCount);
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
new file mode 100644
index 0000000..1ccab41
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
new file mode 100644
index 0000000..dad1de4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
new file mode 100644
index 0000000..cd4f23a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
new file mode 100644
index 0000000..e858c11
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "reanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 48
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 64
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 80
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 96
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 112
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 128
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 144
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 160
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 176
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 192
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 208
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 224
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 240
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 256
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 272
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 288
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 304
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 320
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 336
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 352
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 496
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 512
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 816
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 976
+ image: "reanchor.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1168
+ hash: "f7814217626627ce70ca0e9487354ba9"
+ }
+ Frame {
+ msec: 1184
+ hash: "7825b2b77e441ca6f46dbca80c7fe602"
+ }
+ Frame {
+ msec: 1200
+ hash: "0ac443a9946b0bcf8db768af7d16d51e"
+ }
+ Frame {
+ msec: 1216
+ hash: "c943d5d46f0d527690f38a9c8bd7be51"
+ }
+ Frame {
+ msec: 1232
+ hash: "38151db0c9964d33bcb2ff155ebd468c"
+ }
+ Frame {
+ msec: 1248
+ hash: "0fb8c53587a95a12cced6d30018edec1"
+ }
+ Frame {
+ msec: 1264
+ hash: "2c684a649652270a638aca41a80e327c"
+ }
+ Frame {
+ msec: 1280
+ hash: "60dd5c448ef8b97ec13ad3140a584229"
+ }
+ Frame {
+ msec: 1296
+ hash: "d564f28f9d528daca729db6fab163b6c"
+ }
+ Frame {
+ msec: 1312
+ hash: "4c07b33632ec4f30ee31141099c15a88"
+ }
+ Frame {
+ msec: 1328
+ hash: "9facfd27fa16ee9d493e7fb7bcfadbf8"
+ }
+ Frame {
+ msec: 1344
+ hash: "fc0fbb8aac8f389841e615be1e7b06de"
+ }
+ Frame {
+ msec: 1360
+ hash: "579c18fa201b5609276c761ffd42df33"
+ }
+ Frame {
+ msec: 1376
+ hash: "5b3630c37acfc2599a5a8b2e11aaa34c"
+ }
+ Frame {
+ msec: 1392
+ hash: "2c1ee8aca06dccf0d39287721bf76aa7"
+ }
+ Frame {
+ msec: 1408
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1424
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1440
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1456
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1472
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1488
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1504
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1520
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1536
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1552
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1568
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1584
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1600
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1616
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1632
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1648
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1664
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1680
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1696
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1712
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1728
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1744
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1760
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1776
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1792
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1808
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1824
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1840
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1856
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1872
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1888
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1904
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1920
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1936
+ image: "reanchor.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1968
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1984
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2000
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2016
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2048
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2064
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2080
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2096
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2128
+ hash: "e9d7372c17ca1510eb15faff5d0794b2"
+ }
+ Frame {
+ msec: 2144
+ hash: "60f897e2b9594c4b5c02ce2fbdf9ae3c"
+ }
+ Frame {
+ msec: 2160
+ hash: "c35ead9a8e682e8f3c0a091d232310f7"
+ }
+ Frame {
+ msec: 2176
+ hash: "272632b0568391022590edc09ea30e28"
+ }
+ Frame {
+ msec: 2192
+ hash: "9d4cdb31b01e86a31627e3ff9bb64100"
+ }
+ Frame {
+ msec: 2208
+ hash: "5ee65b0290721fe47508c6435c18554b"
+ }
+ Frame {
+ msec: 2224
+ hash: "8dd65e1a9417318d793d2027de4fe6ae"
+ }
+ Frame {
+ msec: 2240
+ hash: "bcce6d1fd7d2c1539ad9ac42c0552d5e"
+ }
+ Frame {
+ msec: 2256
+ hash: "e01f5850113c178da3383406fe73d6e0"
+ }
+ Frame {
+ msec: 2272
+ hash: "968fc6b2bf6b7d43e05254339cf6123f"
+ }
+ Frame {
+ msec: 2288
+ hash: "30f25fdde31e13934e328fa1d2655ccb"
+ }
+ Frame {
+ msec: 2304
+ hash: "f58a21e96037813c9dd7f933405c9b11"
+ }
+ Frame {
+ msec: 2320
+ hash: "1fe42c887f2eaf7696fcf0b8b884d0fd"
+ }
+ Frame {
+ msec: 2336
+ hash: "848a27b9e4f4c0bcc1a11d6dba7ce92b"
+ }
+ Frame {
+ msec: 2352
+ hash: "ca92736257db83e39f54b04325201942"
+ }
+ Frame {
+ msec: 2368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2496
+ hash: "9082504eee5e0c3cbef9fd9545f09dcb"
+ }
+ Frame {
+ msec: 2512
+ hash: "dbe5169edb4400c74841a8af64e0949f"
+ }
+ Frame {
+ msec: 2528
+ hash: "d588405fc5e2423cdb954c5624172209"
+ }
+ Frame {
+ msec: 2544
+ hash: "ed2b273ea36fb7d8feaca4d5dae72f81"
+ }
+ Frame {
+ msec: 2560
+ hash: "5249e4824eb169b5ee3f7fb52fe09aa7"
+ }
+ Frame {
+ msec: 2576
+ hash: "2838eff2a1a299c9e47cf78be99172ca"
+ }
+ Frame {
+ msec: 2592
+ hash: "c47f6a937a4a6ef045159d7ba04de8af"
+ }
+ Frame {
+ msec: 2608
+ hash: "fd3bc1b9ba2629bccb0fec04deffcdad"
+ }
+ Frame {
+ msec: 2624
+ hash: "54c9b8599a32ac95aff324977b34f7e6"
+ }
+ Frame {
+ msec: 2640
+ hash: "cc5652a05828146cdc9c9b8430f5f59c"
+ }
+ Frame {
+ msec: 2656
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 2672
+ hash: "01dfd2604263f1fd24382ce876af10f9"
+ }
+ Frame {
+ msec: 2688
+ hash: "45ea282d20ee9e345eb2cac8c22c42e0"
+ }
+ Frame {
+ msec: 2704
+ hash: "afd26ac9776e57c94e4b52ebfeb7206c"
+ }
+ Frame {
+ msec: 2720
+ hash: "97aeed321d4d92cb1ec236d2a98fbe9b"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2752
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2768
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2784
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2800
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2832
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 2848
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 2864
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 2880
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2896
+ image: "reanchor.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 2928
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 2944
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 2960
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 2976
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 2992
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 3024
+ hash: "efd61e7c1aaffec77bd3d2de6645b2c0"
+ }
+ Frame {
+ msec: 3040
+ hash: "02ac5ca0fa7d2ec3903fccd5dc556fa5"
+ }
+ Frame {
+ msec: 3056
+ hash: "daf52e45b8fc68f74e424554074678cc"
+ }
+ Frame {
+ msec: 3072
+ hash: "9e2def87e83b0c4b9f26684665aa1e51"
+ }
+ Frame {
+ msec: 3088
+ hash: "0e72fc762cc9a061e91692376d65d292"
+ }
+ Frame {
+ msec: 3104
+ hash: "c5ac37e4a5250b35a4976bcb31505cca"
+ }
+ Frame {
+ msec: 3120
+ hash: "eefe6bb7963c580c68198ee6098a36f4"
+ }
+ Frame {
+ msec: 3136
+ hash: "7b78d77ac11b72d1fb827ebb66a04c8e"
+ }
+ Frame {
+ msec: 3152
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 3168
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 3184
+ hash: "61a56140e5a6a2bfcee5c6322b37e130"
+ }
+ Frame {
+ msec: 3200
+ hash: "a67b22c0a966fe3fbe869497dc00960f"
+ }
+ Frame {
+ msec: 3216
+ hash: "4edd212676ac93ae761039e80f989349"
+ }
+ Frame {
+ msec: 3232
+ hash: "fea5797441d65625c400238f73d94807"
+ }
+ Frame {
+ msec: 3248
+ hash: "23e9209ff0257343016cffdf7ea6571c"
+ }
+ Frame {
+ msec: 3264
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3280
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3296
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3312
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3328
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3344
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3360
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3376
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3392
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3408
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3424
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3440
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3456
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3472
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3488
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3504
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3520
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3536
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3552
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3568
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3584
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3600
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3616
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3632
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3648
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3664
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3680
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3696
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3712
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3728
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3744
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3760
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3776
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3792
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3808
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3824
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3840
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3856
+ image: "reanchor.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3888
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3904
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3920
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3936
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3952
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3968
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3984
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4000
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4016
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4032
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4048
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4064
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4080
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4096
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4112
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4128
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4144
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4160
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4176
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4208
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4224
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4240
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4256
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4288
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 4304
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 4320
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 4336
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 4352
+ hash: "5b0679ff3730cba4ac026e89c7811fbe"
+ }
+ Frame {
+ msec: 4368
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 4384
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 4400
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 4416
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 4432
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 4448
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 4464
+ hash: "295ea6ff4d3c2c7de0cfbc29b2bd2c38"
+ }
+ Frame {
+ msec: 4480
+ hash: "26b978ab645c04731703bcf15ac34a11"
+ }
+ Frame {
+ msec: 4496
+ hash: "0db4c2515b89506df51732c4b9bf75dc"
+ }
+ Frame {
+ msec: 4512
+ hash: "3cf30f3a06e325e195a4a7dec1e04c01"
+ }
+ Frame {
+ msec: 4528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4816
+ image: "reanchor.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4976
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5168
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5184
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5200
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5216
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5232
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5248
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5264
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5280
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5296
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5312
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5328
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5344
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5360
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5376
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5392
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5408
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5424
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5440
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5456
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5472
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5488
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5504
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5520
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5536
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5552
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5568
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5584
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
new file mode 100644
index 0000000..ba37737
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ anchors.layoutDirection: Qt.RightToLeft
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { id: bottomGuideline; y: 150 }
+ Item { id: topGuideline2; y: 50 }
+ Item { id: bottomGuideline2; y: 175 }
+ MouseArea {
+ id: wholeArea
+ anchors.fill: parent
+ onClicked: {
+ if (container.state == "") {
+ container.state = "reanchored";
+ } else if (container.state == "reanchored") {
+ container.state = "reanchored2";
+ } else if (container.state == "reanchored2")
+ container.state = "reanchored";
+ }
+ }
+
+ states: [ State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }, State {
+ name: "reanchored2"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: undefined
+ anchors.top: topGuideline2.top
+ anchors.bottom: bottomGuideline2.bottom
+ }
+ }]
+
+ transitions: Transition {
+ AnchorAnimation { }
+ }
+
+ MouseArea {
+ width: 50; height: 50
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ onClicked: {
+ container.state = "";
+ }
+ }
+
+ state: "reanchored"
+}
diff --git a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
index 2029c8a..057a8ca 100644
--- a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
+++ b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index 6679ee3..186f00c 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -2,7 +2,7 @@
# (i.e. QT=core gui network).
# The test system is allowed to run these tests before the rest of Qt has
# been compiled.
-#
+#
TEMPLATE=subdirs
SUBDIRS=\
gestures \
@@ -49,6 +49,7 @@ SUBDIRS=\
qfiledialog \
qfiledialog2 \
qfileiconprovider \
+ qfileopenevent \
qfilesystemmodel \
qfocusframe \
qfont \
@@ -111,6 +112,7 @@ SUBDIRS=\
qmimedata \
qmouseevent_modal \
qmovie \
+ qvolatileimage \
qnetworkaccessmanager_and_qprogressdialog \
qnetworkcachemetadata \
qnetworkdiskcache \
diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro
index 93841a3..11beb7e 100644
--- a/tests/auto/lancelot/lancelot.pro
+++ b/tests/auto/lancelot/lancelot.pro
@@ -3,11 +3,11 @@ QT += xml svg
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
SOURCES += tst_lancelot.cpp \
- $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.cpp
-HEADERS += $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.h
-RESOURCES += $$QT_SOURCE_TREE/tests/arthur/common/images.qrc
+ $$PWD/../../arthur/common/paintcommands.cpp
+HEADERS += $$PWD/../../arthur/common/paintcommands.h
+RESOURCES += $$PWD/../../arthur/common/images.qrc
-include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
+include($$PWD/../../arthur/common/qbaselinetest.pri)
!symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp
index 0e8757b..e515c48 100644
--- a/tests/auto/lancelot/tst_lancelot.cpp
+++ b/tests/auto/lancelot/tst_lancelot.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/mediaobject/dummy/dummy.pro b/tests/auto/mediaobject/dummy/dummy.pro
index 88b864b..c81411c 100644
--- a/tests/auto/mediaobject/dummy/dummy.pro
+++ b/tests/auto/mediaobject/dummy/dummy.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.6.4
+ VERSION=4.7.3
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 20fade1..203f0ae 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -493,7 +493,12 @@ private slots:
void QTBUG5590_dummyProperty();
void QTBUG12260_defaultTemplate();
void notifyError();
+ void QTBUG17635_invokableAndProperty();
void revisions();
+ void warnings_data();
+ void warnings();
+
+
signals:
void sigWithUnsignedArg(unsigned foo);
void sigWithSignedArg(signed foo);
@@ -1386,6 +1391,31 @@ void tst_Moc::notifyError()
#endif
}
+class QTBUG_17635_InvokableAndProperty : public QObject
+{
+ Q_OBJECT
+public:
+ Q_PROPERTY(int numberOfEggs READ numberOfEggs)
+ Q_PROPERTY(int numberOfChickens READ numberOfChickens)
+ Q_INVOKABLE QString getEgg(int index) { return QString::fromLatin1("Egg"); }
+ Q_INVOKABLE QString getChicken(int index) { return QString::fromLatin1("Chicken"); }
+ int numberOfEggs() { return 2; }
+ int numberOfChickens() { return 4; }
+};
+
+void tst_Moc::QTBUG17635_invokableAndProperty()
+{
+ //Moc used to fail parsing Q_INVOKABLE if they were dirrectly following a Q_PROPERTY;
+ QTBUG_17635_InvokableAndProperty mc;
+ QString val;
+ QMetaObject::invokeMethod(&mc, "getEgg", Q_RETURN_ARG(QString, val), Q_ARG(int, 10));
+ QCOMPARE(val, QString::fromLatin1("Egg"));
+ QMetaObject::invokeMethod(&mc, "getChicken", Q_RETURN_ARG(QString, val), Q_ARG(int, 10));
+ QCOMPARE(val, QString::fromLatin1("Chicken"));
+ QVERIFY(mc.metaObject()->indexOfProperty("numberOfEggs") != -1);
+ QVERIFY(mc.metaObject()->indexOfProperty("numberOfChickens") != -1);
+}
+
// If changed, update VersionTestNotify below
class VersionTest : public QObject
{
@@ -1498,8 +1528,126 @@ void tst_Moc::revisions()
revisions_T<VersionTestNotify>();
}
-QTEST_APPLESS_MAIN(tst_Moc)
-#include "tst_moc.moc"
+void tst_Moc::warnings_data()
+{
+ QTest::addColumn<QByteArray>("input");
+ QTest::addColumn<QStringList>("args");
+ QTest::addColumn<int>("exitCode");
+ QTest::addColumn<QString>("expectedStdOut");
+ QTest::addColumn<QString>("expectedStdErr");
+
+ // empty input should result in "no relevant classes" note
+ QTest::newRow("No relevant classes")
+ << QByteArray(" ")
+ << QStringList()
+ << 0
+ << QString()
+ << QString("standard input:0: Note: No relevant classes found. No output generated.");
+
+ // passing "-nn" should suppress "no relevant classes" note
+ QTest::newRow("-nn")
+ << QByteArray(" ")
+ << (QStringList() << "-nn")
+ << 0
+ << QString()
+ << QString();
+
+ // passing "-nw" should also suppress "no relevant classes" note
+ QTest::newRow("-nw")
+ << QByteArray(" ")
+ << (QStringList() << "-nw")
+ << 0
+ << QString()
+ << QString();
+
+ // This should output a warning
+ QTest::newRow("Invalid property warning")
+ << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };")
+ << QStringList()
+ << 0
+ << QString("IGNORE_ALL_STDOUT")
+ << QString("standard input:1: Warning: Property declaration x has no READ accessor function. The property will be invalid.");
+
+ // Passing "-nn" should NOT suppress the warning
+ QTest::newRow("Invalid property warning")
+ << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };")
+ << (QStringList() << "-nn")
+ << 0
+ << QString("IGNORE_ALL_STDOUT")
+ << QString("standard input:1: Warning: Property declaration x has no READ accessor function. The property will be invalid.");
+
+ // Passing "-nw" should suppress the warning
+ QTest::newRow("Invalid property warning")
+ << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };")
+ << (QStringList() << "-nw")
+ << 0
+ << QString("IGNORE_ALL_STDOUT")
+ << QString();
+
+ // This should output an error
+ QTest::newRow("Does not inherit QObject")
+ << QByteArray("class X { Q_OBJECT };")
+ << QStringList()
+ << 1
+ << QString()
+ << QString("standard input:1: Error: Class contains Q_OBJECT macro but does not inherit from QObject");
+
+ // "-nn" should not suppress the error
+ QTest::newRow("Does not inherit QObject with -nn")
+ << QByteArray("class X { Q_OBJECT };")
+ << (QStringList() << "-nn")
+ << 1
+ << QString()
+ << QString("standard input:1: Error: Class contains Q_OBJECT macro but does not inherit from QObject");
+
+ // "-nw" should not suppress the error
+ QTest::newRow("Does not inherit QObject with -nn")
+ << QByteArray("class X { Q_OBJECT };")
+ << (QStringList() << "-nw")
+ << 1
+ << QString()
+ << QString("standard input:1: Error: Class contains Q_OBJECT macro but does not inherit from QObject");
+}
+
+void tst_Moc::warnings()
+{
+#ifdef MOC_CROSS_COMPILED
+ QSKIP("Not tested when cross-compiled", SkipAll);
+#endif
+ QFETCH(QByteArray, input);
+ QFETCH(QStringList, args);
+ QFETCH(int, exitCode);
+ QFETCH(QString, expectedStdOut);
+ QFETCH(QString, expectedStdErr);
+
+#ifdef Q_CC_MSVC
+ // for some reasons, moc compiled with MSVC uses a different output format
+ QRegExp lineNumberRe(":(\\d+):");
+ lineNumberRe.setMinimal(true);
+ expectedStdErr.replace(lineNumberRe, "(\\1):");
+#endif
+
+ QProcess proc;
+ proc.start("moc", args);
+ QVERIFY(proc.waitForStarted());
+ QCOMPARE(proc.write(input), qint64(input.size()));
+
+ proc.closeWriteChannel();
+
+ QVERIFY(proc.waitForFinished());
+
+ QCOMPARE(proc.exitCode(), exitCode);
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+
+ // magic value "IGNORE_ALL_STDOUT" ignores stdout
+ if (expectedStdOut != "IGNORE_ALL_STDOUT")
+ QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardOutput()).trimmed(), expectedStdOut);
+ QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()).trimmed(), expectedStdErr);
+
+ }
+
+QTEST_APPLESS_MAIN(tst_Moc)
+#include "tst_moc.moc"
diff --git a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro
new file mode 100644
index 0000000..fb8ecb0
--- /dev/null
+++ b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+SOURCES += tst_nativeimagehandleprovider.cpp
+symbian {
+ LIBS += -lfbscli -lbitgdi
+ contains(QT_CONFIG, openvg): QT *= openvg
+}
diff --git a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp
new file mode 100644
index 0000000..3a315f2
--- /dev/null
+++ b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
+#include <QScopedPointer>
+#include <QPixmap>
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+#include <fbs.h>
+#include <bitdev.h>
+#include <QtOpenVG/private/qpixmapdata_vg_p.h>
+#endif
+
+QPixmap pixmapFromNativeImageHandleProvider(QNativeImageHandleProvider *source)
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ if (!source)
+ return QPixmap();
+ QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ pd->fromNativeType(source, QPixmapData::NativeImageHandleProvider);
+ return QPixmap(pd.take());
+#else
+ Q_UNUSED(source);
+ return QPixmap();
+#endif
+}
+
+class DummyProvider : public QNativeImageHandleProvider
+{
+public:
+ void get(void **handle, QString *type);
+ void release(void *handle, const QString &type);
+};
+
+void DummyProvider::get(void **handle, QString *type)
+{
+ *handle = (void *) 0x12345678;
+ *type = "some dummy type";
+}
+
+void DummyProvider::release(void *handle, const QString &type)
+{
+ Q_UNUSED(handle);
+ Q_UNUSED(type);
+}
+
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+class BitmapProvider : public QNativeImageHandleProvider
+{
+public:
+ BitmapProvider() : bmp(0), refCount(0), w(50), h(60) { }
+ void get(void **handle, QString *type);
+ void release(void *handle, const QString &type);
+
+ CFbsBitmap *bmp;
+ int refCount, w, h;
+ void *returnedHandle;
+ QString returnedType;
+};
+
+void BitmapProvider::get(void **handle, QString *type)
+{
+ // There may not be a release() if the get() fails so don't bother with
+ // refcounting in such cases.
+ if (bmp)
+ ++refCount;
+ returnedType = QLatin1String("CFbsBitmap");
+ returnedHandle = bmp;
+ *handle = returnedHandle;
+ *type = returnedType;
+}
+
+void BitmapProvider::release(void *handle, const QString &type)
+{
+ if (handle == returnedHandle && type == returnedType && returnedHandle) {
+ --refCount;
+ }
+}
+#endif // symbian & openvg
+
+class tst_NativeImageHandleProvider : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_NativeImageHandleProvider() { }
+
+private slots:
+ void create();
+ void bitmap();
+ void hibernate();
+};
+
+void tst_NativeImageHandleProvider::create()
+{
+ QPixmap pm = pixmapFromNativeImageHandleProvider(0);
+ QVERIFY(pm.isNull());
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ // Verify that null pixmap is properly returned when get() provides bogus results.
+ DummyProvider prov;
+ pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(pm.isNull());
+ pm = QPixmap();
+ } else {
+ QSKIP("Not openvg, skipping non-trivial tests", SkipSingle);
+ }
+}
+
+void tst_NativeImageHandleProvider::bitmap()
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ BitmapProvider prov;
+
+ // This should fail because of null ptr.
+ QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(pm.isNull());
+ pm = QPixmap();
+ QCOMPARE(prov.refCount, 0);
+
+ prov.bmp = new CFbsBitmap;
+ QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
+ CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(prov.bmp);
+ CBitmapContext *bitmapContext = 0;
+ QCOMPARE(bitmapDevice->CreateBitmapContext(bitmapContext), KErrNone);
+ TRgb symbianColor = TRgb(255, 200, 100);
+ bitmapContext->SetBrushColor(symbianColor);
+ bitmapContext->Clear();
+ delete bitmapContext;
+ delete bitmapDevice;
+
+ pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(!pm.isNull());
+ QCOMPARE(pm.width(), prov.w);
+ QCOMPARE(pm.height(), prov.h);
+ QVERIFY(prov.refCount == 1);
+ QImage img = pm.toImage();
+ QVERIFY(prov.refCount == 1);
+ QRgb pix = img.pixel(QPoint(1, 2));
+ QCOMPARE(qRed(pix), symbianColor.Red());
+ QCOMPARE(qGreen(pix), symbianColor.Green());
+ QCOMPARE(qBlue(pix), symbianColor.Blue());
+
+ pm = QPixmap(); // should result in calling release
+ QCOMPARE(prov.refCount, 0);
+ delete prov.bmp;
+ } else {
+ QSKIP("Not openvg", SkipSingle);
+ }
+#else
+ QSKIP("Not applicable", SkipSingle);
+#endif
+}
+
+void tst_NativeImageHandleProvider::hibernate()
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ BitmapProvider prov;
+ prov.bmp = new CFbsBitmap;
+ QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
+
+ QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
+ QCOMPARE(prov.refCount, 1);
+
+ QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pm.pixmapData());
+ vgpd->hibernate();
+ QCOMPARE(prov.refCount, 0);
+
+ // Calling toVGImage() may cause some warnings as we don't have a gui initialized,
+ // but the only thing we care about here is get() being called.
+ vgpd->toVGImage();
+ QCOMPARE(prov.refCount, 1);
+
+ pm = QPixmap();
+ QCOMPARE(prov.refCount, 0);
+ delete prov.bmp;
+ } else {
+ QSKIP("Not openvg", SkipSingle);
+ }
+#else
+ QSKIP("Not applicable", SkipSingle);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication::setGraphicsSystem("openvg");
+ QApplication app(argc, argv);
+ tst_NativeImageHandleProvider tc;
+ return QTest::qExec(&tc, argc, argv);
+}
+
+#include "tst_nativeimagehandleprovider.moc"
diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index 7d83054..b427f1c 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -35,6 +35,8 @@ SUBDIRS=\
qsslerror \
qsslkey \
qsslsocket \
+ qsslsocket_onDemandCertificates_member \
+ qsslsocket_onDemandCertificates_static \
# qnetworkproxyfactory \ # Uses a hardcoded proxy configuration
!contains(QT_CONFIG, private_tests): SUBDIRS -= \
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index cfcafc0..64de64a 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -967,7 +967,7 @@ void tst_NetworkSelfTest::smbServer()
QVERIFY2(f, qt_error_string().toLocal8Bit());
char buf[128];
- size_t ret = fread(buf, sizeof buf, 1, f);
+ size_t ret = fread(buf, 1, sizeof buf, f);
fclose(f);
QCOMPARE(ret, strlen(contents));
diff --git a/tests/auto/other.pro b/tests/auto/other.pro
index 512cd25..8819879 100644
--- a/tests/auto/other.pro
+++ b/tests/auto/other.pro
@@ -34,7 +34,8 @@ SUBDIRS=\
qvariant \
qwidget \
qworkspace \
- windowsmobile
+ windowsmobile \
+ nativeimagehandleprovider
contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter
mac: {
diff --git a/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
index 5952252..1178169 100644
--- a/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
+++ b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 6331db7..db0d0a7 100644
--- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -331,7 +331,7 @@ void tst_QAbstractNetworkCache::checkSynchronous()
QNetworkRequest request(realUrl);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(QNetworkRequest::DownloadBufferAttribute + 1),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
// prime the cache
diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp
index c05bbac..7840974 100644
--- a/tests/auto/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/qclipboard/tst_qclipboard.cpp
@@ -205,7 +205,7 @@ void tst_QClipboard::testSignals()
void tst_QClipboard::copy_exit_paste()
{
#ifndef QT_NO_PROCESS
-#if defined Q_WS_X11 || defined Q_WS_QWS
+#if defined Q_WS_X11 || defined Q_WS_QWS || defined (Q_WS_QPA)
QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ", SkipAll);
// ### It's still possible to test copy/paste - just keep the apps running
#elif defined (Q_OS_SYMBIAN) && defined (Q_CC_NOKIAX86)
diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
index c1938b1..39f0677 100644
--- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
@@ -169,6 +169,25 @@ public slots:
int MyObject::callCount = 0;
QVariantList MyObject::callArgs;
+class MyObjectUnknownType: public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "com.trolltech.QtDBus.MyObject")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"com.trolltech.QtDBus.MyObjectUnknownTypes\" >\n"
+" <property access=\"readwrite\" type=\"~\" name=\"prop1\" />\n"
+" <signal name=\"somethingHappened\" >\n"
+" <arg direction=\"out\" type=\"~\" />\n"
+" </signal>\n"
+" <method name=\"ping\" >\n"
+" <arg direction=\"in\" type=\"~\" name=\"ping\" />\n"
+" <arg direction=\"out\" type=\"~\" name=\"ping\" />\n"
+" </method>\n"
+" <method name=\"regularMethod\" />\n"
+" </interface>\n"
+ "")
+};
+
class Spy: public QObject
{
Q_OBJECT
@@ -228,6 +247,7 @@ private slots:
void notValidDerived();
void invalidAfterServiceOwnerChanged();
void introspect();
+ void introspectUnknownTypes();
void callMethod();
void invokeMethod();
void invokeMethodWithReturn();
@@ -250,8 +270,7 @@ void tst_QDBusInterface::initTestCase()
con.registerObject("/", &obj, QDBusConnection::ExportAllProperties
| QDBusConnection::ExportAllSlots
- | QDBusConnection::ExportAllInvokables
- | QDBusConnection::ExportChildObjects);
+ | QDBusConnection::ExportAllInvokables);
}
void tst_QDBusInterface::notConnected()
@@ -322,6 +341,27 @@ void tst_QDBusInterface::introspect()
QVERIFY(mo->indexOfProperty("complexProp") != -1);
}
+void tst_QDBusInterface::introspectUnknownTypes()
+{
+ QDBusConnection con = QDBusConnection::sessionBus();
+ MyObjectUnknownType obj;
+ con.registerObject("/unknownTypes", &obj, QDBusConnection::ExportAllContents);
+ QDBusInterface iface(QDBusConnection::sessionBus().baseService(), QLatin1String("/unknownTypes"),
+ "com.trolltech.QtDBus.MyObjectUnknownTypes");
+
+ const QMetaObject *mo = iface.metaObject();
+ QVERIFY(mo->indexOfMethod("regularMethod()") != -1); // this is the control
+ QVERIFY(mo->indexOfMethod("somethingHappened(QDBusRawType<0x7e>*)") != -1);
+
+ QVERIFY(mo->indexOfMethod("ping(QDBusRawType<0x7e>*)") != -1);
+ int midx = mo->indexOfMethod("ping(QDBusRawType<0x7e>*)");
+ QCOMPARE(mo->method(midx).typeName(), "QDBusRawType<0x7e>*");
+
+ QVERIFY(mo->indexOfProperty("prop1") != -1);
+ int pidx = mo->indexOfProperty("prop1");
+ QCOMPARE(mo->property(pidx).typeName(), "QDBusRawType<0x7e>*");
+}
+
void tst_QDBusInterface::callMethod()
{
QDBusConnection con = QDBusConnection::sessionBus();
diff --git a/tests/auto/qdbusmarshall/test/test.pro b/tests/auto/qdbusmarshall/test/test.pro
index 8901999..71fc656 100644
--- a/tests/auto/qdbusmarshall/test/test.pro
+++ b/tests/auto/qdbusmarshall/test/test.pro
@@ -5,4 +5,5 @@ TARGET = ../tst_qdbusmarshall
QT = core
QT += dbus
-
+LIBS += $$QT_LIBS_DBUS
+QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS
diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
index c05e49c..9bae6af 100644
--- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -38,7 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#define DBUS_API_SUBJECT_TO_CHANGE
#include <QtCore/QtCore>
#include <QtTest/QtTest>
#include <QtDBus/QtDBus>
@@ -47,6 +46,8 @@
#include "common.h"
#include <limits>
+#include <dbus/dbus.h>
+
static const char serviceName[] = "com.trolltech.autotests.qpong";
static const char objectPath[] = "/com/trolltech/qpong";
static const char *interfaceName = serviceName;
@@ -88,66 +89,59 @@ private slots:
void sendCallErrors_data();
void sendCallErrors();
+ void receiveUnknownType_data();
+ void receiveUnknownType();
+
private:
QProcess proc;
};
-struct UnregisteredType { };
-Q_DECLARE_METATYPE(UnregisteredType)
-
-class WaitForQPong: public QObject
+class QDBusMessageSpy: public QObject
{
Q_OBJECT
-public:
- WaitForQPong();
- bool ok();
-public Q_SLOTS:
- void ownerChange(const QString &name)
+public slots:
+ Q_SCRIPTABLE int theSlot(const QDBusMessage &msg)
{
- if (name == serviceName)
- loop.quit();
+ list << msg;
+ return 42;
}
-
-private:
- QEventLoop loop;
+public:
+ QList<QDBusMessage> list;
};
-WaitForQPong::WaitForQPong()
-{
- QDBusConnection con = QDBusConnection::sessionBus();
- if (!ok()) {
- connect(con.interface(), SIGNAL(serviceOwnerChanged(QString,QString,QString)),
- SLOT(ownerChange(QString)));
- QTimer::singleShot(2000, &loop, SLOT(quit()));
- loop.exec();
- }
-}
-
-bool WaitForQPong::ok()
-{
- return QDBusConnection::sessionBus().isConnected() &&
- QDBusConnection::sessionBus().interface()->isServiceRegistered(serviceName);
-}
+struct UnregisteredType { };
+Q_DECLARE_METATYPE(UnregisteredType)
void tst_QDBusMarshall::initTestCase()
{
commonInit();
+ QDBusConnection con = QDBusConnection::sessionBus();
#ifdef Q_OS_WIN
proc.start("qpong");
#else
proc.start("./qpong/qpong");
#endif
- QVERIFY(proc.waitForStarted());
-
- WaitForQPong w;
- QVERIFY(w.ok());
- //QTest::qWait(2000);
+ if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(serviceName)) {
+ QVERIFY(proc.waitForStarted());
+
+ QVERIFY(con.isConnected());
+ con.connect("org.freedesktop.DBus", QString(), "org.freedesktop.DBus", "NameOwnerChanged",
+ QStringList() << serviceName << QString(""), QString(),
+ &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(serviceName));
+ con.disconnect("org.freedesktop.DBus", QString(), "org.freedesktop.DBus", "NameOwnerChanged",
+ QStringList() << serviceName << QString(""), QString(),
+ &QTestEventLoop::instance(), SLOT(exitLoop()));
+ }
}
void tst_QDBusMarshall::cleanupTestCase()
{
proc.close();
- proc.kill();
+ proc.terminate();
+ proc.waitForFinished(200);
}
void tst_QDBusMarshall::sendBasic_data()
@@ -700,6 +694,8 @@ void tst_QDBusMarshall::sendBasic()
msg << value;
QDBusMessage reply = con.call(msg);
+ QVERIFY2(reply.type() == QDBusMessage::ReplyMessage,
+ qPrintable(reply.errorName() + ": " + reply.errorMessage()));
//qDebug() << reply;
QCOMPARE(reply.arguments().count(), msg.arguments().count());
@@ -938,5 +934,145 @@ void tst_QDBusMarshall::sendCallErrors()
QCOMPARE(reply.errorMessage(), errorMsg);
}
+void tst_QDBusMarshall::receiveUnknownType_data()
+{
+ QTest::addColumn<int>("receivedTypeId");
+ QTest::newRow("in-call") << qMetaTypeId<void*>();
+ QTest::newRow("type-variant") << qMetaTypeId<QDBusVariant>();
+ QTest::newRow("type-array") << qMetaTypeId<QDBusArgument>();
+ QTest::newRow("type-struct") << qMetaTypeId<QDBusArgument>();
+ QTest::newRow("type-naked") << qMetaTypeId<void *>();
+}
+
+struct DisconnectRawDBus {
+ static void cleanup(DBusConnection *connection)
+ {
+ if (!connection)
+ return;
+ dbus_connection_close(connection);
+ dbus_connection_unref(connection);
+ }
+};
+template <typename T, void (*unref)(T *)> struct GenericUnref
+{
+ static void cleanup(T *type)
+ {
+ if (!type) return;
+ unref(type);
+ }
+};
+
+// use these scoped types to avoid memory leaks if QVERIFY or QCOMPARE fails
+typedef QScopedPointer<DBusConnection, DisconnectRawDBus> ScopedDBusConnection;
+typedef QScopedPointer<DBusMessage, GenericUnref<DBusMessage, dbus_message_unref> > ScopedDBusMessage;
+typedef QScopedPointer<DBusPendingCall, GenericUnref<DBusPendingCall, dbus_pending_call_unref> > ScopedDBusPendingCall;
+
+void tst_QDBusMarshall::receiveUnknownType()
+{
+#ifndef DBUS_TYPE_UNIX_FD
+ QSKIP("Your system's D-Bus library is too old for this test", SkipAll);
+#else
+ QDBusConnection con = QDBusConnection::sessionBus();
+ QVERIFY(con.isConnected());
+
+ // this needs to be implemented in raw
+ // open a new connection to the bus daemon
+ DBusError error;
+ dbus_error_init(&error);
+ ScopedDBusConnection rawcon(dbus_bus_get_private(DBUS_BUS_SESSION, &error));
+ QVERIFY2(rawcon.data(), error.name);
+
+ // check if this bus supports passing file descriptors
+ if (!dbus_connection_can_send_type(rawcon.data(), DBUS_TYPE_UNIX_FD))
+ QSKIP("Your session bus does not allow sending Unix file descriptors", SkipAll);
+
+ if (qstrcmp(QTest::currentDataTag(), "in-call") == 0) {
+ // create a call back to us containing a file descriptor
+ QDBusMessageSpy spy;
+ con.registerObject("/spyObject", &spy, QDBusConnection::ExportAllSlots);
+ ScopedDBusMessage msg(dbus_message_new_method_call(con.baseService().toLatin1(), "/spyObject", NULL, "theSlot"));
+
+ int fd = fileno(stdout);
+ dbus_message_append_args(msg.data(), DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_INVALID);
+
+ // try to send to us
+ DBusPendingCall *pending_ptr;
+ dbus_connection_send_with_reply(rawcon.data(), msg.data(), &pending_ptr, 1000);
+ ScopedDBusPendingCall pending(pending_ptr);
+
+ // check that it got sent
+ while (dbus_connection_dispatch(rawcon.data()) == DBUS_DISPATCH_DATA_REMAINS)
+ ;
+
+ // now spin our event loop. We don't catch this call, so let's get the reply
+ QEventLoop loop;
+ QTimer::singleShot(200, &loop, SLOT(quit()));
+ loop.exec();
+
+ // now try to receive the reply
+ dbus_pending_call_block(pending.data());
+
+ // check that the spy received what it was supposed to receive
+ QCOMPARE(spy.list.size(), 1);
+ QCOMPARE(spy.list.at(0).arguments().size(), 1);
+ QFETCH(int, receivedTypeId);
+ QCOMPARE(spy.list.at(0).arguments().at(0).userType(), receivedTypeId);
+
+ msg.reset(dbus_pending_call_steal_reply(pending.data()));
+ QVERIFY(msg);
+ QCOMPARE(dbus_message_get_type(msg.data()), DBUS_MESSAGE_TYPE_METHOD_RETURN);
+ QCOMPARE(dbus_message_get_signature(msg.data()), DBUS_TYPE_INT32_AS_STRING);
+
+ int retval;
+ QVERIFY(dbus_message_get_args(msg.data(), &error, DBUS_TYPE_INT32, &retval, DBUS_TYPE_INVALID));
+ QCOMPARE(retval, 42);
+ } else {
+ // create a signal that we'll emit
+ static const char signalName[] = "signalName";
+ static const char interfaceName[] = "local.interface.name";
+ ScopedDBusMessage msg(dbus_message_new_signal("/", interfaceName, signalName));
+ con.connect(dbus_bus_get_unique_name(rawcon.data()), QString(), interfaceName, signalName, &QTestEventLoop::instance(), SLOT(exitLoop()));
+
+ QDBusMessageSpy spy;
+ con.connect(dbus_bus_get_unique_name(rawcon.data()), QString(), interfaceName, signalName, &spy, SLOT(theSlot(QDBusMessage)));
+
+ DBusMessageIter iter;
+ dbus_message_iter_init_append(msg.data(), &iter);
+ int fd = fileno(stdout);
+
+ if (qstrcmp(QTest::currentDataTag(), "type-naked") == 0) {
+ // send naked
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_UNIX_FD, &fd);
+ } else {
+ DBusMessageIter subiter;
+ if (qstrcmp(QTest::currentDataTag(), "type-variant") == 0)
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_UNIX_FD_AS_STRING, &subiter);
+ else if (qstrcmp(QTest::currentDataTag(), "type-array") == 0)
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_UNIX_FD_AS_STRING, &subiter);
+ else if (qstrcmp(QTest::currentDataTag(), "type-struct") == 0)
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_STRUCT, 0, &subiter);
+ dbus_message_iter_append_basic(&subiter, DBUS_TYPE_UNIX_FD, &fd);
+ dbus_message_iter_close_container(&iter, &subiter);
+ }
+
+ // send it
+ dbus_connection_send(rawcon.data(), msg.data(), 0);
+
+ // check that it got sent
+ while (dbus_connection_dispatch(rawcon.data()) == DBUS_DISPATCH_DATA_REMAINS)
+ ;
+
+ // now let's see what happens
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QCOMPARE(spy.list.size(), 1);
+ QCOMPARE(spy.list.at(0).arguments().count(), 1);
+ QFETCH(int, receivedTypeId);
+ //qDebug() << spy.list.at(0).arguments().at(0).typeName();
+ QCOMPARE(spy.list.at(0).arguments().at(0).userType(), receivedTypeId);
+ }
+#endif
+}
+
QTEST_MAIN(tst_QDBusMarshall)
#include "tst_qdbusmarshall.moc"
diff --git a/tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp
index 25595c5..f83795c 100644
--- a/tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp
+++ b/tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp
@@ -287,11 +287,14 @@ void tst_QDBusXmlParser::methods_data()
"</method>" << map;
// one invalid arg
+ method.inputArgs << arg("~", "invalid");
+ map.clear();
+ map << method;
QTest::newRow("two-in-one-invalid") <<
"<method name=\"Method\">"
"<arg type=\"s\" direction=\"in\"/>"
- "<arg type=\"~\" name=\"invalid\" direction=\"in\"/>" // this line should be ignored
"<arg type=\"v\" direction=\"in\"/>"
+ "<arg type=\"~\" name=\"invalid\" direction=\"in\"/>"
"</method>" << map;
// one out argument
@@ -380,8 +383,6 @@ void tst_QDBusXmlParser::methods()
QFETCH(QString, xmlDataFragment);
- if (strcmp(QTest::currentDataTag(), "two-in-one-invalid") == 0)
- QTest::ignoreMessage(QtWarningMsg, "Invalid D-BUS type signature '~' found while parsing introspection");
QDBusIntrospection::Interface iface =
QDBusIntrospection::parseInterface(xmlHeader + xmlDataFragment + xmlFooter);
@@ -390,9 +391,9 @@ void tst_QDBusXmlParser::methods()
QFETCH(MethodMap, methodMap);
MethodMap parsedMap = iface.methods;
- QCOMPARE(methodMap.count(), parsedMap.count());
- QCOMPARE(methodMap, parsedMap);
-}
+ QCOMPARE(parsedMap.count(), methodMap.count());
+ QCOMPARE(parsedMap, methodMap);
+}
void tst_QDBusXmlParser::signals__data()
{
diff --git a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
index 0256b82..f66b849 100644
--- a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -127,7 +127,7 @@ void tst_QDesktopWidget::screenNumberForQWidget()
QWidget widget;
widget.show();
- QApplication::processEvents();
+ QTest::qWaitForWindowShown(&widget);
QVERIFY(widget.isVisible());
int widgetScreen = desktop.screenNumber(&widget);
@@ -142,7 +142,9 @@ void tst_QDesktopWidget::screenNumberForQPoint()
QRect allScreens;
for (int i = 0; i < desktopWidget->numScreens(); ++i) {
QRect screenGeometry = desktopWidget->screenGeometry(i);
+#if !defined(Q_OS_SYMBIAN)
QCOMPARE(desktopWidget->screenNumber(screenGeometry.center()), i);
+#endif
allScreens |= screenGeometry;
}
@@ -180,7 +182,6 @@ void tst_QDesktopWidget::screenGeometry()
total = desktopWidget->screenGeometry(i);
available = desktopWidget->availableGeometry(i);
}
- QVERIFY(total.contains(r));
}
QTEST_MAIN(tst_QDesktopWidget)
diff --git a/tests/auto/qfileopenevent/qfileopenevent.pro b/tests/auto/qfileopenevent/qfileopenevent.pro
new file mode 100644
index 0000000..45978d7
--- /dev/null
+++ b/tests/auto/qfileopenevent/qfileopenevent.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = test qfileopeneventexternal
diff --git a/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
new file mode 100644
index 0000000..0a5e032
--- /dev/null
+++ b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QtGui>
+#include <QApplication>
+#include <QEvent>
+
+struct MyApplication : public QApplication
+{
+ MyApplication(int& argc, char** argv)
+ : QApplication(argc, argv)
+ {}
+
+ bool event(QEvent * event)
+ {
+ if (event->type() == QEvent::FileOpen) {
+ QFileOpenEvent* ev = static_cast<QFileOpenEvent *>(event);
+ QFile file;
+ bool ok = ev->openFile(file, QFile::Append | QFile::Unbuffered);
+ if (ok)
+ file.write(QByteArray("+external"));
+ return true;
+ } else {
+ return QApplication::event(event);
+ }
+ }
+};
+
+int main(int argc, char *argv[])
+{
+ MyApplication a(argc, argv);
+ a.sendPostedEvents(&a, QEvent::FileOpen);
+ return 0;
+}
diff --git a/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro
new file mode 100644
index 0000000..b95ed45
--- /dev/null
+++ b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = qfileopeneventexternal
+QT += core gui
+SOURCES += qfileopeneventexternal.cpp
+symbian: {
+ RSS_RULES += "embeddability=KAppEmbeddable;"
+ RSS_RULES.datatype_list += "priority = EDataTypePriorityHigh; type = \"application/x-tst_qfileopenevent\";"
+ LIBS += -lapparc \
+ -leikcore -lefsrv -lcone
+}
diff --git a/tests/auto/qfileopenevent/test/test.pro b/tests/auto/qfileopenevent/test/test.pro
new file mode 100644
index 0000000..3f16dcf
--- /dev/null
+++ b/tests/auto/qfileopenevent/test/test.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+TARGET = tst_qfileopenevent
+HEADERS +=
+SOURCES += tst_qfileopenevent.cpp
+symbian {
+ LIBS+=-lefsrv -lapgrfx -lapmime
+}
diff --git a/tests/auto/qfileopenevent/test/tst_qfileopenevent.cpp b/tests/auto/qfileopenevent/test/tst_qfileopenevent.cpp
new file mode 100644
index 0000000..1177131
--- /dev/null
+++ b/tests/auto/qfileopenevent/test/tst_qfileopenevent.cpp
@@ -0,0 +1,362 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QEvent>
+
+#ifdef Q_OS_SYMBIAN
+#include <apgcli.h>
+#include "private/qcore_symbian_p.h"
+#endif
+
+class tst_qfileopenevent : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qfileopenevent(){}
+ ~tst_qfileopenevent();
+
+public slots:
+ void initTestCase();
+
+private slots:
+ void constructor();
+ void fileOpen();
+ void handleLifetime();
+ void multiOpen();
+ void sendAndReceive();
+ void external_data();
+ void external();
+
+private:
+#ifdef Q_OS_SYMBIAN
+ RFile createRFile(const TDesC& filename, const TDesC8& content);
+#else
+ void createFile(const QString &filename, const QByteArray &content);
+#endif
+ QFileOpenEvent * createFileAndEvent(const QString &filename, const QByteArray &content);
+ void checkReadAndWrite(QFileOpenEvent& event, const QByteArray& readContent, const QByteArray& writeContent, bool writeOk);
+ QByteArray readFileContent(QFileOpenEvent& event);
+ bool appendFileContent(QFileOpenEvent& event, const QByteArray& writeContent);
+
+ bool event(QEvent *);
+
+private:
+#ifdef Q_OS_SYMBIAN
+ struct AutoRFs : public RFs
+ {
+ AutoRFs()
+ {
+ qt_symbian_throwIfError(Connect());
+ qt_symbian_throwIfError(ShareProtected());
+ }
+
+ ~AutoRFs()
+ {
+ Close();
+ }
+ };
+ AutoRFs fsSession;
+#endif
+};
+
+tst_qfileopenevent::~tst_qfileopenevent()
+{
+};
+
+void tst_qfileopenevent::initTestCase()
+{
+}
+
+#ifdef Q_OS_SYMBIAN
+RFile tst_qfileopenevent::createRFile(const TDesC& filename, const TDesC8& content)
+{
+ RFile file;
+ qt_symbian_throwIfError(file.Replace(fsSession, filename, EFileWrite));
+ qt_symbian_throwIfError(file.Write(content));
+ return file;
+}
+#else
+void tst_qfileopenevent::createFile(const QString &filename, const QByteArray &content)
+{
+ QFile file(filename);
+ file.open(QFile::WriteOnly);
+ file.write(content);
+ file.close();
+}
+#endif
+
+QFileOpenEvent * tst_qfileopenevent::createFileAndEvent(const QString &filename, const QByteArray &content)
+{
+#ifdef Q_OS_SYMBIAN
+ RFile rFile = createRFile(qt_QString2TPtrC(filename), TPtrC8((TText8*)content.constData(), content.size()));
+ QScopedPointer<RFile, QScopedPointerRCloser<RFile> > closeRFile(&rFile);
+ return new QFileOpenEvent(rFile);
+#else
+ createFile(filename, content);
+ return new QFileOpenEvent(filename);
+#endif
+}
+
+void tst_qfileopenevent::constructor()
+{
+ // check that filename get/set works
+ QFileOpenEvent nameTest(QLatin1String("fileNameTest"));
+ QCOMPARE(nameTest.file(), QLatin1String("fileNameTest"));
+
+ // check that url get/set works
+ QFileOpenEvent urlTest(QUrl(QLatin1String("file:///urlNameTest")));
+ QCOMPARE(urlTest.url().toString(), QLatin1String("file:///urlNameTest"));
+
+#ifdef Q_OS_SYMBIAN
+ // check that RFile construction works
+ RFile rFile = createRFile(_L("testRFile"), _L8("test content"));
+ QFileOpenEvent rFileTest(rFile);
+ QString targetName(QLatin1String("testRFile"));
+ QCOMPARE(rFileTest.file().right(targetName.size()), targetName);
+ QCOMPARE(rFileTest.url().toString().right(targetName.size()), targetName);
+ rFile.Close();
+#endif
+}
+
+QByteArray tst_qfileopenevent::readFileContent(QFileOpenEvent& event)
+{
+ QFile file;
+ event.openFile(file, QFile::ReadOnly);
+ file.seek(0);
+ QByteArray data = file.readAll();
+ return data;
+}
+
+bool tst_qfileopenevent::appendFileContent(QFileOpenEvent& event, const QByteArray& writeContent)
+{
+ QFile file;
+ bool ok = event.openFile(file, QFile::Append | QFile::Unbuffered);
+ if (ok)
+ ok = file.write(writeContent) == writeContent.size();
+ return ok;
+}
+
+void tst_qfileopenevent::checkReadAndWrite(QFileOpenEvent& event, const QByteArray& readContent, const QByteArray& writeContent, bool writeOk)
+{
+ QCOMPARE(readFileContent(event), readContent);
+ QCOMPARE(appendFileContent(event, writeContent), writeOk);
+ QCOMPARE(readFileContent(event), writeOk ? readContent+writeContent : readContent);
+}
+
+void tst_qfileopenevent::fileOpen()
+{
+#ifdef Q_OS_SYMBIAN
+ // create writeable file
+ {
+ RFile rFile = createRFile(_L("testFileOpen"), _L8("test content"));
+ QFileOpenEvent rFileTest(rFile);
+ checkReadAndWrite(rFileTest, QByteArray("test content"), QByteArray("+RFileWrite"), true);
+ rFile.Close();
+ }
+
+ // open read-only RFile
+ {
+ RFile rFile;
+ int err = rFile.Open(fsSession, _L("testFileOpen"), EFileRead);
+ QFileOpenEvent rFileTest(rFile);
+ checkReadAndWrite(rFileTest, QByteArray("test content+RFileWrite"), QByteArray("+RFileRead"), false);
+ rFile.Close();
+ }
+#else
+ createFile(QLatin1String("testFileOpen"), QByteArray("test content+RFileWrite"));
+#endif
+
+ // filename event
+ QUrl fileUrl; // need to get the URL during the file test, for use in the URL test
+ {
+ QFileOpenEvent nameTest(QLatin1String("testFileOpen"));
+ fileUrl = nameTest.url();
+ checkReadAndWrite(nameTest, QByteArray("test content+RFileWrite"), QByteArray("+nameWrite"), true);
+ }
+
+ // url event
+ {
+ QFileOpenEvent urlTest(fileUrl);
+ checkReadAndWrite(urlTest, QByteArray("test content+RFileWrite+nameWrite"), QByteArray("+urlWrite"), true);
+ }
+
+ QFile::remove(QLatin1String("testFileOpen"));
+}
+
+void tst_qfileopenevent::handleLifetime()
+{
+ QScopedPointer<QFileOpenEvent> event(createFileAndEvent(QLatin1String("testHandleLifetime"), QByteArray("test content")));
+
+ // open a QFile after the original RFile is closed
+ QFile qFile;
+ QCOMPARE(event->openFile(qFile, QFile::Append | QFile::Unbuffered), true);
+ event.reset(0);
+
+ // write to the QFile after the event is closed
+ QString writeContent(QLatin1String("+closed original handles"));
+ QCOMPARE(int(qFile.write(writeContent.toUtf8())), writeContent.size());
+ qFile.close();
+
+ // check the content
+ QFile check("testHandleLifetime");
+ check.open(QFile::ReadOnly);
+ QString content(check.readAll());
+ QCOMPARE(content, QLatin1String("test content+closed original handles"));
+ check.close();
+
+ QFile::remove(QLatin1String("testHandleLifetime"));
+}
+
+void tst_qfileopenevent::multiOpen()
+{
+ QScopedPointer<QFileOpenEvent> event(createFileAndEvent(QLatin1String("testMultiOpen"), QByteArray("itlum")));
+
+ QFile files[5];
+ for (int i=0; i<5; i++) {
+ QCOMPARE(event->openFile(files[i], QFile::ReadOnly), true);
+ }
+ for (int i=0; i<5; i++)
+ files[i].seek(i);
+ QString str;
+ for (int i=4; i>=0; i--) {
+ char c;
+ files[i].getChar(&c);
+ str.append(c);
+ files[i].close();
+ }
+ QCOMPARE(str, QLatin1String("multi"));
+
+ QFile::remove(QLatin1String("testMultiOpen"));
+}
+
+bool tst_qfileopenevent::event(QEvent *event)
+{
+ if (event->type() != QEvent::FileOpen)
+ return QObject::event(event);
+ QFileOpenEvent* fileOpenEvent = static_cast<QFileOpenEvent *>(event);
+ appendFileContent(*fileOpenEvent, "+received");
+ return true;
+}
+
+void tst_qfileopenevent::sendAndReceive()
+{
+ QScopedPointer<QFileOpenEvent> event(createFileAndEvent(QLatin1String("testSendAndReceive"), QByteArray("sending")));
+
+ QCoreApplication::instance()->postEvent(this, event.take());
+ QCoreApplication::instance()->processEvents();
+
+ // QTBUG-17468: On Mac, processEvents doesn't always process posted events
+ QCoreApplication::instance()->sendPostedEvents();
+
+ // check the content
+ QFile check("testSendAndReceive");
+ QCOMPARE(check.open(QFile::ReadOnly), true);
+ QString content(check.readAll());
+ QCOMPARE(content, QLatin1String("sending+received"));
+ check.close();
+
+ QFile::remove(QLatin1String("testSendAndReceive"));
+}
+
+void tst_qfileopenevent::external_data()
+{
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<QByteArray>("targetContent");
+ QTest::addColumn<bool>("sendHandle");
+
+ QString privateName(QLatin1String("tst_qfileopenevent_external"));
+ QString publicName(QLatin1String("C:\\Data\\tst_qfileopenevent_external"));
+ QByteArray writeSuccess("original+external");
+ QByteArray writeFail("original");
+ QTest::newRow("public name") << publicName << writeSuccess << false;
+ QTest::newRow("data caged name") << privateName << writeFail << false;
+ QTest::newRow("public handle") << publicName << writeSuccess << true;
+ QTest::newRow("data caged handle") << privateName << writeSuccess << true;
+}
+
+void tst_qfileopenevent::external()
+{
+#ifndef Q_OS_SYMBIAN
+ QSKIP("external app file open test only valid in Symbian", SkipAll);
+#else
+
+ QFETCH(QString, filename);
+ QFETCH(QByteArray, targetContent);
+ QFETCH(bool, sendHandle);
+
+ RFile rFile = createRFile(qt_QString2TPtrC(filename), _L8("original"));
+
+ // launch app with the file
+ RApaLsSession apa;
+ QCOMPARE(apa.Connect(), KErrNone);
+ TThreadId threadId;
+ TDataType type(_L8("application/x-tst_qfileopenevent"));
+ if (sendHandle) {
+ QCOMPARE(apa.StartDocument(rFile, type, threadId), KErrNone);
+ rFile.Close();
+ } else {
+ TFileName fullName;
+ rFile.FullName(fullName);
+ rFile.Close();
+ QCOMPARE(apa.StartDocument(fullName, type, threadId), KErrNone);
+ }
+
+ // wait for app exit
+ RThread appThread;
+ if (appThread.Open(threadId) == KErrNone) {
+ TRequestStatus status;
+ appThread.Logon(status);
+ User::WaitForRequest(status);
+ }
+
+ // check the contents
+ QFile check(filename);
+ QCOMPARE(check.open(QFile::ReadOnly), true);
+ QCOMPARE(check.readAll(), targetContent);
+ bool ok = check.remove();
+
+ QFile::remove(filename);
+#endif
+}
+
+QTEST_MAIN(tst_qfileopenevent)
+#include "tst_qfileopenevent.moc"
diff --git a/tests/auto/qfilesystementry/tst_qfilesystementry.cpp b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp
index 4375f99..dea6d2e 100644
--- a/tests/auto/qfilesystementry/tst_qfilesystementry.cpp
+++ b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index cf0406c..53781c9 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -980,8 +980,12 @@ void tst_QFileSystemModel::drives()
model.setRootPath(path);
model.fetchMore(QModelIndex());
QFileInfoList drives = QDir::drives();
+ int driveCount = 0;
+ foreach(const QFileInfo& driveRoot, drives)
+ if (driveRoot.exists())
+ driveCount++;
QTest::qWait(5000);
- QTRY_COMPARE(model.rowCount(), drives.count());
+ QTRY_COMPARE(model.rowCount(), driveCount);
}
void tst_QFileSystemModel::dirsBeforeFiles()
diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp
index 82c8f65..dabe3fa 100644
--- a/tests/auto/qfont/tst_qfont.cpp
+++ b/tests/auto/qfont/tst_qfont.cpp
@@ -150,6 +150,13 @@ void tst_QFont::exactMatch()
return;
#endif
+#ifdef Q_WS_X11
+ QVERIFY(QFont("sans").exactMatch());
+ QVERIFY(QFont("sans-serif").exactMatch());
+ QVERIFY(QFont("serif").exactMatch());
+ QVERIFY(QFont("monospace").exactMatch());
+#endif
+
QSKIP("This test is bogus on Unix with support for font aliases in fontconfig", SkipAll);
return;
diff --git a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
index eb8677a..a4598dc 100644
--- a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -486,8 +486,6 @@ class ProgressTextTask : public RunFunctionTask<T>
public:
void runFunctor()
{
- while (this->isProgressUpdateNeeded() == false)
- QTest::qSleep(1);
this->setProgressValueAndText(1, QLatin1String("Foo 1"));
while (this->isProgressUpdateNeeded() == false)
@@ -497,6 +495,10 @@ public:
while (this->isProgressUpdateNeeded() == false)
QTest::qSleep(1);
this->setProgressValueAndText(3, QLatin1String("Foo 3"));
+
+ while (this->isProgressUpdateNeeded() == false)
+ QTest::qSleep(1);
+ this->setProgressValueAndText(4, QLatin1String("Foo 4"));
}
};
@@ -524,14 +526,16 @@ void tst_QFutureWatcher::progressText()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(f.progressText(), QLatin1String("Foo 3"));
- QCOMPARE(f.progressValue(), 3);
+ QCOMPARE(f.progressText(), QLatin1String("Foo 4"));
+ QCOMPARE(f.progressValue(), 4);
QVERIFY(progressValues.contains(1));
QVERIFY(progressValues.contains(2));
QVERIFY(progressValues.contains(3));
+ QVERIFY(progressValues.contains(4));
QVERIFY(progressTexts.contains(QLatin1String("Foo 1")));
QVERIFY(progressTexts.contains(QLatin1String("Foo 2")));
QVERIFY(progressTexts.contains(QLatin1String("Foo 3")));
+ QVERIFY(progressTexts.contains(QLatin1String("Foo 4")));
}
}
diff --git a/tests/auto/qglfunctions/tst_qglfunctions.cpp b/tests/auto/qglfunctions/tst_qglfunctions.cpp
index 73e63b5..8756438 100644
--- a/tests/auto/qglfunctions/tst_qglfunctions.cpp
+++ b/tests/auto/qglfunctions/tst_qglfunctions.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphs/tst_qglyphs.cpp
index da91063..1c0aa9e 100644
--- a/tests/auto/qglyphs/tst_qglyphs.cpp
+++ b/tests/auto/qglyphs/tst_qglyphs.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index bac17b1..837df78 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -2541,7 +2541,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 0, 50,10) << QRectF(50, 0, 50,10)
<< QRectF(0, 10, 50,100) << QRectF(50, 10, 50,400)
);
-#if 0
+
QTest::newRow("hfw-100x470") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
@@ -2556,9 +2556,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(500, 500))
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(500,500))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 470)
@@ -2567,7 +2567,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 70, 50,100) << QRectF(50, 70, 50,400)
);
-
// change layout width and verify
QTest::newRow("hfw-100x401") << (ItemList()
<< ItemDesc(0,0)
@@ -2583,9 +2582,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
+ .minSize(QSizeF(-1,-1))
+ .preferredSize(QSizeF(-1,-1))
+ .maxSize(QSizeF(-1, -1))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 401)
@@ -2594,7 +2593,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF( 0, 1, 50, 100) << QRectF( 50, 1, 50, 400)
);
- QTest::newRow("hfw-160x400") << (ItemList()
+ QTest::newRow("hfw-160x350") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
.preferredSize(QSizeF(50,10))
@@ -2608,18 +2607,17 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
- .dynamicConstraint(hfw1, Qt::Vertical)
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000,5000))
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
- << QSizeF(160, 400)
+ << QSizeF(160, 350)
<< (RectList()
<< QRectF( 0, 0, 80, 100) << QRectF( 80, 0, 80, 100)
<< QRectF( 0, 100, 80, 100) << QRectF( 80, 100, 80, 250)
);
-
QTest::newRow("hfw-160x300") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
@@ -2634,9 +2632,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000, 5000))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(160, 300)
@@ -2647,11 +2645,11 @@ void tst_QGraphicsGridLayout::geometries_data()
QTest::newRow("hfw-20x40") << (ItemList()
<< ItemDesc(0,0)
- .minSize(QSizeF(1,1))
+ .minSize(QSizeF(1,10))
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(0,1)
- .minSize(QSizeF(1,10))
+ .minSize(QSizeF(1,1))
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,0)
@@ -2659,9 +2657,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1, 1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50, 50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(hfw3, Qt::Vertical)
)
<< QSizeF(20, 40)
@@ -2684,9 +2682,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(10,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(10,10))
- .preferredSize(QSizeF(400,50))
- .maxSize(QSizeF(5000, 5000))
+ .sizeHint(Qt::MinimumSize, QSizeF(10,10))
+ .sizeHint(Qt::PreferredSize, QSizeF(400,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000, 5000))
.dynamicConstraint(wfh1, Qt::Horizontal)
)
<< QSizeF(300, 160)
@@ -2711,9 +2709,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
<< QSizeF(40, 20)
@@ -2736,9 +2734,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
@@ -2767,9 +2765,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(10,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(10,50))
- .maxSize(QSizeF(500, 500))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(10,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(500, 500))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
<< QSizeF(160, 100)
@@ -2777,7 +2775,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 0, 80, 50) << QRectF( 80, 0, 80, 50)
<< QRectF(0, 50, 80, 50) << QRectF( 80, 50, 50, 50)
);
-#endif
QTest::newRow("hfw-h470") << (ItemList()
<< ItemDesc(0,0)
@@ -2804,7 +2801,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 70, 50,100) << QRectF(50, 70, 50,400)
);
-
// change layout width and verify
QTest::newRow("hfw-w100") << (ItemList()
<< ItemDesc(0,0)
@@ -3069,25 +3065,24 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->setSpacing(0);
RectWidget *w00 = new RectWidget;
w00->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w00->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w00->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w00->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w00, 0, 0);
RectWidget *w01 = new RectWidget;
w01->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w01->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w01->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w01->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w01, 0, 1);
RectWidget *w10 = new RectWidget;
w10->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w10->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w10->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w10->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w11->setSizeHint(Qt::PreferredSize, QSizeF(50,400));
w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
w11->setConstraintFunction(hfw);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -3096,34 +3091,37 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->addItem(w11, 1, 1);
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, -1)), QSizeF(2, 2));
- QEXPECT_FAIL("", "QTBUG-14693", Continue);
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, -1)), QSizeF(210, 110));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, -1)), QSizeF(30100, 30100));
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(2, -1)), QSizeF(2, 20001));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20050));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20010));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(2, -1)), QSizeF(2, 20100));
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1)), QSizeF(20, 1 + 2000));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1)), QSizeF(20, 50 + 2000));
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1)), QSizeF(20, 100 + 2000));
+ // Since 20 is somewhere between "minimum width hint" (2) and
+ // "preferred width hint" (210), it will try to do distribution by
+ // stretching them with different factors.
+ // Since column 1 has a "preferred width" of 200 it means that
+ // column 1 will be a bit wider than column 0. Thus it will also be a bit
+ // shorter than 2001, (the expected height if all columns had width=10)
+ QSizeF sh = layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1));
+ // column 1 cannot be wider than 19, which means that it must be taller than 20000/19~=1052
+ QVERIFY(sh.height() < 2000 + 1 && sh.height() > 1052 + 1);
+
+ sh = layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1));
+ QVERIFY(sh.height() < 2000 + 10 && sh.height() > 1052 + 10);
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(300, -1)), QSizeF(300, 1 + 100));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(300, -1)), QSizeF(300, 50 + 100));
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(300, -1)), QSizeF(300, 100 + 100));
+ sh = layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1));
+ QVERIFY(sh.height() < 2000 + 100 && sh.height() > 1052 + 100);
// the height of the hfw widget is shorter than the one to the left, which is 100, so
// the total height of the last row is 100 (which leaves the layout height to be 200)
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(500, -1)), QSizeF(500, 100 + 100));
- // hfw item size: (500, 40) -> preferred size is maxed up to preferred size of item w10 (50)
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(600, -1)), QSizeF(600, 50 + 50));
-
}
void tst_QGraphicsGridLayout::widthForHeight()
{
-#if 0
QGraphicsWidget *widget = new QGraphicsWidget;
QGraphicsGridLayout *layout = new QGraphicsGridLayout;
widget->setLayout(layout);
@@ -3150,9 +3148,10 @@ void tst_QGraphicsGridLayout::widthForHeight()
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
- w11->setMinimumSize(1,1);
- w11->setPreferredSize(50, 50);
- w11->setMaximumSize(30000,30000);
+ w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
+ w11->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
+
// This will make sure its always square.
w11->setConstraintFunction(wfh);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -3196,7 +3195,6 @@ void tst_QGraphicsGridLayout::widthForHeight()
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 300)), QSizeF(1 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 300)), QSizeF(50 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 300)), QSizeF(100 + 200, 300));
-#endif
}
void tst_QGraphicsGridLayout::heightForWidthWithSpanning()
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index d446ca7..9ff086c 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -289,6 +289,7 @@ private slots:
void taskQTBUG_7863_paintIntoCacheWithTransparentParts();
void taskQT_3674_doNotCrash();
void taskQTBUG_15977_renderWithDeviceCoordinateCache();
+ void taskQTBUG_16401_focusItem();
};
void tst_QGraphicsScene::initTestCase()
@@ -4680,5 +4681,35 @@ void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache()
QCOMPARE(image, expected);
}
+void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
+ rect->setFlag(QGraphicsItem::ItemIsFocusable);
+
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QApplication::setActiveWindow(&view);
+
+ QVERIFY(!scene.focusItem());
+
+ rect->setFocus();
+ QCOMPARE(scene.focusItem(), rect);
+ QFocusEvent focusOut(QEvent::FocusOut);
+ QApplication::sendEvent(&view, &focusOut);
+ QVERIFY(!scene.focusItem());
+ QFocusEvent focusIn(QEvent::FocusIn);
+ QApplication::sendEvent(&view, &focusIn);
+ QCOMPARE(scene.focusItem(), rect);
+
+ rect->clearFocus();
+ QVERIFY(!scene.focusItem());
+ QApplication::sendEvent(&view, &focusOut);
+ QVERIFY(!scene.focusItem());
+ QApplication::sendEvent(&view, &focusIn);
+ QVERIFY(!scene.focusItem());
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index db71e39..9a25fb6 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -195,6 +195,8 @@ private slots:
void QTBUG8650_crashOnInsertSections();
void QTBUG12268_hiddenMovedSectionSorting();
+ void initialSortOrderRole();
+
protected:
QWidget *topLevel;
QHeaderView *view;
@@ -2097,5 +2099,40 @@ void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting()
QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
}
+void tst_QHeaderView::initialSortOrderRole()
+{
+ QTableView view;
+ QStandardItemModel *model = new QStandardItemModel(4, 3, &view);
+ for (int i = 0; i< model->rowCount(); ++i)
+ for (int j = 0; j< model->columnCount(); ++j)
+ model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j));
+ QStandardItem *ascendingItem = new QStandardItem();
+ QStandardItem *descendingItem = new QStandardItem();
+ ascendingItem->setData(Qt::AscendingOrder, Qt::InitialSortOrderRole);
+ descendingItem->setData(Qt::DescendingOrder, Qt::InitialSortOrderRole);
+ model->setHorizontalHeaderItem(1, ascendingItem);
+ model->setHorizontalHeaderItem(2, descendingItem);
+ view.setModel(model);
+ view.setSortingEnabled(true);
+ view.sortByColumn(0, Qt::AscendingOrder);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ const int column1Pos = view.horizontalHeader()->sectionViewportPosition(1) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column1Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 1);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder);
+
+ const int column2Pos = view.horizontalHeader()->sectionViewportPosition(2) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column2Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 2);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::DescendingOrder);
+
+ const int column0Pos = view.horizontalHeader()->sectionViewportPosition(0) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column0Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 0);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder);
+}
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"
diff --git a/tests/auto/qimagereader/images/corrupt-pixel-count.xpm b/tests/auto/qimagereader/images/corrupt-pixel-count.xpm
new file mode 100644
index 0000000..3a736ff
--- /dev/null
+++ b/tests/auto/qimagereader/images/corrupt-pixel-count.xpm
@@ -0,0 +1,11 @@
+/* XPM */
+static const char *marble_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"2 2 2 -2",
+/* colors */
+"a c #adadad",
+"b c #dedede",
+/* pixels */
+"ab",
+"ba"
+};
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 7c2aee8..f02fd6a 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1410,6 +1410,9 @@ void tst_QImageReader::readFromResources_data()
QTest::newRow("corrupt-pixels.xpm") << QString("corrupt-pixels.xpm")
<< QByteArray("xpm") << QSize(0, 0)
<< QString("QImage: XPM pixels missing on image line 3");
+ QTest::newRow("corrupt-pixel-count.xpm") << QString("corrupt-pixel-count.xpm")
+ << QByteArray("xpm") << QSize(0, 0)
+ << QString("");
QTest::newRow("marble.xpm") << QString("marble.xpm")
<< QByteArray("xpm") << QSize(240, 240)
<< QString("");
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp
index 800f9de..6a047f2 100644
--- a/tests/auto/qinputcontext/tst_qinputcontext.cpp
+++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp
@@ -88,6 +88,7 @@ private slots:
void closeSoftwareInputPanel();
void selections();
void focusProxy();
+ void contextInheritance();
void symbianTestCoeFepInputContext_data();
void symbianTestCoeFepInputContext();
void symbianTestCoeFepAutoCommit_data();
@@ -473,6 +474,37 @@ void tst_QInputContext::focusProxy()
QCOMPARE(gic->focusWidget(), &proxy);
}
+void tst_QInputContext::contextInheritance()
+{
+ QWidget parent;
+ QWidget child(&parent);
+
+ parent.setAttribute(Qt::WA_InputMethodEnabled, true);
+ child.setAttribute(Qt::WA_InputMethodEnabled, true);
+
+ QCOMPARE(parent.inputContext(), qApp->inputContext());
+ QCOMPARE(child.inputContext(), qApp->inputContext());
+
+ QInputContext *qic = new QFilterInputContext;
+ parent.setInputContext(qic);
+ QCOMPARE(parent.inputContext(), qic);
+ QCOMPARE(child.inputContext(), qic);
+
+ parent.setAttribute(Qt::WA_InputMethodEnabled, false);
+ QVERIFY(!parent.inputContext());
+ QCOMPARE(child.inputContext(), qic);
+ parent.setAttribute(Qt::WA_InputMethodEnabled, true);
+
+ parent.setInputContext(0);
+ QCOMPARE(parent.inputContext(), qApp->inputContext());
+ QCOMPARE(child.inputContext(), qApp->inputContext());
+
+ qic = new QFilterInputContext;
+ qApp->setInputContext(qic);
+ QCOMPARE(parent.inputContext(), qic);
+ QCOMPARE(child.inputContext(), qic);
+}
+
#ifdef QT_WEBKIT_LIB
class AutoWebView : public QWebView
{
diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp
index d44e632..67d3d0d 100644
--- a/tests/auto/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp
@@ -287,6 +287,8 @@ private slots:
void setActivationOrder();
void tabBetweenSubWindows();
void setViewMode();
+ void setTabsClosable();
+ void setTabsMovable();
void setTabShape();
void setTabPosition_data();
void setTabPosition();
@@ -2464,6 +2466,77 @@ void tst_QMdiArea::setViewMode()
QCOMPARE(mdiArea.viewMode(), QMdiArea::SubWindowView);
}
+void tst_QMdiArea::setTabsClosable()
+{
+ QMdiArea mdiArea;
+ mdiArea.addSubWindow(new QWidget);
+
+ // test default
+ QCOMPARE(mdiArea.tabsClosable(), false);
+
+ // change value before tab bar exists
+ QTabBar *tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(!tabBar);
+ mdiArea.setTabsClosable(true);
+ QCOMPARE(mdiArea.tabsClosable(), true);
+
+ // force tab bar creation
+ mdiArea.setViewMode(QMdiArea::TabbedView);
+ tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(tabBar);
+
+ // value must've been propagated
+ QCOMPARE(tabBar->tabsClosable(), true);
+
+ // change value when tab bar exists
+ mdiArea.setTabsClosable(false);
+ QCOMPARE(mdiArea.tabsClosable(), false);
+ QCOMPARE(tabBar->tabsClosable(), false);
+}
+
+void tst_QMdiArea::setTabsMovable()
+{
+ QMdiArea mdiArea;
+ QMdiSubWindow *subWindow1 = mdiArea.addSubWindow(new QWidget);
+ QMdiSubWindow *subWindow2 = mdiArea.addSubWindow(new QWidget);
+ QMdiSubWindow *subWindow3 = mdiArea.addSubWindow(new QWidget);
+
+ // test default
+ QCOMPARE(mdiArea.tabsMovable(), false);
+
+ // change value before tab bar exists
+ QTabBar *tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(!tabBar);
+ mdiArea.setTabsMovable(true);
+ QCOMPARE(mdiArea.tabsMovable(), true);
+
+ // force tab bar creation
+ mdiArea.setViewMode(QMdiArea::TabbedView);
+ tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(tabBar);
+
+ // value must've been propagated
+ QCOMPARE(tabBar->isMovable(), true);
+
+ // test tab moving
+ QList<QMdiSubWindow *> subWindows;
+ subWindows << subWindow1 << subWindow2 << subWindow3;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+ tabBar->moveTab(1, 2); // 1,3,2
+ subWindows.clear();
+ subWindows << subWindow1 << subWindow3 << subWindow2;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+ tabBar->moveTab(0, 2); // 3,2,1
+ subWindows.clear();
+ subWindows << subWindow3 << subWindow2 << subWindow1;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+
+ // change value when tab bar exists
+ mdiArea.setTabsMovable(false);
+ QCOMPARE(mdiArea.tabsMovable(), false);
+ QCOMPARE(tabBar->isMovable(), false);
+}
+
void tst_QMdiArea::setTabShape()
{
QMdiArea mdiArea;
diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
index 0c89013..91dfe47 100644
--- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -171,16 +171,16 @@ void tst_QNetworkCookie::parseSingleCookie_data()
QTest::newRow("with-value7") << "a = b" << cookie;
QTest::newRow("with-value8") << "a = b " << cookie;
- cookie.setValue(",");
+ cookie.setValue("\",\"");
QTest::newRow("with-value-with-special1") << "a = \",\" " << cookie;
- cookie.setValue(";");
+ cookie.setValue("\";\"");
QTest::newRow("with-value-with-special2") << "a = \";\" " << cookie;
- cookie.setValue(" ");
+ cookie.setValue("\" \"");
QTest::newRow("with-value-with-special3") << "a = \" \" " << cookie;
- cookie.setValue("\"");
- QTest::newRow("with-value-with-special3") << "a = \"\\\"\" " << cookie;
- cookie.setValue("\"a, b; c\"");
- QTest::newRow("with-value-with-special4") << "a = \"\\\"a, b; c\\\"\"" << cookie;
+ cookie.setValue("\"\\\"\"");
+ QTest::newRow("with-value-with-special4") << "a = \"\\\"\" " << cookie;
+ cookie.setValue("\"\\\"a, b; c\\\"\"");
+ QTest::newRow("with-value-with-special5") << "a = \"\\\"a, b; c\\\"\"" << cookie;
cookie.setValue("b");
cookie.setSecure(true);
@@ -568,10 +568,18 @@ void tst_QNetworkCookie::parseSingleCookie_data()
cookie.setDomain("mail.yahoo.com");
QTest::newRow("network3") << "YM.LC=v=2&m=9993_262838_159_1558_1063_0_5649_4012_3776161073,9426_260205_549_1295_1336_0_5141_4738_3922731647,6733_258196_952_1364_643_0_3560_-1_0,3677_237633_1294_1294_19267_0_3244_29483_4102206176,1315_235149_1693_1541_941_0_3224_1691_1861378060,1858_214311_2100_1298_19538_0_2873_30900_716411652,6258_212007_2506_1285_1017_0_2868_3606_4288540264,3743_207884_2895_1362_2759_0_2545_7114_3388520216,2654_205253_3257_1297_1332_0_2504_4682_3048534803,1891_184881_3660_1291_19079_0_978_29178_2592538685&f=1&n=20&s=date&o=down&e=1196548712&b=Inbox&u=removed; path=/; domain=mail.yahoo.com" << cookie;
- cookie = QNetworkCookie("__ac", "c2hhdXNtYW46U2FTYW80Wm8%3D");
+ cookie = QNetworkCookie("__ac", "\"c2hhdXNtYW46U2FTYW80Wm8%3D\"");
cookie.setPath("/");
cookie.setExpirationDate(QDateTime(QDate(2008, 8, 30), QTime(20, 21, 49), Qt::UTC));
QTest::newRow("network4") << "__ac=\"c2hhdXNtYW46U2FTYW80Wm8%3D\"; Path=/; Expires=Sat, 30 Aug 2008 20:21:49 +0000" << cookie;
+
+ // linkedin.com sends cookies in quotes and expects the cookie in quotes
+ cookie = QNetworkCookie("leo_auth_token", "\"GST:UroVXaxYA3sVSkoVjMNH9bj4dZxVzK2yekgrAUxMfUsyLTNyPjoP60:1298974875:b675566ae32ab36d7a708c0efbf446a5c22b9fca\"");
+ cookie.setPath("/");
+ cookie.setExpirationDate(QDateTime(QDate(2011, 3, 1), QTime(10, 51, 14), Qt::UTC));
+ QTest::newRow("network5") << "leo_auth_token=\"GST:UroVXaxYA3sVSkoVjMNH9bj4dZxVzK2yekgrAUxMfUsyLTNyPjoP60:1298974875:b675566ae32ab36d7a708c0efbf446a5c22b9fca\"; Version=1; Max-Age=1799; Expires=Tue, 01-Mar-2011 10:51:14 GMT; Path=/" << cookie;
+
+
}
void tst_QNetworkCookie::parseSingleCookie()
diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index 10fa7c6..2baee27 100644
--- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -60,8 +60,8 @@ QString tst_QNetworkProxyFactory::formatProxyName(const QNetworkProxy & proxy) c
QString proxyName;
if (!proxy.user().isNull())
proxyName.append("%1:%2@").arg(proxy.user(), proxy.password());
- proxyName.append("%1:%2").arg(proxy.hostName(), proxy.port());
- proxyName.append(" (type=%1, capabilities=%2)").arg(proxy.type(), proxy.capabilities());
+ proxyName.append(QString("%1:%2").arg(proxy.hostName()).arg(proxy.port()));
+ proxyName.append(QString(" (type=%1, capabilities=%2)").arg(proxy.type()).arg(proxy.capabilities()));
return proxyName;
}
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 1d2a69f..93e3051 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -84,8 +84,6 @@ Q_DECLARE_METATYPE(QList<QNetworkProxy>)
Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
Q_DECLARE_METATYPE(QBuffer*)
-const int SynchronousRequestAttribute = QNetworkRequest::DownloadBufferAttribute + 1;
-
class QNetworkReplyPtr: public QSharedPointer<QNetworkReply>
{
public:
@@ -327,6 +325,7 @@ private Q_SLOTS:
void ioGetFromHttpBrokenChunkedEncoding();
void qtbug12908compressedHttpReply();
+ void compressedHttpReplyBrokenGzip();
void getFromUnreachableIp();
@@ -340,7 +339,11 @@ private Q_SLOTS:
void synchronousRequest_data();
void synchronousRequest();
+#ifndef QT_NO_OPENSSL
void synchronousRequestSslFailure();
+#endif
+
+ void httpAbort();
// NOTE: This test must be last!
void parentingRepliesToTheApp();
@@ -455,6 +458,7 @@ private:
{
//qDebug() << "connectSocketSignals" << client;
connect(client, SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
+ connect(client, SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWrittenSlot()));
connect(client, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(slotError(QAbstractSocket::SocketError)));
}
@@ -482,15 +486,19 @@ public slots:
if (multiple)
receivedData.remove(0, doubleEndlPos+4);
- client->write(dataToTransmit);
- while (client->bytesToWrite() > 0)
- client->waitForBytesWritten();
+ // we need to emulate the bytesWrittenSlot call if the data is empty.
+ if (dataToTransmit.size() == 0)
+ QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection);
+ else
+ client->write(dataToTransmit);
+ }
+ }
- if (doClose) {
- client->disconnectFromHost();
- disconnect(client, 0, this, 0);
- client = 0;
- }
+ void bytesWrittenSlot() {
+ if (doClose && client->bytesToWrite() == 0) {
+ client->disconnectFromHost();
+ disconnect(client, 0, this, 0);
+ client = 0;
}
}
};
@@ -959,7 +967,9 @@ tst_QNetworkReply::tst_QNetworkReply()
qRegisterMetaType<QNetworkReply *>(); // for QSignalSpy
qRegisterMetaType<QAuthenticator *>();
qRegisterMetaType<QNetworkProxy>();
+#ifndef QT_NO_OPENSSL
qRegisterMetaType<QList<QSslError> >();
+#endif
Q_SET_DEFAULT_IAP
@@ -1055,7 +1065,7 @@ QString tst_QNetworkReply::runSimpleRequest(QNetworkAccessManager::Operation op,
returnCode = Timeout;
int code = Success;
- if (request.attribute(static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute)).toBool()) {
+ if (request.attribute(QNetworkRequest::SynchronousRequestAttribute).toBool()) {
if (reply->isFinished())
code = reply->error() != QNetworkReply::NoError ? Failure : Success;
else
@@ -1492,6 +1502,12 @@ void tst_QNetworkReply::getErrors()
{
QFETCH(QString, url);
QNetworkRequest request(url);
+
+#if defined(Q_OS_WIN) || defined (Q_OS_SYMBIAN)
+ if (qstrcmp(QTest::currentDataTag(), "empty-scheme-host") == 0)
+ QTest::ignoreMessage(QtWarningMsg, "QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files");
+#endif
+
QNetworkReplyPtr reply = manager.get(request);
reply->setParent(this); // we have expect-fails
@@ -1506,6 +1522,9 @@ void tst_QNetworkReply::getErrors()
//qDebug() << reply->errorString();
QFETCH(int, error);
+#if defined(Q_OS_WIN) || defined (Q_OS_SYMBIAN)
+ QEXPECT_FAIL("empty-scheme-host", "this is expected to fail on Windows and Symbian, QTBUG-17731", Abort);
+#endif
QEXPECT_FAIL("ftp-is-dir", "QFtp cannot provide enough detail", Abort);
// the line below is not necessary
QEXPECT_FAIL("ftp-dir-not-readable", "QFtp cannot provide enough detail", Abort);
@@ -1678,7 +1697,7 @@ void tst_QNetworkReply::putToHttpSynchronous()
QFETCH(QByteArray, data);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::PutOperation, request, reply, data));
@@ -1738,7 +1757,7 @@ void tst_QNetworkReply::postToHttpSynchronous()
QNetworkRequest request(url);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply;
@@ -2253,7 +2272,7 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth()
// now check with synchronous calls:
{
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QSignalSpy authspy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -2277,7 +2296,7 @@ void tst_QNetworkReply::ioGetFromHttpWithAuthSynchronous()
QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt"));
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QSignalSpy authspy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -2362,7 +2381,7 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth()
reference.seek(0);
{
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -2388,7 +2407,7 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuthSynchronous()
QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
manager.setProxy(proxy);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -3501,7 +3520,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocketSynchronous()
QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply = manager.post(request, socketpair.endPoints[1]);
@@ -3693,12 +3712,12 @@ void tst_QNetworkReply::ioPostToHttpsUploadProgress()
incomingSocket->setReadBufferSize(1*1024);
QTestEventLoop::instance().enterLoop(2);
// some progress should have been made
+ QVERIFY(!spy.isEmpty());
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
@@ -3709,16 +3728,16 @@ void tst_QNetworkReply::ioPostToHttpsUploadProgress()
incomingSocket->read(16*1024);
QTestEventLoop::instance().enterLoop(2);
// some more progress than before
+ QVERIFY(!spy.isEmpty());
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
+ QVERIFY(!spy.isEmpty());
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());
@@ -3808,6 +3827,8 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp()
if (reader.data.size() < testData.size()) { // oops?
QCOMPARE(reader.data, testData.mid(0, reader.data.size()));
qDebug() << "The data is incomplete, the last" << testData.size() - reader.data.size() << "bytes are missing";
+ QEXPECT_FAIL("http+limited", "Limiting is broken right now, check QTBUG-15065", Abort);
+ QEXPECT_FAIL("https+limited", "Limiting is broken right now, check QTBUG-15065", Abort);
}
QCOMPARE(reader.data.size(), testData.size());
QCOMPARE(reader.data, testData);
@@ -3820,8 +3841,8 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp()
const int maxRate = rate * 1024 * (100+allowedDeviation) / 100;
qDebug() << minRate << "<="<< server.transferRate << "<=" << maxRate << "?";
QVERIFY(server.transferRate >= minRate);
- QEXPECT_FAIL("http+limited", "Limiting is broken right now", Continue);
- QEXPECT_FAIL("https+limited", "Limiting is broken right now", Continue);
+ QEXPECT_FAIL("http+limited", "Limiting is broken right now, check QTBUG-15065", Continue);
+ QEXPECT_FAIL("https+limited", "Limiting is broken right now, check QTBUG-15065", Continue);
QVERIFY(server.transferRate <= maxRate);
}
}
@@ -3850,19 +3871,13 @@ void tst_QNetworkReply::ioPostToHttpUploadProgress()
disconnect(&server, SIGNAL(newConnection()), &QTestEventLoop::instance(), SLOT(exitLoop()));
incomingSocket->setReadBufferSize(1*1024);
- QTestEventLoop::instance().enterLoop(2);
+ QTestEventLoop::instance().enterLoop(5);
// some progress should have been made
QList<QVariant> args = spy.last();
QVERIFY(!args.isEmpty());
QVERIFY(args.at(0).toLongLong() > 0);
-
- 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());
+ // but not everything!
+ QVERIFY(args.at(0).toLongLong() != sourceFile.size());
// set the read buffer to unlimited
incomingSocket->setReadBufferSize(0);
@@ -3870,8 +3885,10 @@ void tst_QNetworkReply::ioPostToHttpUploadProgress()
// progress should be finished
QList<QVariant> args3 = spy.last();
QVERIFY(!args3.isEmpty());
- QVERIFY(args3.at(0).toLongLong() > args2.at(0).toLongLong());
+ // More progress than before
+ QVERIFY(args3.at(0).toLongLong() > args.at(0).toLongLong());
QCOMPARE(args3.at(0).toLongLong(), args3.at(1).toLongLong());
+ // And actually finished..
QCOMPARE(args3.at(0).toLongLong(), sourceFile.size());
// after sending this, the QNAM should emit finished()
@@ -4276,7 +4293,7 @@ void tst_QNetworkReply::receiveCookiesFromHttpSynchronous()
QNetworkRequest request(url);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply;
@@ -4368,7 +4385,7 @@ void tst_QNetworkReply::sendCookiesSynchronous()
QNetworkRequest request(url);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply;
@@ -4510,7 +4527,7 @@ void tst_QNetworkReply::httpProxyCommandsSynchronous()
// send synchronous request
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply = manager.get(request);
@@ -4570,7 +4587,7 @@ void tst_QNetworkReply::proxyChange()
manager.setProxy(dummyProxy);
QNetworkReplyPtr reply3 = manager.get(req);
connect(reply3, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(1);
+ QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(int(reply3->error()) > 0);
@@ -5236,6 +5253,7 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply()
// dd if=/dev/zero of=qtbug-12908 bs=16384 count=1 && gzip qtbug-12908 && base64 -w 0 qtbug-12908.gz
QString encodedFile("H4sICDdDaUwAA3F0YnVnLTEyOTA4AO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA");
QByteArray decodedFile = QByteArray::fromBase64(encodedFile.toAscii());
+ QCOMPARE(decodedFile.size(), 63);
MiniHttpServer server(header.toAscii() + decodedFile);
server.doClose = true;
@@ -5248,6 +5266,31 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->size(), qint64(16384));
+ QCOMPARE(reply->readAll(), QByteArray(16384, '\0'));
+}
+
+void tst_QNetworkReply::compressedHttpReplyBrokenGzip()
+{
+ QString header("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 63\r\n\r\n");
+
+ // dd if=/dev/zero of=qtbug-12908 bs=16384 count=1 && gzip qtbug-12908 && base64 -w 0 qtbug-12908.gz
+ // Then change "BMQ" to "BMX"
+ QString encodedFile("H4sICDdDaUwAA3F0YnVnLTEyOTA4AO3BMXEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA");
+ QByteArray decodedFile = QByteArray::fromBase64(encodedFile.toAscii());
+ QCOMPARE(decodedFile.size(), 63);
+
+ MiniHttpServer server(header.toAscii() + decodedFile);
+ server.doClose = true;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::ProtocolFailure);
}
// TODO add similar test for FTP
@@ -5325,7 +5368,7 @@ void tst_QNetworkReply::qtbug13431replyThrottling()
connect(&nam, SIGNAL(finished(QNetworkReply*)), &helper, SLOT(replyFinished(QNetworkReply*)));
// Download a bigger file
- QNetworkRequest netRequest(QUrl("http://qt-test-server/qtest/bigfile"));
+ QNetworkRequest netRequest(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"));
helper.m_reply = nam.get(netRequest);
// Set the throttle
helper.m_reply->setReadBufferSize(36000);
@@ -5456,7 +5499,7 @@ void tst_QNetworkReply::synchronousRequest()
#endif
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply;
@@ -5487,6 +5530,7 @@ void tst_QNetworkReply::synchronousRequest()
reply->deleteLater();
}
+#ifndef QT_NO_OPENSSL
void tst_QNetworkReply::synchronousRequestSslFailure()
{
// test that SSL won't be accepted with self-signed certificate,
@@ -5496,7 +5540,7 @@ void tst_QNetworkReply::synchronousRequestSslFailure()
QUrl url("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
QNetworkRequest request(url);
request.setAttribute(
- static_cast<QNetworkRequest::Attribute>(SynchronousRequestAttribute),
+ QNetworkRequest::SynchronousRequestAttribute,
true);
QNetworkReplyPtr reply;
QSignalSpy sslErrorsSpy(&manager, SIGNAL(sslErrors(QNetworkReply *, const QList<QSslError> &)));
@@ -5505,6 +5549,19 @@ void tst_QNetworkReply::synchronousRequestSslFailure()
QCOMPARE(reply->error(), QNetworkReply::SslHandshakeFailedError);
QCOMPARE(sslErrorsSpy.count(), 0);
}
+#endif
+
+void tst_QNetworkReply::httpAbort()
+{
+ // FIXME: Implement a test that aborts a big HTTP reply
+ // a) after the first readyRead()
+ // b) immediatly after the get()
+ // c) after the finished()
+ // The goal is no crash and no irrelevant signals after the abort
+
+ // FIXME Also implement one where we do a big upload and then abort().
+ // It must not crash either.
+}
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index ce1ff77..c21514b 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -262,6 +262,8 @@ private slots:
void QTBUG14614_gradientCacheRaceCondition();
void drawTextOpacity();
+ void QTBUG17053_zeroDashPattern();
+
private:
void fillData();
void setPenColor(QPainter& p);
@@ -4684,6 +4686,26 @@ void tst_QPainter::drawTextOpacity()
QCOMPARE(image, copy);
}
+void tst_QPainter::QTBUG17053_zeroDashPattern()
+{
+ QImage image(32, 32, QImage::Format_RGB32);
+ image.fill(0xffffffff);
+
+ QImage original = image;
+
+ QVector<qreal> pattern;
+ pattern << qreal(0) << qreal(0);
+
+ QPainter p(&image);
+ QPen pen(Qt::black, 2.0);
+ pen.setDashPattern(pattern);
+
+ p.setPen(pen);
+ p.drawLine(0, 0, image.width(), image.height());
+
+ QCOMPARE(image, original);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index 185ec1a..e73c130 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -25,6 +25,7 @@ wince*: {
LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
contains(QT_CONFIG, openvg) {
LIBS += $$QMAKE_LIBS_OPENVG
+ QT *= openvg
}
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index a8f8b7b..480893a 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -68,6 +68,10 @@
#include <fbs.h>
#include <gdi.h>
#include <bitdev.h>
+#if !defined(QT_NO_OPENVG)
+#include <QtOpenVG/qvg.h>
+#include <QtOpenVG/private/qpixmapdata_vg_p.h>
+#endif
#endif
#ifdef Q_WS_X11
@@ -187,6 +191,10 @@ private slots:
void toImageDeepCopy();
void loadAsBitmapOrPixmap();
+
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ void vgImageReadBack();
+#endif
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1783,6 +1791,104 @@ void tst_QPixmap::toImageDeepCopy()
QVERIFY(first != second);
}
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap);
+class FriendlyVGPixmapData : public QVGPixmapData
+{
+public:
+ FriendlyVGPixmapData(PixelType type) : QVGPixmapData(type) { }
+ bool sourceIsNull() { return source.isNull(); }
+ friend QPixmap pixmapFromVGImage(VGImage image);
+};
+QPixmap pixmapFromVGImage(VGImage image)
+{
+ if (image != VG_INVALID_HANDLE) {
+ int w = vgGetParameteri(image, VG_IMAGE_WIDTH);
+ int h = vgGetParameteri(image, VG_IMAGE_HEIGHT);
+ FriendlyVGPixmapData *pd = new FriendlyVGPixmapData(QPixmapData::PixmapType);
+ pd->resize(w, h);
+ pd->vgImage = image;
+ pd->recreate = false;
+ pd->prevSize = QSize(pd->w, pd->h);
+ return QPixmap(pd);
+ }
+ return QPixmap();
+}
+class Content : public QWidget
+{
+public:
+ void paintEvent(QPaintEvent *) {
+ QPainter painter(this);
+ QColor testPixel(qRgb(200, 150, 100));
+ if (pm.isNull()) { // first phase: create a VGImage
+ painter.beginNativePainting();
+ vgimage = vgCreateImage(VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER);
+ QImage img(20, 10, QImage::Format_ARGB32_Premultiplied);
+ img.fill(qRgb(0, 0, 0));
+ QPainter p(&img);
+ p.fillRect(0, 0, img.width(), img.height(), testPixel);
+ p.end();
+ vgImageSubData(vgimage, img.bits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
+ // Now the area 0,0 20x10 (in OpenVG coords) is filled with some color.
+ painter.endNativePainting();
+ } else { // second phase: check if readback works
+ painter.drawPixmap(0, 0, pm);
+ // Drawing should not cause readback, this is important for performance;
+ noreadback_ok = static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ // However toImage() requires readback.
+ QImage img = pm.toImage();
+ readback_ok = img.width() == pm.width();
+ readback_ok &= img.height() == pm.height();
+ readback_ok &= !static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ uint pix = img.pixel(1, 1);
+ content_ok = qRed(pix) == testPixel.red();
+ content_ok &= qGreen(pix) == testPixel.green();
+ content_ok &= qBlue(pix) == testPixel.blue();
+ pix = img.pixel(img.width() - 1, img.height() - 1);
+ content_ok &= qRed(pix) == 0;
+ content_ok &= qGreen(pix) == 0;
+ content_ok &= qBlue(pix) == 0;
+ }
+ }
+ int w;
+ int h;
+ VGImage vgimage;
+ QPixmap pm;
+ bool noreadback_ok;
+ bool readback_ok;
+ bool content_ok;
+};
+void tst_QPixmap::vgImageReadBack()
+{
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ Content c;
+ c.w = 50;
+ c.h = 60;
+ c.vgimage = VG_INVALID_HANDLE;
+ c.noreadback_ok = c.readback_ok = c.content_ok = false;
+ c.showFullScreen();
+ QTest::qWaitForWindowShown(&c);
+ QVERIFY(c.vgimage != VG_INVALID_HANDLE);
+ QPixmap pm = pixmapFromVGImage(c.vgimage);
+ QVERIFY(!pm.isNull());
+ QCOMPARE(pm.width(), c.w);
+ QCOMPARE(pm.height(), c.h);
+ QVERIFY(qPixmapToVGImage(pm) == c.vgimage);
+ QVERIFY(static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull());
+ c.pm = pm;
+ // Make sure the second phase in paintEvent is executed too.
+ c.hide();
+ c.showFullScreen();
+ QTest::qWaitForWindowShown(&c);
+ QVERIFY(c.noreadback_ok);
+ QVERIFY(c.readback_ok);
+ QVERIFY(c.content_ok);
+ } else {
+ QSKIP("Not using openvg graphicssystem", SkipSingle);
+ }
+}
+#endif // Symbian & OpenVG
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"
diff --git a/tests/auto/qscopedvaluerollback/qscopedvaluerollback.pro b/tests/auto/qscopedvaluerollback/qscopedvaluerollback.pro
new file mode 100644
index 0000000..f06e21b
--- /dev/null
+++ b/tests/auto/qscopedvaluerollback/qscopedvaluerollback.pro
@@ -0,0 +1,4 @@
+load(qttest_p4)
+SOURCES += tst_qscopedvaluerollback.cpp
+QT -= gui
+CONFIG += parallel_test
diff --git a/tests/auto/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
new file mode 100644
index 0000000..956253f
--- /dev/null
+++ b/tests/auto/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtCore/QScopedValueRollback>
+
+/*!
+ \class tst_QScopedValueRollback
+ \internal
+ \since 4.8
+ \brief Tests class QScopedValueRollback.
+
+ */
+class tst_QScopedValueRollback : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void leavingScope();
+ void leavingScopeAfterCommit();
+ void rollbackToPreviousCommit();
+ void exceptions();
+ void earlyExitScope();
+private:
+ void earlyExitScope_helper(int exitpoint, int &member);
+};
+
+void tst_QScopedValueRollback::leavingScope()
+{
+ int i = 0;
+ bool b = false;
+ QString s("This is useful");
+
+ //test rollback on going out of scope
+ {
+ QScopedValueRollback<int> ri(i);
+ QScopedValueRollback<bool> rb(b);
+ QScopedValueRollback<QString> rs(s);
+ QCOMPARE(b, false);
+ QCOMPARE(i, 0);
+ QCOMPARE(s, QString("This is useful"));
+ b = true;
+ i = 1;
+ s = "Useless";
+ QCOMPARE(b, true);
+ QCOMPARE(i, 1);
+ QCOMPARE(s, QString("Useless"));
+ }
+ QCOMPARE(b, false);
+ QCOMPARE(i, 0);
+ QCOMPARE(s, QString("This is useful"));
+}
+
+void tst_QScopedValueRollback::leavingScopeAfterCommit()
+{
+ int i = 0;
+ bool b = false;
+ QString s("This is useful");
+
+ //test rollback on going out of scope
+ {
+ QScopedValueRollback<int> ri(i);
+ QScopedValueRollback<bool> rb(b);
+ QScopedValueRollback<QString> rs(s);
+ QCOMPARE(b, false);
+ QCOMPARE(i, 0);
+ QCOMPARE(s, QString("This is useful"));
+ b = true;
+ i = 1;
+ s = "Useless";
+ QCOMPARE(b, true);
+ QCOMPARE(i, 1);
+ QCOMPARE(s, QString("Useless"));
+ ri.commit();
+ rb.commit();
+ rs.commit();
+ }
+ QCOMPARE(b, true);
+ QCOMPARE(i, 1);
+ QCOMPARE(s, QString("Useless"));
+}
+
+void tst_QScopedValueRollback::rollbackToPreviousCommit()
+{
+ int i=0;
+ {
+ QScopedValueRollback<int> ri(i);
+ i++;
+ ri.commit();
+ i++;
+ }
+ QCOMPARE(i,1);
+ {
+ QScopedValueRollback<int> ri1(i);
+ i++;
+ ri1.commit();
+ i++;
+ ri1.commit();
+ i++;
+ }
+ QCOMPARE(i,3);
+}
+
+void tst_QScopedValueRollback::exceptions()
+{
+ bool b = false;
+ bool caught = false;
+ QT_TRY
+ {
+ QScopedValueRollback<bool> rb(b);
+ b = true;
+ QT_THROW(std::bad_alloc()); //if Qt compiled without exceptions this is noop
+ rb.commit(); //if Qt compiled without exceptions, true is committed
+ }
+ QT_CATCH(...)
+ {
+ caught = true;
+ }
+ QCOMPARE(b, !caught); //expect false if exception was thrown, true otherwise
+}
+
+void tst_QScopedValueRollback::earlyExitScope()
+{
+ int i=0;
+ int j=0;
+ while (true) {
+ QScopedValueRollback<int> ri(i);
+ i++;
+ j=i;
+ if (i>8) break;
+ ri.commit();
+ }
+ QCOMPARE(i,8);
+ QCOMPARE(j,9);
+
+ for (i = 0; i < 5; i++) {
+ j=1;
+ earlyExitScope_helper(i,j);
+ QCOMPARE(j, 1<<i);
+ }
+}
+
+void tst_QScopedValueRollback::earlyExitScope_helper(int exitpoint, int& member)
+{
+ QScopedValueRollback<int> r(member);
+ member *= 2;
+ if (exitpoint == 0)
+ return;
+ r.commit();
+ member *= 2;
+ if (exitpoint == 1)
+ return;
+ r.commit();
+ member *= 2;
+ if (exitpoint == 2)
+ return;
+ r.commit();
+ member *= 2;
+ if (exitpoint == 3)
+ return;
+ r.commit();
+}
+
+QTEST_MAIN(tst_QScopedValueRollback)
+#include "tst_qscopedvaluerollback.moc"
diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp
index 5286a5a..9ab8318 100644
--- a/tests/auto/qscriptclass/tst_qscriptclass.cpp
+++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp
@@ -617,7 +617,7 @@ void tst_QScriptClass::newInstance()
QScriptValue obj1 = eng.newObject(&cls);
QVERIFY(!obj1.data().isValid());
QVERIFY(obj1.prototype().strictlyEquals(cls.prototype()));
- QEXPECT_FAIL("", "classname is not implemented", Continue);
+ QEXPECT_FAIL("", "QTBUG-17599: classname is not implemented", Continue);
QCOMPARE(obj1.toString(), QString::fromLatin1("[object TestClass]"));
QCOMPARE(obj1.scriptClass(), (QScriptClass*)&cls);
@@ -741,7 +741,7 @@ void tst_QScriptClass::getAndSetPropertyFromCpp()
QCOMPARE(obj1.propertyFlags(foo2), foo2Pflags);
QVERIFY(cls.lastQueryPropertyObject().strictlyEquals(obj1));
QVERIFY(cls.lastQueryPropertyName() == foo2);
- QEXPECT_FAIL("", "classObject.getOwnPropertyDescriptor() reads the property value", Continue);
+ QEXPECT_FAIL("", "QTBUG-17601: classObject.getOwnPropertyDescriptor() reads the property value", Continue);
QVERIFY(!cls.lastPropertyObject().isValid());
QVERIFY(cls.lastPropertyFlagsObject().strictlyEquals(obj1));
QVERIFY(cls.lastPropertyFlagsName() == foo2);
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 9d7e896..457188c 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -725,10 +725,7 @@ void tst_QScriptContext::backtrace_data()
expected << "<native>('hey') at -1"
<< "<eval>() at 3"
- << QString::fromLatin1("foo(arg1 = 'hello', arg2 = 456) at testfile:%0")
- // interpreter unfortunately doesn't provide line number for eval()
- .arg(qt_script_isJITEnabled() ? 2 : -1);
- expected
+ << "foo(arg1 = 'hello', arg2 = 456) at testfile:2"
<< "<global>() at testfile:4";
QTest::newRow("eval") << source << expected;
@@ -787,10 +784,7 @@ void tst_QScriptContext::backtrace_data()
expected << "<native>('hey') at -1"
<< "<eval>() at 3"
- << QString::fromLatin1("plop('hello', 456) at testfile:%0")
- // interpreter unfortunately doesn't provide line number for eval()
- .arg(qt_script_isJITEnabled() ? 3 : -1);
- expected
+ << "plop('hello', 456) at testfile:3"
<< "<global>() at testfile:5";
QTest::newRow("eval in member") << source << expected;
@@ -987,6 +981,8 @@ void tst_QScriptContext::backtrace()
QVERIFY(!eng.hasUncaughtException());
QVERIFY(ret.isArray());
QStringList slist = qscriptvalue_cast<QStringList>(ret);
+ QEXPECT_FAIL("eval", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue);
+ QEXPECT_FAIL("eval in member", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue);
QCOMPARE(slist, expectedbacktrace);
}
diff --git a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
index 89c5330..62f899c 100644
--- a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
+++ b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
@@ -151,7 +151,7 @@ void tst_QScriptContextInfo::nativeFunction()
QVERIFY(info.scriptId() != -1);
QCOMPARE(info.fileName(), fileName);
QCOMPARE(info.lineNumber(), lineNumber);
- QEXPECT_FAIL("", "columnNumber doesn't work", Continue);
+ QEXPECT_FAIL("", "QTBUG-17602: columnNumber doesn't work", Continue);
QCOMPARE(info.columnNumber(), 1);
QCOMPARE(info.functionName(), QString());
QCOMPARE(info.functionEndLineNumber(), -1);
@@ -183,7 +183,7 @@ void tst_QScriptContextInfo::scriptFunction()
QVERIFY(info.scriptId() != -1);
QCOMPARE(info.fileName(), fileName);
QCOMPARE(info.lineNumber(), lineNumber + 1);
- QEXPECT_FAIL("", "columnNumber doesn't work", Continue);
+ QEXPECT_FAIL("", "QTBUG-17602: columnNumber doesn't work", Continue);
QCOMPARE(info.columnNumber(), 2);
QCOMPARE(info.functionName(), QString::fromLatin1("bar"));
QCOMPARE(info.functionStartLineNumber(), lineNumber);
@@ -202,7 +202,7 @@ void tst_QScriptContextInfo::scriptFunction()
QVERIFY(info.scriptId() != -1);
QCOMPARE(info.fileName(), fileName);
QCOMPARE(info.lineNumber(), lineNumber + 3);
- QEXPECT_FAIL("", "columnNumber doesn't work", Continue);
+ QEXPECT_FAIL("", "QTBUG-17602: columnNumber doesn't work", Continue);
QCOMPARE(info.columnNumber(), 1);
QCOMPARE(info.functionName(), QString());
QCOMPARE(info.functionEndLineNumber(), -1);
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 589b3b1..bc4091d 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -157,6 +157,7 @@ private slots:
void reportAdditionalMemoryCost();
void gcWithNestedDataStructure();
void processEventsWhileRunning();
+ void throwErrorFromProcessEvents_data();
void throwErrorFromProcessEvents();
void disableProcessEventsInterval();
void stacktrace();
@@ -164,6 +165,7 @@ private slots:
void numberParsing();
void automaticSemicolonInsertion();
void abortEvaluation_notEvaluating();
+ void abortEvaluation_data();
void abortEvaluation();
void abortEvaluation_tryCatch();
void abortEvaluation_fromNative();
@@ -235,6 +237,7 @@ private slots:
void evaluateProgram_multipleEngines();
void evaluateProgram_empty();
void collectGarbageAfterConnect();
+ void collectGarbageAfterNativeArguments();
void promoteThisObjectToQObjectInConstructor();
void scriptValueFromQMetaObject();
@@ -470,10 +473,10 @@ void tst_QScriptEngine::newArray_HooliganTask233836()
{
QScriptEngine eng;
{
+ // According to ECMA-262, this should cause a RangeError.
QScriptValue ret = eng.evaluate("a = new Array(4294967295); a.push('foo')");
- QVERIFY(ret.isNumber());
- QCOMPARE(ret.toInt32(), 0);
- QCOMPARE(eng.evaluate("a[4294967295]").toString(), QString::fromLatin1("foo"));
+ QEXPECT_FAIL("", "ECMA compliance bug in Array.prototype.push: https://bugs.webkit.org/show_bug.cgi?id=55033", Continue);
+ QVERIFY(ret.isError() && ret.toString().contains(QLatin1String("RangeError")));
}
{
QScriptValue ret = eng.newArray(0xFFFFFFFF);
@@ -672,7 +675,8 @@ void tst_QScriptEngine::jsRegExp()
QCOMPARE(r5.toString(), QString::fromLatin1("/foo/gim"));
// In JSC, constructing a RegExp from another produces the same identical object.
// This is different from SpiderMonkey and old back-end.
- QVERIFY(r5.strictlyEquals(r));
+ QEXPECT_FAIL("", "RegExp copy-constructor should return a new object: https://bugs.webkit.org/show_bug.cgi?id=55040", Continue);
+ QVERIFY(!r5.strictlyEquals(r));
QScriptValue r6 = rxCtor.construct(QScriptValueList() << "foo" << "bar");
QVERIFY(r6.isError());
@@ -1316,7 +1320,7 @@ void tst_QScriptEngine::globalObjectProperties()
QCOMPARE(global.propertyFlags("URIError"), QScriptValue::SkipInEnumeration);
QVERIFY(global.property("Math").isObject());
QVERIFY(!global.property("Math").isFunction());
- QEXPECT_FAIL("", "[ECMA compliance] JSC sets DontDelete flag for Math object", Continue);
+ QEXPECT_FAIL("", "[ECMA compliance] JSC sets DontDelete flag for Math object: https://bugs.webkit.org/show_bug.cgi?id=55034", Continue);
QCOMPARE(global.propertyFlags("Math"), QScriptValue::SkipInEnumeration);
}
@@ -2960,17 +2964,42 @@ public:
QScriptEngine *engine;
};
+void tst_QScriptEngine::throwErrorFromProcessEvents_data()
+{
+ QTest::addColumn<QString>("script");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("while (1)")
+ << QString::fromLatin1("while (1) { }")
+ << QString::fromLatin1("Error: Killed");
+ QTest::newRow("while (1) i++")
+ << QString::fromLatin1("i = 0; while (1) { i++; }")
+ << QString::fromLatin1("Error: Killed");
+ // Unlike abortEvaluation(), scripts should be able to catch the
+ // exception.
+ QTest::newRow("try catch")
+ << QString::fromLatin1("try {"
+ " while (1) { }"
+ "} catch(e) {"
+ " throw new Error('Caught');"
+ "}")
+ << QString::fromLatin1("Error: Caught");
+}
+
void tst_QScriptEngine::throwErrorFromProcessEvents()
{
+ QFETCH(QString, script);
+ QFETCH(QString, error);
+
QScriptEngine eng;
EventReceiver2 receiver(&eng);
QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1)));
eng.setProcessEventsInterval(100);
- QScriptValue ret = eng.evaluate(QString::fromLatin1("while (1) { }"));
+ QScriptValue ret = eng.evaluate(script);
QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("Error: Killed"));
+ QCOMPARE(ret.toString(), error);
}
void tst_QScriptEngine::disableProcessEventsInterval()
@@ -3385,8 +3414,26 @@ void tst_QScriptEngine::abortEvaluation_notEvaluating()
}
}
+void tst_QScriptEngine::abortEvaluation_data()
+{
+ QTest::addColumn<QString>("script");
+
+ QTest::newRow("while (1)")
+ << QString::fromLatin1("while (1) { }");
+ QTest::newRow("while (1) i++")
+ << QString::fromLatin1("i = 0; while (1) { i++; }");
+ QTest::newRow("try catch")
+ << QString::fromLatin1("try {"
+ " while (1) { }"
+ "} catch(e) {"
+ " throw new Error('Caught');"
+ "}");
+}
+
void tst_QScriptEngine::abortEvaluation()
{
+ QFETCH(QString, script);
+
QScriptEngine eng;
EventReceiver3 receiver(&eng);
@@ -3394,7 +3441,7 @@ void tst_QScriptEngine::abortEvaluation()
for (int x = 0; x < 4; ++x) {
QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1)));
receiver.resultType = EventReceiver3::AbortionResult(x);
- QScriptValue ret = eng.evaluate(QString::fromLatin1("while (1) { }"));
+ QScriptValue ret = eng.evaluate(script);
switch (receiver.resultType) {
case EventReceiver3::None:
QVERIFY(!eng.hasUncaughtException());
@@ -4201,7 +4248,8 @@ void tst_QScriptEngine::getterSetterThisObject_activation()
// read
eng.evaluate("act.__defineGetter__('x', function() { return this; })");
QVERIFY(eng.evaluate("x === act").toBoolean());
- QEXPECT_FAIL("", "Exotic overload (don't care for now)", Continue);
+ QEXPECT_FAIL("", "QTBUG-17605: Not possible to implement local variables as getter/setter properties", Abort);
+ QVERIFY(!eng.hasUncaughtException());
QVERIFY(eng.evaluate("with (act) x").equals("foo"));
QVERIFY(eng.evaluate("(function() { with (act) return x; })() === act").toBoolean());
eng.evaluate("q = {}; with (act) with (q) x").equals(eng.evaluate("act"));
@@ -5332,7 +5380,7 @@ void tst_QScriptEngine::functionScopes()
// top-level functions have only the global object in their scope
QScriptValue fun = eng.evaluate("(function() {})");
QVERIFY(fun.isFunction());
- QEXPECT_FAIL("", "Function scope proxying is not implemented", Abort);
+ QEXPECT_FAIL("", "QScriptValue::scope() is internal, not implemented", Abort);
QVERIFY(fun.scope().isObject());
QVERIFY(fun.scope().strictlyEquals(eng.globalObject()));
QVERIFY(!eng.globalObject().scope().isValid());
@@ -5641,6 +5689,16 @@ void tst_QScriptEngine::collectGarbageAfterConnect()
QVERIFY(widget == 0);
}
+void tst_QScriptEngine::collectGarbageAfterNativeArguments()
+{
+ // QTBUG-17788
+ QScriptEngine eng;
+ QScriptContext *ctx = eng.pushContext();
+ QScriptValue arguments = ctx->argumentsObject();
+ // Shouldn't crash when marking the arguments object.
+ collectGarbage_helper(eng);
+}
+
static QScriptValue constructQObjectFromThisObject(QScriptContext *ctx, QScriptEngine *eng)
{
Q_ASSERT(ctx->isCalledAsConstructor());
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index d89f9f1..065f099 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -1291,7 +1291,7 @@ void tst_QScriptEngineAgent::positionChange_1()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, lineNumber);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 8);
// 5 + 6
@@ -1326,7 +1326,7 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QVERIFY(spy->at(1).scriptId != spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, lineNumber);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 18);
}
@@ -1345,7 +1345,7 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 11);
}
@@ -1376,14 +1376,14 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 31);
// void(i)
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 31);
}
@@ -1402,21 +1402,21 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 12);
// ++i
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 28);
// ++i
QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(3).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(3).columnNumber, 28);
}
@@ -1435,28 +1435,28 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 12);
// ++i
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 17);
// do
QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(3).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(3).columnNumber, 12);
// ++i
QCOMPARE(spy->at(4).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(4).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(4).columnNumber, 17);
}
@@ -1487,7 +1487,7 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 15);
}
@@ -1506,14 +1506,14 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 32);
// continue
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 32);
}
@@ -1556,7 +1556,7 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 31);
}
@@ -1575,14 +1575,14 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 38);
// break
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 45);
}
@@ -1607,21 +1607,21 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange);
QVERIFY(spy->at(0).scriptId != -1);
QCOMPARE(spy->at(0).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(0).columnNumber, 7);
// i = e
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 29);
// i = 2
QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(2).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(2).columnNumber, 48);
}
@@ -1634,14 +1634,14 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange);
QVERIFY(spy->at(0).scriptId != -1);
QCOMPARE(spy->at(0).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(0).columnNumber, 7);
// i = 3
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 46);
}
@@ -1663,7 +1663,7 @@ void tst_QScriptEngineAgent::positionChange_2()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
QCOMPARE(spy->at(1).lineNumber, 1);
- QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue);
+ QEXPECT_FAIL("", "QTBUG-17609: With JSC-based back-end, column number is always reported as 1", Continue);
QCOMPARE(spy->at(1).columnNumber, 20);
}
delete spy;
@@ -2247,8 +2247,7 @@ void tst_QScriptEngineAgent::syntaxError()
QCOMPARE(spy->at(i).scriptId, spy->at(0).scriptId);
QVERIFY(!spy->at(i).hasExceptionHandler);
QVERIFY(spy->at(i).value.isError());
- QEXPECT_FAIL("","QTBUG-6137 There are other messages in JSC",Continue);
- QCOMPARE(spy->at(i).value.toString(), QString("SyntaxError: Expected `}'"));
+ QVERIFY(spy->at(i).value.toString().contains(QLatin1String("SyntaxError")));
QCOMPARE(spy->at(i).scriptId, spy->at(0).scriptId);
i = 7;
//exit script
diff --git a/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp
index 1679512..c4fb0e3 100644
--- a/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp
+++ b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp
index b13f723..e4b9e4e 100644
--- a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp
+++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp b/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp
index e8b5e0a..78e949c 100644
--- a/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp
+++ b/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
index 1607bed..c53abcb 100644
--- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
+++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
@@ -1008,8 +1008,9 @@ void tst_QScriptExtQObject::getSetStaticProperty_methodPersistence()
QVERIFY(slot.isFunction());
QScriptValue sameSlot = m_engine->evaluate("myObject.mySlot");
QVERIFY(sameSlot.strictlyEquals(slot));
- sameSlot = m_engine->evaluate("myObject[mySlot()]");
- QEXPECT_FAIL("", "Signature-based method lookup creates new function wrapper object", Continue);
+ sameSlot = m_engine->evaluate("myObject['mySlot()']");
+ QVERIFY(sameSlot.isFunction());
+ QEXPECT_FAIL("", "QTBUG-17611: Signature-based method lookup creates new function wrapper object", Continue);
QVERIFY(sameSlot.strictlyEquals(slot));
}
}
@@ -1103,7 +1104,7 @@ void tst_QScriptExtQObject::getSetDynamicProperty_doNotHideJSProperty()
val.setProperty("x", 42);
m_myObject->setProperty("x", 2222);
- QEXPECT_FAIL("", "", Continue);
+ QEXPECT_FAIL("", "QTBUG-17612: Dynamic C++ property overrides JS property", Continue);
// JS should see the original JS value
QVERIFY(val.property("x").strictlyEquals(QScriptValue(m_engine, 42)));
diff --git a/tests/auto/qscriptjstestsuite/expect_fail.txt b/tests/auto/qscriptjstestsuite/expect_fail.txt
new file mode 100644
index 0000000..7f93378
--- /dev/null
+++ b/tests/auto/qscriptjstestsuite/expect_fail.txt
@@ -0,0 +1,198 @@
+ecma/Array/15.4.3.1-2.js | var props = ''; for ( p in Array ) { props += p } props
+
+ecma/Boolean/15.6.3.1-1.js | var str='';for ( p in Boolean ) { str += p } str;
+
+ecma/Expressions/11.4.1.js | var abc; delete(abc)
+
+ecma/FunctionObjects/15.3.3.1-2.js | var str='';for (prop in Function ) str += prop; str;
+
+ecma/ObjectObjects/15.2.3.1-1.js | var str = '';for ( p in Object ) { str += p; }; str
+
+ecma/Statements/12.6.3-11.js | result = ""; for ( p in Number ) { result += String(p) };
+ecma/Statements/12.6.3-2.js | Boolean.prototype.foo = 34; for ( j in Boolean ) Boolean[j]
+
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4256) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4257) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4258) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4259) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4260) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4261) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4262) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4263) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4264) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4265) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4266) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4267) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4268) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4269) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4270) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4271) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4272) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4273) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4274) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4275) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4276) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4277) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4278) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4279) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4280) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4281) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4282) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4283) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4284) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4285) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4286) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4287) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4288) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4289) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4290) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4291) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4292) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-2.js | var s = new String( String.fromCharCode(4293) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-5.js | var s = new String( String.fromCharCode(1024) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.11-5.js | var s = new String( String.fromCharCode(1037) ); s.toLowerCase().charCodeAt(0)
+ecma/String/15.5.4.12-1.js | var s = new String( String.fromCharCode(181) ); s.toUpperCase().charCodeAt(0)
+ecma/String/15.5.4.12-1.js | var s = new String( String.fromCharCode(329) ); s.toUpperCase().charCodeAt(0)
+ecma/String/15.5.4.12-4.js | var s = new String( String.fromCharCode(1104) ); s.toUpperCase().charCodeAt(0)
+ecma/String/15.5.4.12-4.js | var s = new String( String.fromCharCode(1117) ); s.toUpperCase().charCodeAt(0)
+ecma/String/15.5.4.12-5.js | var s = new String( String.fromCharCode(1415) ); s.toUpperCase().charCodeAt(0)
+
+ecma/TypeConversion/9.3.1-3.js | -"\u20001234\u2001"
+ecma/TypeConversion/9.3.1-3.js | - "-0x123456789abcde8"
+
+ecma/extensions/15.1.2.1-1.js | var PROPS = ''; for ( p in eval ) { PROPS += p }; PROPS
+
+ecma/GlobalObject/15.1.2.2-1.js | var PROPS=''; for ( var p in parseInt ) { PROPS += p; }; PROPS
+ecma/GlobalObject/15.1.2.3-1.js | var MYPROPS=''; for ( var p in parseFloat ) { MYPROPS += p }; MYPROPS
+ecma/GlobalObject/15.1.2.4.js | var MYPROPS=''; for ( var p in escape ) { MYPROPS+= p}; MYPROPS
+ecma/GlobalObject/15.1.2.5-1.js | var MYPROPS=''; for ( var p in unescape ) { MYPROPS+= p }; MYPROPS
+ecma/GlobalObject/15.1.2.6.js | var MYPROPS=''; for ( var p in isNaN ) { MYPROPS+= p }; MYPROPS
+ecma/GlobalObject/15.1.2.7.js | var MYPROPS=''; for ( p in isFinite ) { MYPROPS+= p }; MYPROPS
+
+ecma_3/Array/15.4.5.1-01.js | 15.4.5.1 - array.length coverage
+
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 0
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 1
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 2
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 3
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 4
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 5
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 6
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 7
+ecma_3/extensions/regress-274152.js | Do not ignore unicode format-control characters: 8
+ecma_3/extensions/regress-368516.js | Treat unicode BOM characters as whitespace: 0
+ecma_3/extensions/regress-368516.js | Treat unicode BOM characters as whitespace: 1
+
+ecma_3/Date/15.9.4.3.js | 15.9.4.3 - Date.UTC edge-case arguments.: date Infinity
+ecma_3/Date/15.9.4.3.js | 15.9.4.3 - Date.UTC edge-case arguments.: hours Infinity
+ecma_3/Date/15.9.4.3.js | 15.9.4.3 - Date.UTC edge-case arguments.: minutes Infinity
+ecma_3/Date/15.9.4.3.js | 15.9.4.3 - Date.UTC edge-case arguments.: seconds Infinity
+ecma_3/Function/regress-131964.js | Section 1 of test -
+ecma_3/Function/regress-313570.js | length of objects whose prototype chain includes a function: immutable
+ecma_3/FunExpr/fe-001.js | Both functions were defined.
+
+ecma_3/LexicalConventions/7.9.1.js | Automatic Semicolon insertion in postfix expressions: expr\n++
+ecma_3/LexicalConventions/7.9.1.js | Automatic Semicolon insertion in postfix expressions: expr\n--
+ecma_3/LexicalConventions/7.9.1.js | Automatic Semicolon insertion in postfix expressions: (x\n)-- y
+ecma_3/LexicalConventions/7.9.1.js | Automatic Semicolon insertion in postfix expressions: (x)-- y
+
+ecma_3/Object/8.6.1-01.js | In strict mode, setting a read-only property should generate a warning: Throw if STRICT and WERROR is enabled
+
+ecma_3/Operators/order-01.js | operator evaluation order: 11.8.2 >
+ecma_3/Operators/order-01.js | operator evaluation order: 11.8.4 >=
+
+ecma_3/RegExp/15.10.2-1.js | Section 7 of test - \nregexp = /(z)((a+)?(b+)?(c))*/\nstring = 'zaacbbbcac'\nERROR !!! regexp failed to give expected match array:\nExpect: ["zaacbbbcac", "z", "ac", "a", , "c"]\nActual: ["zaacbbbcac", "z", "ac", "a", "bbb", "c"]\n
+ecma_3/RegExp/15.10.2-1.js | Section 8 of test - \nregexp = /(a*)*/\nstring = 'b'\nERROR !!! regexp failed to give expected match array:\nExpect: ["", , ]\nActual: ["", ""]\n
+ecma_3/RegExp/15.10.2-1.js | Section 12 of test - \nregexp = /(.*?)a(?!(a+)b\2c)\2(.*)/\nstring = 'baaabaac'\nERROR !!! regexp failed to give expected match array:\nExpect: ["baaabaac", "ba", , "abaac"]\nActual: ["baaabaac", "ba", "aa", "abaac"]\n
+ecma_3/RegExp/perlstress-001.js | Section 218 of test - \nregexp = /((foo)|(bar))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: ["foobar", "bar", , "bar"]\nActual: ["foobar", "bar", "foo", "bar"]\n
+ecma_3/RegExp/perlstress-001.js | Section 234 of test - \nregexp = /(?:(f)(o)(o)|(b)(a)(r))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: ["foobar", , , , "b", "a", "r"]\nActual: ["foobar", "f", "o", "o", "b", "a", "r"]\n
+ecma_3/RegExp/perlstress-001.js | Section 241 of test - \nregexp = /^(?:b|a(?=(.)))*\1/\nstring = 'abc'\nERROR !!! regexp failed to give expected match array:\nExpect: ["ab", , ]\nActual: ["ab", "b"]\n
+ecma_3/RegExp/perlstress-001.js | Section 412 of test - \nregexp = /^(a(b)?)+$/\nstring = 'aba'\nERROR !!! regexp failed to give expected match array:\nExpect: ["aba", "a", , ]\nActual: ["aba", "a", "b"]\n
+ecma_3/RegExp/perlstress-001.js | Section 413 of test - \nregexp = /^(aa(bb)?)+$/\nstring = 'aabbaa'\nERROR !!! regexp failed to give expected match array:\nExpect: ["aabbaa", "aa", , ]\nActual: ["aabbaa", "aa", "bb"]\n
+
+ecma_3/RegExp/regress-209919.js | Section 1 of test - \nregexp = /(a|b*)*/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: ["a", "a"]\nActual: ["a", ""]\n
+ecma_3/RegExp/regress-209919.js | Section 3 of test - \nregexp = /(b*)*/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: ["", , ]\nActual: ["", ""]\n
+ecma_3/RegExp/regress-209919.js | Section 5 of test - \nregexp = /^\-?(\d{1,}|\.{0,})*(\,\d{1,})?$/\nstring = '100.00'\nERROR !!! regexp failed to give expected match array:\nExpect: ["100.00", "00", , ]\nActual: ["100.00", "", , ]\n
+ecma_3/RegExp/regress-209919.js | Section 6 of test - \nregexp = /^\-?(\d{1,}|\.{0,})*(\,\d{1,})?$/\nstring = '100,00'\nERROR !!! regexp failed to give expected match array:\nExpect: ["100,00", "100", ",00"]\nActual: ["100,00", "", ",00"]\n
+ecma_3/RegExp/regress-209919.js | Section 7 of test - \nregexp = /^\-?(\d{1,}|\.{0,})*(\,\d{1,})?$/\nstring = '1.000,00'\nERROR !!! regexp failed to give expected match array:\nExpect: ["1.000,00", "000", ",00"]\nActual: ["1.000,00", "", ",00"]\n
+
+ecma_3/String/15.5.4.11.js | Section 7
+ecma_3/String/15.5.4.11.js | Section 24
+ecma_3/String/15.5.4.11.js | Section 26
+ecma_3/String/15.5.4.11.js | Section 28
+ecma_3/String/15.5.4.11.js | Section 30
+ecma_3/String/15.5.4.14.js | 15.5.4.14 - String.prototype.split(/()/)
+
+ecma_3/Unicode/regress-352044-01.js | issues with Unicode escape sequences in JavaScript source code
+ecma_3/Unicode/uc-001.js | Unicode format-control character test (Category Cf.)
+
+ecma_2/RegExp/exec-001.js | NO TESTS EXIST
+ecma_2/String/replace-001.js | NO TESTS EXIST
+
+[Q_CC_MSVC]
+ecma_3/Expressions/11.7.3-01.js | 11.7.3 - >>> should evaluate operands in order: order | QTBUG-8056
+ecma_3/Operators/order-01.js | operator evaluation order: 11.7.3 >>> | QTBUG-8056
+ecma_3/Operators/order-01.js | operator evaluation order: 11.13.2 >>>= | QTBUG-8056
+
+[Q_CC_MINGW]
+ecma/Math/15.8.2.13.js | Math.pow(NaN,0)
+ecma/Math/15.8.2.13.js | Math.pow(NaN,-0)
+ecma/Math/15.8.2.5.js | Math.atan2(Infinity, Infinity)
+ecma/Math/15.8.2.5.js | Math.atan2(Infinity, -Infinity)
+ecma/Math/15.8.2.5.js | Math.atan2(-Infinity, Infinity)
+ecma/Math/15.8.2.5.js | Math.atan2(-Infinity, -Infinity)
+
+[Q_OS_SOLARIS]
+ecma/Expressions/11.13.2-2.js | VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1
+ecma/Expressions/11.13.2-2.js | VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1
+ecma/Expressions/11.13.2-2.js | VAR1 = 1; VAR2= -0; VAR1 /= VAR2
+ecma/Expressions/11.13.2-2.js | VAR1 = -1; VAR2= -0; VAR1 /= VAR2
+ecma/Expressions/11.5.2.js | Number.POSITIVE_INFINITY / -0
+ecma/Expressions/11.5.2.js | Number.NEGATIVE_INFINITY / -0
+ecma/Expressions/11.5.2.js | 1 / -0
+ecma/Expressions/11.5.2.js | -1 / -0
+ecma/Math/15.8.2.10.js | Math.log(-0.0000001)
+ecma/Math/15.8.2.10.js | Math.log(-1)
+ecma/Math/15.8.2.11.js | Infinity/Math.max(-0,-0)
+ecma/Math/15.8.2.12.js | Infinity/Math.min(0,-0)
+ecma/Math/15.8.2.12.js | Infinity/Math.min(-0,-0)
+ecma/Math/15.8.2.13.js | Math.pow(NaN,0)
+ecma/Math/15.8.2.13.js | Math.pow(NaN,-0)
+ecma/Math/15.8.2.13.js | Infinity/Math.pow(-Infinity, -1)
+ecma/Math/15.8.2.13.js | Math.pow(0, -1)
+ecma/Math/15.8.2.13.js | Math.pow(0, -0.5)
+ecma/Math/15.8.2.13.js | Math.pow(0, -1000)
+ecma/Math/15.8.2.13.js | Infinity/Math.pow(-0, 1)
+ecma/Math/15.8.2.13.js | Infinity/Math.pow(-0, 3)
+ecma/Math/15.8.2.13.js | Math.pow(-0, -2)
+ecma/Math/15.8.2.15.js | Infinity/Math.round(-0)
+ecma/Math/15.8.2.15.js | Infinity/Math.round(-0.49)
+ecma/Math/15.8.2.15.js | Infinity/Math.round(-0.5)
+ecma/Math/15.8.2.17.js | Infinity/Math.sqrt(-0)
+ecma/Math/15.8.2.18.js | Infinity/Math.tan(-0)
+ecma/Math/15.8.2.2.js | Math.acos(1.00000001)
+ecma/Math/15.8.2.2.js | Math.acos(11.00000001)
+ecma/Math/15.8.2.3.js | Math.asin(1.000001)
+ecma/Math/15.8.2.3.js | Math.asin(-1.000001)
+ecma/Math/15.8.2.3.js | Infinity/Math.asin(-0)
+ecma/Math/15.8.2.4.js | Infinity/Math.atan(-0)
+ecma/Math/15.8.2.5.js | Math.atan2(0, -0)
+ecma/Math/15.8.2.5.js | Infinity/Math.atan2(-0, 1)
+ecma/Math/15.8.2.5.js | Math.atan2(-0,\t-0)
+ecma/Math/15.8.2.5.js | Math.atan2(-0,\t-1)
+ecma/Math/15.8.2.6.js | Infinity/Math.ceil('-0')
+ecma/Math/15.8.2.6.js | Infinity/Math.ceil(-0)
+ecma/Math/15.8.2.6.js | Infinity/Math.ceil(-Number.MIN_VALUE)
+ecma/Math/15.8.2.6.js | Infinity/Math.ceil(-0.9)
+ecma/Math/15.8.2.9.js | Infinity/Math.floor(-0)
+ecma/TypeConversion/9.3.1-3.js | var z = 0; print(1/-z)
+ecma/TypeConversion/9.3.1-3.js | 1/-1e-2000
+
+[Q_OS_SYMBIAN]
+ecma/Math/15.8.2.13.js | Math.pow(-1, 0.5)
+ecma/Math/15.8.2.13.js | Math.pow(-1, -0.5)
+ecma_3/Operators/order-01.js | operator evaluation order: 11.5.1 *
+ecma_3/Operators/order-01.js | operator evaluation order: 11.5.2 /
+ecma_3/Operators/order-01.js | operator evaluation order: 11.6.2 -
+ecma_3/Operators/order-01.js | operator evaluation order: 11.13.2 *=
+ecma_3/Operators/order-01.js | operator evaluation order: 11.13.2 /=
diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
index b1ddd64..471aa02 100644
--- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
+++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
@@ -1,6 +1,8 @@
load(qttest_p4)
QT = core script
SOURCES += tst_qscriptjstestsuite.cpp
+RESOURCES += qscriptjstestsuite.qrc
+include(../qscriptv8testsuite/abstracttestsuite.pri)
!symbian: DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.qrc b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.qrc
new file mode 100644
index 0000000..4a4eb60
--- /dev/null
+++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>expect_fail.txt</file>
+ <file>skip.txt</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qscriptjstestsuite/skip.txt b/tests/auto/qscriptjstestsuite/skip.txt
new file mode 100644
index 0000000..2dc0ccb
--- /dev/null
+++ b/tests/auto/qscriptjstestsuite/skip.txt
@@ -0,0 +1,9 @@
+.+/15\.9\.2\..+ | unstable on slow machines
+.+/15\.9\.5\..+ | too slooow
+regress-130451.js | asserts
+regress-322135-01.js | asserts
+regress-322135-02.js | asserts
+regress-322135-03.js | takes forever
+regress-322135-04.js | takes forever
+ecma_3/RegExp/regress-375715-04.js | bug
+ecma_3/RegExp/regress-289669.js | Can fail due to relying on wall-clock time
diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
index 43a6dba..e042dfe 100644
--- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
+++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
@@ -40,44 +40,18 @@
****************************************************************************/
+#include "abstracttestsuite.h"
#include <QtTest/QtTest>
#include <QtScript>
#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
+# define SRCDIR "."
#endif
//TESTED_CLASS=
//TESTED_FILES=
-// Uncomment the following define to have the autotest generate
-// addExpectedFailure() code for all the tests that fail.
-// This is useful when a whole new test (sub)suite is added.
-// The code is stored in addexpectedfailures.cpp.
-// Paste the contents into this file after the existing
-// addExpectedFailure() calls.
-
-//#define GENERATE_ADDEXPECTEDFAILURE_CODE
-
-static QString readFile(const QString &filename)
-{
- QFile file(filename);
- if (!file.open(QFile::ReadOnly))
- return QString();
- QTextStream stream(&file);
- return stream.readAll();
-}
-
-static void appendCString(QVector<char> *v, const char *s)
-{
- char c;
- do {
- c = *(s++);
- *v << c;
- } while (c != '\0');
-}
-
struct TestRecord
{
TestRecord() : lineNumber(-1) { }
@@ -120,17 +94,18 @@ struct FailureItem
QString message;
};
-class tst_Suite : public QObject
+class tst_QScriptJSTestSuite : public AbstractTestSuite
{
public:
- tst_Suite();
- virtual ~tst_Suite();
+ tst_QScriptJSTestSuite();
+ virtual ~tst_QScriptJSTestSuite();
- static QMetaObject staticMetaObject;
- virtual const QMetaObject *metaObject() const;
- virtual void *qt_metacast(const char *);
- virtual int qt_metacall(QMetaObject::Call, int, void **argv);
+protected:
+ virtual void configData(TestConfig::Mode mode, const QStringList &parts);
+ virtual void writeSkipConfigFile(QTextStream &);
+ virtual void writeExpectFailConfigFile(QTextStream &);
+ virtual void runTestFunction(int testIndex);
private:
void addExpectedFailure(const QString &fileName, const QString &description, const QString &message);
@@ -143,33 +118,11 @@ private:
void addFileExclusion(const QRegExp &rx, const QString &message);
bool isExcludedFile(const QString &fileName, QString *message) const;
- QDir testsDir;
QList<QString> subSuitePaths;
QList<FailureItem> expectedFailures;
QList<QPair<QRegExp, QString> > fileExclusions;
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- QString generatedAddExpectedFailureCode;
-#endif
};
-QMetaObject tst_Suite::staticMetaObject;
-
-Q_GLOBAL_STATIC(QVector<uint>, qt_meta_data_tst_Suite)
-Q_GLOBAL_STATIC(QVector<char>, qt_meta_stringdata_tst_Suite)
-
-const QMetaObject *tst_Suite::metaObject() const
-{
- return &staticMetaObject;
-}
-
-void *tst_Suite::qt_metacast(const char *_clname)
-{
- if (!_clname) return 0;
- if (!strcmp(_clname, qt_meta_stringdata_tst_Suite()->constData()))
- return static_cast<void*>(const_cast<tst_Suite*>(this));
- return QObject::qt_metacast(_clname);
-}
-
static QScriptValue qscript_void(QScriptContext *, QScriptEngine *eng)
{
return eng->undefinedValue();
@@ -222,625 +175,245 @@ static QScriptValue qscript_TestCase(QScriptContext *ctx, QScriptEngine *eng)
return ret;
}
-int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+void tst_QScriptJSTestSuite::runTestFunction(int testIndex)
{
- _id = QObject::qt_metacall(_c, _id, _a);
- if (_id < 0)
- return _id;
- if (_c == QMetaObject::InvokeMetaMethod) {
- if (!(_id & 1)) {
- // data
- QTest::addColumn<TestRecord>("record");
- bool hasData = false;
-
- QString testsShellPath = testsDir.absoluteFilePath("shell.js");
- QString testsShellContents = readFile(testsShellPath);
-
- QDir subSuiteDir(subSuitePaths.at(_id / 2));
- QString subSuiteShellPath = subSuiteDir.absoluteFilePath("shell.js");
- QString subSuiteShellContents = readFile(subSuiteShellPath);
-
- QDir testSuiteDir(subSuiteDir);
- testSuiteDir.cdUp();
- QString suiteJsrefPath = testSuiteDir.absoluteFilePath("jsref.js");
- QString suiteJsrefContents = readFile(suiteJsrefPath);
- QString suiteShellPath = testSuiteDir.absoluteFilePath("shell.js");
- QString suiteShellContents = readFile(suiteShellPath);
-
- QFileInfoList testFileInfos = subSuiteDir.entryInfoList(QStringList() << "*.js", QDir::Files);
- foreach (QFileInfo tfi, testFileInfos) {
- if ((tfi.fileName() == "shell.js") || (tfi.fileName() == "browser.js"))
- continue;
-
- QString abspath = tfi.absoluteFilePath();
- QString relpath = testsDir.relativeFilePath(abspath);
- QString excludeMessage;
- if (isExcludedFile(relpath, &excludeMessage)) {
- QTest::newRow(relpath.toLatin1()) << TestRecord(excludeMessage, relpath);
- continue;
- }
+ if (!(testIndex & 1)) {
+ // data
+ QTest::addColumn<TestRecord>("record");
+ bool hasData = false;
+
+ QString testsShellPath = testsDir.absoluteFilePath("shell.js");
+ QString testsShellContents = readFile(testsShellPath);
+
+ QDir subSuiteDir(subSuitePaths.at(testIndex / 2));
+ QString subSuiteShellPath = subSuiteDir.absoluteFilePath("shell.js");
+ QString subSuiteShellContents = readFile(subSuiteShellPath);
+
+ QDir testSuiteDir(subSuiteDir);
+ testSuiteDir.cdUp();
+ QString suiteJsrefPath = testSuiteDir.absoluteFilePath("jsref.js");
+ QString suiteJsrefContents = readFile(suiteJsrefPath);
+ QString suiteShellPath = testSuiteDir.absoluteFilePath("shell.js");
+ QString suiteShellContents = readFile(suiteShellPath);
+
+ QFileInfoList testFileInfos = subSuiteDir.entryInfoList(QStringList() << "*.js", QDir::Files);
+ foreach (QFileInfo tfi, testFileInfos) {
+ if ((tfi.fileName() == "shell.js") || (tfi.fileName() == "browser.js"))
+ continue;
+
+ QString abspath = tfi.absoluteFilePath();
+ QString relpath = testsDir.relativeFilePath(abspath);
+ QString excludeMessage;
+ if (isExcludedFile(relpath, &excludeMessage)) {
+ QTest::newRow(relpath.toLatin1()) << TestRecord(excludeMessage, relpath);
+ continue;
+ }
- QScriptEngine eng;
- QScriptValue global = eng.globalObject();
- global.setProperty("print", eng.newFunction(qscript_void));
- global.setProperty("quit", eng.newFunction(qscript_quit));
- global.setProperty("options", eng.newFunction(qscript_options));
-
- eng.evaluate(testsShellContents, testsShellPath);
- if (eng.hasUncaughtException()) {
- QStringList bt = eng.uncaughtExceptionBacktrace();
- QString err = eng.uncaughtException().toString();
- qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
- break;
- }
+ QScriptEngine eng;
+ QScriptValue global = eng.globalObject();
+ global.setProperty("print", eng.newFunction(qscript_void));
+ global.setProperty("quit", eng.newFunction(qscript_quit));
+ global.setProperty("options", eng.newFunction(qscript_options));
+
+ eng.evaluate(testsShellContents, testsShellPath);
+ if (eng.hasUncaughtException()) {
+ QStringList bt = eng.uncaughtExceptionBacktrace();
+ QString err = eng.uncaughtException().toString();
+ qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
+ break;
+ }
- eng.evaluate(suiteJsrefContents, suiteJsrefPath);
- if (eng.hasUncaughtException()) {
- QStringList bt = eng.uncaughtExceptionBacktrace();
- QString err = eng.uncaughtException().toString();
- qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
- break;
- }
+ eng.evaluate(suiteJsrefContents, suiteJsrefPath);
+ if (eng.hasUncaughtException()) {
+ QStringList bt = eng.uncaughtExceptionBacktrace();
+ QString err = eng.uncaughtException().toString();
+ qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
+ break;
+ }
- eng.evaluate(suiteShellContents, suiteShellPath);
- if (eng.hasUncaughtException()) {
- QStringList bt = eng.uncaughtExceptionBacktrace();
- QString err = eng.uncaughtException().toString();
- qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
- break;
- }
+ eng.evaluate(suiteShellContents, suiteShellPath);
+ if (eng.hasUncaughtException()) {
+ QStringList bt = eng.uncaughtExceptionBacktrace();
+ QString err = eng.uncaughtException().toString();
+ qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
+ break;
+ }
- eng.evaluate(subSuiteShellContents, subSuiteShellPath);
- if (eng.hasUncaughtException()) {
- QStringList bt = eng.uncaughtExceptionBacktrace();
- QString err = eng.uncaughtException().toString();
- qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
- break;
- }
+ eng.evaluate(subSuiteShellContents, subSuiteShellPath);
+ if (eng.hasUncaughtException()) {
+ QStringList bt = eng.uncaughtExceptionBacktrace();
+ QString err = eng.uncaughtException().toString();
+ qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
+ break;
+ }
- QScriptValue origTestCaseCtor = global.property("TestCase");
- QScriptValue myTestCaseCtor = eng.newFunction(qscript_TestCase);
- myTestCaseCtor.setData(origTestCaseCtor);
- global.setProperty("TestCase", myTestCaseCtor);
+ QScriptValue origTestCaseCtor = global.property("TestCase");
+ QScriptValue myTestCaseCtor = eng.newFunction(qscript_TestCase);
+ myTestCaseCtor.setData(origTestCaseCtor);
+ global.setProperty("TestCase", myTestCaseCtor);
- global.setProperty("gTestfile", tfi.fileName());
- global.setProperty("gTestsuite", testSuiteDir.dirName());
- global.setProperty("gTestsubsuite", subSuiteDir.dirName());
- QString testFileContents = readFile(abspath);
+ global.setProperty("gTestfile", tfi.fileName());
+ global.setProperty("gTestsuite", testSuiteDir.dirName());
+ global.setProperty("gTestsubsuite", subSuiteDir.dirName());
+ QString testFileContents = readFile(abspath);
// qDebug() << relpath;
- eng.evaluate(testFileContents, abspath);
- if (eng.hasUncaughtException() && !relpath.endsWith("-n.js")) {
- QStringList bt = eng.uncaughtExceptionBacktrace();
- QString err = eng.uncaughtException().toString();
- qWarning("%s\n%s\n", qPrintable(err), qPrintable(bt.join("\n")));
- continue;
- }
+ eng.evaluate(testFileContents, abspath);
+ if (eng.hasUncaughtException() && !relpath.endsWith("-n.js")) {
+ QStringList bt = eng.uncaughtExceptionBacktrace();
+ QString err = eng.uncaughtException().toString();
+ qWarning("%s\n%s\n", qPrintable(err), qPrintable(bt.join("\n")));
+ continue;
+ }
- QScriptValue testcases = global.property("testcases");
- if (!testcases.isArray())
- testcases = global.property("gTestcases");
- int count = testcases.property("length").toInt32();
- if (count == 0)
- continue;
-
- hasData = true;
- QString title = global.property("TITLE").toString();
- for (int i = 0; i < count; ++i) {
- QScriptValue kase = testcases.property(i);
- QString description = kase.property("description").toString();
- QScriptValue expect = kase.property("expect");
- QScriptValue actual = kase.property("actual");
- bool passed = kase.property("passed").toBoolean();
- int lineNumber = kase.property("__lineNumber__").toInt32();
-
- TestRecord rec(description, passed,
- actual.toString(), expect.toString(),
- relpath, lineNumber);
-
- QTest::newRow(description.toLatin1()) << rec;
- }
+ QScriptValue testcases = global.property("testcases");
+ if (!testcases.isArray())
+ testcases = global.property("gTestcases");
+ int count = testcases.property("length").toInt32();
+ if (count == 0)
+ continue;
+
+ hasData = true;
+ QString title = global.property("TITLE").toString();
+ for (int i = 0; i < count; ++i) {
+ QScriptValue kase = testcases.property(i);
+ QString description = kase.property("description").toString();
+ QScriptValue expect = kase.property("expect");
+ QScriptValue actual = kase.property("actual");
+ bool passed = kase.property("passed").toBoolean();
+ int lineNumber = kase.property("__lineNumber__").toInt32();
+
+ TestRecord rec(description, passed,
+ actual.toString(), expect.toString(),
+ relpath, lineNumber);
+
+ QTest::newRow(description.toLatin1()) << rec;
}
- if (!hasData)
- QTest::newRow("") << TestRecord(); // dummy
+ }
+ if (!hasData)
+ QTest::newRow("") << TestRecord(); // dummy
+ } else {
+ QFETCH(TestRecord, record);
+ if ((record.lineNumber == -1) && (record.actual == "QSKIP")) {
+ QTest::qSkip(record.description.toLatin1(), QTest::SkipAll, record.fileName.toLatin1(), -1);
} else {
- QFETCH(TestRecord, record);
- if ((record.lineNumber == -1) && (record.actual == "QSKIP")) {
- QTest::qSkip(record.description.toLatin1(), QTest::SkipAll, record.fileName.toLatin1(), -1);
- } else {
- QString msg;
- FailureItem::Action failAct;
- bool expectFail = isExpectedFailure(record.fileName, record.description, &msg, &failAct);
- if (expectFail) {
- switch (failAct) {
- case FailureItem::ExpectFail:
- QTest::qExpectFail("", msg.toLatin1(),
- QTest::Continue, record.fileName.toLatin1(),
- record.lineNumber);
- break;
- case FailureItem::Skip:
- QTest::qSkip(msg.toLatin1(), QTest::SkipSingle,
- record.fileName.toLatin1(), record.lineNumber);
- break;
- }
+ QString msg;
+ FailureItem::Action failAct;
+ bool expectFail = isExpectedFailure(record.fileName, record.description, &msg, &failAct);
+ if (expectFail) {
+ switch (failAct) {
+ case FailureItem::ExpectFail:
+ QTest::qExpectFail("", msg.toLatin1(),
+ QTest::Continue, record.fileName.toLatin1(),
+ record.lineNumber);
+ break;
+ case FailureItem::Skip:
+ QTest::qSkip(msg.toLatin1(), QTest::SkipSingle,
+ record.fileName.toLatin1(), record.lineNumber);
+ break;
}
- if (!expectFail || (failAct == FailureItem::ExpectFail)) {
- if (!record.passed) {
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- if (!expectFail) {
- QString escapedDescription = record.description;
- escapedDescription.replace("\\", "\\\\");
- escapedDescription.replace("\n", "\\n");
- escapedDescription.replace("\"", "\\\"");
- generatedAddExpectedFailureCode.append(
- " addExpectedFailure(\"" + record.fileName
- + "\", \"" + escapedDescription +
- "\", willFixInNextReleaseMessage);\n");
- }
-#endif
- QTest::qCompare(record.actual, record.expected, "actual", "expect",
- record.fileName.toLatin1(), record.lineNumber);
- } else {
- QTest::qCompare(record.actual, record.actual, "actual", "expect",
- record.fileName.toLatin1(), record.lineNumber);
+ }
+ if (!expectFail || (failAct == FailureItem::ExpectFail)) {
+ if (!record.passed) {
+ if (!expectFail && shouldGenerateExpectedFailures) {
+ addExpectedFailure(record.fileName,
+ record.description,
+ QString());
}
+ QTest::qCompare(record.actual, record.expected, "actual", "expect",
+ record.fileName.toLatin1(), record.lineNumber);
+ } else {
+ QTest::qCompare(record.actual, record.actual, "actual", "expect",
+ record.fileName.toLatin1(), record.lineNumber);
}
}
}
- _id -= subSuitePaths.size()*2;
}
- return _id;
}
-tst_Suite::tst_Suite()
+tst_QScriptJSTestSuite::tst_QScriptJSTestSuite()
+ : AbstractTestSuite("tst_QScriptJsTestSuite",
+ QString::fromLatin1("%0/tests").arg(SRCDIR),
+ ":/")
{
- testsDir = QDir(SRCDIR);
- bool testsFound = testsDir.cd("tests");
- if (!testsFound) {
- qWarning("*** no tests/ dir!");
- }
-
- QString willFixInNextReleaseMessage = QString::fromLatin1("Will fix in next release");
- QString fromCharCodeMessage = QString::fromLatin1("Test is wrong?");
- for (int i = 4256; i < 4294; ++i) {
- addExpectedFailure("ecma/String/15.5.4.11-2.js", QString::fromLatin1("var s = new String( String.fromCharCode(%0) ); s.toLowerCase().charCodeAt(0)").arg(i), fromCharCodeMessage);
- }
- addExpectedFailure("ecma/String/15.5.4.11-5.js", "var s = new String( String.fromCharCode(1024) ); s.toLowerCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.11-5.js", "var s = new String( String.fromCharCode(1037) ); s.toLowerCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.12-1.js", "var s = new String( String.fromCharCode(181) ); s.toUpperCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.12-1.js", "var s = new String( String.fromCharCode(329) ); s.toUpperCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.12-4.js", "var s = new String( String.fromCharCode(1104) ); s.toUpperCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.12-4.js", "var s = new String( String.fromCharCode(1117) ); s.toUpperCase().charCodeAt(0)", fromCharCodeMessage);
- addExpectedFailure("ecma/String/15.5.4.12-5.js", "var s = new String( String.fromCharCode(1415) ); s.toUpperCase().charCodeAt(0)", fromCharCodeMessage);
-
- addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "- \"-0x123456789abcde8\"", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma/extensions/15.1.2.1-1.js", "var PROPS = ''; for ( p in eval ) { PROPS += p }; PROPS", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/GlobalObject/15.1.2.2-1.js", "var PROPS=''; for ( var p in parseInt ) { PROPS += p; }; PROPS", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma/GlobalObject/15.1.2.3-1.js", "var MYPROPS=''; for ( var p in parseFloat ) { MYPROPS += p }; MYPROPS", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/GlobalObject/15.1.2.4.js", "var MYPROPS=''; for ( var p in escape ) { MYPROPS+= p}; MYPROPS", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/GlobalObject/15.1.2.5-1.js", "var MYPROPS=''; for ( var p in unescape ) { MYPROPS+= p }; MYPROPS", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/GlobalObject/15.1.2.6.js", "var MYPROPS=''; for ( var p in isNaN ) { MYPROPS+= p }; MYPROPS", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/GlobalObject/15.1.2.7.js", "var MYPROPS=''; for ( p in isFinite ) { MYPROPS+= p }; MYPROPS", willFixInNextReleaseMessage);
-
- addExpectedFailure(QRegExp(), "NO TESTS EXIST", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/Array/15.4.5.1-01.js", "15.4.5.1 - array.length coverage", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/extensions/regress-228087-002.js",
- "Section 1 of test - \nregexp = /{1.*}/g\n"
- "string = 'foo {1} foo {2} foo'\n"
- "ERROR !!! match arrays have different lengths:\n"
- "Expect: [\"{1} foo {2}\"]\n"
- "Actual: []", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js",
- "Section 1 of test - \n"
- "regexp = /a|ab/\n"
- "string = 'abc'\n"
- "ERROR !!! regexp failed to give expected match array:\n"
- "Expect: [\"a\"]\n"
- "Actual: [\"ab\"]\n", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js",
- "Section 2 of test - \n"
- "regexp = /((a)|(ab))((c)|(bc))/\n"
- "string = 'abc'\n"
- "ERROR !!! regexp failed to give expected match array:\n"
- "Expect: [\"abc\", \"a\", \"a\", , \"bc\", , \"bc\"]\n"
- "Actual: [\"abc\", \"ab\", \"\", \"ab\", \"c\", \"c\", \"\"]\n", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js",
- "Section 4 of test - \n"
- "regexp = /a[a-z]{2,4}?/\n"
- "string = 'abcdefghi'\n"
- "ERROR !!! regexp FAILED to match anything !!!\n"
- "Expect: abc\n"
- "Actual: null\n", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js(317)",
- "Section 5 of test - \n"
- "regexp = /(aa|aabaac|ba|b|c)*/\n"
- "string = 'aabaac'\n"
- "ERROR !!! regexp failed to give expected match array:\n"
- "Expect: [\"aaba\", \"ba\"]\n"
- "Actual: [\"aabaac\", \"aabaac\"]\n", willFixInNextReleaseMessage);
-
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 1 of test - \nregexp = /{1.*}/g\nstring = 'foo {1} foo {2} foo'\nERROR !!! match arrays have different lengths:\nExpect: [\"{1} foo {2}\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 2 of test - \nregexp = /{1.*}/g\nstring = 'foo {1} foo {2} foo'\nERROR !!! match arrays have different lengths:\nExpect: [\"{1} foo {2}\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 3 of test - \nregexp = /{1[.!}]*}/g\nstring = 'foo {1} foo {2} foo'\nERROR !!! match arrays have different lengths:\nExpect: [\"{1}\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 4 of test - \nregexp = /{1[.!}]*}/g\nstring = 'foo {1} foo {2} foo'\nERROR !!! match arrays have different lengths:\nExpect: [\"{1}\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 6 of test - \nregexp = /c{3 }/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 7 of test - \nregexp = /c{3.}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 8 of test - \nregexp = /c{3\\s}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 9 of test - \nregexp = /c{3[ ]}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 10 of test - \nregexp = /c{ 3}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{ 3}\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 12 of test - \nregexp = /c{3, }/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3, }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 13 of test - \nregexp = /c{3 ,}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 ,}\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 15 of test - \nregexp = /c{3 ,4}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3 ,4}\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 16 of test - \nregexp = /c{3, 4}/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3, 4}\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-228087.js", "Section 17 of test - \nregexp = /c{3,4 }/\nstring = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de'\nERROR !!! regexp FAILED to match anything !!!\nExpect: c{3,4 }\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 1", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 2", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 3", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 4", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 5", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 6", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 7", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-274152.js", "Do not ignore unicode format-control characters: 8", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-368516.js", "Treat unicode BOM characters as whitespace: 0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/extensions/regress-368516.js", "Treat unicode BOM characters as whitespace: 1", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/FunExpr/fe-001-n.js", "Previous statement should have thrown a ReferenceError", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/LexicalConventions/7.9.1.js", "Automatic Semicolon insertion in postfix expressions: expr\n++", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/LexicalConventions/7.9.1.js", "Automatic Semicolon insertion in postfix expressions: expr\n--", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/LexicalConventions/7.9.1.js", "Automatic Semicolon insertion in postfix expressions: (x\n)-- y", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/LexicalConventions/7.9.1.js", "Automatic Semicolon insertion in postfix expressions: (x)-- y", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Object/8.6.1-01.js", "In strict mode, setting a read-only property should generate a warning: Throw if STRICT and WERROR is enabled", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.8.2 >", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.8.4 >=", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 5 of test - \nregexp = /(aa|aabaac|ba|b|c)*/\nstring = 'aabaac'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aaba\", \"ba\"]\nActual: [\"aabaac\", \"aabaac\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 6 of test - \nregexp = /^(a+)\\1*,\\1+$/\nstring = 'aaaaaaaaaa,aaaaaaaaaaaaaaa'\nERROR !!! regexp FAILED to match anything !!!\nExpect: aaaaaaaaaa,aaaaaaaaaaaaaaa,aaaaa\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 7 of test - \nregexp = /(z)((a+)?(b+)?(c))*/\nstring = 'zaacbbbcac'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"zaacbbbcac\", \"z\", \"ac\", \"a\", , \"c\"]\nActual: [\"zaacbbbcac\", \"z\", \"ac\", \"a\", \"\", \"c\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 8 of test - \nregexp = /(a*)*/\nstring = 'b'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\", , ]\nActual: [\"\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 10 of test - \nregexp = /(?=(a+))/\nstring = 'baaabac'\nERROR !!! match arrays have different lengths:\nExpect: [\"\", \"aaa\"]\nActual: [\"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 11 of test - \nregexp = /(?=(a+))a*b\\1/\nstring = 'baaabac'\nERROR !!! match arrays have different lengths:\nExpect: [\"aba\", \"a\"]\nActual: [\"aaab\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 12 of test - \nregexp = /(.*?)a(?!(a+)b\\2c)\\2(.*)/\nstring = 'baaabaac'\nERROR !!! regexp FAILED to match anything !!!\nExpect: baaabaac,ba,,abaac\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 13 of test - \nregexp = /(?=(a+))/\nstring = 'baaabac'\nERROR !!! match arrays have different lengths:\nExpect: [\"\", \"aaa\"]\nActual: [\"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 34 of test - \nregexp = /a]/\nstring = 'a]'\nERROR !!! regexp FAILED to match anything !!!\nExpect: a]\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 66 of test - \nregexp = /a.+?c/\nstring = 'abcabc'\nERROR !!! regexp FAILED to match anything !!!\nExpect: abc\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 94 of test - \nregexp = /^a(bc+|b[eh])g|.h$/\nstring = 'abh'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"bh\", , ]\nActual: [\"bh\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 95 of test - \nregexp = /(bc+d$|ef*g.|h?i(j|k))/\nstring = 'effgz'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"effgz\", \"effgz\", , ]\nActual: [\"effgz\", \"effgz\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 97 of test - \nregexp = /(bc+d$|ef*g.|h?i(j|k))/\nstring = 'reffgz'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"effgz\", \"effgz\", , ]\nActual: [\"effgz\", \"effgz\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 109 of test - \nregexp = /(([a-c])b*?\\2)*/\nstring = 'ababbbcbc'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ababb,bb,b\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 110 of test - \nregexp = /(([a-c])b*?\\2){3}/\nstring = 'ababbbcbc'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ababbbcbc,cbc,c\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 119 of test - \nregexp = /ab*?bc/i\nstring = 'ABBBBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBBBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 120 of test - \nregexp = /ab{0,}?bc/i\nstring = 'ABBBBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBBBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 121 of test - \nregexp = /ab+?bc/i\nstring = 'ABBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 123 of test - \nregexp = /ab{1,}?bc/i\nstring = 'ABBBBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBBBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 124 of test - \nregexp = /ab{1,3}?bc/i\nstring = 'ABBBBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBBBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 125 of test - \nregexp = /ab{3,4}?bc/i\nstring = 'ABBBBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBBBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 126 of test - \nregexp = /ab??bc/i\nstring = 'ABBC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABBC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 127 of test - \nregexp = /ab??bc/i\nstring = 'ABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 128 of test - \nregexp = /ab{0,1}?bc/i\nstring = 'ABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 129 of test - \nregexp = /ab??c/i\nstring = 'ABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 130 of test - \nregexp = /ab{0,1}?c/i\nstring = 'ABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 138 of test - \nregexp = /a.*?c/i\nstring = 'AXYZC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: AXYZC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 144 of test - \nregexp = /a]/i\nstring = 'A]'\nERROR !!! regexp FAILED to match anything !!!\nExpect: A]\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 160 of test - \nregexp = /a.+?c/i\nstring = 'ABCABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 161 of test - \nregexp = /a.*?c/i\nstring = 'ABCABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 162 of test - \nregexp = /a.{0,5}?c/i\nstring = 'ABCABC'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ABC\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 169 of test - \nregexp = /(a+|b){0,1}?/i\nstring = 'AB'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ,\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 191 of test - \nregexp = /^a(bc+|b[eh])g|.h$/i\nstring = 'ABH'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"BH\", , ]\nActual: [\"BH\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 192 of test - \nregexp = /(bc+d$|ef*g.|h?i(j|k))/i\nstring = 'EFFGZ'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"EFFGZ\", \"EFFGZ\", , ]\nActual: [\"EFFGZ\", \"EFFGZ\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 194 of test - \nregexp = /(bc+d$|ef*g.|h?i(j|k))/i\nstring = 'REFFGZ'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"EFFGZ\", \"EFFGZ\", , ]\nActual: [\"EFFGZ\", \"EFFGZ\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 212 of test - \nregexp = /a(?:b|c|d)+?(.)/\nstring = 'ace'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ace,e\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 213 of test - \nregexp = /a(?:b|c|d)+?(.)/\nstring = 'acdbcdbe'\nERROR !!! regexp FAILED to match anything !!!\nExpect: acd,d\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 217 of test - \nregexp = /a(?:b|c|d){4,5}?(.)/\nstring = 'acdbcdbe'\nERROR !!! regexp FAILED to match anything !!!\nExpect: acdbcd,d\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 218 of test - \nregexp = /((foo)|(bar))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"foobar\", \"bar\", , \"bar\"]\nActual: [\"foobar\", \"bar\", \"\", \"bar\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 220 of test - \nregexp = /a(?:b|c|d){6,7}?(.)/\nstring = 'acdbcdbe'\nERROR !!! regexp FAILED to match anything !!!\nExpect: acdbcdbe,e\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 222 of test - \nregexp = /a(?:b|c|d){5,6}?(.)/\nstring = 'acdbcdbe'\nERROR !!! regexp FAILED to match anything !!!\nExpect: acdbcdb,b\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 224 of test - \nregexp = /a(?:b|c|d){5,7}?(.)/\nstring = 'acdbcdbe'\nERROR !!! regexp FAILED to match anything !!!\nExpect: acdbcdb,b\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 225 of test - \nregexp = /a(?:b|(c|e){1,2}?|d)+?(.)/\nstring = 'ace'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ace,c,e\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 227 of test - \nregexp = /^([^a-z])|(\\^)$/\nstring = '.'\nERROR !!! regexp failed to give expected match array:\nExpect: [\".\", \".\", , ]\nActual: [\".\", \".\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 234 of test - \nregexp = /(?:(f)(o)(o)|(b)(a)(r))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"foobar\", , , , \"b\", \"a\", \"r\"]\nActual: [\"foobar\", \"\", \"\", \"\", \"b\", \"a\", \"r\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 240 of test - \nregexp = /(?:..)*?a/\nstring = 'aba'\nERROR !!! regexp FAILED to match anything !!!\nExpect: a\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 241 of test - \nregexp = /^(?:b|a(?=(.)))*\\1/\nstring = 'abc'\nERROR !!! match arrays have different lengths:\nExpect: [\"ab\", , ]\nActual: [\"ab\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 246 of test - \nregexp = /(a|x)*ab/\nstring = 'cab'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"ab\", , ]\nActual: [\"ab\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 247 of test - \nregexp = /(a)*ab/\nstring = 'cab'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"ab\", , ]\nActual: [\"ab\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 300 of test - \nregexp = /(?=(a+?))(\\1ab)/\nstring = 'aaab'\nERROR !!! regexp FAILED to match anything !!!\nExpect: aab,a,aab\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 303 of test - \nregexp = /(?=(a+?))(\\1ab)/\nstring = 'aaab'\nERROR !!! regexp FAILED to match anything !!!\nExpect: aab,a,aab\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 304 of test - \nregexp = /([\\w:]+::)?(\\w+)$/\nstring = 'abcd'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"abcd\", , \"abcd\"]\nActual: [\"abcd\", \"\", \"abcd\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 308 of test - \nregexp = /([\\w:]+::)?(\\w+)$/\nstring = 'abcd'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"abcd\", , \"abcd\"]\nActual: [\"abcd\", \"\", \"abcd\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 342 of test - \nregexp = /a$/m\nstring = 'a\\nb\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: a\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 344 of test - \nregexp = /a$/m\nstring = 'b\\na\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: a\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 353 of test - \nregexp = /aa$/m\nstring = 'aa\\nb\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: aa\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 355 of test - \nregexp = /aa$/m\nstring = 'b\\naa\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: aa\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 364 of test - \nregexp = /ab$/m\nstring = 'ab\\nb\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ab\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 366 of test - \nregexp = /ab$/m\nstring = 'b\\nab\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: ab\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 375 of test - \nregexp = /abb$/m\nstring = 'abb\\nb\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: abb\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 377 of test - \nregexp = /abb$/m\nstring = 'b\\nabb\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: abb\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 383 of test - \nregexp = /^d[x][x][x]/m\nstring = 'abcd\\ndxxx'\nERROR !!! regexp FAILED to match anything !!!\nExpect: dxxx\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 391 of test - \nregexp = /\\.c(pp|xx|c)?$/i\nstring = 'IO.c'\nERROR !!! regexp failed to give expected match array:\nExpect: [\".c\", , ]\nActual: [\".c\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 392 of test - \nregexp = /(\\.c(pp|xx|c)?$)/i\nstring = 'IO.c'\nERROR !!! regexp failed to give expected match array:\nExpect: [\".c\", \".c\", , ]\nActual: [\".c\", \".c\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 394 of test - \nregexp = /^([ab]*?)(b)?(c)$/\nstring = 'abac'\nERROR !!! regexp FAILED to match anything !!!\nExpect: abac,aba,,c\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 412 of test - \nregexp = /^(a(b)?)+$/\nstring = 'aba'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aba\", \"a\", , ]\nActual: [\"aba\", \"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 413 of test - \nregexp = /^(aa(bb)?)+$/\nstring = 'aabbaa'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aabbaa\", \"aa\", , ]\nActual: [\"aabbaa\", \"aa\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 414 of test - \nregexp = /^.{9}abc.*\\n/m\nstring = '123\\nabcabcabcabc\\n'\nERROR !!! regexp FAILED to match anything !!!\nExpect: abcabcabcabc\n\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 415 of test - \nregexp = /^(a)?a$/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", , ]\nActual: [\"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 416 of test - \nregexp = /^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$/\nstring = 'aaaaaa'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aaaaaa\", \"a\", \"aa\", \"a\", \"aa\"]\nActual: [\"aaaaaa\", \"aa\", \"a\", \"aa\", \"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 418 of test - \nregexp = /^(0+)?(?:x(1))?/\nstring = 'x1'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"x1\", , \"1\"]\nActual: [\"x1\", \"\", \"1\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 419 of test - \nregexp = /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/\nstring = '012cxx0190'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"012cxx0190\", \"012c\", , \"0190\"]\nActual: [\"012cxx0190\", \"012c\", \"\", \"0190\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 420 of test - \nregexp = /^(b+?|a){1,2}c/\nstring = 'bbbac'\nERROR !!! regexp FAILED to match anything !!!\nExpect: bbbac,a\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 421 of test - \nregexp = /^(b+?|a){1,2}c/\nstring = 'bbbbac'\nERROR !!! regexp FAILED to match anything !!!\nExpect: bbbbac,a\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-002.js", "Section 40 of test - \nregexp = /(a)|\\1/\nstring = 'x'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\", , ]\nActual: [\"\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-105972.js", "Section 1 of test - \nregexp = /^.*?$/\nstring = 'Hello World'\nERROR !!! regexp FAILED to match anything !!!\nExpect: Hello World\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-105972.js", "Section 2 of test - \nregexp = /^.*?/\nstring = 'Hello World'\nERROR !!! regexp FAILED to match anything !!!\nExpect: \nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-105972.js", "Section 3 of test - \nregexp = /^.*?(:|$)/\nstring = 'Hello: World'\nERROR !!! regexp FAILED to match anything !!!\nExpect: Hello:,:\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-123437.js", "Section 1 of test - \nregexp = /(a)?a/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", , ]\nActual: [\"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-123437.js", "Section 2 of test - \nregexp = /a|(b)/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", , ]\nActual: [\"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-123437.js", "Section 3 of test - \nregexp = /(a)?(a)/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", , \"a\"]\nActual: [\"a\", \"\", \"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-165353.js", "Section 1 of test - \nregexp = /^([a-z]+)*[a-z]$/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", , ]\nActual: [\"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-169497.js", "Section 1 of test - \nregexp = /<body.*>((.*\\n?)*?)<\\/body>/i\nstring = '<html>\\n<body onXXX=\"alert(event.type);\">\\n<p>Kibology for all</p>\\n<p>All for Kibology</p>\\n</body>\\n</html>'\nERROR !!! regexp FAILED to match anything !!!\nExpect: <body onXXX=\"alert(event.type);\">\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n</body>,\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n,<p>All for Kibology</p>\n\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-187133.js", "Section 5 of test - \nregexp = /(?!a|b)|c/\nstring = 'bc'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\"]\nActual: [\"c\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 1 of test - \nregexp = /(\\d|\\d\\s){2,}/\nstring = '12 3 45'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"12\", \"2\"]\nActual: [\"12 3 45\", \"5\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 3 of test - \nregexp = /(\\d|\\d\\s)+/\nstring = '12 3 45'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"12\", \"2\"]\nActual: [\"12 3 45\", \"5\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 8 of test - \nregexp = /(\\d|\\d\\s){2,}?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 12,2\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 9 of test - \nregexp = /(\\d|\\d\\s){4,}?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 12 3 4,4\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 10 of test - \nregexp = /(\\d|\\d\\s)+?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 1,1\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 11 of test - \nregexp = /(\\d\\s?){4,}?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 12 3 4,4\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 12 of test - \nregexp = /(\\d\\s|\\d){2,}?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 12 ,2 \nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 13 of test - \nregexp = /(\\d\\s|\\d){4,}?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 12 3 4,4\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-191479.js", "Section 14 of test - \nregexp = /(\\d\\s|\\d)+?/\nstring = '12 3 45'\nERROR !!! regexp FAILED to match anything !!!\nExpect: 1,1\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-202564.js", "Section 1 of test - \nregexp = /(?:(.+), )?(.+), (..) to (?:(.+), )?(.+), (..)/\nstring = 'Seattle, WA to Buckley, WA'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"Seattle, WA to Buckley, WA\", , \"Seattle\", \"WA\", , \"Buckley\", \"WA\"]\nActual: [\"Seattle, WA to Buckley, WA\", \"\", \"Seattle\", \"WA\", \"\", \"Buckley\", \"WA\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 2 of test - \nregexp = /(a|b*){5,}/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", \"\"]\nActual: [\"a\", \"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 3 of test - \nregexp = /(b*)*/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\", , ]\nActual: [\"\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 5 of test - \nregexp = /^\\-?(\\d{1,}|\\.{0,})*(\\,\\d{1,})?$/\nstring = '100.00'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"100.00\", \"00\", , ]\nActual: [\"100.00\", \"00\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-216591.js", "Section 1 of test - \nregexp = /\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}/i\nstring = 'a {result.data.DATA} b'\nERROR !!! regexp FAILED to match anything !!!\nExpect: {result.data.DATA},result.data.,data.,DATA\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-216591.js", "Section 2 of test - \nregexp = /\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}/gi\nstring = 'a {result.data.DATA} b'\nERROR !!! match arrays have different lengths:\nExpect: [\"{result.data.DATA}\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-220367-001.js", "Section 1 of test - \nregexp = /(a)|(b)/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", \"a\", , ]\nActual: [\"a\", \"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-220367-001.js", "Section 2 of test - \nregexp = /(a)|(b)/\nstring = 'b'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"b\", , \"b\"]\nActual: [\"b\", \"\", \"b\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-223535.js", "Section 2 of test - \nregexp = /|a/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\"]\nActual: [\"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-223535.js", "Section 6 of test - \nregexp = /(|a)/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\", \"\"]\nActual: [\"a\", \"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-223535.js", "Section 7 of test - \nregexp = /(|a|)/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"\", \"\"]\nActual: [\"a\", \"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-224676.js", "Section 17 of test - \nregexp = /[x]b|(a)/\nstring = 'ZZZxbZZZ'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"xb\", , ]\nActual: [\"xb\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-224676.js", "Section 18 of test - \nregexp = /[x]b|()a/\nstring = 'ZZZxbZZZ'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"xb\", , ]\nActual: [\"xb\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-225289.js", "Section 7 of test - \nregexp = /(a)|([^a])/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", \"a\", , ]\nActual: [\"a\", \"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-225289.js", "Section 9 of test - \nregexp = /(a)|([^a])/\nstring = '()'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"(\", , \"(\"]\nActual: [\"(\", \"\", \"(\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-225289.js", "Section 10 of test - \nregexp = /((?:a|[^a])*)/g\nstring = 'a'\nERROR !!! match arrays have different lengths:\nExpect: [\"a\", \"\"]\nActual: [\"a\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-225289.js", "Section 11 of test - \nregexp = /((?:a|[^a])*)/g\nstring = ''\nERROR !!! match arrays have different lengths:\nExpect: [\"\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-225289.js", "Section 12 of test - \nregexp = /((?:a|[^a])*)/g\nstring = '()'\nERROR !!! match arrays have different lengths:\nExpect: [\"()\", \"\"]\nActual: [\"()\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-31316.js", "Section 1 of test - \nregexp = /<([^\\/<>][^<>]*[^\\/])>|<([^\\/<>])>/\nstring = '<p>Some<br />test</p>'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"<p>\", , \"p\"]\nActual: [\"<p>\", \"\", \"p\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-330684.js", "Do not hang on RegExp", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-375711.js", "Do not assert with /[Q-b]/i.exec(\"\"): /[q-b]/.exec(\"\")", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-375711.js", "Do not assert with /[Q-b]/i.exec(\"\"): /[q-b]/i.exec(\"\")", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(?)'and flag 'i'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(?)'and flag 'g'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(?)'and flag 'm'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(?)'and flag 'undefined'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(a'and flag 'i'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(a'and flag 'g'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(a'and flag 'm'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '(a'and flag 'undefined'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '( ]'and flag 'i'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '( ]'and flag 'g'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '( ]'and flag 'm'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-57631.js", "Testing for error creating illegal RegExp object on pattern '( ]'and flag 'undefined'", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-78156.js", "Section 1 of test - \nregexp = /^\\d/gm\nstring = 'aaa\\n789\\r\\nccc\\r\\n345'\nERROR !!! match arrays have different lengths:\nExpect: [\"7\", \"3\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-78156.js", "Section 2 of test - \nregexp = /\\d$/gm\nstring = 'aaa\\n789\\r\\nccc\\r\\n345'\nERROR !!! match arrays have different lengths:\nExpect: [\"9\", \"5\"]\nActual: [\"5\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-78156.js", "Section 3 of test - \nregexp = /^\\d/gm\nstring = 'aaa\\n789\\r\\nccc\\r\\nddd'\nERROR !!! match arrays have different lengths:\nExpect: [\"7\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-78156.js", "Section 4 of test - \nregexp = /\\d$/gm\nstring = 'aaa\\n789\\r\\nccc\\r\\nddd'\nERROR !!! match arrays have different lengths:\nExpect: [\"9\"]\nActual: []\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-85721.js", "Section 2 of test - \nregexp = /<sql:connection id=\"([^\\r\\n]*?)\">\\s*<sql:url>\\s*([^\\r\\n]*?)\\s*<\\/sql:url>\\s*<sql:driver>\\s*([^\\r\\n]*?)\\s*<\\/sql:driver>\\s*(\\s*<sql:userId>\\s*([^\\r\\n]*?)\\s*<\\/sql:userId>\\s*)?\\s*(\\s*<sql:password>\\s*([^\\r\\n]*?)\\s*<\\/sql:password>\\s*)?\\s*<\\/sql:connection>/\nstring = '<sql:connection id=\"conn1\"> <sql:url>www.m.com</sql:url> <sql:driver>drive.class</sql:driver>\\n<sql:userId>foo</sql:userId> <sql:password>goo</sql:password> </sql:connection>'\nERROR !!! regexp FAILED to match anything !!!\nExpect: <sql:connection id=\"conn1\"> <sql:url>www.m.com</sql:url> <sql:driver>drive.class</sql:driver>\n<sql:userId>foo</sql:userId> <sql:password>goo</sql:password> </sql:connection>,conn1,www.m.com,drive.class,<sql:userId>foo</sql:userId> ,foo,<sql:password>goo</sql:password> ,goo\nActual: null\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-87231.js", "Section 3 of test - \nregexp = /^(A)?(A.*)$/\nstring = 'A'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"A\", , \"A\"]\nActual: [\"A\", \"\", \"A\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-87231.js", "Section 6 of test - \nregexp = /(A)?(A.*)/\nstring = 'zxcasd;fl\\ ^AaaAAaaaf;lrlrzs'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"AaaAAaaaf;lrlrzs\", , \"AaaAAaaaf;lrlrzs\"]\nActual: [\"AaaAAaaaf;lrlrzs\", \"\", \"AaaAAaaaf;lrlrzs\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.11.js", "Section 24", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.11.js", "Section 28", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.11.js", "Section 30", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.14.js", "15.5.4.14 - String.prototype.split(/()/)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Unicode/regress-352044-01.js", "issues with Unicode escape sequences in JavaScript source code", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Unicode/uc-001.js", "Unicode format-control character test (Category Cf.)", willFixInNextReleaseMessage);
-
- addFileExclusion(".+/15\\.9\\.2\\..+", "unstable on slow machines");
- addFileExclusion(".+/15\\.9\\.5\\..+", "too slooow");
- addFileExclusion("regress-130451.js", "asserts");
- addFileExclusion("regress-322135-01.js", "asserts");
- addFileExclusion("regress-322135-02.js", "asserts");
- addFileExclusion("regress-322135-03.js", "takes forever");
- addFileExclusion("regress-322135-04.js", "takes forever");
- addFileExclusion("ecma_3/RegExp/regress-375715-04.js", "bug");
-
- addFileExclusion("ecma_3/RegExp/regress-289669.js", "Can fail due to relying on wall-clock time");
-
- // Failures due to switch to JSC as back-end
- addExpectedFailure("ecma/Array/15.4.3.1-2.js", "var props = ''; for ( p in Array ) { props += p } props", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Boolean/15.6.3.1-1.js", "var str='';for ( p in Boolean ) { str += p } str;", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.4.1.js", "var abc; delete(abc)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/FunctionObjects/15.3.3.1-2.js", "var str='';for (prop in Function ) str += prop; str;", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/ObjectObjects/15.2.3.1-1.js", "var str = '';for ( p in Object ) { str += p; }; str", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Statements/12.6.3-11.js", "result = \"\"; for ( p in Number ) { result += String(p) };", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Statements/12.6.3-2.js", "Boolean.prototype.foo = 34; for ( j in Boolean ) Boolean[j]", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "-\"\\u20001234\\u2001\"", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_2/RegExp/properties-001.js", "//.toString()", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Date/15.9.4.3.js", "15.9.4.3 - Date.UTC edge-case arguments.: date Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Date/15.9.4.3.js", "15.9.4.3 - Date.UTC edge-case arguments.: hours Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Date/15.9.4.3.js", "15.9.4.3 - Date.UTC edge-case arguments.: minutes Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Date/15.9.4.3.js", "15.9.4.3 - Date.UTC edge-case arguments.: seconds Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Function/regress-131964.js", "Section 1 of test - ", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Function/regress-313570.js", "length of objects whose prototype chain includes a function: immutable", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/FunExpr/fe-001.js", "Both functions were defined.", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 7 of test - \nregexp = /(z)((a+)?(b+)?(c))*/\nstring = 'zaacbbbcac'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"zaacbbbcac\", \"z\", \"ac\", \"a\", , \"c\"]\nActual: [\"zaacbbbcac\", \"z\", \"ac\", \"a\", \"bbb\", \"c\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/15.10.2-1.js", "Section 12 of test - \nregexp = /(.*?)a(?!(a+)b\\2c)\\2(.*)/\nstring = 'baaabaac'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"baaabaac\", \"ba\", , \"abaac\"]\nActual: [\"baaabaac\", \"ba\", \"aa\", \"abaac\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 218 of test - \nregexp = /((foo)|(bar))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"foobar\", \"bar\", , \"bar\"]\nActual: [\"foobar\", \"bar\", \"foo\", \"bar\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 234 of test - \nregexp = /(?:(f)(o)(o)|(b)(a)(r))*/\nstring = 'foobar'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"foobar\", , , , \"b\", \"a\", \"r\"]\nActual: [\"foobar\", \"f\", \"o\", \"o\", \"b\", \"a\", \"r\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 241 of test - \nregexp = /^(?:b|a(?=(.)))*\\1/\nstring = 'abc'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"ab\", , ]\nActual: [\"ab\", \"b\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 412 of test - \nregexp = /^(a(b)?)+$/\nstring = 'aba'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aba\", \"a\", , ]\nActual: [\"aba\", \"a\", \"b\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/perlstress-001.js", "Section 413 of test - \nregexp = /^(aa(bb)?)+$/\nstring = 'aabbaa'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"aabbaa\", \"aa\", , ]\nActual: [\"aabbaa\", \"aa\", \"bb\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 1 of test - \nregexp = /(a|b*)*/\nstring = 'a'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"a\", \"a\"]\nActual: [\"a\", \"\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 5 of test - \nregexp = /^\\-?(\\d{1,}|\\.{0,})*(\\,\\d{1,})?$/\nstring = '100.00'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"100.00\", \"00\", , ]\nActual: [\"100.00\", \"\", , ]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 6 of test - \nregexp = /^\\-?(\\d{1,}|\\.{0,})*(\\,\\d{1,})?$/\nstring = '100,00'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"100,00\", \"100\", \",00\"]\nActual: [\"100,00\", \"\", \",00\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-209919.js", "Section 7 of test - \nregexp = /^\\-?(\\d{1,}|\\.{0,})*(\\,\\d{1,})?$/\nstring = '1.000,00'\nERROR !!! regexp failed to give expected match array:\nExpect: [\"1.000,00\", \"000\", \",00\"]\nActual: [\"1.000,00\", \"\", \",00\"]\n", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/RegExp/regress-311414.js", "RegExp captured tail match should be O(N) BigO 2 < 2", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.11.js", "Section 7", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/String/15.5.4.11.js", "Section 26", willFixInNextReleaseMessage);
-
-#ifdef Q_CC_MSVC
- addExpectedFailure("ecma_3/Expressions/11.7.3-01.js", "11.7.3 - >>> should evaluate operands in order: order", "QTBUG-8056");
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.7.3 >>>", "QTBUG-8056");
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 >>>=", "QTBUG-8056");
-#endif
-
-#ifdef Q_CC_MINGW
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(NaN,0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(NaN,-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(Infinity, Infinity)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(Infinity, -Infinity)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(-Infinity, Infinity)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(-Infinity, -Infinity)", willFixInNextReleaseMessage);
-#endif
-
-#ifdef Q_OS_SOLARIS
- addExpectedFailure("ecma/Expressions/11.13.2-2.js", "VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.13.2-2.js", "VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.13.2-2.js", "VAR1 = 1; VAR2= -0; VAR1 /= VAR2", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.13.2-2.js", "VAR1 = -1; VAR2= -0; VAR1 /= VAR2", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.5.2.js", "Number.POSITIVE_INFINITY / -0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.5.2.js", "Number.NEGATIVE_INFINITY / -0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.5.2.js", "1 / -0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Expressions/11.5.2.js", "-1 / -0", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.10.js", "Math.log(-0.0000001)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.10.js", "Math.log(-1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.11.js", "Infinity/Math.max(-0,-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.12.js", "Infinity/Math.min(0,-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.12.js", "Infinity/Math.min(-0,-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(NaN,0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(NaN,-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Infinity/Math.pow(-Infinity, -1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(0, -1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(0, -0.5)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(0, -1000)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Infinity/Math.pow(-0, 1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Infinity/Math.pow(-0, 3)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(-0, -2)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.15.js", "Infinity/Math.round(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.15.js", "Infinity/Math.round(-0.49)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.15.js", "Infinity/Math.round(-0.5)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.17.js", "Infinity/Math.sqrt(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.18.js", "Infinity/Math.tan(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.2.js", "Math.acos(1.00000001)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.2.js", "Math.acos(11.00000001)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.3.js", "Math.asin(1.000001)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.3.js", "Math.asin(-1.000001)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.3.js", "Infinity/Math.asin(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.4.js", "Infinity/Math.atan(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(0, -0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Infinity/Math.atan2(-0, 1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(-0,\t-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.5.js", "Math.atan2(-0,\t-1)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.6.js", "Infinity/Math.ceil('-0')", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.6.js", "Infinity/Math.ceil(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.6.js", "Infinity/Math.ceil(-Number.MIN_VALUE)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.6.js", "Infinity/Math.ceil(-0.9)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.9.js", "Infinity/Math.floor(-0)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "var z = 0; print(1/-z)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "1/-1e-2000", willFixInNextReleaseMessage);
-#endif
-
-#ifdef Q_OS_SYMBIAN
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(-1, 0.5)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(-1, -0.5)", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.5.1 *", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.5.2 /", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.6.2 -", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 *=", willFixInNextReleaseMessage);
- addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 /=", willFixInNextReleaseMessage);
-#endif
-
- static const char klass[] = "tst_QScriptJsTestSuite";
-
- QVector<uint> *data = qt_meta_data_tst_Suite();
- // content:
- *data << 1 // revision
- << 0 // classname
- << 0 << 0 // classinfo
- << 0 << 10 // methods (backpatched later)
- << 0 << 0 // properties
- << 0 << 0 // enums/sets
- ;
-
- QVector<char> *stringdata = qt_meta_stringdata_tst_Suite();
- appendCString(stringdata, klass);
- appendCString(stringdata, "");
-
// don't execute any tests on slow machines
#if !defined(Q_OS_IRIX)
// do all the test suites
- QFileInfoList testSuiteDirInfos;
- if (testsFound)
- testSuiteDirInfos = testsDir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot);
+ QFileInfoList testSuiteDirInfos = testsDir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot);
foreach (QFileInfo tsdi, testSuiteDirInfos) {
QDir testSuiteDir(tsdi.absoluteFilePath());
// do all the dirs in the test suite
QFileInfoList subSuiteDirInfos = testSuiteDir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot);
foreach (QFileInfo ssdi, subSuiteDirInfos) {
subSuitePaths.append(ssdi.absoluteFilePath());
- // slot: signature, parameters, type, tag, flags
- QString data_slot = QString::fromLatin1("%0/%1_data()")
- .arg(testSuiteDir.dirName()).arg(ssdi.fileName());
- static const int nullbyte = sizeof(klass);
- *data << stringdata->size() << nullbyte << nullbyte << nullbyte << 0x08;
- appendCString(stringdata, data_slot.toLatin1());
- QString slot = QString::fromLatin1("%0/%1()")
- .arg(testSuiteDir.dirName()).arg(ssdi.fileName());
- *data << stringdata->size() << nullbyte << nullbyte << nullbyte << 0x08;
- appendCString(stringdata, slot.toLatin1());
+ QString function = QString::fromLatin1("%0/%1")
+ .arg(testSuiteDir.dirName()).arg(ssdi.fileName());
+ addTestFunction(function, CreateDataFunction);
}
}
#endif
- (*data)[4] = subSuitePaths.size() * 2;
+ finalizeMetaObject();
+}
+
+tst_QScriptJSTestSuite::~tst_QScriptJSTestSuite()
+{
+}
- *data << 0; // eod
+void tst_QScriptJSTestSuite::configData(TestConfig::Mode mode, const QStringList &parts)
+{
+ switch (mode) {
+ case TestConfig::Skip:
+ addFileExclusion(parts.at(0), parts.value(1));
+ break;
+
+ case TestConfig::ExpectFail:
+ addExpectedFailure(parts.at(0), parts.value(1), parts.value(2));
+ break;
+ }
+}
- // initialize staticMetaObject
- staticMetaObject.d.superdata = &QObject::staticMetaObject;
- staticMetaObject.d.stringdata = stringdata->constData();
- staticMetaObject.d.data = data->constData();
- staticMetaObject.d.extradata = 0;
+void tst_QScriptJSTestSuite::writeSkipConfigFile(QTextStream &stream)
+{
+ stream << QString::fromLatin1("# testcase | message") << endl;
}
-tst_Suite::~tst_Suite()
+void tst_QScriptJSTestSuite::writeExpectFailConfigFile(QTextStream &stream)
{
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- if (!generatedAddExpectedFailureCode.isEmpty()) {
- QFile file("addexpectedfailures.cpp");
- file.open(QFile::WriteOnly);
- QTextStream ts(&file);
- ts << generatedAddExpectedFailureCode;
+ stream << QString::fromLatin1("# testcase | description | message") << endl;
+ for (int i = 0; i < expectedFailures.size(); ++i) {
+ const FailureItem &fail = expectedFailures.at(i);
+ if (fail.pathRegExp.pattern().isEmpty())
+ continue;
+ stream << QString::fromLatin1("%0 | %1")
+ .arg(fail.pathRegExp.pattern())
+ .arg(escape(fail.description));
+ if (!fail.message.isEmpty())
+ stream << QString::fromLatin1(" | %0").arg(escape(fail.message));
+ stream << endl;
}
-#endif
}
-void tst_Suite::addExpectedFailure(const QRegExp &path, const QString &description, const QString &message)
+void tst_QScriptJSTestSuite::addExpectedFailure(const QRegExp &path, const QString &description, const QString &message)
{
expectedFailures.append(FailureItem(FailureItem::ExpectFail, path, description, message));
}
-void tst_Suite::addExpectedFailure(const QString &fileName, const QString &description, const QString &message)
+void tst_QScriptJSTestSuite::addExpectedFailure(const QString &fileName, const QString &description, const QString &message)
{
expectedFailures.append(FailureItem(FailureItem::ExpectFail, QRegExp(fileName), description, message));
}
-void tst_Suite::addSkip(const QRegExp &path, const QString &description, const QString &message)
+void tst_QScriptJSTestSuite::addSkip(const QRegExp &path, const QString &description, const QString &message)
{
expectedFailures.append(FailureItem(FailureItem::Skip, path, description, message));
}
-void tst_Suite::addSkip(const QString &fileName, const QString &description, const QString &message)
+void tst_QScriptJSTestSuite::addSkip(const QString &fileName, const QString &description, const QString &message)
{
expectedFailures.append(FailureItem(FailureItem::Skip, QRegExp(fileName), description, message));
}
-bool tst_Suite::isExpectedFailure(const QString &fileName, const QString &description,
+bool tst_QScriptJSTestSuite::isExpectedFailure(const QString &fileName, const QString &description,
QString *message, FailureItem::Action *action) const
{
for (int i = 0; i < expectedFailures.size(); ++i) {
@@ -857,17 +430,17 @@ bool tst_Suite::isExpectedFailure(const QString &fileName, const QString &descri
return false;
}
-void tst_Suite::addFileExclusion(const QString &fileName, const QString &message)
+void tst_QScriptJSTestSuite::addFileExclusion(const QString &fileName, const QString &message)
{
fileExclusions.append(qMakePair(QRegExp(fileName), message));
}
-void tst_Suite::addFileExclusion(const QRegExp &rx, const QString &message)
+void tst_QScriptJSTestSuite::addFileExclusion(const QRegExp &rx, const QString &message)
{
fileExclusions.append(qMakePair(rx, message));
}
-bool tst_Suite::isExcludedFile(const QString &fileName, QString *message) const
+bool tst_QScriptJSTestSuite::isExcludedFile(const QString &fileName, QString *message) const
{
for (int i = 0; i < fileExclusions.size(); ++i) {
if (fileExclusions.at(i).first.indexIn(fileName) != -1) {
@@ -879,4 +452,4 @@ bool tst_Suite::isExcludedFile(const QString &fileName, QString *message) const
return false;
}
-QTEST_MAIN(tst_Suite)
+QTEST_MAIN(tst_QScriptJSTestSuite)
diff --git a/tests/auto/qscriptv8testsuite/abstracttestsuite.cpp b/tests/auto/qscriptv8testsuite/abstracttestsuite.cpp
new file mode 100644
index 0000000..d47eb24
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/abstracttestsuite.cpp
@@ -0,0 +1,481 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "abstracttestsuite.h"
+#include <QtTest/QtTest>
+#include <QtCore/qset.h>
+#include <QtCore/qtextstream.h>
+
+/*!
+ AbstractTestSuite provides a way of building QtTest test objects
+ dynamically. The use case is integration of JavaScript test suites
+ into QtTest autotests.
+
+ Subclasses add their tests functions with addTestFunction() in the
+ constructor, and must reimplement runTestFunction(). Additionally,
+ subclasses can reimplement initTestCase() and cleanupTestCase()
+ (but make sure to call the base implementation).
+
+ AbstractTestSuite uses configuration files for getting information
+ about skipped tests (skip.txt) and expected test failures
+ (expect_fail.txt). Subclasses must reimplement
+ createSkipConfigFile() and createExpectFailConfigFile() for
+ creating these files, and configData() for processing an entry of
+ such a file.
+
+ The config file format is as follows:
+ - Lines starting with '#' are skipped.
+ - Lines of the form [SYMBOL] means that the upcoming data
+ should only be processed if the given SYMBOL is defined on
+ this platform.
+ - Any other line is split on ' | ' and handed off to the client.
+
+ Subclasses must provide a default tests directory (where the
+ subclass expects to find the script files to run as tests), and a
+ default config file directory. Some environment variables can be
+ used to affect where AbstractTestSuite will look for files:
+
+ - QTSCRIPT_TEST_CONFIG_DIR: Overrides the default test config path.
+
+ - QTSCRIPT_TEST_CONFIG_SUFFIX: Is appended to "skip" and
+ "expect_fail" to create the test config name. This makes it easy to
+ maintain skip- and expect_fail-files corresponding to different
+ revisions of a test suite, and switch between them.
+
+ - QTSCRIPT_TEST_DIR: Overrides the default test dir.
+
+ AbstractTestSuite does _not_ define how the test dir itself is
+ processed or how tests are run; this is left up to the subclass.
+
+ If no config files are found, AbstractTestSuite will ask the
+ subclass to create a default skip file. Also, the
+ shouldGenerateExpectedFailures variable will be set to true. The
+ subclass should check for this when a test fails, and add an entry
+ to its set of expected failures. When all tests have been run,
+ AbstractTestSuite will ask the subclass to create the expect_fail
+ file based on the tests that failed. The next time the autotest is
+ run, the created config files will be used.
+
+ The reason for skipping a test is usually that it takes a very long
+ time to complete (or even hangs completely), or it crashes. It's
+ not possible for the test runner to know in advance which tests are
+ problematic, which is why the entries to the skip file are
+ typically added manually. When running tests for the first time, it
+ can be useful to run the autotest with the -v1 command line option,
+ so you can see the name of each test before it's run, and can add a
+ skip entry if appropriate.
+*/
+
+// Helper class for constructing the test class's QMetaObject contents
+// at runtime.
+class TestMetaObjectBuilder
+{
+public:
+ TestMetaObjectBuilder(const QByteArray &className,
+ const QMetaObject *superClass);
+
+ void appendPrivateVoidSlot(const char *signature);
+ void appendPrivateVoidSlot(const QString &signature)
+ { appendPrivateVoidSlot(signature.toLatin1().constData()); }
+
+ void assignContents(QMetaObject &);
+
+private:
+ void appendString(const char *);
+ void finalize();
+
+ const QByteArray m_className;
+ const QMetaObject *m_superClass;
+ QVector<uint> m_data;
+ QVector<char> m_stringdata;
+ int m_emptyStringOffset;
+ bool m_finalized;
+};
+
+TestMetaObjectBuilder::TestMetaObjectBuilder(
+ const QByteArray &className,
+ const QMetaObject *superClass)
+ : m_className(className), m_superClass(superClass),
+ m_finalized(false)
+{
+ // header
+ m_data << 1 // revision
+ << 0 // classname
+ << 0 << 0 // classinfo
+ << 0 << 10 // methods (backpatched later)
+ << 0 << 0 // properties
+ << 0 << 0 // enums/sets
+ ;
+
+ appendString(className.constData());
+ m_emptyStringOffset = m_stringdata.size();
+ appendString("");
+}
+
+void TestMetaObjectBuilder::appendString(const char *s)
+{
+ char c;
+ do {
+ c = *(s++);
+ m_stringdata << c;
+ } while (c != '\0');
+}
+
+void TestMetaObjectBuilder::appendPrivateVoidSlot(const char *signature)
+{
+ static const int methodCountOffset = 4;
+ // signature, parameters, type, tag, flags
+ m_data << m_stringdata.size()
+ << m_emptyStringOffset
+ << m_emptyStringOffset
+ << m_emptyStringOffset
+ << 0x08;
+ appendString(signature);
+ ++m_data[methodCountOffset];
+}
+
+void TestMetaObjectBuilder::finalize()
+{
+ if (m_finalized)
+ return;
+ m_data << 0; // eod
+ m_finalized = true;
+}
+
+/**
+ Assigns this builder's contents to the meta-object \a mo. It's up
+ to the caller to ensure that this builder (and hence, its data)
+ stays alive as long as needed.
+*/
+void TestMetaObjectBuilder::assignContents(QMetaObject &mo)
+{
+ finalize();
+ mo.d.superdata = m_superClass;
+ mo.d.stringdata = m_stringdata.constData();
+ mo.d.data = m_data.constData();
+ mo.d.extradata = 0;
+}
+
+
+class TestConfigClientInterface;
+// For parsing information about skipped tests and expected failures.
+class TestConfigParser
+{
+public:
+ static void parse(const QString &path,
+ TestConfig::Mode mode,
+ TestConfigClientInterface *client);
+
+private:
+ static QString unescape(const QString &);
+ static bool isKnownSymbol(const QString &);
+ static bool isDefined(const QString &);
+
+ static QSet<QString> knownSymbols;
+ static QSet<QString> definedSymbols;
+};
+
+QSet<QString> TestConfigParser::knownSymbols;
+QSet<QString> TestConfigParser::definedSymbols;
+
+/**
+ Parses the config file at the given \a path in the given \a mode.
+ Handling of errors and data is delegated to the given \a client.
+*/
+void TestConfigParser::parse(const QString &path,
+ TestConfig::Mode mode,
+ TestConfigClientInterface *client)
+{
+ QFile file(path);
+ if (!file.open(QIODevice::ReadOnly))
+ return;
+ QTextStream stream(&file);
+ int lineNumber = 0;
+ QString predicate;
+ const QString separator = QString::fromLatin1(" | ");
+ while (!stream.atEnd()) {
+ ++lineNumber;
+ QString line = stream.readLine();
+ if (line.isEmpty())
+ continue;
+ if (line.startsWith('#')) // Comment
+ continue;
+ if (line.startsWith('[')) { // Predicate
+ if (!line.endsWith(']')) {
+ client->configError(path, "malformed predicate", lineNumber);
+ return;
+ }
+ QString symbol = line.mid(1, line.size()-2);
+ if (isKnownSymbol(symbol)) {
+ predicate = symbol;
+ } else {
+ qWarning("symbol %s is not known -- add it to TestConfigParser!", qPrintable(symbol));
+ predicate = QString();
+ }
+ } else {
+ if (predicate.isEmpty() || isDefined(predicate)) {
+ QStringList parts = line.split(separator, QString::KeepEmptyParts);
+ for (int i = 0; i < parts.size(); ++i)
+ parts[i] = unescape(parts[i]);
+ client->configData(mode, parts);
+ }
+ }
+ }
+}
+
+QString TestConfigParser::unescape(const QString &str)
+{
+ return QString(str).replace("\\n", "\n");
+}
+
+bool TestConfigParser::isKnownSymbol(const QString &symbol)
+{
+ if (knownSymbols.isEmpty()) {
+ knownSymbols
+ // If you add a symbol here, add a case for it in
+ // isDefined() as well.
+ << "Q_OS_LINUX"
+ << "Q_OS_SOLARIS"
+ << "Q_OS_WINCE"
+ << "Q_OS_SYMBIAN"
+ << "Q_CC_MSVC"
+ << "Q_CC_MINGW"
+ ;
+ }
+ return knownSymbols.contains(symbol);
+}
+
+bool TestConfigParser::isDefined(const QString &symbol)
+{
+ if (definedSymbols.isEmpty()) {
+ definedSymbols
+#ifdef Q_OS_LINUX
+ << "Q_OS_LINUX"
+#endif
+#ifdef Q_OS_SOLARIS
+ << "Q_OS_SOLARIS"
+#endif
+#ifdef Q_OS_WINCE
+ << "Q_OS_WINCE"
+#endif
+#ifdef Q_OS_SYMBIAN
+ << "Q_OS_SYMBIAN"
+#endif
+#ifdef Q_CC_MSVC
+ << "Q_CC_MSVC"
+#endif
+#ifdef Q_CC_MINGW
+ << "Q_CC_MINGW"
+#endif
+ ;
+ }
+ return definedSymbols.contains(symbol);
+}
+
+
+QMetaObject AbstractTestSuite::staticMetaObject;
+
+const QMetaObject *AbstractTestSuite::metaObject() const
+{
+ return &staticMetaObject;
+}
+
+void *AbstractTestSuite::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, staticMetaObject.d.stringdata))
+ return static_cast<void*>(const_cast<AbstractTestSuite*>(this));
+ return QObject::qt_metacast(_clname);
+}
+
+int AbstractTestSuite::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QObject::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0:
+ initTestCase();
+ break;
+ case 1:
+ cleanupTestCase();
+ break;
+ default:
+ // If another method is added above, this offset must be adjusted.
+ runTestFunction(_id - 2);
+ }
+ _id -= staticMetaObject.methodCount() - staticMetaObject.methodOffset();
+ }
+ return _id;
+}
+
+AbstractTestSuite::AbstractTestSuite(const QByteArray &className,
+ const QString &defaultTestsPath,
+ const QString &defaultConfigPath)
+ : shouldGenerateExpectedFailures(false),
+ metaBuilder(new TestMetaObjectBuilder(className, &QObject::staticMetaObject))
+{
+ QString testConfigPath = qgetenv("QTSCRIPT_TEST_CONFIG_DIR");
+ if (testConfigPath.isEmpty())
+ testConfigPath = defaultConfigPath;
+ QString configSuffix = qgetenv("QTSCRIPT_TEST_CONFIG_SUFFIX");
+ skipConfigPath = QString::fromLatin1("%0/skip%1.txt")
+ .arg(testConfigPath).arg(configSuffix);
+ expectFailConfigPath = QString::fromLatin1("%0/expect_fail%1.txt")
+ .arg(testConfigPath).arg(configSuffix);
+
+ QString testsPath = qgetenv("QTSCRIPT_TEST_DIR");
+ if (testsPath.isEmpty())
+ testsPath = defaultTestsPath;
+ testsDir = QDir(testsPath);
+
+ addTestFunction("initTestCase");
+ addTestFunction("cleanupTestCase");
+
+ // Subclass constructors should add their custom test functions to
+ // the meta-object and call finalizeMetaObject().
+}
+
+AbstractTestSuite::~AbstractTestSuite()
+{
+ delete metaBuilder;
+}
+
+void AbstractTestSuite::addTestFunction(const QString &name,
+ DataFunctionCreation dfc)
+{
+ if (dfc == CreateDataFunction) {
+ QString dataSignature = QString::fromLatin1("%0_data()").arg(name);
+ metaBuilder->appendPrivateVoidSlot(dataSignature);
+ }
+ QString signature = QString::fromLatin1("%0()").arg(name);
+ metaBuilder->appendPrivateVoidSlot(signature);
+}
+
+void AbstractTestSuite::finalizeMetaObject()
+{
+ metaBuilder->assignContents(staticMetaObject);
+}
+
+void AbstractTestSuite::initTestCase()
+{
+ if (!testsDir.exists()) {
+ QString message = QString::fromLatin1("tests directory (%0) doesn't exist.")
+ .arg(testsDir.path());
+ QFAIL(qPrintable(message));
+ return;
+ }
+
+ if (QFileInfo(skipConfigPath).exists())
+ TestConfigParser::parse(skipConfigPath, TestConfig::Skip, this);
+ else
+ createSkipConfigFile();
+
+ if (QFileInfo(expectFailConfigPath).exists())
+ TestConfigParser::parse(expectFailConfigPath, TestConfig::ExpectFail, this);
+ else
+ shouldGenerateExpectedFailures = true;
+}
+
+void AbstractTestSuite::cleanupTestCase()
+{
+ if (shouldGenerateExpectedFailures)
+ createExpectFailConfigFile();
+}
+
+void AbstractTestSuite::configError(const QString &path, const QString &message, int lineNumber)
+{
+ QString output;
+ output.append(path);
+ if (lineNumber != -1)
+ output.append(":").append(QString::number(lineNumber));
+ output.append(": ").append(message);
+ QFAIL(qPrintable(output));
+}
+
+void AbstractTestSuite::createSkipConfigFile()
+{
+ QFile file(skipConfigPath);
+ if (!file.open(QIODevice::WriteOnly))
+ return;
+ QWARN(qPrintable(QString::fromLatin1("creating %0").arg(skipConfigPath)));
+ QTextStream stream(&file);
+
+ writeSkipConfigFile(stream);
+
+ file.close();
+}
+
+void AbstractTestSuite::createExpectFailConfigFile()
+{
+ QFile file(expectFailConfigPath);
+ if (!file.open(QFile::WriteOnly))
+ return;
+ QWARN(qPrintable(QString::fromLatin1("creating %0").arg(expectFailConfigPath)));
+ QTextStream stream(&file);
+
+ writeExpectFailConfigFile(stream);
+
+ file.close();
+}
+
+/*!
+ Convenience function for reading all contents of a file.
+ */
+QString AbstractTestSuite::readFile(const QString &filename)
+{
+ QFile file(filename);
+ if (!file.open(QFile::ReadOnly))
+ return QString();
+ QTextStream stream(&file);
+ stream.setCodec("UTF-8");
+ return stream.readAll();
+}
+
+/*!
+ Escapes characters in the string \a str so it's suitable for writing
+ to a config file.
+ */
+QString AbstractTestSuite::escape(const QString &str)
+{
+ return QString(str).replace("\n", "\\n");
+}
diff --git a/tests/auto/qscriptv8testsuite/abstracttestsuite.h b/tests/auto/qscriptv8testsuite/abstracttestsuite.h
new file mode 100644
index 0000000..b13c61a
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/abstracttestsuite.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTTESTSUITE_H
+#define ABSTRACTTESTSUITE_H
+
+#include <QtCore/qobject.h>
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qtextstream.h>
+
+class TestMetaObjectBuilder;
+
+namespace TestConfig {
+enum Mode {
+ Skip,
+ ExpectFail
+};
+}
+
+// For receiving callbacks from the config parser.
+class TestConfigClientInterface
+{
+public:
+ virtual ~TestConfigClientInterface() {}
+ virtual void configData(TestConfig::Mode mode,
+ const QStringList &parts) = 0;
+ virtual void configError(const QString &path,
+ const QString &message,
+ int lineNumber) = 0;
+};
+
+class AbstractTestSuite : public QObject,
+ public TestConfigClientInterface
+{
+// No Q_OBJECT macro, we implement the meta-object ourselves.
+public:
+ AbstractTestSuite(const QByteArray &className,
+ const QString &defaultTestsPath,
+ const QString &defaultConfigPath);
+ virtual ~AbstractTestSuite();
+
+ static QMetaObject staticMetaObject;
+ virtual const QMetaObject *metaObject() const;
+ virtual void *qt_metacast(const char *);
+ virtual int qt_metacall(QMetaObject::Call, int, void **argv);
+
+ static QString readFile(const QString &);
+ static QString escape(const QString &);
+
+protected:
+ enum DataFunctionCreation {
+ DontCreateDataFunction,
+ CreateDataFunction
+ };
+
+ void addTestFunction(const QString &,
+ DataFunctionCreation = DontCreateDataFunction);
+ void finalizeMetaObject();
+
+ virtual void initTestCase();
+ virtual void cleanupTestCase();
+
+ virtual void writeSkipConfigFile(QTextStream &) = 0;
+ virtual void writeExpectFailConfigFile(QTextStream &) = 0;
+
+ virtual void runTestFunction(int index) = 0;
+
+ virtual void configError(const QString &path, const QString &message, int lineNumber);
+
+ QDir testsDir;
+ bool shouldGenerateExpectedFailures;
+
+private:
+ TestMetaObjectBuilder *metaBuilder;
+ QString skipConfigPath, expectFailConfigPath;
+
+private:
+ void createSkipConfigFile();
+ void createExpectFailConfigFile();
+};
+
+#endif
diff --git a/tests/auto/qscriptv8testsuite/abstracttestsuite.pri b/tests/auto/qscriptv8testsuite/abstracttestsuite.pri
new file mode 100644
index 0000000..1de5b93
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/abstracttestsuite.pri
@@ -0,0 +1,4 @@
+SOURCES += $$PWD/abstracttestsuite.cpp
+HEADERS += $$PWD/abstracttestsuite.h
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
diff --git a/tests/auto/qscriptv8testsuite/expect_fail.txt b/tests/auto/qscriptv8testsuite/expect_fail.txt
new file mode 100644
index 0000000..a4eee73
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/expect_fail.txt
@@ -0,0 +1,16 @@
+# testcase | actual | expected | message
+arguments-enum | 2 | 0
+const-redecl | undefined | TypeError | local:'const x; var x'
+date-parse | NaN | 946713600000 | Sat, 01-Jan-2000 08:00:00 GMT+00:00
+delete-global-properties | true | false
+delete | false | true | delete 100
+function-arguments-null | false | true
+function-caller | null | function eval() {\n [native code]\n}
+function-prototype | prototype | disconnectconnect
+global-const-var-conflicts | false | true
+number-tostring | 0 | 0.0000a7c5ac471b4788
+parse-int-float | 1e+21 | 1
+regexp | false | true
+string-lastindexof | 0 | -1
+string-split | 4 | 3 | 19 - array length
+substr | abcdefghijklmn |
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
index 00e2e01..e1c6234 100644
--- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
QT = core script
SOURCES += tst_qscriptv8testsuite.cpp
RESOURCES += qscriptv8testsuite.qrc
+include(abstracttestsuite.pri)
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc
index a894ee5..150ccf0 100644
--- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc
@@ -1,5 +1,7 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>tests</file>
+ <file>expect_fail.txt</file>
+ <file>skip.txt</file>
</qresource>
</RCC>
diff --git a/tests/auto/qscriptv8testsuite/skip.txt b/tests/auto/qscriptv8testsuite/skip.txt
new file mode 100644
index 0000000..3c2cc53
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/skip.txt
@@ -0,0 +1,17 @@
+# testcase | message
+debug-* | not applicable
+mirror-* | not applicable
+array-concat | Hangs on JSC backend
+array-splice | Hangs on JSC backend
+sparse-array-reverse | Hangs on JSC backend
+string-case | V8-specific behavior? (Doesn't pass on SpiderMonkey either)
+
+[Q_OS_WINCE]
+deep-recursion | Demands too much memory on WinCE
+nested-repetition-count-overflow | Demands too much memory on WinCE
+unicode-test | Demands too much memory on WinCE
+mul-exhaustive | Demands too much memory on WinCE
+
+[Q_OS_SYMBIAN]
+nested-repetition-count-overflow | Demands too much memory on Symbian
+unicode-test | Demands too much memory on Symbian
diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
index 7d0858e..b35fd06 100644
--- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
+++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
@@ -40,68 +40,33 @@
****************************************************************************/
+#include "abstracttestsuite.h"
#include <QtTest/QtTest>
-#include <QByteArray>
-
#include <QtScript>
//TESTED_CLASS=
//TESTED_FILES=
-// Uncomment the following define to have the autotest generate
-// addExpectedFailure() code for all the tests that fail.
-// This is useful when a whole new test (sub)suite is added.
-// The code is stored in addexpectedfailures.cpp.
-// Paste the contents into this file after the existing
-// addExpectedFailure() calls.
-
-//#define GENERATE_ADDEXPECTEDFAILURE_CODE
-
-static QString readFile(const QString &filename)
-{
- QFile file(filename);
- if (!file.open(QFile::ReadOnly))
- return QString();
- QTextStream stream(&file);
- stream.setCodec("UTF-8");
- return stream.readAll();
-}
-
-static void appendCString(QVector<char> *v, const char *s)
-{
- char c;
- do {
- c = *(s++);
- *v << c;
- } while (c != '\0');
-}
-
-struct ExpectedFailure
+class tst_QScriptV8TestSuite : public AbstractTestSuite
{
- ExpectedFailure(const QString &name, const QString &act,
- const QString &exp, const QString &msg)
- : testName(name), actual(act), expected(exp), message(msg)
- { }
-
- QString testName;
- QString actual;
- QString expected;
- QString message;
-};
-
-class tst_Suite : public QObject
-{
-
public:
- tst_Suite();
- virtual ~tst_Suite();
+ tst_QScriptV8TestSuite();
+ virtual ~tst_QScriptV8TestSuite();
+
+protected:
+ struct ExpectedFailure
+ {
+ ExpectedFailure(const QString &name, const QString &act,
+ const QString &exp, const QString &msg)
+ : testName(name), actual(act), expected(exp), message(msg)
+ { }
+
+ QString testName;
+ QString actual;
+ QString expected;
+ QString message;
+ };
- static QMetaObject staticMetaObject;
- virtual const QMetaObject *metaObject() const;
- virtual void *qt_metacast(const char *);
- virtual int qt_metacall(QMetaObject::Call, int, void **argv);
-
-private:
void addExpectedFailure(const QString &testName, const QString &actual,
const QString &expected, const QString &message);
bool isExpectedFailure(const QString &testName, const QString &actual,
@@ -110,34 +75,23 @@ private:
void addTestExclusion(const QRegExp &rx, const QString &message);
bool isExcludedTest(const QString &testName, QString *message) const;
- QDir testsDir;
+ virtual void initTestCase();
+ virtual void configData(TestConfig::Mode mode, const QStringList &parts);
+ virtual void writeSkipConfigFile(QTextStream &);
+ virtual void writeExpectFailConfigFile(QTextStream &);
+ virtual void runTestFunction(int testIndex);
+
QStringList testNames;
QList<ExpectedFailure> expectedFailures;
QList<QPair<QRegExp, QString> > testExclusions;
QString mjsunitContents;
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- QString generatedAddExpectedFailureCode;
-#endif
};
-QMetaObject tst_Suite::staticMetaObject;
-
-Q_GLOBAL_STATIC(QVector<uint>, qt_meta_data_tst_Suite)
-Q_GLOBAL_STATIC(QVector<char>, qt_meta_stringdata_tst_Suite)
-
-const QMetaObject *tst_Suite::metaObject() const
-{
- return &staticMetaObject;
-}
-
-void *tst_Suite::qt_metacast(const char *_clname)
-{
- if (!_clname) return 0;
- if (!strcmp(_clname, qt_meta_stringdata_tst_Suite()->constData()))
- return static_cast<void*>(const_cast<tst_Suite*>(this));
- return QObject::qt_metacast(_clname);
-}
-
+// We expect failing tests to call the fail() function (defined in
+// mjsunit.js) with arguments expected, actual, message_opt. This
+// function intercepts the call, calls the real fail() function (which
+// will throw an exception), and sets the original arguments on the
+// exception object so that we can process them later.
static QScriptValue qscript_fail(QScriptContext *ctx, QScriptEngine *eng)
{
QScriptValue realFail = ctx->callee().data();
@@ -146,193 +100,141 @@ static QScriptValue qscript_fail(QScriptContext *ctx, QScriptEngine *eng)
Q_ASSERT(eng->hasUncaughtException());
ret.setProperty("expected", ctx->argument(0));
ret.setProperty("actual", ctx->argument(1));
+ ret.setProperty("message", ctx->argument(2));
QScriptContextInfo info(ctx->parentContext()->parentContext());
ret.setProperty("lineNumber", info.lineNumber());
return ret;
}
-int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+void tst_QScriptV8TestSuite::writeSkipConfigFile(QTextStream &stream)
{
- _id = QObject::qt_metacall(_c, _id, _a);
- if (_id < 0)
- return _id;
- if (_c == QMetaObject::InvokeMetaMethod) {
- QString name = testNames.at(_id);
- QString path = testsDir.absoluteFilePath(name + ".js");
- QString excludeMessage;
- if (isExcludedTest(name, &excludeMessage)) {
- QTest::qSkip(excludeMessage.toLatin1(), QTest::SkipAll, path.toLatin1(), -1);
- } else {
- QScriptEngine engine;
- engine.evaluate(mjsunitContents).toString();
- if (engine.hasUncaughtException()) {
- QStringList bt = engine.uncaughtExceptionBacktrace();
- QString err = engine.uncaughtException().toString();
- qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
- } else {
- QScriptValue fakeFail = engine.newFunction(qscript_fail);
- fakeFail.setData(engine.globalObject().property("fail"));
- engine.globalObject().setProperty("fail", fakeFail);
- QString contents = readFile(path);
- QScriptValue ret = engine.evaluate(contents);
- if (engine.hasUncaughtException()) {
- if (!ret.isError()) {
- Q_ASSERT(ret.instanceOf(engine.globalObject().property("MjsUnitAssertionError")));
- QString actual = ret.property("actual").toString();
- QString expected = ret.property("expected").toString();
- int lineNumber = ret.property("lineNumber").toInt32();
- QString failMessage;
- if (isExpectedFailure(name, actual, expected, &failMessage)) {
- QTest::qExpectFail("", failMessage.toLatin1(),
- QTest::Continue, path.toLatin1(),
- lineNumber);
- }
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- else {
- generatedAddExpectedFailureCode.append(
- " addExpectedFailure(\"" + name
- + "\", \"" + actual + "\", \"" + expected
- + "\", willFixInNextReleaseMessage);\n");
- }
-#endif
- QTest::qCompare(actual, expected, "actual", "expect",
- path.toLatin1(), lineNumber);
- } else {
- int lineNumber = ret.property("lineNumber").toInt32();
- QTest::qExpectFail("", ret.toString().toLatin1(),
- QTest::Continue, path.toLatin1(), lineNumber);
- QTest::qVerify(false, ret.toString().toLatin1(), "", path.toLatin1(), lineNumber);
- }
- }
- }
- }
- _id -= testNames.size();
- }
- return _id;
+ stream << QString::fromLatin1("# testcase | message") << endl;
}
-tst_Suite::tst_Suite()
+void tst_QScriptV8TestSuite::writeExpectFailConfigFile(QTextStream &stream)
{
- testsDir = QDir(":/tests");
- if (!testsDir.exists()) {
- qWarning("*** no tests/ dir!");
- } else {
- if (!testsDir.exists("mjsunit.js"))
- qWarning("*** no tests/mjsunit.js file!");
- else {
- mjsunitContents = readFile(testsDir.absoluteFilePath("mjsunit.js"));
- if (mjsunitContents.isEmpty())
- qWarning("*** tests/mjsunit.js is empty!");
- }
+ stream << QString::fromLatin1("# testcase | actual | expected | message") << endl;
+ for (int i = 0; i < expectedFailures.size(); ++i) {
+ const ExpectedFailure &fail = expectedFailures.at(i);
+ stream << QString::fromLatin1("%0 | %1 | %2")
+ .arg(fail.testName)
+ .arg(escape(fail.actual))
+ .arg(escape(fail.expected));
+ if (!fail.message.isEmpty())
+ stream << QString::fromLatin1(" | %0").arg(escape(fail.message));
+ stream << endl;
}
- QString willFixInNextReleaseMessage = QString::fromLatin1("Will fix in next release");
- addExpectedFailure("arguments-enum", "2", "0", willFixInNextReleaseMessage);
- addExpectedFailure("const-redecl", "undefined", "TypeError", willFixInNextReleaseMessage);
- addExpectedFailure("global-const-var-conflicts", "false", "true", willFixInNextReleaseMessage);
- addExpectedFailure("string-lastindexof", "0", "-1", "test is wrong?");
-
-#ifndef Q_OS_LINUX
- addExpectedFailure("to-precision", "1.235e+27", "1.234e+27", "QTBUG-8053: toPrecision(4) gives wrong result on Mac");
-#endif
-
-#ifdef Q_OS_SOLARIS
- addExpectedFailure("math-min-max", "Infinity", "-Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("negate-zero", "false", "true", willFixInNextReleaseMessage);
- addExpectedFailure("str-to-num", "Infinity", "-Infinity", willFixInNextReleaseMessage);
-#endif
-
- addTestExclusion("debug-*", "not applicable");
- addTestExclusion("mirror-*", "not applicable");
-
- addTestExclusion("array-concat", "Hangs on JSC backend");
- addTestExclusion("array-splice", "Hangs on JSC backend");
- addTestExclusion("sparse-array-reverse", "Hangs on JSC backend");
-
- addTestExclusion("string-case", "V8-specific behavior? (Doesn't pass on SpiderMonkey either)");
-
-#ifdef Q_OS_WINCE
- addTestExclusion("deep-recursion", "Demands too much memory on WinCE");
- addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on WinCE");
- addTestExclusion("unicode-test", "Demands too much memory on WinCE");
- addTestExclusion("mul-exhaustive", "Demands too much memory on WinCE");
-#endif
-
-#ifdef Q_OS_SYMBIAN
- addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian");
- addTestExclusion("unicode-test", "Demands too much memory on Symbian");
-#endif
- // Failures due to switch to JSC as back-end
- addExpectedFailure("date-parse", "NaN", "946713600000", willFixInNextReleaseMessage);
- addExpectedFailure("delete-global-properties", "true", "false", willFixInNextReleaseMessage);
- addExpectedFailure("delete", "false", "true", willFixInNextReleaseMessage);
- addExpectedFailure("function-arguments-null", "false", "true", willFixInNextReleaseMessage);
- addExpectedFailure("function-caller", "null", "function eval() {\n [native code]\n}", willFixInNextReleaseMessage);
- addExpectedFailure("function-prototype", "prototype", "disconnectconnect", willFixInNextReleaseMessage);
- addExpectedFailure("number-tostring", "0", "0.0000a7c5ac471b4788", willFixInNextReleaseMessage);
- addExpectedFailure("parse-int-float", "1e+21", "1", willFixInNextReleaseMessage);
- addExpectedFailure("regexp", "false", "true", willFixInNextReleaseMessage);
- addExpectedFailure("smi-negative-zero", "-Infinity", "Infinity", willFixInNextReleaseMessage);
- addExpectedFailure("string-split", "4", "3", willFixInNextReleaseMessage);
- addExpectedFailure("substr", "abcdefghijklmn", "", willFixInNextReleaseMessage);
+}
- static const char klass[] = "tst_QScriptV8TestSuite";
+void tst_QScriptV8TestSuite::runTestFunction(int testIndex)
+{
+ QString name = testNames.at(testIndex);
+ QString path = testsDir.absoluteFilePath(name + ".js");
- QVector<uint> *data = qt_meta_data_tst_Suite();
- // content:
- *data << 1 // revision
- << 0 // classname
- << 0 << 0 // classinfo
- << 0 << 10 // methods (backpatched later)
- << 0 << 0 // properties
- << 0 << 0 // enums/sets
- ;
+ QString excludeMessage;
+ if (isExcludedTest(name, &excludeMessage)) {
+ QTest::qSkip(excludeMessage.toLatin1(), QTest::SkipAll, path.toLatin1(), -1);
+ return;
+ }
- QVector<char> *stringdata = qt_meta_stringdata_tst_Suite();
- appendCString(stringdata, klass);
- appendCString(stringdata, "");
+ QScriptEngine engine;
+ engine.evaluate(mjsunitContents);
+ if (engine.hasUncaughtException()) {
+ QStringList bt = engine.uncaughtExceptionBacktrace();
+ QString err = engine.uncaughtException().toString();
+ qWarning("%s\n%s", qPrintable(err), qPrintable(bt.join("\n")));
+ } else {
+ // Prepare to intercept calls to mjsunit's fail() function.
+ QScriptValue fakeFail = engine.newFunction(qscript_fail);
+ fakeFail.setData(engine.globalObject().property("fail"));
+ engine.globalObject().setProperty("fail", fakeFail);
+
+ QString contents = readFile(path);
+ QScriptValue ret = engine.evaluate(contents);
+ if (engine.hasUncaughtException()) {
+ if (!ret.isError()) {
+ Q_ASSERT(ret.instanceOf(engine.globalObject().property("MjsUnitAssertionError")));
+ QString actual = ret.property("actual").toString();
+ QString expected = ret.property("expected").toString();
+ int lineNumber = ret.property("lineNumber").toInt32();
+ QString failMessage;
+ if (shouldGenerateExpectedFailures) {
+ if (ret.property("message").isString())
+ failMessage = ret.property("message").toString();
+ addExpectedFailure(name, actual, expected, failMessage);
+ } else if (isExpectedFailure(name, actual, expected, &failMessage)) {
+ QTest::qExpectFail("", failMessage.toLatin1(),
+ QTest::Continue, path.toLatin1(),
+ lineNumber);
+ }
+ QTest::qCompare(actual, expected, "actual", "expect",
+ path.toLatin1(), lineNumber);
+ } else {
+ int lineNumber = ret.property("lineNumber").toInt32();
+ QTest::qExpectFail("", ret.toString().toLatin1(),
+ QTest::Continue, path.toLatin1(), lineNumber);
+ QTest::qVerify(false, ret.toString().toLatin1(), "", path.toLatin1(), lineNumber);
+ }
+ }
+ }
+}
+tst_QScriptV8TestSuite::tst_QScriptV8TestSuite()
+ : AbstractTestSuite("tst_QScriptV8TestSuite",
+ ":/tests", ":/")
+{
+ // One test function per test file.
QFileInfoList testFileInfos;
testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files);
foreach (QFileInfo tfi, testFileInfos) {
QString name = tfi.baseName();
- // slot: signature, parameters, type, tag, flags
- QString slot = QString::fromLatin1("%0()").arg(name);
- static const int nullbyte = sizeof(klass);
- *data << stringdata->size() << nullbyte << nullbyte << nullbyte << 0x08;
- appendCString(stringdata, slot.toLatin1());
+ addTestFunction(name);
testNames.append(name);
}
- (*data)[4] = testFileInfos.size();
+ finalizeMetaObject();
+}
- *data << 0; // eod
+tst_QScriptV8TestSuite::~tst_QScriptV8TestSuite()
+{
+}
- // initialize staticMetaObject
- staticMetaObject.d.superdata = &QObject::staticMetaObject;
- staticMetaObject.d.stringdata = stringdata->constData();
- staticMetaObject.d.data = data->constData();
- staticMetaObject.d.extradata = 0;
+void tst_QScriptV8TestSuite::initTestCase()
+{
+ AbstractTestSuite::initTestCase();
+
+ // FIXME: These warnings should be QFAIL, but that would make the
+ // test fail right now.
+ if (!testsDir.exists("mjsunit.js"))
+ qWarning("*** no tests/mjsunit.js file!");
+ else {
+ mjsunitContents = readFile(testsDir.absoluteFilePath("mjsunit.js"));
+ if (mjsunitContents.isEmpty())
+ qWarning("*** tests/mjsunit.js is empty!");
+ }
}
-tst_Suite::~tst_Suite()
+void tst_QScriptV8TestSuite::configData(TestConfig::Mode mode, const QStringList &parts)
{
-#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE
- if (!generatedAddExpectedFailureCode.isEmpty()) {
- QFile file("addexpectedfailures.cpp");
- file.open(QFile::WriteOnly);
- QTextStream ts(&file);
- ts << generatedAddExpectedFailureCode;
+ switch (mode) {
+ case TestConfig::Skip:
+ addTestExclusion(parts.at(0), parts.value(1));
+ break;
+
+ case TestConfig::ExpectFail:
+ addExpectedFailure(parts.at(0), parts.value(1),
+ parts.value(2), parts.value(3));
+ break;
}
-#endif
}
-void tst_Suite::addExpectedFailure(const QString &testName, const QString &actual,
+void tst_QScriptV8TestSuite::addExpectedFailure(const QString &testName, const QString &actual,
const QString &expected, const QString &message)
{
expectedFailures.append(ExpectedFailure(testName, actual, expected, message));
}
-bool tst_Suite::isExpectedFailure(const QString &testName, const QString &actual,
+bool tst_QScriptV8TestSuite::isExpectedFailure(const QString &testName, const QString &actual,
const QString &expected, QString *message) const
{
for (int i = 0; i < expectedFailures.size(); ++i) {
@@ -346,17 +248,17 @@ bool tst_Suite::isExpectedFailure(const QString &testName, const QString &actual
return false;
}
-void tst_Suite::addTestExclusion(const QString &testName, const QString &message)
+void tst_QScriptV8TestSuite::addTestExclusion(const QString &testName, const QString &message)
{
testExclusions.append(qMakePair(QRegExp(testName), message));
}
-void tst_Suite::addTestExclusion(const QRegExp &rx, const QString &message)
+void tst_QScriptV8TestSuite::addTestExclusion(const QRegExp &rx, const QString &message)
{
testExclusions.append(qMakePair(rx, message));
}
-bool tst_Suite::isExcludedTest(const QString &testName, QString *message) const
+bool tst_QScriptV8TestSuite::isExcludedTest(const QString &testName, QString *message) const
{
for (int i = 0; i < testExclusions.size(); ++i) {
if (testExclusions.at(i).first.indexIn(testName) != -1) {
@@ -368,4 +270,4 @@ bool tst_Suite::isExcludedTest(const QString &testName, QString *message) const
return false;
}
-QTEST_MAIN(tst_Suite)
+QTEST_MAIN(tst_QScriptV8TestSuite)
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index b302eba..6686e2d 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -1889,7 +1889,7 @@ void tst_QScriptValue::getSetProperty_gettersAndSetters()
QCOMPARE(object.propertyFlags("foo") & ~QScriptValue::UserRange,
QScriptValue::PropertyGetter );
- QEXPECT_FAIL("", "User-range flags are not retained for getter/setter properties", Continue);
+ QEXPECT_FAIL("", "QTBUG-17615: User-range flags are not retained for getter/setter properties", Continue);
QCOMPARE(object.propertyFlags("foo"),
QScriptValue::PropertyGetter | QScriptValue::UserRange);
object.setProperty("x", num);
@@ -2004,10 +2004,10 @@ void tst_QScriptValue::getSetProperty_gettersAndSettersThrowErrorJS()
QScriptValue object = eng.evaluate("o");
QVERIFY(!eng.hasUncaughtException());
QScriptValue ret = object.property("foo");
- QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue);
+ QEXPECT_FAIL("", "QTBUG-17616: Exception thrown from js function are not returned by the JSC port", Continue);
QVERIFY(ret.isError());
QVERIFY(eng.hasUncaughtException());
- QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue);
+ QEXPECT_FAIL("", "QTBUG-17616: Exception thrown from js function are not returned by the JSC port", Continue);
QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: get foo"));
eng.evaluate("Object"); // clear exception state...
@@ -2185,9 +2185,9 @@ void tst_QScriptValue::getSetProperty()
}
// should still be deletable from C++
object.setProperty("undeletableProperty", QScriptValue());
- QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
+ QEXPECT_FAIL("", "QTBUG-17617: With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
QVERIFY(!object.property("undeletableProperty").isValid());
- QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
+ QEXPECT_FAIL("", "QTBUG-17617: With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
QCOMPARE(object.propertyFlags("undeletableProperty"), 0);
// SkipInEnumeration
@@ -2328,8 +2328,7 @@ void tst_QScriptValue::getSetPrototype_invalidPrototype()
inv.setPrototype(object);
QCOMPARE(inv.prototype().isValid(), false);
object.setPrototype(inv);
- // FIXME should it be invalid or proto?
- QVERIFY(object.prototype().strictlyEquals(inv));
+ QVERIFY(object.prototype().strictlyEquals(proto));
}
void tst_QScriptValue::getSetPrototype_twoEngines()
@@ -2367,8 +2366,6 @@ void tst_QScriptValue::getSetPrototype_notObjectOrNull()
QScriptValue object = eng.newObject();
QScriptValue originalProto = object.prototype();
- QEXPECT_FAIL("", "QTBUG-15154: QScriptValue::setPrototype() allows a non-Object value to be set as prototype", Abort);
-
// bool
object.setPrototype(true);
QVERIFY(object.prototype().equals(originalProto));
diff --git a/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h
index 1c61fc5..be4f79f 100644
--- a/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h
+++ b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp
index 962a2af..529558f 100644
--- a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h
index 8248ef3..f625399 100644
--- a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscroller/tst_qscroller.cpp b/tests/auto/qscroller/tst_qscroller.cpp
index b4e4ddf..a9b3d9f 100644
--- a/tests/auto/qscroller/tst_qscroller.cpp
+++ b/tests/auto/qscroller/tst_qscroller.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 6bb971d..d26f0cd 100644
--- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -144,6 +144,8 @@ private slots:
void taskQTBUG_7537_appearsAndSort();
void taskQTBUG_7716_unnecessaryDynamicSorting();
void taskQTBUG_10287_unnecessaryMapCreation();
+ void taskQTBUG_17812_resetInvalidate_data();
+ void taskQTBUG_17812_resetInvalidate();
void testMultipleProxiesWithSelection();
void mapSelectionFromSource();
@@ -3351,5 +3353,60 @@ void tst_QSortFilterProxyModel::filteredColumns()
insertCommand->doCommand();
}
+void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate_data()
+{
+ QTest::addColumn<int>("test");
+ QTest::addColumn<bool>("works");
+
+ QTest::newRow("nothing") << 0 << false;
+ QTest::newRow("reset") << 1 << true;
+ QTest::newRow("invalidate") << 2 << true;
+ QTest::newRow("invalidate_filter") << 3 << true;
+}
+
+void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate()
+{
+ QFETCH(int, test);
+ QFETCH(bool, works);
+
+ struct Proxy : QSortFilterProxyModel {
+ QString pattern;
+ virtual bool filterAcceptsRow(int source_row, const QModelIndex&) const {
+ return sourceModel()->data(sourceModel()->index(source_row, 0)).toString().contains(pattern);
+ }
+ void notifyChange(int test) {
+ switch (test) {
+ case 0: break;
+ case 1: reset(); break;
+ case 2: invalidate(); break;
+ case 3: invalidateFilter(); break;
+ }
+ }
+ };
+
+ QStringListModel sourceModel(QStringList() << "Poisson" << "Vache" << "Brebis"
+ << "Elephant" << "Cochon" << "Serpent"
+ << "Mouton" << "Ecureuil" << "Mouche");
+ Proxy proxy;
+ proxy.pattern = QString::fromLatin1("n");
+ proxy.setSourceModel(&sourceModel);
+
+ QCOMPARE(proxy.rowCount(), 5);
+ for (int i = 0; i < proxy.rowCount(); i++) {
+ QVERIFY(proxy.data(proxy.index(i,0)).toString().contains('n'));
+ }
+
+ proxy.pattern = QString::fromLatin1("o");
+ proxy.notifyChange(test);
+
+ QCOMPARE(proxy.rowCount(), works ? 4 : 5);
+ bool ok = true;
+ for (int i = 0; i < proxy.rowCount(); i++) {
+ if (!proxy.data(proxy.index(i,0)).toString().contains('o'))
+ ok = false;
+ }
+ QCOMPARE(ok, works);
+}
+
QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc"
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index f7d2180..bf68375 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -773,6 +773,27 @@ void tst_QSqlTableModel::removeInsertedRow()
QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry"));
QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond"));
QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi"));
+
+ // Now insert a row with a null, and check that removing it also works (QTBUG-15979 etc)
+ model.insertRow(1);
+ model.setData(model.index(1,0), 55);
+ model.setData(model.index(1,1), QString("null columns"));
+ model.setData(model.index(1,2), QVariant());
+
+ model.submitAll();
+
+ QCOMPARE(model.rowCount(), 4);
+ QCOMPARE(model.data(model.index(3, 0)).toInt(), 55);
+ QCOMPARE(model.data(model.index(3, 1)).toString(), QString("null columns"));
+ QCOMPARE(model.data(model.index(3, 2)).isNull(), true);
+
+ QVERIFY(model.removeRow(3));
+ model.submitAll();
+ QCOMPARE(model.rowCount(), 3);
+
+ QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry"));
+ QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond"));
+ QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi"));
}
void tst_QSqlTableModel::removeInsertedRows()
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 8177d29..739f902 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -390,6 +390,9 @@ void tst_QSslSocket::constructing()
QSslConfiguration savedDefault = QSslConfiguration::defaultConfiguration();
// verify that changing the default config doesn't affect this socket
+ // (on Unix, the ca certs might be empty, depending on whether we load
+ // them on demand or not, so set them explicitly)
+ socket.setCaCertificates(QSslSocket::systemCaCertificates());
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
QSslSocket::setDefaultCiphers(QList<QSslCipher>());
QVERIFY(!socket.caCertificates().isEmpty());
@@ -518,11 +521,6 @@ void tst_QSslSocket::sslErrors_data()
<< 993
<< (SslErrorList() << QSslError::HostNameMismatch
<< QSslError::SelfSignedCertificate);
-
- QTest::newRow("imap.trolltech.com")
- << "imap.trolltech.com"
- << 993
- << (SslErrorList() << QSslError::SelfSignedCertificateInChain);
}
void tst_QSslSocket::sslErrors()
diff --git a/tests/auto/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
new file mode 100644
index 0000000..ea62865
--- /dev/null
+++ b/tests/auto/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
@@ -0,0 +1,36 @@
+load(qttest_p4)
+
+SOURCES += tst_qsslsocket_onDemandCertificates_member.cpp
+!wince*:win32:LIBS += -lws2_32
+QT += network
+QT -= gui
+
+TARGET = tst_qsslsocket_onDemandCertificates_member
+
+win32 {
+ CONFIG(debug, debug|release) {
+ DESTDIR = debug
+} else {
+ DESTDIR = release
+ }
+}
+
+wince* {
+ DEFINES += SRCDIR=\\\"./\\\"
+
+ certFiles.files = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+} else:symbian {
+ TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+ TARGET.CAPABILITY=NetworkServices
+
+ certFiles.files = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+ INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
new file mode 100644
index 0000000..2a1358d
--- /dev/null
+++ b/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QtNetwork>
+#include <QtTest/QtTest>
+
+#include <QNetworkProxy>
+#include <QAuthenticator>
+
+#include "private/qhostinfo_p.h"
+
+#include "../network-settings.h"
+
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
+#ifndef QT_NO_OPENSSL
+class QSslSocketPtr: public QSharedPointer<QSslSocket>
+{
+public:
+ inline QSslSocketPtr(QSslSocket *ptr = 0)
+ : QSharedPointer<QSslSocket>(ptr)
+ { }
+
+ inline operator QSslSocket *() const { return data(); }
+};
+#endif
+
+class tst_QSslSocket_onDemandCertificates_member : public QObject
+{
+ Q_OBJECT
+
+ int proxyAuthCalled;
+
+public:
+ tst_QSslSocket_onDemandCertificates_member();
+ virtual ~tst_QSslSocket_onDemandCertificates_member();
+
+#ifndef QT_NO_OPENSSL
+ QSslSocketPtr newSocket();
+#endif
+
+public slots:
+ void initTestCase_data();
+ void init();
+ void cleanup();
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth);
+
+#ifndef QT_NO_OPENSSL
+private slots:
+ void onDemandRootCertLoadingMemberMethods();
+
+private:
+ QSslSocket *socket;
+#endif // QT_NO_OPENSSL
+};
+
+tst_QSslSocket_onDemandCertificates_member::tst_QSslSocket_onDemandCertificates_member()
+{
+ Q_SET_DEFAULT_IAP
+}
+
+tst_QSslSocket_onDemandCertificates_member::~tst_QSslSocket_onDemandCertificates_member()
+{
+}
+
+enum ProxyTests {
+ NoProxy = 0x00,
+ Socks5Proxy = 0x01,
+ HttpProxy = 0x02,
+ TypeMask = 0x0f,
+
+ NoAuth = 0x00,
+ AuthBasic = 0x10,
+ AuthNtlm = 0x20,
+ AuthMask = 0xf0
+};
+
+void tst_QSslSocket_onDemandCertificates_member::initTestCase_data()
+{
+ QTest::addColumn<bool>("setProxy");
+ QTest::addColumn<int>("proxyType");
+
+ QTest::newRow("WithoutProxy") << false << 0;
+ QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy);
+ QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic);
+
+ QTest::newRow("WithHttpProxy") << true << int(HttpProxy);
+ QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic);
+ // uncomment the line below when NTLM works
+// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm);
+}
+
+void tst_QSslSocket_onDemandCertificates_member::init()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy) {
+ QFETCH_GLOBAL(int, proxyType);
+ QString testServer = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ QNetworkProxy proxy;
+
+ switch (proxyType) {
+ case Socks5Proxy:
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1080);
+ break;
+
+ case Socks5Proxy | AuthBasic:
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1081);
+ break;
+
+ case HttpProxy | NoAuth:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3128);
+ break;
+
+ case HttpProxy | AuthBasic:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3129);
+ break;
+
+ case HttpProxy | AuthNtlm:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3130);
+ break;
+ }
+ QNetworkProxy::setApplicationProxy(proxy);
+ }
+
+ qt_qhostinfo_clear_cache();
+}
+
+void tst_QSslSocket_onDemandCertificates_member::cleanup()
+{
+ QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy);
+}
+
+#ifndef QT_NO_OPENSSL
+QSslSocketPtr tst_QSslSocket_onDemandCertificates_member::newSocket()
+{
+ QSslSocket *socket = new QSslSocket;
+
+ proxyAuthCalled = 0;
+ connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ Qt::DirectConnection);
+
+ return QSslSocketPtr(socket);
+}
+#endif
+
+void tst_QSslSocket_onDemandCertificates_member::proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth)
+{
+ ++proxyAuthCalled;
+ auth->setUser("qsockstest");
+ auth->setPassword("password");
+}
+
+#ifndef QT_NO_OPENSSL
+
+void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMethods()
+{
+ QString host("qt.nokia.com");
+
+ // not using any root certs -> should not work
+ QSslSocketPtr socket2 = newSocket();
+ this->socket = socket2;
+ socket2->setCaCertificates(QList<QSslCertificate>());
+ socket2->connectToHostEncrypted(host, 443);
+ QVERIFY(!socket2->waitForEncrypted());
+
+ // default: using on demand loading -> should work
+ QSslSocketPtr socket = newSocket();
+ this->socket = socket;
+ socket->connectToHostEncrypted(host, 443);
+ QVERIFY(socket->waitForEncrypted());
+
+ // not using any root certs again -> should not work
+ QSslSocketPtr socket3 = newSocket();
+ this->socket = socket3;
+ socket3->setCaCertificates(QList<QSslCertificate>());
+ socket3->connectToHostEncrypted(host, 443);
+ QVERIFY(!socket3->waitForEncrypted());
+}
+
+#endif // QT_NO_OPENSSL
+
+QTEST_MAIN(tst_QSslSocket_onDemandCertificates_member)
+#include "tst_qsslsocket_onDemandCertificates_member.moc"
diff --git a/tests/auto/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
new file mode 100644
index 0000000..13990cb
--- /dev/null
+++ b/tests/auto/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
@@ -0,0 +1,36 @@
+load(qttest_p4)
+
+SOURCES += tst_qsslsocket_onDemandCertificates_static.cpp
+!wince*:win32:LIBS += -lws2_32
+QT += network
+QT -= gui
+
+TARGET = tst_qsslsocket_onDemandCertificates_static
+
+win32 {
+ CONFIG(debug, debug|release) {
+ DESTDIR = debug
+} else {
+ DESTDIR = release
+ }
+}
+
+wince* {
+ DEFINES += SRCDIR=\\\"./\\\"
+
+ certFiles.files = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+} else:symbian {
+ TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+ TARGET.CAPABILITY=NetworkServices
+
+ certFiles.files = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+ INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
new file mode 100644
index 0000000..8259977
--- /dev/null
+++ b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QtNetwork>
+#include <QtTest/QtTest>
+
+#include <QNetworkProxy>
+#include <QAuthenticator>
+
+#include "private/qhostinfo_p.h"
+
+#include "../network-settings.h"
+
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
+#ifndef QT_NO_OPENSSL
+class QSslSocketPtr: public QSharedPointer<QSslSocket>
+{
+public:
+ inline QSslSocketPtr(QSslSocket *ptr = 0)
+ : QSharedPointer<QSslSocket>(ptr)
+ { }
+
+ inline operator QSslSocket *() const { return data(); }
+};
+#endif
+
+class tst_QSslSocket_onDemandCertificates_static : public QObject
+{
+ Q_OBJECT
+
+ int proxyAuthCalled;
+
+public:
+ tst_QSslSocket_onDemandCertificates_static();
+ virtual ~tst_QSslSocket_onDemandCertificates_static();
+
+#ifndef QT_NO_OPENSSL
+ QSslSocketPtr newSocket();
+#endif
+
+public slots:
+ void initTestCase_data();
+ void init();
+ void cleanup();
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth);
+
+#ifndef QT_NO_OPENSSL
+private slots:
+ void onDemandRootCertLoadingStaticMethods();
+
+private:
+ QSslSocket *socket;
+#endif // QT_NO_OPENSSL
+};
+
+tst_QSslSocket_onDemandCertificates_static::tst_QSslSocket_onDemandCertificates_static()
+{
+ Q_SET_DEFAULT_IAP
+}
+
+tst_QSslSocket_onDemandCertificates_static::~tst_QSslSocket_onDemandCertificates_static()
+{
+}
+
+enum ProxyTests {
+ NoProxy = 0x00,
+ Socks5Proxy = 0x01,
+ HttpProxy = 0x02,
+ TypeMask = 0x0f,
+
+ NoAuth = 0x00,
+ AuthBasic = 0x10,
+ AuthNtlm = 0x20,
+ AuthMask = 0xf0
+};
+
+void tst_QSslSocket_onDemandCertificates_static::initTestCase_data()
+{
+ QTest::addColumn<bool>("setProxy");
+ QTest::addColumn<int>("proxyType");
+
+ QTest::newRow("WithoutProxy") << false << 0;
+ QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy);
+ QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic);
+
+ QTest::newRow("WithHttpProxy") << true << int(HttpProxy);
+ QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic);
+ // uncomment the line below when NTLM works
+// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm);
+}
+
+void tst_QSslSocket_onDemandCertificates_static::init()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy) {
+ QFETCH_GLOBAL(int, proxyType);
+ QString testServer = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ QNetworkProxy proxy;
+
+ switch (proxyType) {
+ case Socks5Proxy:
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1080);
+ break;
+
+ case Socks5Proxy | AuthBasic:
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1081);
+ break;
+
+ case HttpProxy | NoAuth:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3128);
+ break;
+
+ case HttpProxy | AuthBasic:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3129);
+ break;
+
+ case HttpProxy | AuthNtlm:
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3130);
+ break;
+ }
+ QNetworkProxy::setApplicationProxy(proxy);
+ }
+
+ qt_qhostinfo_clear_cache();
+}
+
+void tst_QSslSocket_onDemandCertificates_static::cleanup()
+{
+ QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy);
+}
+
+#ifndef QT_NO_OPENSSL
+QSslSocketPtr tst_QSslSocket_onDemandCertificates_static::newSocket()
+{
+ QSslSocket *socket = new QSslSocket;
+
+ proxyAuthCalled = 0;
+ connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ Qt::DirectConnection);
+
+ return QSslSocketPtr(socket);
+}
+#endif
+
+void tst_QSslSocket_onDemandCertificates_static::proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth)
+{
+ ++proxyAuthCalled;
+ auth->setUser("qsockstest");
+ auth->setPassword("password");
+}
+
+#ifndef QT_NO_OPENSSL
+
+void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMethods()
+{
+ QString host("qt.nokia.com");
+
+ // not using any root certs -> should not work
+ QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
+ QSslSocketPtr socket = newSocket();
+ this->socket = socket;
+ socket->connectToHostEncrypted(host, 443);
+ QVERIFY(!socket->waitForEncrypted());
+
+ // using system root certs -> should work
+ QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+ QSslSocketPtr socket2 = newSocket();
+ this->socket = socket2;
+ socket2->connectToHostEncrypted(host, 443);
+ QVERIFY(socket2->waitForEncrypted());
+
+ // not using any root certs again -> should not work
+ QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
+ QSslSocketPtr socket3 = newSocket();
+ this->socket = socket3;
+ socket3->connectToHostEncrypted(host, 443);
+ QVERIFY(!socket3->waitForEncrypted());
+}
+
+#endif // QT_NO_OPENSSL
+
+QTEST_MAIN(tst_QSslSocket_onDemandCertificates_static)
+#include "tst_qsslsocket_onDemandCertificates_static.moc"
diff --git a/tests/auto/qstringref/tst_qstringref.cpp b/tests/auto/qstringref/tst_qstringref.cpp
index 585e14e..301559e 100644
--- a/tests/auto/qstringref/tst_qstringref.cpp
+++ b/tests/auto/qstringref/tst_qstringref.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 50002a6..83adf49 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -100,6 +100,7 @@ private slots:
void task188195_baseBackground();
void task232085_spinBoxLineEditBg();
void changeStyleInChangeEvent();
+ void QTBUG15910_crashNullWidget();
//at the end because it mess with the style.
void widgetStyle();
@@ -1657,6 +1658,23 @@ void tst_QStyleSheetStyle::QTBUG11658_cachecrash()
qApp->setStyleSheet(QString());
}
+void tst_QStyleSheetStyle::QTBUG15910_crashNullWidget()
+{
+ struct : QWidget {
+ virtual void paintEvent(QPaintEvent* ) {
+ QStyleOption opt;
+ opt.init(this);
+ QPainter p(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, 0);
+ style()->drawPrimitive(QStyle::PE_Frame, &opt, &p, 0);
+ style()->drawControl(QStyle::CE_PushButton, &opt, &p, 0);
+ }
+ } w;
+ w.setStyleSheet("* { background-color: white; color:black; border 3px solid yellow }");
+ w.show();
+ QTest::qWaitForWindowShown(&w);
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"
diff --git a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index a6499ff..92e8608 100644
--- a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -201,6 +201,7 @@ void tst_QtConcurrentIterateKernel::noIterations()
startThreadEngine(new IterateKernel<TestIterator, void>(0, 0)).startBlocking();
}
+QMutex threadsMutex;
QSet<QThread *> threads;
class ThrottleFor : public IterateKernel<TestIterator, void>
{
@@ -219,8 +220,10 @@ public:
QThread *thread = QThread::currentThread();
- if (begin > 140 && end < 160)
+ if (begin > 140 && end < 160) {
+ QMutexLocker locker(&threadsMutex);
threads.insert(thread);
+ }
if (100 >= begin && 100 < end) {
throttling = true;
diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp
index 7b41874..cec3a6a 100644
--- a/tests/auto/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/qtextblock/tst_qtextblock.cpp
@@ -75,6 +75,7 @@ private slots:
void fragmentOverBlockBoundaries();
void excludeParagraphSeparatorFragment();
void backwardsBlockIterator();
+ void previousBlock_qtbug18026();
private:
QTextDocument *doc;
@@ -174,5 +175,11 @@ void tst_QTextBlock::backwardsBlockIterator()
QCOMPARE(it.fragment().position(), 0);
}
+void tst_QTextBlock::previousBlock_qtbug18026()
+{
+ QTextBlock last = doc->end().previous();
+ QVERIFY(last.isValid());
+}
+
QTEST_MAIN(tst_QTextBlock)
#include "tst_qtextblock.moc"
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index d1b615e..0a14e4a 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -124,8 +124,8 @@ private slots:
void testLineBreakingAllSpaces();
void lineWidthFromBOM();
void textWidthVsWIdth();
-
void textWithSurrogates_qtbug15679();
+ void textWidthWithStackedTextEngine();
private:
QFont testFont;
@@ -1432,5 +1432,16 @@ void tst_QTextLayout::textWithSurrogates_qtbug15679()
QCOMPARE(x[2] - x[0], x[5] - x[3]);
}
+void tst_QTextLayout::textWidthWithStackedTextEngine()
+{
+ QString text = QString::fromUtf8("คลิก ถัดไป เพื่อดำเนินการต่อ");
+ QTextLayout layout(text);
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+ QFontMetricsF fm(layout.font());
+ QCOMPARE(line.naturalTextWidth(), fm.width(text));
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 91d0f3f..4f4e706a 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -56,7 +56,7 @@
-#if defined(Q_WS_X11)
+#if defined(Q_WS_X11) || defined(Q_WS_MAC)
#define private public
#include <private/qtextengine_p.h>
#include <qtextlayout.h>
@@ -104,6 +104,7 @@ private slots:
void khmer();
void linearB();
void controlInSyllable_qtbug14204();
+ void combiningMarks_qtbug15675();
};
tst_QTextScriptEngine::tst_QTextScriptEngine()
@@ -1133,5 +1134,27 @@ void tst_QTextScriptEngine::controlInSyllable_qtbug14204()
#endif
}
+void tst_QTextScriptEngine::combiningMarks_qtbug15675()
+{
+#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
+ QString s;
+ s.append(QChar(0x0061));
+ s.append(QChar(0x0062));
+ s.append(QChar(0x0300));
+ s.append(QChar(0x0063));
+
+ QFont font("Monaco");
+ QTextLayout layout(s, font);
+ QTextEngine *e = layout.d;
+ e->itemize();
+ e->shape(0);
+
+ QVERIFY(e->layoutData->items[0].num_glyphs == 4);
+ QVERIFY(e->layoutData->glyphLayout.advances_y[2] > 0);
+#else
+ QSKIP("Mac specific test", SkipAll);
+#endif
+}
+
QTEST_MAIN(tst_QTextScriptEngine)
#include "tst_qtextscriptengine.moc"
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp
index 19c6c16..c69052e 100644
--- a/tests/auto/qthread/tst_qthread.cpp
+++ b/tests/auto/qthread/tst_qthread.cpp
@@ -113,6 +113,7 @@ private slots:
void wait3_slowDestructor();
void destroyFinishRace();
void startFinishRace();
+ void startAndQuitCustomEventLoop();
void stressTest();
};
@@ -1150,5 +1151,20 @@ void tst_QThread::startFinishRace()
}
}
+void tst_QThread::startAndQuitCustomEventLoop()
+{
+ struct Thread : QThread {
+ void run() { QEventLoop().exec(); }
+ };
+
+ for (int i = 0; i < 5; i++) {
+ Thread t;
+ t.start();
+ t.quit();
+ t.wait();
+ }
+}
+
+
QTEST_MAIN(tst_QThread)
#include "tst_qthread.moc"
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index 6cff7c53..c2acc18 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -50,6 +50,8 @@
#include <unistd.h>
#endif
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -272,9 +274,9 @@ void tst_QTimer::livelock()
QFETCH(int, interval);
LiveLockTester tester(interval);
QTest::qWait(180); // we have to use wait here, since we're testing timers with a non-zero timeout
- QCOMPARE(tester.timeoutsForFirst, 1);
+ QTRY_COMPARE(tester.timeoutsForFirst, 1);
QCOMPARE(tester.timeoutsForExtra, 0);
- QCOMPARE(tester.timeoutsForSecond, 1);
+ QTRY_COMPARE(tester.timeoutsForSecond, 1);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (QSysInfo::WindowsVersion < QSysInfo::WV_XP)
QEXPECT_FAIL("non-zero timer", "Multimedia timers are not available on Windows 2000", Continue);
@@ -724,7 +726,7 @@ void tst_QTimer::QTBUG13633_dontBlockEvents()
{
DontBlockEvents t;
QTest::qWait(60);
- QVERIFY(t.total > 2);
+ QTRY_VERIFY(t.total > 2);
}
class SlotRepeater : public QObject {
diff --git a/tests/auto/qvolatileimage/qvolatileimage.pro b/tests/auto/qvolatileimage/qvolatileimage.pro
new file mode 100644
index 0000000..5a0a613
--- /dev/null
+++ b/tests/auto/qvolatileimage/qvolatileimage.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+SOURCES += tst_qvolatileimage.cpp
+
+symbian {
+ TARGET.EPOCHEAPSIZE = 0x200000 0x800000
+ LIBS += -lfbscli
+}
diff --git a/tests/auto/qvolatileimage/tst_qvolatileimage.cpp b/tests/auto/qvolatileimage/tst_qvolatileimage.cpp
new file mode 100644
index 0000000..b91a150
--- /dev/null
+++ b/tests/auto/qvolatileimage/tst_qvolatileimage.cpp
@@ -0,0 +1,403 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 <QtGui/qpainter.h>
+#include <QtGui/qpaintengine.h>
+#include <QtGui/private/qvolatileimage_p.h>
+#ifdef Q_OS_SYMBIAN
+#include <fbs.h>
+#endif
+
+class tst_QVolatileImage : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QVolatileImage() { }
+
+private slots:
+ void create();
+ void ensureFormat();
+ void dataAccess();
+ void sharing();
+ void paint();
+ void fill();
+ void copy();
+ void bitmap();
+};
+
+void tst_QVolatileImage::create()
+{
+ QVolatileImage nullImg;
+ QVERIFY(nullImg.isNull());
+
+ QVolatileImage img(100, 200, QImage::Format_ARGB32);
+ QVERIFY(!img.isNull());
+ QCOMPARE(img.width(), 100);
+ QCOMPARE(img.height(), 200);
+ QCOMPARE(img.format(), QImage::Format_ARGB32);
+ QCOMPARE(img.byteCount(), img.bytesPerLine() * img.height());
+ QCOMPARE(img.hasAlphaChannel(), true);
+ QCOMPARE(img.depth(), 32);
+
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ img = QVolatileImage(source);
+ QVERIFY(!img.isNull());
+ QCOMPARE(img.width(), 12);
+ QCOMPARE(img.height(), 23);
+ QCOMPARE(img.format(), source.format());
+ QCOMPARE(img.byteCount(), img.bytesPerLine() * img.height());
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+ QCOMPARE(img.hasAlphaChannel(), true);
+ QCOMPARE(img.hasAlphaChannel(), img.imageRef().hasAlphaChannel());
+ QCOMPARE(img.hasAlphaChannel(), img.toImage().hasAlphaChannel());
+ QCOMPARE(img.depth(), 32);
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVERIFY(!bmpimg.isNull());
+ QCOMPARE(bmpimg.width(), 100);
+ QCOMPARE(bmpimg.height(), 50);
+ // Verify that we only did handle duplication, not pixel data copying.
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+ // Check if content is still valid.
+ QImage copyimg = bmpimg.toImage();
+ QCOMPARE(copyimg.format(), QImage::Format_ARGB32_Premultiplied);
+#endif
+}
+
+void tst_QVolatileImage::ensureFormat()
+{
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ QVolatileImage img(source);
+ QVERIFY(!img.isNull());
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+
+ QVERIFY(img.ensureFormat(QImage::Format_ARGB32_Premultiplied)); // no-op
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+ QVERIFY(img.format() == QImage::Format_ARGB32_Premultiplied);
+
+ QVERIFY(img.ensureFormat(QImage::Format_RGB32)); // new data under-the-hood
+ QVERIFY(img.imageRef() != source);
+ QVERIFY(img.toImage() != source);
+ QVERIFY(img.format() == QImage::Format_RGB32);
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied)); // no-op
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+
+ // A different format should cause data copying.
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB32));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ const uchar *prevBits = bmpimg.constBits();
+
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB16));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QVERIFY(bmpimg.constBits() != prevBits);
+ prevBits = bmpimg.constBits();
+
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_MonoLSB));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QVERIFY(bmpimg.constBits() != prevBits);
+
+ delete bmp;
+#endif
+}
+
+void tst_QVolatileImage::dataAccess()
+{
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ QVolatileImage img(source);
+ QVERIFY(!img.isNull());
+ img.beginDataAccess();
+ QVERIFY(img.constBits());
+ QVERIFY(img.imageRef().constBits());
+ QVERIFY(img.bits());
+ QVERIFY(img.imageRef().bits());
+ img.endDataAccess();
+
+ img = QVolatileImage(12, 23, QImage::Format_ARGB32);
+ img.beginDataAccess();
+ QVERIFY(img.constBits() && img.bits());
+ img.endDataAccess();
+}
+
+void tst_QVolatileImage::sharing()
+{
+ QVolatileImage img1(100, 100, QImage::Format_ARGB32);
+ QVolatileImage img2 = img1;
+ img1.beginDataAccess();
+ img2.beginDataAccess();
+ QVERIFY(img1.constBits() == img2.constBits());
+ img2.endDataAccess();
+ img1.endDataAccess();
+ img1.imageRef(); // non-const call, should detach
+ img1.beginDataAccess();
+ img2.beginDataAccess();
+ QVERIFY(img1.constBits() != img2.constBits());
+ img2.endDataAccess();
+ img1.endDataAccess();
+
+ // toImage() should return a copy of the internal QImage.
+ // imageRef() is a reference to the internal QImage.
+ QVERIFY(img1.imageRef().constBits() != img1.toImage().constBits());
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVolatileImage bmpimg2;
+ bmpimg2 = bmpimg;
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
+ // Now force a detach, which should copy the pixel data under-the-hood.
+ bmpimg.imageRef();
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+#endif
+}
+
+bool fuzzyCompareImages(const QImage &image1, const QImage &image2, int tolerance)
+{
+ if (image1.bytesPerLine() != image2.bytesPerLine()
+ || image1.width() != image2.width()
+ || image1.height() != image2.height()) {
+ return false;
+ }
+ for (int i = 0; i < image1.height(); i++) {
+ const uchar *line1 = image1.scanLine(i);
+ const uchar *line2 = image2.scanLine(i);
+ int bytes = image1.bytesPerLine();
+ for (int j = 0; j < bytes; j++) {
+ int delta = line1[j] - line2[j];
+ if (qAbs(delta) > tolerance)
+ return false;
+ }
+ }
+ return true;
+}
+
+void tst_QVolatileImage::paint()
+{
+#ifdef Q_OS_SYMBIAN
+ QVolatileImage img(100, 100, QImage::Format_ARGB32);
+ img.beginDataAccess();
+ img.imageRef().fill(QColor(Qt::green).rgba());
+ QPainter p(&img.imageRef());
+ p.drawRect(10, 10, 50, 50);
+ p.end();
+ img.endDataAccess();
+ QImage imgA = img.toImage();
+
+ // The following assumes that on openvg the pixmapdata is backed by QVolatileImage)
+ // (and that openvg is in use)
+ // It should pass with any engine nonetheless.
+ // See if painting into the underlying QImage succeeds.
+ QPixmap pm(100, 100);
+ if (pm.paintEngine()->type() == QPaintEngine::Raster) {
+ pm.fill(Qt::green);
+ QPainter pmp(&pm);
+ pmp.drawRect(10, 10, 50, 50);
+ pmp.end();
+ QImage imgB = pm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ // Exercise the accelerated QVolatileImagePaintEngine::drawPixmap() a bit.
+ QPixmap targetPm(pm.size());
+ targetPm.fill(Qt::black);
+ pmp.begin(&targetPm);
+ pmp.drawPixmap(QPointF(0, 0), pm);
+ pmp.end();
+ imgB = targetPm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ // Now the overload taking rects.
+ targetPm.fill(Qt::black);
+ pmp.begin(&targetPm);
+ QRectF rect(QPointF(0, 0), pm.size());
+ pmp.drawPixmap(rect, pm, rect);
+ pmp.end();
+ imgB = targetPm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ } else {
+ QSKIP("Pixmaps not painted via raster, skipping paint test", SkipSingle);
+ }
+#endif
+}
+
+void tst_QVolatileImage::fill()
+{
+ QVolatileImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
+ QColor col = QColor(10, 20, 30);
+ img.fill(col.rgba());
+ QVERIFY(img.imageRef().pixel(1, 1) == col.rgba());
+ QVERIFY(img.toImage().pixel(1, 1) == col.rgba());
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = static_cast<CFbsBitmap *>(img.duplicateNativeImage());
+ QVERIFY(bmp);
+ TRgb pix;
+ bmp->GetPixel(pix, TPoint(1, 1));
+ QCOMPARE(pix.Red(), col.red());
+ QCOMPARE(pix.Green(), col.green());
+ QCOMPARE(pix.Blue(), col.blue());
+ delete bmp;
+#endif
+}
+
+void tst_QVolatileImage::copy()
+{
+ QVolatileImage img(100, 100, QImage::Format_RGB32);
+ img.beginDataAccess();
+ img.imageRef().fill(QColor(Qt::green).rgba());
+ QPainter p(&img.imageRef());
+ p.drawRect(10, 10, 50, 50);
+ p.end();
+ img.endDataAccess();
+
+ QVolatileImage img2(100, 100, QImage::Format_RGB32);
+ img2.copyFrom(&img, QRect());
+ QImage imgA = img.toImage();
+ QImage imgB = img2.toImage();
+ QCOMPARE(imgA.size(), imgB.size());
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+
+ img2 = QVolatileImage(20, 20, QImage::Format_RGB32);
+ img2.copyFrom(&img, QRect(5, 5, 20, 20));
+ imgA = img.toImage().copy(5, 5, 20, 20);
+ imgB = img2.toImage();
+ QCOMPARE(imgA.size(), imgB.size());
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+}
+
+void tst_QVolatileImage::bitmap()
+{
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor64K) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ CFbsBitmap *dupbmp = static_cast<CFbsBitmap *>(bmpimg.duplicateNativeImage());
+ QVERIFY(dupbmp);
+ QVERIFY(dupbmp != bmp);
+ QCOMPARE(dupbmp->DataAddress(), bmp->DataAddress());
+ delete dupbmp;
+ delete bmp;
+ bmpimg.beginDataAccess();
+ qMemSet(bmpimg.bits(), 0, bmpimg.byteCount());
+ qMemSet(bmpimg.bits(), 1, bmpimg.bytesPerLine() * bmpimg.height());
+ bmpimg.endDataAccess();
+
+ // Test bgr->rgb conversion in case of EColor16M.
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16M) == KErrNone);
+ bmp->BeginDataAccess();
+ TUint32 *addr = bmp->DataAddress();
+ uint rgb = QColor(10, 20, 30).rgb();
+ qMemCopy(bmp->DataAddress(), &rgb, 3);
+ bmp->EndDataAccess();
+ TRgb symrgb;
+ bmp->GetPixel(symrgb, TPoint(0, 0));
+ QVERIFY(symrgb.Red() == 10 && symrgb.Green() == 20 && symrgb.Blue() == 30);
+ bmpimg = QVolatileImage(bmp);
+ QVERIFY(bmpimg.toImage().pixel(0, 0) == rgb);
+ // check if there really was a conversion
+ bmp->BeginDataAccess();
+ bmpimg.beginDataAccess();
+ qMemCopy(&rgb, bmpimg.constBits(), 3);
+ uint rgb2 = rgb;
+ qMemCopy(&rgb2, bmp->DataAddress(), 3);
+ QVERIFY(rgb != rgb2);
+ bmpimg.endDataAccess(true);
+ bmp->EndDataAccess(true);
+ delete bmp;
+
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EGray2) == KErrNone);
+ bmpimg = QVolatileImage(bmp); // inverts pixels, but should do it in place
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg.format(), QImage::Format_MonoLSB);
+ bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
+ delete bmp;
+
+ // The following two formats must be optimal always.
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16MAP) == KErrNone);
+ bmpimg = QVolatileImage(bmp);
+ QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16MU) == KErrNone);
+ bmpimg = QVolatileImage(bmp);
+ QCOMPARE(bmpimg.format(), QImage::Format_RGB32);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ bmpimg.ensureFormat(QImage::Format_RGB32);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+
+#else
+ QSKIP("CFbsBitmap is only available on Symbian, skipping bitmap test", SkipSingle);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication::setGraphicsSystem("openvg");
+ QApplication app(argc, argv);
+ tst_QVolatileImage tc;
+ return QTest::qExec(&tc, argc, argv);
+}
+
+#include "tst_qvolatileimage.moc"
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 2208bea..35014c9 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -10576,7 +10576,7 @@ void tst_QWidget::nativeChildFocus()
QTest::qWaitForWindowShown(&w);
QCOMPARE(QApplication::activeWindow(), &w);
- QCOMPARE(QApplication::focusWidget(), p1);
+ QCOMPARE(QApplication::focusWidget(), static_cast<QWidget*>(p1));
}
QTEST_MAIN(tst_QWidget)
diff --git a/tests/benchmarks/corelib/corelib.pro b/tests/benchmarks/corelib/corelib.pro
index 335280e..a2efe91 100644
--- a/tests/benchmarks/corelib/corelib.pro
+++ b/tests/benchmarks/corelib/corelib.pro
@@ -11,6 +11,7 @@ TRUSTED_BENCHMARKS += \
kernel/qmetaobject \
kernel/qmetatype \
kernel/qobject \
- thread/qthreadstorage
+ thread/qthreadstorage \
+ io/qdir/tree
include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
index b0c5702..aa4c15a 100644
--- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
index 497a556..a03e095 100644
--- a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
+++ b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index f94767b..fd5132c 100644
--- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
index 4016be1..a9e49b5 100644
--- a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
+++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 6cb62d0..041b61a 100644
--- a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -46,7 +46,7 @@
#include <qsslsocket.h>
-// #include "../../../../auto/network-settings.h"
+#include "../../../../auto/network-settings.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -65,6 +65,7 @@ public slots:
void init();
void cleanup();
private slots:
+ void rootCertLoading();
void systemCaCertificates();
};
@@ -89,6 +90,16 @@ void tst_QSslSocket::cleanup()
}
//----------------------------------------------------------------------------------
+
+void tst_QSslSocket::rootCertLoading()
+{
+ QBENCHMARK_ONCE {
+ QSslSocket socket;
+ socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.waitForEncrypted();
+ }
+}
+
void tst_QSslSocket::systemCaCertificates()
{
// The results of this test change if the benchmarking system changes too much.
diff --git a/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp b/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp
index 62f3c2a..926d2ce 100644
--- a/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp
+++ b/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/script/script.pro b/tests/benchmarks/script/script.pro
index d4fc822..80278d0 100644
--- a/tests/benchmarks/script/script.pro
+++ b/tests/benchmarks/script/script.pro
@@ -13,6 +13,8 @@ SUBDIRS = \
TRUSTED_BENCHMARKS += \
qscriptclass \
qscriptvalue \
- qscriptengine
+ qscriptengine \
+ qscriptobject \
+ context2d
include(../trusted-benchmarks.pri)
diff --git a/tests/benchmarks/script/sunspider/tst_sunspider.cpp b/tests/benchmarks/script/sunspider/tst_sunspider.cpp
index 0df19b6..da1458e 100644
--- a/tests/benchmarks/script/sunspider/tst_sunspider.cpp
+++ b/tests/benchmarks/script/sunspider/tst_sunspider.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -110,7 +110,7 @@ void tst_SunSpider::benchmark_data()
void tst_SunSpider::benchmark()
{
QFETCH(QString, testName);
- QString testContents = readFile(testsDir.absoluteFilePath(testName + ".js"));
+ QString testContents = readFile(testsDir.filePath(testName + ".js"));
QVERIFY(!testContents.isEmpty());
QScriptEngine engine;
diff --git a/tests/benchmarks/script/v8/tst_v8.cpp b/tests/benchmarks/script/v8/tst_v8.cpp
index 841e2f3..c23395a 100644
--- a/tests/benchmarks/script/v8/tst_v8.cpp
+++ b/tests/benchmarks/script/v8/tst_v8.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -115,10 +115,10 @@ void tst_V8::benchmark()
{
QFETCH(QString, testName);
- QString baseDotJsContents = readFile(testsDir.absoluteFilePath("base.js"));
+ QString baseDotJsContents = readFile(testsDir.filePath("base.js"));
QVERIFY(!baseDotJsContents.isEmpty());
- QString testContents = readFile(testsDir.absoluteFilePath(testName + ".js"));
+ QString testContents = readFile(testsDir.filePath(testName + ".js"));
QVERIFY(!testContents.isEmpty());
QScriptEngine engine;
diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh
index 7e942a4..0aae76a 100755
--- a/tests/manual/mkspecs/test.sh
+++ b/tests/manual/mkspecs/test.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#############################################################################
##
-## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf
index 491f159..4bd3842 100644
--- a/tools/assistant/tools/assistant/doc/assistant.qdocconf
+++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf
@@ -10,7 +10,7 @@ description = "Qt Assistant"
HTML.{postheader,address} = ""
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\">Trademarks</td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.8.0</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/assistant/tools/assistant/globalactions.cpp b/tools/assistant/tools/assistant/globalactions.cpp
index 0eeab21..7fc59eb 100644
--- a/tools/assistant/tools/assistant/globalactions.cpp
+++ b/tools/assistant/tools/assistant/globalactions.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/globalactions.h b/tools/assistant/tools/assistant/globalactions.h
index ca8d7eb..a9059a9 100644
--- a/tools/assistant/tools/assistant/globalactions.h
+++ b/tools/assistant/tools/assistant/globalactions.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index 2d31ad7..efb9b59 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -379,7 +379,7 @@ bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental
bool fromSearch)
{
TRACE_OBJ
- Q_UNUSED((incremental && fromSearch))
+ Q_UNUSED(incremental); Q_UNUSED(fromSearch);
QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument;
if (flags & FindBackward)
options |= QWebPage::FindBackward;
diff --git a/tools/assistant/tools/assistant/openpagesmanager.cpp b/tools/assistant/tools/assistant/openpagesmanager.cpp
index 75b8653..272d9e2 100644
--- a/tools/assistant/tools/assistant/openpagesmanager.cpp
+++ b/tools/assistant/tools/assistant/openpagesmanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpagesmanager.h b/tools/assistant/tools/assistant/openpagesmanager.h
index 5837392..c34686c 100644
--- a/tools/assistant/tools/assistant/openpagesmanager.h
+++ b/tools/assistant/tools/assistant/openpagesmanager.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpagesmodel.cpp b/tools/assistant/tools/assistant/openpagesmodel.cpp
index 2663b85..3517693 100644
--- a/tools/assistant/tools/assistant/openpagesmodel.cpp
+++ b/tools/assistant/tools/assistant/openpagesmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpagesmodel.h b/tools/assistant/tools/assistant/openpagesmodel.h
index 64013a6..dd28a7c 100644
--- a/tools/assistant/tools/assistant/openpagesmodel.h
+++ b/tools/assistant/tools/assistant/openpagesmodel.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpagesswitcher.cpp b/tools/assistant/tools/assistant/openpagesswitcher.cpp
index d4b7d82..8e7f29b 100644
--- a/tools/assistant/tools/assistant/openpagesswitcher.cpp
+++ b/tools/assistant/tools/assistant/openpagesswitcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpagesswitcher.h b/tools/assistant/tools/assistant/openpagesswitcher.h
index e27db6b..80c7e96 100644
--- a/tools/assistant/tools/assistant/openpagesswitcher.h
+++ b/tools/assistant/tools/assistant/openpagesswitcher.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/assistant/tools/assistant/openpageswidget.cpp b/tools/assistant/tools/assistant/openpageswidget.cpp
index b7ac33e..db03712 100644
--- a/tools/assistant/tools/assistant/openpageswidget.cpp
+++ b/tools/assistant/tools/assistant/openpageswidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index 0426b8c..714a556 100644
--- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -2278,6 +2278,7 @@ void QDesignerResource::createResources(DomResources *resources)
path = core()->dialogGui()->getOpenFileName(dialogParent, fileDialogTitle, fi.absolutePath(), fileDialogPattern);
if (path.isEmpty())
break;
+ m_formWindow->setProperty("_q_resourcepathchanged", QVariant(true));
} else {
break;
}
diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp
index 521b5cb..9f298d0 100644
--- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -91,6 +91,7 @@ static const char *ViewKeyC = "View";
static const char *ColorKeyC = "Colored";
static const char *SortedKeyC = "Sorted";
static const char *ExpansionKeyC = "ExpandedItems";
+static const char *SplitterPositionKeyC = "SplitterPosition";
enum SettingsView { TreeView, ButtonView };
@@ -365,10 +366,12 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare
m_sorting = settings->value(QLatin1String(SortedKeyC), false).toBool();
m_coloring = settings->value(QLatin1String(ColorKeyC), true).toBool();
const QVariantMap expansionState = settings->value(QLatin1String(ExpansionKeyC), QVariantMap()).toMap();
+ const int splitterPosition = settings->value(QLatin1String(SplitterPositionKeyC), 150).toInt();
settings->endGroup();
// Apply settings
m_sortingAction->setChecked(m_sorting);
m_coloringAction->setChecked(m_coloring);
+ m_treeBrowser->setSplitterPosition(splitterPosition);
#if QT_VERSION >= 0x040500
switch (view) {
case TreeView:
@@ -415,6 +418,7 @@ void PropertyEditor::saveSettings() const
expansionState.insert(it.key(), QVariant(it.value()));
}
settings->setValue(QLatin1String(ExpansionKeyC), expansionState);
+ settings->setValue(QLatin1String(SplitterPositionKeyC), m_treeBrowser->splitterPosition());
settings->endGroup();
}
diff --git a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
index 3ac0167..ac1fe1c 100644
--- a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
+++ b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
@@ -244,7 +244,12 @@ namespace qdesigner_internal {
ClassesMemberFunctions reverseClassesMemberFunctions(const QString &obj_name, MemberType member_type,
const QString &peer, QDesignerFormWindowInterface *form)
{
- QObject *object = form->mainContainer()->findChild<QObject*>(obj_name);
+ QObject *object = 0;
+ if (obj_name == form->mainContainer()->objectName()) {
+ object = form->mainContainer();
+ } else {
+ object = form->mainContainer()->findChild<QObject*>(obj_name);
+ }
if (!object)
return ClassesMemberFunctions();
QDesignerFormEditorInterface *core = form->core();
diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index 86ce674..b06a66f 100644
--- a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -658,8 +658,12 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent,
const qdesigner_internal::ClassesMemberFunctions class_list = qdesigner_internal::reverseClassesMemberFunctions(obj_name, type, peer, m_form);
- QObject *object = m_form->mainContainer()->findChild<QObject*>(obj_name);
-
+ QObject *object = 0;
+ if (obj_name == m_form->mainContainer()->objectName()) {
+ object = m_form->mainContainer();
+ } else {
+ object = m_form->mainContainer()->findChild<QObject*>(obj_name);
+ }
inline_editor->addText(type == qdesigner_internal::SignalMember ? tr("<signal>") : tr("<slot>"));
foreach (const qdesigner_internal::ClassMemberFunctions &class_info, class_list) {
if (class_info.m_className.isEmpty() || class_info.m_memberList.isEmpty())
diff --git a/tools/designer/src/components/taskmenu/button_taskmenu.cpp b/tools/designer/src/components/taskmenu/button_taskmenu.cpp
index b0b7d4a..953996b 100644
--- a/tools/designer/src/components/taskmenu/button_taskmenu.cpp
+++ b/tools/designer/src/components/taskmenu/button_taskmenu.cpp
@@ -528,7 +528,7 @@ bool ButtonTaskMenu::refreshAssignMenu(const QDesignerFormWindowInterface *fw, i
QList<QAction*> ButtonTaskMenu::taskActions() const
{
ButtonTaskMenu *ncThis = const_cast<ButtonTaskMenu*>(this);
- QButtonGroup *buttonGroup;
+ QButtonGroup *buttonGroup = 0;
QDesignerFormWindowInterface *fw = formWindow();
const SelectionType st = selectionType(fw->cursor(), &buttonGroup);
diff --git a/tools/designer/src/designer/qdesigner_formwindow.cpp b/tools/designer/src/designer/qdesigner_formwindow.cpp
index 1fbdcec..4770d2a 100644
--- a/tools/designer/src/designer/qdesigner_formwindow.cpp
+++ b/tools/designer/src/designer/qdesigner_formwindow.cpp
@@ -159,6 +159,7 @@ void QDesignerFormWindow::firstShow()
if (m_editor) {
connect(m_editor, SIGNAL(fileNameChanged(QString)), this, SLOT(updateWindowTitle(QString)));
updateWindowTitle(m_editor->fileName());
+ updateChanged();
}
}
show();
diff --git a/tools/designer/src/designer/qdesigner_workbench.cpp b/tools/designer/src/designer/qdesigner_workbench.cpp
index 836feb7..840667a 100644
--- a/tools/designer/src/designer/qdesigner_workbench.cpp
+++ b/tools/designer/src/designer/qdesigner_workbench.cpp
@@ -966,7 +966,9 @@ QDesignerFormWindow * QDesignerWorkbench::loadForm(const QString &fileName,
return 0;
}
*uic3Converted = editor->fileName().isEmpty();
- editor->setDirty(false);
+ // Did user specify another (missing) resource path -> set dirty.
+ const bool dirty = editor->property("_q_resourcepathchanged").toBool();
+ editor->setDirty(dirty);
resizeForm(formWindow, editor->mainContainer());
formWindowManager->setActiveFormWindow(editor);
return formWindow;
diff --git a/tools/designer/src/lib/shared/grid.cpp b/tools/designer/src/lib/shared/grid.cpp
index 6add8bd..ba991c7 100644
--- a/tools/designer/src/lib/shared/grid.cpp
+++ b/tools/designer/src/lib/shared/grid.cpp
@@ -89,12 +89,20 @@ Grid::Grid() :
bool Grid::fromVariantMap(const QVariantMap& vm)
{
- *this = Grid();
- valueFromVariantMap(vm, QLatin1String(KEY_VISIBLE), m_visible);
- valueFromVariantMap(vm, QLatin1String(KEY_SNAPX), m_snapX);
- valueFromVariantMap(vm, QLatin1String(KEY_SNAPY), m_snapY);
- valueFromVariantMap(vm, QLatin1String(KEY_DELTAX), m_deltaX);
- return valueFromVariantMap(vm, QLatin1String(KEY_DELTAY), m_deltaY);
+ Grid grid;
+ bool anyData = valueFromVariantMap(vm, QLatin1String(KEY_VISIBLE), grid.m_visible);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_SNAPX), grid.m_snapX);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_SNAPY), grid.m_snapY);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_DELTAX), grid.m_deltaX);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_DELTAY), grid.m_deltaY);
+ if (!anyData)
+ return false;
+ if (grid.m_deltaX == 0 || grid.m_deltaY == 0) {
+ qWarning("Attempt to set invalid grid with a spacing of 0.");
+ return false;
+ }
+ *this = grid;
+ return true;
}
QVariantMap Grid::toVariantMap(bool forceKeys) const
diff --git a/tools/doxygen/config/footer.html b/tools/doxygen/config/footer.html
index 8e99c72..d7e968d 100644
--- a/tools/doxygen/config/footer.html
+++ b/tools/doxygen/config/footer.html
@@ -1,6 +1,6 @@
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
-<td width="30%">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies).</td>
+<td width="30%">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies).</td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt $projectnumber</div></td>
</tr></table></div></address>
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index e27916b..c2cad89 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -49,6 +49,8 @@
#include "text.h"
#include "tree.h"
+#include <ctype.h>
+
QT_BEGIN_NAMESPACE
/*!
diff --git a/tools/qdoc3/doc/files/qt.qdocconf b/tools/qdoc3/doc/files/qt.qdocconf
index 44cfbc1..9b16233 100644
--- a/tools/qdoc3/doc/files/qt.qdocconf
+++ b/tools/qdoc3/doc/files/qt.qdocconf
@@ -22,7 +22,7 @@ edition.DesktopLight.groups = -graphicsview-api
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.473
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.indexRoot =
@@ -36,9 +36,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.3 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.7.3
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.3
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
diff --git a/tools/qdoc3/doc/qdoc-manual.qdocconf b/tools/qdoc3/doc/qdoc-manual.qdocconf
index 9514d63..53486be 100644
--- a/tools/qdoc3/doc/qdoc-manual.qdocconf
+++ b/tools/qdoc3/doc/qdoc-manual.qdocconf
@@ -174,7 +174,7 @@ HTML.footer = "" \
" </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
+ " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
" subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
" in Finland and/or other countries worldwide.</p>\n" \
" <p>\n" \
diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp
index 5a513f7..e0b7c50 100644
--- a/tools/qdoc3/jscodemarker.cpp
+++ b/tools/qdoc3/jscodemarker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/qmlcodemarker.cpp b/tools/qdoc3/qmlcodemarker.cpp
index a7dc5a0..bdb2631 100644
--- a/tools/qdoc3/qmlcodemarker.cpp
+++ b/tools/qdoc3/qmlcodemarker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/qmlcodeparser.cpp b/tools/qdoc3/qmlcodeparser.cpp
index 9c1d4ee..269a566 100644
--- a/tools/qdoc3/qmlcodeparser.cpp
+++ b/tools/qdoc3/qmlcodeparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp
index 7acac48..f849319 100644
--- a/tools/qdoc3/qmlmarkupvisitor.cpp
+++ b/tools/qdoc3/qmlmarkupvisitor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h
index 709a858..6cee613 100644
--- a/tools/qdoc3/qmlmarkupvisitor.h
+++ b/tools/qdoc3/qmlmarkupvisitor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp
index 9295624..7045313 100644
--- a/tools/qdoc3/qmlvisitor.cpp
+++ b/tools/qdoc3/qmlvisitor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf
index 4d43403..ff50ce6 100644
--- a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf
+++ b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf
@@ -6,7 +6,7 @@ macro.TheEclipseIntegration = Carbide.c++
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\"><a href=\"http://qt.nokia.com/doc\">Trademarks</a></td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Carbide.c++</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/qdoc3/test/jambi.qdocconf b/tools/qdoc3/test/jambi.qdocconf
index aa87826..3f4b42d 100644
--- a/tools/qdoc3/test/jambi.qdocconf
+++ b/tools/qdoc3/test/jambi.qdocconf
@@ -42,7 +42,7 @@ HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Jambi \\version</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
index fa15d90..a69d7a1 100644
--- a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
@@ -149,7 +149,7 @@ HTML.footer = \
" </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
+ " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
" subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
" in Finland and/or other countries worldwide.</p>\n" \
" <p>\n" \
diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf
index 18ed5c1..74a4d14 100644
--- a/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf
@@ -36,7 +36,7 @@ HTML.footer = \
" </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
+ " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
" subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
" in Finland and/or other countries worldwide.</p>\n" \
" <p>\n" \
diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
index 285ec27..ed2162e 100644
--- a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
@@ -149,7 +149,7 @@ HTML.footer = \
" </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
+ " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
" subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
" in Finland and/or other countries worldwide.</p>\n" \
" <p>\n" \
diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf
index 402ee9e..b4c8f7b 100644
--- a/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf
@@ -149,7 +149,7 @@ HTML.footer = \
" </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
+ " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
" subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
" in Finland and/or other countries worldwide.</p>\n" \
" <p>\n" \
diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf
index 3ed7cff..2da0e90 100644
--- a/tools/qdoc3/test/qt-project.qdocconf
+++ b/tools/qdoc3/test/qt-project.qdocconf
@@ -6,7 +6,7 @@ include(qt-defines.qdocconf)
project = Qt
description = Qt Reference Documentation
url = http://qt.nokia.com/doc/4.7
-version = 4.7.2
+version = 4.7.3
sourceencoding = UTF-8
outputencoding = UTF-8
@@ -15,14 +15,14 @@ naturallanguage = en_US
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.473
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.indexRoot =
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.3 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.7.3
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.3
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
diff --git a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf
index 96c2c98..850a2db 100644
--- a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf
+++ b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf
@@ -5,7 +5,7 @@ macro.TheEclipseIntegration = The Qt Eclipse Integration
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\"><a href=\"http://qt.nokia.com/doc/trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Eclipse Integration 1.5.3</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
index e1c0460..ac32995 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
@@ -111,6 +111,8 @@ void QMeeGoGraphicsSystemHelper::switchToRaster()
QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
app->setGraphicsSystem(QLatin1String("raster"));
+ QMeeGoRuntime::invalidateLiveSurfaces();
+
QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch);
foreach (QWidget *widget, QApplication::topLevelWidgets())
QCoreApplication::sendEvent(widget, &didSwitchEvent);
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
index c32b654..7c81d51 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
@@ -65,6 +65,7 @@ typedef bool (*QMeeGoLiveTextureReleaseFunc) (QPixmap*, QImage *i);
typedef Qt::HANDLE (*QMeeGoLiveTextureGetHandleFunc) (QPixmap*);
typedef void* (*QMeeGoCreateFenceSyncFunc) (void);
typedef void (*QMeeGoDestroyFenceSyncFunc) (void *fs);
+typedef void (*QMeeGoInvalidateLiveSurfacesFunc) (void);
static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL;
static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL;
@@ -81,6 +82,7 @@ static QMeeGoLiveTextureReleaseFunc qt_meego_live_texture_release = NULL;
static QMeeGoLiveTextureGetHandleFunc qt_meego_live_texture_get_handle = NULL;
static QMeeGoCreateFenceSyncFunc qt_meego_create_fence_sync = NULL;
static QMeeGoDestroyFenceSyncFunc qt_meego_destroy_fence_sync = NULL;
+static QMeeGoInvalidateLiveSurfacesFunc qt_meego_invalidate_live_surfaces = NULL;
void QMeeGoRuntime::initialize()
{
@@ -109,13 +111,14 @@ void QMeeGoRuntime::initialize()
qt_meego_live_texture_get_handle = (QMeeGoLiveTextureGetHandleFunc) library.resolve("qt_meego_live_texture_get_handle");
qt_meego_create_fence_sync = (QMeeGoCreateFenceSyncFunc) library.resolve("qt_meego_create_fence_sync");
qt_meego_destroy_fence_sync = (QMeeGoDestroyFenceSyncFunc) library.resolve("qt_meego_destroy_fence_sync");
+ qt_meego_invalidate_live_surfaces = (QMeeGoInvalidateLiveSurfacesFunc) library.resolve("qt_meego_invalidate_live_surfaces");
if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image &&
qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap &&
qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent &&
qt_meego_pixmapdata_with_new_live_texture && qt_meego_pixmapdata_from_live_texture_handle &&
qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle &&
- qt_meego_create_fence_sync && qt_meego_destroy_fence_sync)
+ qt_meego_create_fence_sync && qt_meego_destroy_fence_sync && qt_meego_invalidate_live_surfaces)
{
qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion));
} else {
@@ -232,3 +235,10 @@ void QMeeGoRuntime::destroyFenceSync(void *fs)
Q_ASSERT(qt_meego_destroy_fence_sync);
qt_meego_destroy_fence_sync(fs);
}
+
+void QMeeGoRuntime::invalidateLiveSurfaces()
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_invalidate_live_surfaces);
+ qt_meego_invalidate_live_surfaces();
+}
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h
index bdc4eef..b91efae 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.h
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h
@@ -62,6 +62,7 @@ public:
static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap);
static void* createFenceSync();
static void destroyFenceSync(void *fs);
+ static void invalidateLiveSurfaces();
private:
static bool initialized;
diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
index 0ab272f..b833e31 100644
--- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
@@ -65,4 +65,4 @@ QEvent::Type QMeeGoSwitchEvent::eventNumber()
switchEventNumber = QEvent::registerEventType();
return (QEvent::Type) switchEventNumber;
-} \ No newline at end of file
+}
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index 08cd506..cfc74af 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -19,18 +19,18 @@ SOURCES += $$PWD/qmlruntime.cpp \
RESOURCES = $$PWD/browser/browser.qrc \
$$PWD/startup/startup.qrc
-symbian: {
- contains(QT_CONFIG, s60): {
+symbian {
+ contains(QT_CONFIG, s60) {
LIBS += -lavkon -lcone
}
!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
LIBS += -lsensrvclient -lsensrvutil
- }
- !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2): {
SOURCES += $$PWD/deviceorientation_symbian.cpp
- FORMS = $$PWD/recopts.ui \
- $$PWD/proxysettings.ui
+ } else {
+ SOURCES += $$PWD/deviceorientation.cpp
}
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
} else:maemo5 {
QT += dbus
HEADERS += $$PWD/texteditautoresizer_maemo5.h
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 5d6192d..b1d56ea 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -39,8 +39,8 @@ symbian {
TARGET.CAPABILITY = NetworkServices ReadUserData
# Deploy plugin for remote debugging
- qmldebuggingplugin.sources = $$QT_BUILD_TREE/plugins/qmldebugging/tcpserver$${QT_LIBINFIX}.dll
- qmldebuggingplugin.path = c:$$QT_PLUGINS_BASE_DIR/qmldebugging
+ qmldebuggingplugin.sources = $$QT_BUILD_TREE/plugins/qmltooling/tcpserver$${QT_LIBINFIX}.dll
+ qmldebuggingplugin.path = c:$$QT_PLUGINS_BASE_DIR/qmltooling
DEPLOYMENT += qmldebuggingplugin
}
mac {
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index 9390fb4..5281544 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -56,12 +56,13 @@
void printUsage(QTextStream& outstream, QString exeName)
{
outstream << exeName << " [options] [program] [program arguments]" << endl
- << "-s, --sis <file> specify sis file to install" << endl
+ << "-s, --sis <local file> specify sis file to install" << endl
<< "-p, --portname <COMx> specify COM port to use by device name" << endl
<< "-f, --portfriendlyname <substring> specify COM port to use by friendly name" << endl
<< "-t, --timeout <milliseconds> terminate test if timeout occurs" << endl
<< "-v, --verbose show debugging output" << endl
<< "-q, --quiet hide progress messages" << endl
+ << "-u, --upload <local file> upload executable file to phone" << endl
<< "-d, --download <remote file> <local file> copy file from phone to PC after running test" << endl
<< "--nocrashlog Don't capture call stack if test crashes" << endl
<< "--crashlogpath <dir> Path to save crash logs (default=working dir)" << endl
@@ -84,6 +85,7 @@ int main(int argc, char *argv[])
QStringList args = QCoreApplication::arguments();
QTextStream outstream(stdout);
QTextStream errstream(stderr);
+ QString uploadLocalFile;
QString downloadRemoteFile;
QString downloadLocalFile;
int loglevel=1;
@@ -112,6 +114,18 @@ int main(int argc, char *argv[])
return 1;
}
}
+ else if (arg == "--upload" || arg == "-u") {
+ CHECK_PARAMETER_EXISTS
+ uploadLocalFile = it.next();
+ if (!QFileInfo(uploadLocalFile).exists()) {
+ errstream << "Executable file (" << uploadLocalFile << ") doesn't exist" << endl;
+ return 1;
+ }
+ if (!(QFileInfo(uploadLocalFile).suffix() == "exe")) {
+ errstream << "File (" << uploadLocalFile << ") must be an executable" << endl;
+ return 1;
+ }
+ }
else if (arg == "--download" || arg == "-d") {
CHECK_PARAMETER_EXISTS
downloadRemoteFile = it.next();
@@ -147,12 +161,18 @@ int main(int argc, char *argv[])
}
}
- if (exeFile.isEmpty() && sisFile.isEmpty() &&
+ if (exeFile.isEmpty() && sisFile.isEmpty() && uploadLocalFile.isEmpty() &&
(downloadLocalFile.isEmpty() || downloadRemoteFile.isEmpty())) {
printUsage(outstream, args[0]);
return 1;
}
+ if (!uploadLocalFile.isEmpty() && (!downloadLocalFile.isEmpty() || !downloadRemoteFile.isEmpty())) {
+ errstream << "Upload option can't be used together with download" << endl;
+ printUsage(outstream, args[0]);
+ return 1;
+ }
+
if (serialPortName.isEmpty()) {
if (loglevel > 0)
outstream << "Detecting serial ports" << endl;
@@ -182,19 +202,20 @@ int main(int argc, char *argv[])
QScopedPointer<trk::Launcher> launcher;
launcher.reset(new trk::Launcher(trk::Launcher::ActionPingOnly));
- QFileInfo info(exeFile);
+ QFileInfo exeInfo(exeFile);
+ QFileInfo uploadInfo(uploadLocalFile);
if (!sisFile.isEmpty()) {
launcher->addStartupActions(trk::Launcher::ActionCopyInstall);
launcher->setCopyFileName(sisFile, "c:\\data\\testtemp.sis");
launcher->setInstallFileName("c:\\data\\testtemp.sis");
}
- else if (info.exists()) {
+ else if (!uploadLocalFile.isEmpty() && uploadInfo.exists()) {
launcher->addStartupActions(trk::Launcher::ActionCopy);
- launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + info.fileName());
+ launcher->setCopyFileName(uploadLocalFile, QString("c:\\sys\\bin\\") + uploadInfo.fileName());
}
if (!exeFile.isEmpty()) {
launcher->addStartupActions(trk::Launcher::ActionRun);
- launcher->setFileName(QString("c:\\sys\\bin\\") + info.fileName());
+ launcher->setFileName(QString("c:\\sys\\bin\\") + exeInfo.fileName());
launcher->setCommandLineArgs(cmdLine);
}
if (!downloadRemoteFile.isEmpty() && !downloadLocalFile.isEmpty()) {
diff --git a/tools/shared/symbian/epocroot.cpp b/tools/shared/symbian/epocroot.cpp
index e128cd2..5e6bc12 100644
--- a/tools/shared/symbian/epocroot.cpp
+++ b/tools/shared/symbian/epocroot.cpp
@@ -99,6 +99,11 @@ static void fixEpocRoot(QString &path)
if (!path.size() || path[path.size()-1] != QLatin1Char('/')) {
path += QLatin1Char('/');
}
+#ifdef Q_OS_WIN32
+ // Make sure we have drive letter in epocroot
+ if (path.startsWith(QLatin1Char('/')))
+ path.prepend(QDir::currentPath().left(2));
+#endif
}
/**
diff --git a/translations/assistant_cs.ts b/translations/assistant_cs.ts
index 9b9e486..be54f86 100755
--- a/translations/assistant_cs.ts
+++ b/translations/assistant_cs.ts
@@ -1078,7 +1078,7 @@ Grund:
<translation>Nepodařilo se najít příslušnou položku obsahu.</translation>
</message>
<message>
- <source>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Version %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;</source>
+ <source>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Version %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;</source>
<translation>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Verze %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Autorské právo (C) 2009 Nokia Corporation a/nebo její dceřinná společnost(i).&lt;/p&gt;</translation>
</message>
<message>
diff --git a/translations/assistant_sl.ts b/translations/assistant_sl.ts
index a7f79e0..40dff80 100644
--- a/translations/assistant_sl.ts
+++ b/translations/assistant_sl.ts
@@ -1088,7 +1088,7 @@ Razlog:
</message>
<message>
<source>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Version %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;</source>
- <translation>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Različica %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Avtorske pravice © 2010 Nokia Corporation in/ali njene podružnice.&lt;/p&gt;&lt;p&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;&lt;/p&gt;</translation>
+ <translation>&lt;center&gt;&lt;h3&gt;%1&lt;/h3&gt;&lt;p&gt;Različica %2&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Avtorske pravice © 2011 Nokia Corporation in/ali njene podružnice.&lt;/p&gt;&lt;p&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;&lt;/p&gt;</translation>
</message>
<message>
<source>About %1</source>
diff --git a/translations/designer_cs.ts b/translations/designer_cs.ts
index 4099695..3db20bd 100755
--- a/translations/designer_cs.ts
+++ b/translations/designer_cs.ts
@@ -3259,7 +3259,7 @@ Chcete tuto předlohu přepsat?</translation>
<translation>&lt;br/&gt;Qt Designer je obrazový návrhář uživatelského rozhraní pro programy Qt.&lt;br/&gt;</translation>
</message>
<message>
- <source>%1&lt;br/&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</source>
+ <source>%1&lt;br/&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</source>
<translation>%1&lt;br/&gt;Autorské právo (C) 2009 Nokia Corporation a/nebo její dceřinná společnost(i).</translation>
</message>
<message>
diff --git a/translations/linguist_cs.ts b/translations/linguist_cs.ts
index 5023355..fb56289 100755
--- a/translations/linguist_cs.ts
+++ b/translations/linguist_cs.ts
@@ -1907,8 +1907,8 @@ Všechny soubory (*)</translation>
<translation>Verze %1</translation>
</message>
<message>
- <source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</source>
- <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist je nástrojem pro přidávání překladů do programů Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation a/nebo její dceřinná společnost(i).</translation>
+ <source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</source>
+ <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist je nástrojem pro přidávání překladů do programů Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation a/nebo její dceřinná společnost(i).</translation>
</message>
<message>
<source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</source>
diff --git a/translations/linguist_sl.ts b/translations/linguist_sl.ts
index 4499133..b5769e4 100644
--- a/translations/linguist_sl.ts
+++ b/translations/linguist_sl.ts
@@ -1749,7 +1749,7 @@ Vse datoteke (*)</translation>
</message>
<message>
<source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</source>
- <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist je orodje za dodajanje prevodov programom Qt..&lt;/p&gt;&lt;p&gt;Avtorske pravice © 2010 Nokia Corporation in/ali njene podružnice.&lt;/p&gt;&lt;p&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;&lt;/p&gt;</translation>
+ <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist je orodje za dodajanje prevodov programom Qt..&lt;/p&gt;&lt;p&gt;Avtorske pravice © 2011 Nokia Corporation in/ali njene podružnice.&lt;/p&gt;&lt;p&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;&lt;/p&gt;</translation>
</message>
<message>
<source>Do you want to save the modified files?</source>
diff --git a/translations/qt_cs.ts b/translations/qt_cs.ts
index 3e72f01..193dfa4 100755
--- a/translations/qt_cs.ts
+++ b/translations/qt_cs.ts
@@ -3763,8 +3763,8 @@ Ověřte, prosím, že byl zadán správný název souboru.</translation>
<translation>Nápověda</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation>&lt;p&gt;Qt je sadou softwarových nástrojů C++ určených pro vývoj aplikací napříč platformami.&lt;/p&gt;&lt;p&gt;Qt poskytuje jednoduchou přenositelnost přes MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, a všechny hlavní obchodní varianty systému Unix. Qt je rovněž dostupný pro vložená zařízení jako Qt pro Embedded Linux a Qt pro Windows CE.&lt;/p&gt;&lt;p&gt;Qt je dostupné pod třemi rozdílnými licenčními volbami navrženými pro přizpůsobení se potřebám našich různých uživatelů.&lt;/p&gt;Qt licencované pod naší obchodní licenční smlouvou je vhodné pro vývoj soukromého/obchodního software, kde si nepřejete sdílet jakýkoli zdrojový kód se třetími stranami, nebo jinak řečeno, když nemůžete vyhovět podmínkám GNU LGPL ve verzi 2.1 nebo GNU GPL ve verzi 3.0.&lt;/p&gt;&lt;p&gt;Qt licencované pod GNU LGPL ve verzi 2.1 je vhodné pro vývoj Qt aplikací (soukromých nebo s otevřeným zdrojovým kódem), za předpokladu že můžete souhlasit s požadavky a podmínkami GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licencované pod GNU General Public License ve verzi 3.0 je vhodné pro vývoj aplikací Qt, u nichž si přejete použít takovou aplikaci ve spojení se software, který podléhá požadavkům GNU GPL ve verzi 3.0, nebo kde jste jinak ochoten souhlasit s podmínkami GNU GPL ve verzi 3.0.&lt;/p&gt;&lt;p&gt;Podívejte se, prosím, na &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; kvůli přehledu licencování Qt.&lt;/p&gt;&lt;p&gt;Autorské právo (C) 2010 Nokia Corporation a/nebo její dceřinná(é) společnost(i).&lt;/p&gt;&lt;p&gt;Qt je výrobkem společnosti Nokia. Podívejte se na &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt;kvůli více informacím.&lt;/p&gt;</translation>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;Qt je sadou softwarových nástrojů C++ určených pro vývoj aplikací napříč platformami.&lt;/p&gt;&lt;p&gt;Qt poskytuje jednoduchou přenositelnost přes MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, a všechny hlavní obchodní varianty systému Unix. Qt je rovněž dostupný pro vložená zařízení jako Qt pro Embedded Linux a Qt pro Windows CE.&lt;/p&gt;&lt;p&gt;Qt je dostupné pod třemi rozdílnými licenčními volbami navrženými pro přizpůsobení se potřebám našich různých uživatelů.&lt;/p&gt;Qt licencované pod naší obchodní licenční smlouvou je vhodné pro vývoj soukromého/obchodního software, kde si nepřejete sdílet jakýkoli zdrojový kód se třetími stranami, nebo jinak řečeno, když nemůžete vyhovět podmínkám GNU LGPL ve verzi 2.1 nebo GNU GPL ve verzi 3.0.&lt;/p&gt;&lt;p&gt;Qt licencované pod GNU LGPL ve verzi 2.1 je vhodné pro vývoj Qt aplikací (soukromých nebo s otevřeným zdrojovým kódem), za předpokladu že můžete souhlasit s požadavky a podmínkami GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licencované pod GNU General Public License ve verzi 3.0 je vhodné pro vývoj aplikací Qt, u nichž si přejete použít takovou aplikaci ve spojení se software, který podléhá požadavkům GNU GPL ve verzi 3.0, nebo kde jste jinak ochoten souhlasit s podmínkami GNU GPL ve verzi 3.0.&lt;/p&gt;&lt;p&gt;Podívejte se, prosím, na &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; kvůli přehledu licencování Qt.&lt;/p&gt;&lt;p&gt;Autorské právo (C) 2011 Nokia Corporation a/nebo její dceřinná(é) společnost(i).&lt;/p&gt;&lt;p&gt;Qt je výrobkem společnosti Nokia. Podívejte se na &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt;kvůli více informacím.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;h3&gt;About Qt&lt;/h3&gt;&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
diff --git a/translations/qt_gl.ts b/translations/qt_gl.ts
index 23e71c2..2431a5d 100644
--- a/translations/qt_gl.ts
+++ b/translations/qt_gl.ts
@@ -3728,7 +3728,7 @@ ou comercial onde non é preciso compartir ningún código fonte con terceiras p
&lt;p&gt;Qt é un produto de Nokia. Consulte &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; para máis información.&lt;/p&gt;</translation>
</message>
<message>
- <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
<translation type="obsolete">&lt;p&gt;Qt é un toolkit de C++ para o desenvolvemento de programas multiplataforma.&lt;/p&gt; &lt;p&gt;Qt fornece portabilidade entre MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux e as principais variantes comerciais de Unix cun único código fonte. Qt tamén está dispoñíbel para dispositivos incrustados como Qt para Embedded Linux e Qt para Windows CE.&lt;/p&gt;
&lt;p&gt;Qt está dispoñíbel en tres opcións de licenzas diferentes deseñadas para adaptarse ás necesidades dos diferentes usuarios.&lt;/p&gt;
&lt;/p&gt;Qt distribuída sob o acordo de licenza comercial é adecuado para o desenvolvemento de software propietario
@@ -3736,7 +3736,7 @@ ou comercial onde non é preciso compartir ningún código fonte con terceiras p
&lt;p&gt;Qt sob a licenza GNU General Public License versión 2.1 é apropiada para o desenvolvemento de programas Qt (propietario ou de fontes abertas) supoñendo que poda cumprir cos termos e condicións da licenza GNU GPL versión 2.1.&lt;/p&gt;
&lt;p&gt;Qt sob a licenza GNU General Public License versión 3.0 é apropiada para o desenvolvemento de programas Qt onde desexe empregar tales programas en combinación con software suxeito aos termos da GNU GPL versión 3.0 ou onde desexe cumprir cos termos da GNU GPL versión 3.0.&lt;/p&gt;
&lt;p&gt;Consulte &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; para ler un resumo das licenzas de Qt.&lt;/p&gt;
-&lt;p&gt;Copyright (C) 2010 Nokia Corporation ou as súas subsidiarias.&lt;/p&gt;
+&lt;p&gt;Copyright (C) 2011 Nokia Corporation ou as súas subsidiarias.&lt;/p&gt;
&lt;p&gt;Qt é un produto de Nokia. Consulte &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; para máis información.&lt;/p&gt;</translation>
</message>
<message>
diff --git a/translations/qtconfig_sl.ts b/translations/qtconfig_sl.ts
index 568efbe..9e09432 100644
--- a/translations/qtconfig_sl.ts
+++ b/translations/qtconfig_sl.ts
@@ -96,7 +96,7 @@
</message>
<message>
<source>&lt;h3&gt;%1&lt;/h3&gt;&lt;br/&gt;Version %2&lt;br/&gt;&lt;br/&gt;Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</source>
- <translation>&lt;h3&gt;%1&lt;/h3&gt;&lt;br/&gt;Različica %2&lt;br/&gt;&lt;br/&gt;Avtorske pravice © 2010 Nokia Corporation in/ali njene podružnice.&lt;br/&gt;&lt;br/&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;</translation>
+ <translation>&lt;h3&gt;%1&lt;/h3&gt;&lt;br/&gt;Različica %2&lt;br/&gt;&lt;br/&gt;Avtorske pravice © 2011 Nokia Corporation in/ali njene podružnice.&lt;br/&gt;&lt;br/&gt;Prevedel: &lt;a href=&quot;mailto:jlp@holodeck1.com&quot;&gt;Jure Repinc&lt;/a&gt;, &lt;a href=&quot;http://www.lugos.si/&quot;&gt;LUGOS&lt;/a&gt;</translation>
</message>
<message>
<source>Qt Configuration</source>
diff --git a/util/integrity/qt.bod b/util/integrity/qt.bod
new file mode 100644
index 0000000..bdf50ce
--- /dev/null
+++ b/util/integrity/qt.bod
@@ -0,0 +1,111 @@
+CommandOptions {
+ MOCCommandOptions {
+ MOCOutput {
+ {
+ name="-o"
+ }
+ delimiter="Space"
+ merge="Replace"
+ #flags={"OUTPUTNAME"}
+ }
+ MOCDefines {
+ {
+ name="-D"
+ }
+ delimiter="Touching"
+ merge="Concat"
+ }
+ MOCIncludes {
+ {
+ name="-I"
+ }
+ delimiter="Touching"
+ merge="Concat"
+ flags={"RELATIVEPATH"}
+ }
+ }
+ UICommandOptions {
+ UIOutput {
+ {
+ name="-o"
+ }
+ delimiter="Space"
+ merge="Replace"
+ flags={"OUTPUTNAME"}
+ }
+ }
+ RCCCommandOptions {
+ RCCOutput {
+ {
+ name="-o"
+ }
+ delimiter="Space"
+ merge="Replace"
+ flags={"OUTPUTNAME"}
+ }
+ RCCName {
+ {
+ name="-name"
+ }
+ delimiter="Space"
+ merge="Replace"
+ }
+ }
+}
+
+Commands {
+ MOCPreprocessor {
+ name="MOCPreprocessor"
+ exec="${QT_BUILD_DIR}/bin/moc"
+ options={ "MOCCommandOptions", "SpecialOptions" }
+ }
+ UIPreprocessor {
+ name="UIPreprocessor"
+ exec="${QT_BUILD_DIR}/bin/uic"
+ options={ "UICommandOptions" }
+ }
+ RCCPreprocessor {
+ name="RCCPreprocessor"
+ exec="${QT_BUILD_DIR}/bin/rcc"
+ options={ "RCCCommandOptions" }
+ }
+}
+
+FileTypes {
+ MocCPP {
+ name="MOC/Qt Header"
+ outputExtension="time"
+ outputType="SourceFile"
+ command="MOCPreprocessor"
+ commandLine="${QT_BUILD_DIR}/bin/moc -nn $OPTIONS $INPUTFILE"
+ progress="MOCing"
+ extraFiles="$(OUTPUTDIR)/moc_$(OUTPUTNAMEBASE).cpp"
+ #postExecSafe={"${GHS_TOOLS_DIR}/filechanged work/$(OUTPUTNAME)"}
+ color="#0020a0"
+ grepable=true
+ }
+ RCC {
+ name="Qt Resource"
+ outputExtension="time"
+ #extensions={"qrc"}
+ outputType="SourceFile"
+ command="RCCPreprocessor"
+ commandLine="${QT_BUILD_DIR}/bin/rcc $OPTIONS $INPUTFILE"
+ extraFiles="$(OUTPUTDIR)/qrc_$(OUTPUTNAMEBASE).cpp"
+ progress="Generating Resource source from"
+ action="Generate Resource source for"
+ grepable=true
+ }
+ UI {
+ name="Qt Dialog"
+ outputExtension="time"
+ #extensions={"ui"}
+ outputType="SourceFile"
+ command="UIPreprocessor"
+ commandLine="${QT_BUILD_DIR}/bin/uic $OPTIONS $INPUTFILE"
+ extraFiles="$(OUTPUTDIR)/ui_$(OUTPUTNAMEBASE).cpp"
+ progress="Generating Dialog source from"
+ action="Generate Dialog source for"
+ grepable=true
+ }
+}
diff --git a/util/qlalr/doc/qlalr.qdocconf b/util/qlalr/doc/qlalr.qdocconf
index ea9eaa6..f5af331 100644
--- a/util/qlalr/doc/qlalr.qdocconf
+++ b/util/qlalr/doc/qlalr.qdocconf
@@ -59,7 +59,7 @@ HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt \\version</div></td>\n" \
"</tr></table></div></address>"