summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-01 15:36:05 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-01 15:36:05 (GMT)
commit7e8d20de90af2e5ea199b6a92830cc223cea777b (patch)
tree89364f787fad44c2fdea1de6358140c568a82e7a
parentf3cf5dd98e321980984288a1768f3375a8349800 (diff)
parentafe0f17eb5974adbedd1bc1f2fcd98459d92df47 (diff)
downloadQt-7e8d20de90af2e5ea199b6a92830cc223cea777b.zip
Qt-7e8d20de90af2e5ea199b6a92830cc223cea777b.tar.gz
Qt-7e8d20de90af2e5ea199b6a92830cc223cea777b.tar.bz2
Merge branch '4.6' into qstatictext-4.6
-rw-r--r--.gitignore1
-rw-r--r--bin/patch_capabilities.bat1
-rwxr-xr-xbin/patch_capabilities.pl21
-rwxr-xr-xconfigure8
-rw-r--r--configure.exebin1176064 -> 1178112 bytes
-rw-r--r--demos/embedded/anomaly/anomaly.pro6
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp5
-rw-r--r--demos/embedded/anomaly/src/BrowserView.h4
-rw-r--r--demos/embedded/anomaly/src/webview.cpp80
-rw-r--r--demos/embedded/anomaly/src/webview.h (renamed from tools/linguist/shared/proreader.h)31
-rw-r--r--demos/embedded/fluidlauncher/backup_registration.xml8
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro5
-rw-r--r--dist/changes-4.6.1263
-rw-r--r--dist/changes-4.6.2159
-rw-r--r--doc/src/development/assistant-manual.qdoc2
-rw-r--r--doc/src/examples/graphicsview-anchorlayout.qdoc48
-rw-r--r--doc/src/examples/graphicsview-flowlayout.qdoc50
-rw-r--r--doc/src/examples/graphicsview-simpleanchorlayout.qdoc48
-rw-r--r--doc/src/examples/graphicsview-weatheranchorlayout.qdoc48
-rw-r--r--doc/src/examples/network-download.qdoc53
-rw-r--r--doc/src/examples/network-downloadmanager.qdoc53
-rw-r--r--doc/src/examples/script-marshal.qdoc48
-rw-r--r--doc/src/examples/script-qscript.qdoc48
-rw-r--r--doc/src/examples/script-qsdbg.qdoc48
-rw-r--r--doc/src/examples/svgalib.qdoc3
-rw-r--r--doc/src/examples/webkit-framecapture.qdoc51
-rw-r--r--doc/src/examples/widgets-softkeys.qdoc47
-rw-r--r--doc/src/examples/widgets-validators.qdoc47
-rw-r--r--doc/src/frameworks-technologies/qthelp.qdoc2
-rw-r--r--doc/src/getting-started/examples.qdoc377
-rw-r--r--doc/src/getting-started/installation.qdoc33
-rw-r--r--doc/src/modules.qdoc2
-rw-r--r--doc/src/platforms/emb-install.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_emb-install.qdoc12
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc18
-rw-r--r--doc/src/snippets/code/doc_src_qthelp.qdoc2
-rw-r--r--doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp11
-rw-r--r--doc/src/snippets/qstring/main.cpp2
-rw-r--r--doc/src/windows-and-dialogs/mainwindow.qdoc2
-rw-r--r--examples/network/googlesuggest/googlesuggest.cpp3
-rw-r--r--examples/network/googlesuggest/searchbox.cpp3
-rw-r--r--examples/network/network-chat/chatdialog.cpp2
-rw-r--r--examples/network/network-chat/client.cpp4
-rw-r--r--examples/network/network-chat/connection.cpp6
-rw-r--r--examples/network/network-chat/peermanager.cpp2
-rw-r--r--examples/network/qftp/ftpwindow.cpp3
-rw-r--r--examples/network/securesocketclient/sslclient.cpp2
-rw-r--r--examples/network/torrent/trackerclient.cpp2
-rw-r--r--examples/tools/customtype/message.cpp2
-rw-r--r--examples/tools/customtype/message.h2
-rw-r--r--mkspecs/common/symbian/symbian.conf2
-rw-r--r--mkspecs/features/symbian/def_files.prf26
-rw-r--r--mkspecs/features/symbian/def_files_disabled.prf7
-rw-r--r--mkspecs/features/symbian/platform_paths.prf2
-rw-r--r--mkspecs/linux-g++-maemo/qmake.conf2
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp1
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h2
-rw-r--r--qmake/generators/symbian/symmake.cpp32
-rw-r--r--qmake/generators/symbian/symmake.h5
-rw-r--r--qmake/project.cpp14
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp3
-rw-r--r--src/3rdparty/phonon/mmf/abstractaudioeffect.h2
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h4
-rw-r--r--src/3rdparty/phonon/mmf/backend.h4
-rw-r--r--src/3rdparty/phonon/mmf/effectparameter.h2
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h4
-rw-r--r--src/3rdparty/phonon/mmf/mmf_medianode.h2
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.h2
-rw-r--r--src/3rdparty/phonon/mmf/videowidget.h4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog11
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h6
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog110
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro21
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp22
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/PopupMenu.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.h10
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp25
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp7
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog79
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/backup_registration.xml5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp69
-rw-r--r--src/corelib/animation/qabstractanimation.cpp2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp17
-rw-r--r--src/corelib/arch/qatomic_ia64.h2
-rw-r--r--src/corelib/global/qglobal.h8
-rw-r--r--src/corelib/io/qfile.cpp104
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp2
-rw-r--r--src/corelib/io/qsettings.cpp44
-rw-r--r--src/corelib/io/qurl.cpp7
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject_p.h6
-rw-r--r--src/corelib/kernel/qobject.cpp28
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qeasingcurve.cpp6
-rw-r--r--src/corelib/tools/qsharedpointer.cpp2
-rw-r--r--src/dbus/qdbusargument.cpp1
-rw-r--r--src/dbus/qdbusintegrator.cpp41
-rw-r--r--src/dbus/qdbusmarshaller.cpp5
-rw-r--r--src/gui/dialogs/qcolordialog.cpp45
-rw-r--r--src/gui/dialogs/qdialog.cpp16
-rw-r--r--src/gui/dialogs/qfiledialog.cpp18
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm7
-rw-r--r--src/gui/dialogs/qprintdialog.h6
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp10
-rw-r--r--src/gui/effects/qgraphicseffect.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp265
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h66
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp108
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h6
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex_p.h2
-rw-r--r--src/gui/image/qbmphandler.cpp2
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp20
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks_p.h23
-rw-r--r--src/gui/image/qpixmap.cpp33
-rw-r--r--src/gui/image/qpixmap_x11.cpp14
-rw-r--r--src/gui/image/qpixmapdata.cpp11
-rw-r--r--src/gui/image/qpixmapdata_p.h8
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h7
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp50
-rw-r--r--src/gui/itemviews/qlistview.cpp7
-rw-r--r--src/gui/itemviews/qtableview.cpp4
-rw-r--r--src/gui/kernel/qapplication.cpp4
-rw-r--r--src/gui/kernel/qapplication_mac.mm42
-rw-r--r--src/gui/kernel/qapplication_p.h6
-rw-r--r--src/gui/kernel/qapplication_s60.cpp77
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac.mm6
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac_p.h1
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm4
-rw-r--r--src/gui/kernel/qdesktopwidget.cpp10
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm2
-rw-r--r--src/gui/kernel/qformlayout.cpp6
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm16
-rw-r--r--src/gui/kernel/qt_s60_p.h1
-rw-r--r--src/gui/kernel/qwidget.cpp10
-rw-r--r--src/gui/kernel/qwidget_mac.mm49
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp9
-rw-r--r--src/gui/painting/qcolor.cpp11
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h4
-rw-r--r--src/gui/painting/qpaintengineex.cpp16
-rw-r--r--src/gui/painting/qpainter.cpp58
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp26
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp8
-rw-r--r--src/gui/styles/qgtkstyle.cpp22
-rw-r--r--src/gui/styles/qmacstyle_mac.mm178
-rw-r--r--src/gui/styles/qs60style.cpp539
-rw-r--r--src/gui/styles/qs60style.h3
-rw-r--r--src/gui/styles/qs60style_p.h107
-rw-r--r--src/gui/styles/qs60style_s60.cpp243
-rw-r--r--src/gui/styles/qs60style_simulated.cpp10
-rw-r--r--src/gui/styles/qstyle_s60.qrc137
-rw-r--r--src/gui/styles/styles.pri10
-rw-r--r--src/gui/text/qfont.cpp10
-rw-r--r--src/gui/text/qfontengine.cpp3
-rw-r--r--src/gui/text/qtextoption.cpp5
-rw-r--r--src/gui/util/qsystemtrayicon_mac.mm13
-rw-r--r--src/gui/widgets/qlinecontrol.cpp5
-rw-r--r--src/gui/widgets/qlinecontrol_p.h5
-rw-r--r--src/gui/widgets/qmainwindowlayout_mac.mm19
-rw-r--r--src/gui/widgets/qmenu.cpp7
-rw-r--r--src/gui/widgets/qmenu_mac.mm36
-rw-r--r--src/network/access/qfilenetworkreply.cpp124
-rw-r--r--src/network/access/qfilenetworkreply_p.h17
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp7
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h3
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp4
-rw-r--r--src/network/access/qhttpnetworkheader.cpp2
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp4
-rw-r--r--src/network/access/qnetworkreply.cpp5
-rw-r--r--src/network/access/qnetworkrequest.cpp2
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--src/network/kernel/qnetworkinterface.cpp4
-rw-r--r--src/network/socket/qlocalserver.cpp10
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp10
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp14
-rw-r--r--src/network/socket/qnativesocketengine.cpp8
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp25
-rw-r--r--src/network/ssl/qsslcertificate.cpp26
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp28
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp10
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h678
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp28
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h2
-rw-r--r--src/opengl/qgl.cpp61
-rw-r--r--src/opengl/qgl_p.h9
-rw-r--r--src/opengl/qgl_x11.cpp6
-rw-r--r--src/opengl/qglpixmapfilter.cpp22
-rw-r--r--src/opengl/qglshaderprogram.cpp38
-rw-r--r--src/opengl/qpixmapdata_gl.cpp2
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp51
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp31
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h1
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp3
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp4
-rw-r--r--src/plugins/qpluginbase.pri2
-rw-r--r--src/qbase.pri38
-rw-r--r--src/s60installs/backup_registration.xml5
-rw-r--r--src/s60installs/bwins/QtCoreu.def1
-rw-r--r--src/s60installs/bwins/QtGuiu.def14
-rw-r--r--src/s60installs/bwins/QtScriptu.def1
-rw-r--r--src/s60installs/eabi/QtCoreu.def1
-rw-r--r--src/s60installs/eabi/QtGuiu.def14
-rw-r--r--src/s60installs/eabi/QtScriptu.def1
-rw-r--r--src/s60installs/qt.iby26
-rw-r--r--src/s60installs/s60installs.pro11
-rw-r--r--src/s60installs/sqlite3_selfsigned.sisbin0 -> 285088 bytes
-rw-r--r--src/script/api/qscriptvalue.cpp13
-rw-r--r--src/script/bridge/qscriptqobject.cpp12
-rw-r--r--src/src.pro1
-rw-r--r--src/tools/uic3/converter.cpp20
-rw-r--r--src/tools/uic3/form.cpp8
-rw-r--r--src/tools/uic3/main.cpp18
-rw-r--r--src/tools/uic3/ui3reader.cpp22
-rw-r--r--src/tools/uic3/ui3reader.h16
-rw-r--r--src/xml/dom/qdom.cpp12
-rw-r--r--src/xmlpatterns/parser/qquerytransformparser.cpp2
-rw-r--r--src/xmlpatterns/parser/qquerytransformparser_p.h2
-rw-r--r--src/xmlpatterns/parser/qxslttokenlookup.cpp2
-rw-r--r--src/xmlpatterns/parser/qxslttokenlookup_p.h2
-rw-r--r--tests/auto/auto.pro28
-rw-r--r--tests/auto/linguist/lupdate/.gitignore6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result (renamed from tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result)0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result (renamed from tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result)0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp45
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result12
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp45
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result17
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp50
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h45
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro7
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result20
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result20
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result20
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result20
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd1
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro4
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro1
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro2
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro1
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro4
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro2
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro1
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro2
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro1
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp46
-rw-r--r--tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro4
-rw-r--r--tests/auto/linguist/lupdate/tst_lupdate.cpp75
-rw-r--r--tests/auto/maketestselftest/maketestselftest.pro9
-rw-r--r--tests/auto/maketestselftest/tst_maketestselftest.cpp100
-rw-r--r--tests/auto/mediaobject/dummy/dummy.pro2
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp9
-rw-r--r--tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp25
-rw-r--r--tests/auto/qgl/qgl.pro4
-rw-r--r--tests/auto/qgl/qgl.qrc5
-rw-r--r--tests/auto/qgl/tst_qgl.cpp240
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp34
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp205
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp43
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp25
-rw-r--r--tests/auto/qimagereader/baseline/35floppy.icobin4286 -> 0 bytes
-rw-r--r--tests/auto/qimagereader/baseline/35floppy.pngbin0 -> 329 bytes
-rw-r--r--tests/auto/qimagereader/baseline/connect.pngbin0 -> 12943 bytes
-rw-r--r--tests/auto/qimagereader/baseline/kde_favicon.icobin1150 -> 0 bytes
-rw-r--r--tests/auto/qimagereader/baseline/kde_favicon.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/qimagereader/baseline/semitransparent.icobin9662 -> 0 bytes
-rw-r--r--tests/auto/qimagereader/baseline/semitransparent.pngbin0 -> 545 bytes
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp26
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp23
-rw-r--r--tests/auto/qobject/tst_qobject.cpp73
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp38
-rw-r--r--tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp91
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp16
-rw-r--r--tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem1
-rw-r--r--tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem1
-rw-r--r--tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem13
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp16
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp8
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp36
-rw-r--r--tests/auto/qurl/tst_qurl.cpp42
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp50
-rw-r--r--tests/auto/selftests/expected_cmptest.txt2
-rw-r--r--tests/auto/selftests/expected_crashes_3.txt2
-rw-r--r--tests/auto/selftests/expected_longstring.txt2
-rw-r--r--tests/auto/selftests/expected_maxwarnings.txt2
-rw-r--r--tests/auto/selftests/expected_skip.txt2
-rw-r--r--tests/auto/selftests/expected_xunit.txt4
-rw-r--r--tests/auto/selftests/tst_selftests.cpp2
-rw-r--r--tests/auto/tests.xml821
-rw-r--r--tests/auto/uic/baseline/config_fromuic3.ui2
-rw-r--r--tests/auto/uic/baseline/config_fromuic3.ui.h4
-rw-r--r--tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro1
-rw-r--r--tests/benchmarks/benchmarks.pro1
-rw-r--r--tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp35
-rw-r--r--tests/benchmarks/qfontmetrics/main.cpp112
-rw-r--r--tests/benchmarks/qfontmetrics/qfontmetrics.pro5
-rw-r--r--tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp16
-rw-r--r--tests/benchmarks/qpainter/tst_qpainter.cpp503
-rw-r--r--tests/benchmarks/qtext/main.cpp205
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.cpp71
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.h3
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.cpp8
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.h1
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp91
-rw-r--r--tools/assistant/tools/assistant/centralwidget.h8
-rw-r--r--tools/assistant/tools/assistant/doc/assistant.qdocconf2
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp11
-rw-r--r--tools/configure/configureapp.cpp35
-rw-r--r--tools/designer/src/components/formeditor/formwindow.cpp5
-rw-r--r--tools/designer/src/components/formeditor/formwindow.h2
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp4
-rw-r--r--tools/designer/src/components/propertyeditor/designerpropertymanager.h2
-rw-r--r--tools/designer/src/designer/qdesigner_actions.cpp4
-rw-r--r--tools/designer/src/designer/qdesigner_server.cpp6
-rw-r--r--tools/designer/src/designer/qdesigner_server.h2
-rw-r--r--tools/designer/src/lib/shared/actioneditor.cpp2
-rw-r--r--tools/designer/src/lib/shared/actionrepository.cpp2
-rw-r--r--tools/designer/src/lib/shared/connectionedit_p.h2
-rw-r--r--tools/designer/src/lib/shared/filterwidget_p.h2
-rw-r--r--tools/designer/src/lib/shared/iconloader.cpp2
-rw-r--r--tools/designer/src/lib/shared/iconselector_p.h2
-rw-r--r--tools/designer/src/lib/shared/plugindialog.cpp4
-rw-r--r--tools/designer/src/lib/shared/qdesigner_introspection.cpp2
-rw-r--r--tools/designer/src/lib/shared/qdesigner_objectinspector_p.h2
-rw-r--r--tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h14
-rw-r--r--tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h2
-rw-r--r--tools/designer/src/lib/shared/qdesigner_toolbar.cpp2
-rw-r--r--tools/designer/src/lib/shared/qdesigner_utils_p.h8
-rw-r--r--tools/designer/src/lib/shared/qdesigner_widgetbox_p.h2
-rw-r--r--tools/designer/src/lib/shared/qtresourceview_p.h4
-rw-r--r--tools/designer/src/lib/shared/richtexteditor_p.h2
-rw-r--r--tools/designer/src/lib/shared/shared_settings.cpp2
-rw-r--r--tools/designer/src/lib/shared/textpropertyeditor_p.h2
-rw-r--r--tools/designer/src/lib/shared/widgetdatabase_p.h6
-rw-r--r--tools/designer/src/lib/shared/widgetfactory.cpp2
-rw-r--r--tools/designer/src/lib/uilib/abstractformbuilder.cpp2
-rw-r--r--tools/designer/src/lib/uilib/formbuilder.cpp2
-rw-r--r--tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h2
-rw-r--r--tools/designer/src/plugins/activeqt/qdesigneraxwidget.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h12
-rw-r--r--tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h2
-rw-r--r--tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h2
-rw-r--r--tools/designer/src/src.pro4
-rw-r--r--tools/linguist/lrelease/main.cpp43
-rw-r--r--tools/linguist/lupdate/main.cpp349
-rw-r--r--tools/linguist/shared/proparser.pri2
-rw-r--r--tools/linguist/shared/proreader.cpp131
-rw-r--r--tools/linguist/shared/translator.h1
-rw-r--r--tools/qdoc3/test/assistant.qdocconf2
-rw-r--r--tools/qdoc3/test/designer.qdocconf2
-rw-r--r--tools/qdoc3/test/linguist.qdocconf2
-rw-r--r--tools/qdoc3/test/macros.qdocconf2
-rw-r--r--tools/qdoc3/test/qmake.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf6
-rw-r--r--tools/qdoc3/test/qt.qdocconf6
-rw-r--r--tools/qttracereplay/main.cpp28
-rw-r--r--tools/runonphone/main.cpp11
-rw-r--r--tools/runonphone/runonphone.pro6
-rw-r--r--tools/runonphone/serenum_stub.cpp53
-rw-r--r--tools/runonphone/serenum_unix.cpp64
-rw-r--r--tools/runonphone/trk/launcher.cpp101
-rw-r--r--tools/runonphone/trk/launcher.h15
-rw-r--r--tools/runonphone/trk/trkdevice.cpp34
-rw-r--r--tools/runonphone/trk/trkutils.h7
-rw-r--r--tools/shared/findwidget/texteditfindwidget.h2
-rw-r--r--tools/shared/fontpanel/fontpanel.cpp2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientutils.cpp2
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.h4
-rw-r--r--translations/translations.pri8
-rw-r--r--translations/translations.pro8
-rw-r--r--util/qlalr/doc/qlalr.qdocconf2
437 files changed, 8129 insertions, 3294 deletions
diff --git a/.gitignore b/.gitignore
index 2069ad5..c8153fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,6 +57,7 @@ bin/qmake*
bin/qdoc3*
bin/qt3to4*
bin/qtdemo*
+bin/qttracereplay*
bin/rcc*
bin/uic*
bin/patternist*
diff --git a/bin/patch_capabilities.bat b/bin/patch_capabilities.bat
new file mode 100644
index 0000000..6a0c4d7
--- /dev/null
+++ b/bin/patch_capabilities.bat
@@ -0,0 +1 @@
+@perl.exe -S %~dp0patch_capabilities.pl %*
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index b6bf5c3..9daa13e 100755
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -111,12 +111,31 @@ if (@ARGV)
# Parse each line.
while (<PKG>)
{
+ # Patch pkg UID
my $line = $_;
my $newLine = $line;
- if ( $line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/)
+ if ($line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/)
{
$newLine =~ s/\(0x./\(0xE/;
}
+
+ # Patch embedded sis name and UID
+ if ($line =~ m/^@.*\.sis.*\(0x[0-9|a-f|A-F]*\).*$/)
+ {
+ $newLine =~ s/\(0x./\(0xE/;
+ if ($line !~ m/^.*_selfsigned.sis.*$/)
+ {
+ $newLine =~ s/\.sis/_selfsigned\.sis/i;
+ }
+ }
+
+ # Remove all dependencies to other packages to reduce unnecessary error messages
+ # from depended packages that are also patched and therefore have different UID.
+ if ($line =~ m/^\(0x[0-9|a-f|A-F]*\).*\{.*\}$/)
+ {
+ $newLine = ""
+ }
+
print NEW_PKG $newLine;
chomp ($line);
diff --git a/configure b/configure
index 81872f9..dc23392 100755
--- a/configure
+++ b/configure
@@ -115,7 +115,7 @@ getQMakeConf1()
inc_file=`echo "$line" | sed -n -e "/^include.*(.*)/s/include.*(\(.*\)).*$/\1/p"`
current_dir=`dirname "$1"`
conf_file="$current_dir/$inc_file"
- if [ ! -e "$conf_file" ]; then
+ if [ ! -f "$conf_file" ]; then
echo "WARNING: Unable to find file $conf_file" >&2
continue
fi
@@ -2278,7 +2278,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
fi
# symlink fonts to be able to run application from build directory
-if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then
+if [ "$PLATFORM_QWS" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
if [ "$PLATFORM" = "$XPLATFORM" ]; then
mkdir -p "${outpath}/lib"
ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
@@ -7557,6 +7557,8 @@ elif [ "$CFG_OPENSSL" = "linked" ]; then
OPENSSL_LINKAGE="(linked)"
fi
echo "OpenSSL support ..... $CFG_OPENSSL $OPENSSL_LINKAGE"
+echo "Alsa support ........ $CFG_ALSA"
+echo
[ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........ $CFG_PTMALLOC"
@@ -7581,8 +7583,6 @@ if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG"
echo "NOTE: Mac OS X frameworks implicitly build debug and release Qt libraries."
echo
fi
-echo "alsa support ........ $CFG_ALSA"
-echo
sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
PROCS=1
diff --git a/configure.exe b/configure.exe
index d88da13..ed2b0b2 100644
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
index 2871ba7..165ce89 100644
--- a/demos/embedded/anomaly/anomaly.pro
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -8,7 +8,8 @@ HEADERS += src/BrowserWindow.h \
src/BookmarksView.h \
src/flickcharm.h \
src/ZoomStrip.h \
- src/ControlStrip.h
+ src/ControlStrip.h \
+ src/webview.h
SOURCES += src/Main.cpp \
src/BrowserWindow.cpp \
src/BrowserView.cpp \
@@ -18,7 +19,8 @@ SOURCES += src/Main.cpp \
src/BookmarksView.cpp \
src/flickcharm.cpp \
src/ZoomStrip.cpp \
- src/ControlStrip.cpp
+ src/ControlStrip.cpp \
+ src/webview.cpp
RESOURCES += src/anomaly.qrc
symbian {
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
index ab52e81..0945b89 100644
--- a/demos/embedded/anomaly/src/BrowserView.cpp
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -48,6 +48,7 @@
#include "ControlStrip.h"
#include "TitleBar.h"
#include "flickcharm.h"
+#include "webview.h"
#include "ZoomStrip.h"
#if defined (Q_OS_SYMBIAN)
@@ -62,7 +63,7 @@ BrowserView::BrowserView(QWidget *parent)
, m_currentZoom(100)
{
m_titleBar = new TitleBar(this);
- m_webView = new QWebView(this);
+ m_webView = new WebView(this);
m_zoomStrip = new ZoomStrip(this);
m_controlStrip = new ControlStrip(this);
@@ -95,7 +96,7 @@ void BrowserView::initialize()
connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));
- m_webView->setHtml("Will try to load page soon!");
+ m_webView->setHtml("about:blank");
m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_webView->setFocus();
#ifdef Q_OS_SYMBIAN
diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h
index fdc126d..5ab1dd7 100644
--- a/demos/embedded/anomaly/src/BrowserView.h
+++ b/demos/embedded/anomaly/src/BrowserView.h
@@ -49,6 +49,7 @@ class QUrl;
class QWebView;
class TitleBar;
class ControlStrip;
+class WebView;
class ZoomStrip;
class BrowserView : public QWidget
@@ -81,7 +82,7 @@ protected:
private:
TitleBar *m_titleBar;
- QWebView *m_webView;
+ WebView *m_webView;
ZoomStrip *m_zoomStrip;
ControlStrip *m_controlStrip;
int m_progress;
@@ -90,3 +91,4 @@ private:
};
#endif // BROWSERVIEW_H
+
diff --git a/demos/embedded/anomaly/src/webview.cpp b/demos/embedded/anomaly/src/webview.cpp
new file mode 100644
index 0000000..5cb913b
--- /dev/null
+++ b/demos/embedded/anomaly/src/webview.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demos 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 "webview.h"
+
+#include <QPaintEvent>
+#include <QWebFrame>
+
+WebView::WebView(QWidget *parent)
+ : QWebView(parent)
+ , inLoading(false)
+{
+ connect(this, SIGNAL(loadStarted()), this, SLOT(newPageLoading()));
+ connect(this, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool)));
+ page()->setPreferredContentsSize(QSize(1024, 768));
+}
+
+void WebView::paintEvent(QPaintEvent *event)
+{
+ if (inLoading && loadingTime.elapsed() < 750) {
+ QPainter painter(this);
+ painter.setBrush(Qt::white);
+ painter.setPen(Qt::NoPen);
+ foreach (const QRect &rect, event->region().rects()) {
+ painter.drawRect(rect);
+ }
+ } else {
+ QWebView::paintEvent(event);
+ }
+}
+
+void WebView::newPageLoading()
+{
+ inLoading = true;
+ loadingTime.start();
+}
+
+void WebView::pageLoaded(bool)
+{
+ inLoading = false;
+ update();
+}
diff --git a/tools/linguist/shared/proreader.h b/demos/embedded/anomaly/src/webview.h
index 70421d7..ecd9f5a 100644
--- a/tools/linguist/shared/proreader.h
+++ b/demos/embedded/anomaly/src/webview.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the Qt Linguist of the Qt Toolkit.
+** This file is part of the demos of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,19 +39,28 @@
**
****************************************************************************/
-#ifndef PROREADER_H
-#define PROREADER_H
+#ifndef WEBVIEW_H
+#define WEBVIEW_H
-#include <QtCore/QHash>
+#include <QWebView>
+#include <QTime>
-QT_BEGIN_NAMESPACE
+class WebView : public QWebView
+{
+ Q_OBJECT
+public:
+ WebView(QWidget *parent = 0);
-class ProFileEvaluator;
+protected:
+ void paintEvent(QPaintEvent *event);
-void evaluateProFile(const ProFileEvaluator &visitor, QHash<QByteArray, QStringList> *varMap,
- const QString &projectDir);
-bool evaluateProFile(const QString &fileName, bool verbose, QHash<QByteArray, QStringList> *varMap);
+private slots:
+ void newPageLoading();
+ void pageLoaded(bool ok);
-QT_END_NAMESPACE
+private:
+ QTime loadingTime;
+ bool inLoading;
+};
-#endif // PROREADER_H
+#endif // WEBVIEW_H
diff --git a/demos/embedded/fluidlauncher/backup_registration.xml b/demos/embedded/fluidlauncher/backup_registration.xml
new file mode 100644
index 0000000..794e11d
--- /dev/null
+++ b/demos/embedded/fluidlauncher/backup_registration.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+ <passive_backup>
+ <include_directory name = "\" />
+ </passive_backup>
+ <system_backup/>
+ <restore requires_reboot = "no"/>
+</backup_registration>
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index bb8835b..92d6e1e 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -207,8 +207,11 @@ symbian {
saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel
saxbookmarks.path = /data/qt/saxbookmarks
+ fluidbackup.sources = backup_registration.xml
+ fluidbackup.path = /private/$$replace(TARGET.UID3, 0x,)
+
DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \
- mifs desktopservices_music desktopservices_images
+ mifs desktopservices_music desktopservices_images fluidbackup
TARGET.EPOCHEAPSIZE = 100000 20000000
}
diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1
index 6e95fd5..4a567bb 100644
--- a/dist/changes-4.6.1
+++ b/dist/changes-4.6.1
@@ -20,12 +20,6 @@ Merge Request: http://qt.gitorious.org
* General *
****************************************************************************
-New features
-------------
-
- - SomeClass, SomeOtherClass
- * New classes for foo, bar and baz
-
Optimizations
-------------
@@ -44,8 +38,8 @@ QtCore
- QFile
* Improve performance of getting the canonical filename on Linux
- and Symbian by using realpath() system call
- * Avoid stat() when opening a file
+ and Symbian by using realpath() system call.
+ * Avoid stat() when opening a file.
- QLibrary and QPluginLoader
* Do not look at the Qt patch-level version embedded in plugins'
@@ -60,7 +54,7 @@ QtCore
- QXmlStreamreader
* [merge request 1926] Fix parsing of DTDs that contain empty markup
- declarations
+ declarations.
QtGui
-----
@@ -68,32 +62,21 @@ QtGui
- QApplication
* [QTBUG-6654] Fix crashes when deleting QWidgets in touch event
handlers.
- - QPixmapCache
- * Fixed a small leak when using the new QPixmapCAche::Key based API.
- - QPixmap
- * load() and loadFromData() can now support compressed GL textures
- in the DDS, ETC1, PVRTC2, and PVRTC4 formats if the OpenGL graphics
- system is active and the appropriate extensions are present in the
- GL implementation.
- * [QTBUG-6840] Fixed load() to not modify referenced copies.
- * [QTBUG-5840] Fixed a crash in fromImage() when passing in a null image.
- * [QTBUG-6116] Fixed memory leak where a global object was not destroyed
- at program exit.
- - QRasterPixmapData
- * [QTBUG-6985] Fixed metric() to return the correct height in mm.
- - QGraphicsObject
- * 'id' property was removed. Use the 'objectName' property instead.
- - QPrinter
- * [QTBUG-3412] QGraphicsProxyWidgets are now rendered correctly when
- printing a QGraphicsScene to PDF format.
- - QPainter
- * [QTBUG-5939] Fixed incorrect redirection matrix that was causing
- wrong transformation for QGraphicsProxyWidgets.
- * [QTBUG-6684] Added optimizations of 32-bit blend functions
- for ARM platforms with NEON support.
- QGraphicsEffect
* [QTBUG-5918] Fixed redraw bugs when using graphics effects on
items while animating them by transformations.
+ - QGraphicsItem
+ * [QTBUG-5917] Fixed memory leaks when removing a QGraphicsEffect from
+ a QGraphicsItem or QWidget with setGraphicsEffect(0).
+ * [QTBUG-5859] Fixes incorrect rounding of the exposed rectangle of the
+ QGraphicsItem causing painting issues when scaling the QGraphicsView.
+ * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping
+ the item with a QGraphicsItemGroup.
+ - QGraphicsObject
+ * 'id' property was removed. Use the 'objectName' property instead.
+ - QGraphicsScene
+ * [QTBUG-6654] Fix crashes when deleting QGraphicsItems in touch
+ event handlers.
- QGraphicsView
* [QTBUG-6935] When using CacheBackground, the background is now
correctly repainted after the QGraphicsView is shown after being
@@ -101,29 +84,37 @@ QtGui
* [QTBUG-6835] Mouse tracking is now automatically enabled when using
AnchorUnderMouse for view transformation.
* [QTBUG-6958] Fix speed regression in _q_polishItems()
- * [QTBUG-6544] Fix a crash on the focus chain when removing items from the scene.
+ * [QTBUG-6544] Fix a crash on the focus chain when removing items from
+ the scene.
* Fix a crash in KDE/Plasma with QGraphicsView with topLevels.
- - QGraphicsItem
- * [QTBUG-5917] Fixed memory leaks when removing a QGraphicsEffect from
- a QGraphicsItem or QWidget with setGraphicsEffect(0).
- * [QTBUG-5859] Fixes incorrect rounding of the exposed rectangle of the
- QGraphicsItem causing painting issues when scaling the QGraphicsView.
- * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping
- the item with a QGraphicsItemGroup.
- QGraphicsWidget
- * [QTBUG-6272] Only call updateFont if the font have changed.
+ * [QTBUG-6272] Only call updateFont if the font has changed.
+ - QPainter
+ * [QTBUG-5939] Fixed incorrect redirection matrix that was causing
+ wrong transformation for QGraphicsProxyWidgets.
+ * [QTBUG-6684] Added optimizations of 32-bit blend functions
+ for ARM platforms with NEON support.
+ - QPixmap
+ * load() and loadFromData() can now support compressed GL textures
+ in the DDS, ETC1, PVRTC2, and PVRTC4 formats if the OpenGL graphics
+ system is active and the appropriate extensions are present in the
+ GL implementation.
+ * [QTBUG-6840] Fixed load() to not modify referenced copies.
+ * [QTBUG-5840] Fixed a crash in fromImage() when passing in a null image.
+ * [QTBUG-6116] Fixed memory leak where a global object was not destroyed
+ at program exit.
+ - QPixmapCache
+ * Fixed a small leak when using the new QPixmapCache::Key based API.
+ - QPrinter
+ * [QTBUG-3412] QGraphicsProxyWidgets are now rendered correctly when
+ printing a QGraphicsScene to PDF format.
+ - QRasterPixmapData
+ * [QTBUG-6985] Fixed metric() to return the correct height in mm.
- QTextDocument
* [QTBUG-5397] Fixed printing of QTextDocuments not including custom
text objects.
-
- - QTextDocument
* [QTBUG-6051] Fixed an endless loop when printing a QTextDocument.
- - QGraphicsScene
- * [QTBUG-6654] Fix crashes when deleting QGraphicsItems in touch
- event handlers.
-
-
QtDBus
------
@@ -132,49 +123,54 @@ QtDBus
correctly when the sender name changes/appears on the bus.
* [QTBUG-7041] Fixed marshalling of booleans in release mode.
* [QT-2307] Fixed calls with the QDBus::BlockWithGui mode.
-
- QDBusInterface
* Made it continue working even when the remote object
introspection fails.
-
- QDBusInterface and qdbuscpp2xml
* [QTBUG-5563] Fixed an issue with generating annotations in
- signals
-
+ signals.
- QDBusPendingReply and QDBusReply
* [QTBUG-6571] Fixed a crash that would happen if you tried to
- make a call with a disconnected QDBusConnection
+ make a call with a disconnected QDBusConnection.
QtMultimedia
------------
- QAudioOutput
* [Merge request 418] Fixed compilation the example provided for
- QAudioOutput::start
+ QAudioOutput::start.
QtNetwork
---------
- QNetworkAccessManager
- * HTTP: Smaller improvements
- * HTTP: Send our locale with the HTTP request
- * HTTP: Start Accept-language and Authorization header with capital letter
- * HTTP: Fix caching algorithm, matching RFC 2612 and the documentation
- * HTTP [QTBUG-7060]: Fix an issue with headers like "private, max-age=300"
- * file: Introduce special subclass for higher performance with file:// URLs
+ * HTTP: Send our locale with the HTTP request.
+ * HTTP: Start Accept-language and Authorization header with capital letter.
+ * HTTP: Fix caching algorithm, matching RFC 2612 and the documentation.
+ * HTTP [QTBUG-7060]: Fix an issue with headers like "private, max-age=300".
+ * file: Introduce special subclass for higher performance with file:// URLs.
- QTcpSocket
- * [QTBUG-5799] Fix waitForConnected() on Windows
+ * [QTBUG-5799] Fix waitForConnected() on Windows.
- QNetworkProxyFactory
* Fixed systemProxyForQuery(), it could sometimes return invalid empty list
- on Windows
+ on Windows.
- QNetworkCookieJar
- * [QTBUG-5815] do not check paths when accepting cookies
+ * [QTBUG-5815] Do not check paths when accepting cookies.
- QHostInfo
- * Use 5 parallel threads for host lookup instead of 1
+ * Use five parallel threads for host lookup instead of one.
QtOpenGL
--------
+ - QGL2PaintEngineEx
+ * Performance: Don't mark brush as dirty if it hasn't changed.
+ * Performance: Use 3x3 PMV matrices rather than 4x4.
+ * Performance: Move the 0.5 offset we add for aliased rendering to
+ updateMatrix().
+ * Performance: Remove superfluous enable/disable vertex attrib arrays.
+ * Performance: Track the glVertexAttribPointer and only update it if it's
+ changed.
+ * [QTBUG-7094] Introduce new "snapToPixelGrid" flag for drawText.
- QGLContext
* bindTexture(QString) now supports DDS, ETC1, PVRTC2, and PVRTC4
compressed textures if the appropriate extensions are present
@@ -187,31 +183,24 @@ QtOpenGL
* bindTexture(QImage): Fix GL_BGRA formats under OpenGL/ES by using
the same value for both internal and external texture formats.
* [QTBUG-5041] Disable depth testing while in renderText().
- - QGLPaintDevice
- * [QTBUG-6204] Rebind window surface fbo after native GL rendering.
- QGLEngineSelector
* [QTBUG-5638] Detect GL2 based on fragment shaders, not programs.
Fragment programs are a GL1 feature.
- QGLFramebufferObject
* [QTBUG-6712] Update docs to better explain how QPainter changes
the GL state when used on an FBO.
- - QGLPixmapData
- * [QTBUG-6902] Align GL_RGB data on a 4-byte line boundary.
- - QTriangulatingStroker
- * [QTBUG-6045] Crash in dashed line handling in the GL stroker.
- QGLGlyphCache
* [QTBUG-6936] Fix memory leak of QGLGlyphCoord objects.
+ - QGLPaintDevice
+ * [QTBUG-6204] Rebind window surface FBO after native GL rendering.
+ - QGLPixmapData
+ * [QTBUG-6902] Align GL_RGB data on a 4-byte line boundary.
- QGLWidget
* [QTBUG-5002, QTBUG-6931] Fixed QGLWidget::renderText().
- * Fixed WA_TranslucentBackground for QGLWidgets on X11/EGL
- * Fix EGL surface leaks when re-parenting on X11/EGL
- - QGL2PaintEngineEx
- * Performance: Don't mark brush as dirty if it hasn't changed
- * Performance: Use 3x3 PMV matrices rather than 4x4
- * Performance: Move the 0.5 offset we add for aliased rendering to updateMatrix()
- * Performance: Remove superfluous enable/disable vertex arrtib arrays
- * Performance: Track the glVertexAttribPointer and only update it if it's changed
- * [QTBUG-7094] Introduce new "snapToPixelGrid" flag for drawText
+ * Fixed WA_TranslucentBackground for QGLWidgets on X11/EGL.
+ * Fix EGL surface leaks when re-parenting on X11/EGL.
+ - QTriangulatingStroker
+ * [QTBUG-6045] Crash in dashed line handling in the GL stroker.
QtOpenVG
--------
@@ -227,32 +216,29 @@ QtOpenVG
QtWebKit
--------
- - Fixed user agent string on Symbian (webkit.org/b/31961)
- - QWebInspector: Don't disable when hiding (webkit.org/b/31851)
- - Fix JavaScript prompt behaviour for empty/null strings (webkit.org/b/30914)
- - Fixed lastIndexOf() on Symbian (webkit.org/b/31773)
- - Fixed crash with Flash on Windows with MinGW
- - Fixed wrapping of QObjects with recurring identity (webkit.org/b/31681)
- - Fixed compilation with ICC
- - Fixed assertion when dragging SVG images (webkit.org/b/32511)
- - Fixed crash with ACID3 test on Symbian
- - Fixed security issue XSL stylesheets and security origins.
- - Added the framecapture example to the default build (merge request 2235)
-
-QtScript
---------
-
- - foo
- * bar
+ - Fixed user agent string on Symbian (webkit.org/b/31961).
+ - QWebInspector: Don't disable when hiding (webkit.org/b/31851).
+ - Fix JavaScript prompt behaviour for empty/null strings (webkit.org/b/30914).
+ - Fixed lastIndexOf() on Symbian (webkit.org/b/31773).
+ - Fixed crash with Flash on Windows with MinGW.
+ - Fixed wrapping of QObjects with recurring identity (webkit.org/b/31681).
+ - Fixed compilation with ICC.
+ - Fixed assertion when dragging SVG images (webkit.org/b/32511).
+ - Added the framecapture example to the default build (merge request 2235)
+ - Fixed crash with ACID3 test on Symbian
+ - Fixed security issue XSL stylesheets and security origins.
QtSql
-----
- - [QTBUG-5373] Fixed QSqlRelationalTableModel doesn't correctly work with relation in other database schema.
- - [QTBUG-5298] (OCI) Fixed QSqlDatabase.tables() does not work with system tables.
- - [QTBUG-6421] Fixed setForwardOnly() for both OCI and SQLite
- - [QTBUG-6618] (ODBC) Fixed segfault when error string is larger than 256 chars.
- - [QTBUG-4461] (OCI) Fixed problem with clobs being handled as binary
+ - [QTBUG-5373] Fixed QSqlRelationalTableModel doesn't correctly work with
+ relation in other database schema.
+ - [QTBUG-5298] (OCI) Fixed QSqlDatabase.tables() does not work with system
+ tables.
+ - [QTBUG-6421] Fixed setForwardOnly() for both OCI and SQLite.
+ - [QTBUG-6618] (ODBC) Fixed segfault when error string is larger than 256
+ chars.
+ - [QTBUG-4461] (OCI) Fixed problem with clobs being handled as binary.
QtSvg
-----
@@ -261,13 +247,8 @@ QtSvg
* [QTBUG-6867] Fixed regression in the parsing of paths with relative
offsets.
* [QTBUG-6899] Fixed crash when parsing invalid coordinate list.
-
-
-QtXml
------
-
- - foo
- * bar
+ - QtXmlPatterns
+ * [QTBUG-6771] Fixed static builds.
Qt Plugins
----------
@@ -283,13 +264,6 @@ Qt Plugins
- PNG plugin
* [QTBUG-7161] Avoid a deep copy of QImage::bits() in the png writer.
-Third party components
-----------------------
-
- - Updated foo to version 2.3.9.
-
- - Updated bar to the latest version from baz.org.
-
****************************************************************************
* Platform Specific Changes *
@@ -300,89 +274,70 @@ Qt for Unix (X11 and Mac OS X)
- [QTBUG-6755] Ensure we don't call select(2) with a negative timeout
if the timer expires during timeout recalculation.
-
- Added mkspecs for Sun CC that enable -library=stlport by default,
to restore STL capability with that compiler.
-
- - [QTBUG-6576] Fixed compilation on HP-UX 11.11
-
- - [QTBUG-6961] Fixed compilation on HURD
+ - [QTBUG-6576] Fixed compilation on HP-UX 11.11.
+ - [QTBUG-6961] Fixed compilation on HURD.
Qt for Linux/X11
----------------
- [QTBUG-5732] Fixed querying of GLX extensions under X11.
- [QTBUG-5547] Fixed handling of the "..." button.
- - Added new mkspec for Maemo targets (linux-g++-maemo)
- - Added new mkspec for Scratchbox host compiler (unsupported/linux-host-g++)
-
+ - Added new mkspec for Maemo targets (linux-g++-maemo).
+ - Added new mkspec for Scratchbox host compiler (unsupported/linux-host-g++).
- QGuiEventDispatcherGlib (internal class)
* Fix regression introduced in 4.6.0 that could cause X11 event
processing to starve timer events.
-
- QFileSystemWatcher
* [QTBUG-4840] Fix memory leak in the dnotify implementation.
-
- QIcon
* [QTBUG-6121] Fixed a problem causing svg-based icon themes to look fuzzy.
-
- QGtkStyle
* [QTBUG-6484] Ensure that gtk-enable-mnemonics is respected.
Qt for Windows
--------------
- - [QTBUG-5145] Compile fixes for win32-icc.
+ - [QTBUG-5145] Compile fixes for win32-icc.
- QAtomicPointer
* [QTBUG-6079] Fix compilation for 64-bit Windows targets.
-
- QEventDispatchWin32 (internal class)
* [QTBUG-6083] Fix a performance regression introduced in 4.6.0
that would cause all Qt posted events to be sent at 15-16ms
intervals (instead of as quickly as possible).
- Vista/XP styles
* [QTBUG-6271] Fixed a compatibility issue with MDI windows in
- certain non-standard themes.
+ certain non-standard themes.
Qt for Mac OS X
---------------
- QPixmap
* [QTBUG-5070] Fixed a crash on Mac that could occur when loading
- pixmaps of different sizes into the same QPixmap object.
- - [QTBUG-6973] Fixed a memory leak when using QWidget::setWindowIcon() in carbon.
+ pixmaps of different sizes into the same QPixmap object.
+ - [QTBUG-6973] Fixed a memory leak when using QWidget::setWindowIcon() in
+ Carbon.
- [QTBUG-5186] Fixed a bug which caused drag and drop icons to show
incorrectly.
- - [QTBUG-6636] Fixed a crash due to stack overflow in QColorDialog on cocoa.
+ - [QTBUG-6636] Fixed a crash due to stack overflow in QColorDialog on Cocoa.
- [QTBUG-6378] Fix a text cursor rendering bug.
- - [QTBUG-6636] Fixed a crash when calling removeToolBar on Mac native toolbars using cocoa.
- - [QTBUG-5613] Fixed a bug where the application refued to quit when showing a single modal dialog.
- - Gestures are now available for the Carbon port also when building Qt against SDK < 10.6
-
-Qt for Embedded Linux
----------------------
-
- -
-
-DirectFB
---------
-
- -
-
-Qt for Windows CE
------------------
-
- -
+ - [QTBUG-6636] Fixed a crash when calling removeToolBar on Mac native toolbars
+ using Cocoa.
+ - [QTBUG-5613] Fixed a bug where the application refused to quit when showing
+ a single modal dialog.
+ - Gestures are now available for the Carbon port also when building Qt against
+ SDK < 10.6
Qt for Symbian
--------------
- QApplication
* [QTBUG-6098] Added a flag to avoid construction of application panes.
-
- Other:
* [QTBUG-4990] Rewrote most of the regular pointer handling.
+
****************************************************************************
* Tools *
****************************************************************************
@@ -397,12 +352,6 @@ Qt for Symbian
* [QTBUG-5824] Fixed code generation to generate a call to
QMainWindow::setCentralWidget() for promoted widgets as well.
- - qdoc3
- * bar
-
- - Linguist
- * baz
-
****************************************************************************
* Important Behavior Changes *
****************************************************************************
diff --git a/dist/changes-4.6.2 b/dist/changes-4.6.2
new file mode 100644
index 0000000..d35f945
--- /dev/null
+++ b/dist/changes-4.6.2
@@ -0,0 +1,159 @@
+Qt 4.6.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 4.6.0. For more details,
+refer to the online documentation included in this distribution. The
+documentation is also available online:
+
+ http://qt.nokia.com/doc/4.6
+
+The Qt version 4.6 series is binary compatible with the 4.5.x series.
+Applications compiled for 4.5 will continue to run with 4.6.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker, the (now obsolete) Task
+Tracker, or the Merge Request queue of the public source repository.
+
+Qt Bug Tracker: http://bugreports.qt.nokia.com
+Task Tracker: http://qt.nokia.com/developer/task-tracker
+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
+------
+
+ - foo
+ * bar
+
+QtGui
+-----
+
+ - foo
+ * bar
+
+QtDBus
+------
+
+ - foo
+ * bar
+
+QtNetwork
+---------
+
+ - foo
+ * bar
+
+QtOpenGL
+--------
+
+ - foo
+ * bar
+
+QtScript
+--------
+
+ - foo
+ * bar
+
+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.
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for Unix (X11 and Mac OS X)
+------------------------------
+
+ -
+
+Qt for Linux/X11
+----------------
+
+ -
+
+Qt for Windows
+--------------
+
+ -
+
+Qt for Mac OS X
+---------------
+
+ -
+
+Qt for Embedded Linux
+---------------------
+
+ -
+
+DirectFB
+--------
+
+ -
+
+Qt for Windows CE
+-----------------
+
+ -
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+ - Designer
+ * foo
+
+ - qdoc3
+ * bar
+
+ - Linguist
+ * baz
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ -
+
diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc
index 83d8679..c4eb615 100644
--- a/doc/src/development/assistant-manual.qdoc
+++ b/doc/src/development/assistant-manual.qdoc
@@ -182,7 +182,7 @@
will appear. Click a sub-item to make its page appear in the \e{Documentation}
window. Click on the control next to an open item to hide its sub-items.
\o The \gui{Index} window is used to look up key words or phrases.
- See \l{The One-Minute Guide to Using Qt Assistant} for how to use this
+ See \l{Qt Assistant Manual#The One-Minute Guide to Using Qt Assistant}{The One-Minute Guide to Using Qt Assistant} for how to use this
window.
\o The \gui{Bookmarks} window lists any bookmarks you have made. Double
click a bookmark to make its page appear in the \e{Documentation} window.
diff --git a/doc/src/examples/graphicsview-anchorlayout.qdoc b/doc/src/examples/graphicsview-anchorlayout.qdoc
new file mode 100644
index 0000000..96a255c
--- /dev/null
+++ b/doc/src/examples/graphicsview-anchorlayout.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example graphicsview/anchorlayout
+ \title Anchor Layout Example
+
+ The Anchor Layout example demonstrates the use of the QGraphicsAnchorLayout
+ class.
+*/
diff --git a/doc/src/examples/graphicsview-flowlayout.qdoc b/doc/src/examples/graphicsview-flowlayout.qdoc
new file mode 100644
index 0000000..5b73069
--- /dev/null
+++ b/doc/src/examples/graphicsview-flowlayout.qdoc
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example graphicsview/flowlayout
+ \title Graphics View Flow Layout Example
+
+ The Graphics View Flow Layout example shows the use of a flow layout
+ in a Graphics View widget.
+
+ See the \l{Flow Layout Example} for a corresponding widget-based example.
+*/
diff --git a/doc/src/examples/graphicsview-simpleanchorlayout.qdoc b/doc/src/examples/graphicsview-simpleanchorlayout.qdoc
new file mode 100644
index 0000000..ddfc854
--- /dev/null
+++ b/doc/src/examples/graphicsview-simpleanchorlayout.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example graphicsview/simpleanchorlayout
+ \title Simple Anchor Layout Example
+
+ The Simple Anchor Layout example shows the basic use of the
+ QGraphicsAnchorLayout class.
+*/
diff --git a/doc/src/examples/graphicsview-weatheranchorlayout.qdoc b/doc/src/examples/graphicsview-weatheranchorlayout.qdoc
new file mode 100644
index 0000000..930c5c0
--- /dev/null
+++ b/doc/src/examples/graphicsview-weatheranchorlayout.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example graphicsview/weatheranchorlayout
+ \title Weather Anchor Layout Example
+
+ The Weather Anchor Layout example shows more complex use of the
+ QGraphicsAnchorLayout class to create a real-world window layout.
+*/
diff --git a/doc/src/examples/network-download.qdoc b/doc/src/examples/network-download.qdoc
new file mode 100644
index 0000000..3481cad
--- /dev/null
+++ b/doc/src/examples/network-download.qdoc
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example network/download
+ \title Network Download Example
+
+ The Network Download example shows how to perform multiple downloads in
+ parallel using the QNetworkAccessManager class.
+
+ This example is designed to be run from the command line.
+
+ The \l{Network Download Manager Example} implements a more complex system
+ that places files in a queue for sequential downloading.
+*/
diff --git a/doc/src/examples/network-downloadmanager.qdoc b/doc/src/examples/network-downloadmanager.qdoc
new file mode 100644
index 0000000..8040c24
--- /dev/null
+++ b/doc/src/examples/network-downloadmanager.qdoc
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example network/downloadmanager
+ \title Network Download Manager Example
+
+ The Network Download example shows how to implement a queue for multiple
+ downloads using the QNetworkAccessManager class.
+
+ This example is designed to be run from the command line.
+
+ See the \l{Network Download Example} for a simpler version of this example
+ that obtains multiple files in parallel.
+*/
diff --git a/doc/src/examples/script-marshal.qdoc b/doc/src/examples/script-marshal.qdoc
new file mode 100644
index 0000000..30c8f97
--- /dev/null
+++ b/doc/src/examples/script-marshal.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example script/marshal
+ \title Qt Script Marshalling Example
+
+ The Qt Script Marshalling example demonstrates the marshalling of value
+ types between C++ and Qt Script.
+*/
diff --git a/doc/src/examples/script-qscript.qdoc b/doc/src/examples/script-qscript.qdoc
new file mode 100644
index 0000000..1d0d12c
--- /dev/null
+++ b/doc/src/examples/script-qscript.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example script/qscript
+ \title Qt Script Interpreter Example
+
+ The Qt Script Interpreter example shows how to create an interactive
+ interpreter for Qt Script.
+*/
diff --git a/doc/src/examples/script-qsdbg.qdoc b/doc/src/examples/script-qsdbg.qdoc
new file mode 100644
index 0000000..332740f
--- /dev/null
+++ b/doc/src/examples/script-qsdbg.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example script/qsdbg
+ \title Qt Script Debugger Example
+
+ The Qt Script Debugger example shows how to enable the Qt Script debugger
+ for command line debugging.
+*/
diff --git a/doc/src/examples/svgalib.qdoc b/doc/src/examples/svgalib.qdoc
index 9142112..cf6512c 100644
--- a/doc/src/examples/svgalib.qdoc
+++ b/doc/src/examples/svgalib.qdoc
@@ -43,6 +43,9 @@
\example qws/svgalib
\title Accelerated Graphics Driver Example
+ \warning This example was designed to work with Qt 4.4 and will not work
+ with current versions of Qt. It will be removed from Qt 4.7.
+
The Accelerated Graphics Driver example shows how you can write
your own accelerated graphics driver and \l {add your graphics
driver to Qt for Embedded Linux}. In \l{Qt for Embedded Linux},
diff --git a/doc/src/examples/webkit-framecapture.qdoc b/doc/src/examples/webkit-framecapture.qdoc
new file mode 100644
index 0000000..cf4e3da
--- /dev/null
+++ b/doc/src/examples/webkit-framecapture.qdoc
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+/*!
+ \example webkit/framecapture
+ \title WebKit Frame Capture Example
+
+ The Frame Capture example shows how to use the WebKit browser engine to
+ obtain images of frames in a Web page.
+
+ This example is designed to be run from the command line. Run the
+ example without arguments to obtain usage information.
+*/
diff --git a/doc/src/examples/widgets-softkeys.qdoc b/doc/src/examples/widgets-softkeys.qdoc
new file mode 100644
index 0000000..3afb930
--- /dev/null
+++ b/doc/src/examples/widgets-softkeys.qdoc
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/softkeys
+ \title Soft Keys Example
+
+ The Soft Keys example shows how to use soft key input on the Symbian platform.
+*/
diff --git a/doc/src/examples/widgets-validators.qdoc b/doc/src/examples/widgets-validators.qdoc
new file mode 100644
index 0000000..0bdd6e6
--- /dev/null
+++ b/doc/src/examples/widgets-validators.qdoc
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/validators
+ \title Validators Example
+
+ The Validators example shows the signal emission behavior of input validators.
+*/
diff --git a/doc/src/frameworks-technologies/qthelp.qdoc b/doc/src/frameworks-technologies/qthelp.qdoc
index 079b080..3c80f04 100644
--- a/doc/src/frameworks-technologies/qthelp.qdoc
+++ b/doc/src/frameworks-technologies/qthelp.qdoc
@@ -264,7 +264,7 @@
help collection to keep track of a documentation set without relying
on its file name. The Qt help system uses a namespace as identifier
which is defined by the mandatory namespace tags. In the example
- above, the namespace is "mycompany.com.myapplication.1_0".
+ above, the namespace is "mycompany.com.myapplication.1.0".
\target Virtual Folders
\section2 Virtual Folders
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index 1477829..0c18773 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -74,13 +74,12 @@
\l{Qt Demonstrations}{selection of demos} that deliberately show off
Qt's features. You might want to look at these as well.
- \table
- \row
- \o{2,1} \l{Widgets Examples}{\bold Widgets}
- \o{2,1} \l{Dialog Examples}{\bold Dialogs}
- \row
- \o \image widget-examples.png
- \o
+ \section1 \l{Widgets Examples}{Widgets}
+ \beginfloatleft
+ \l{Widgets Examples}{\inlineimage widget-examples.png
+ }
+
+ \endfloat
Qt comes with a large range of standard widgets that users of modern
applications have come to expect. You can also develop your own custom
widgets and controls, and use them alongside standard widgets.
@@ -89,28 +88,39 @@
be used to change the appearance of standard widgets and appropriately
written custom widgets.
- \o \image dialog-examples.png Dialogs
- \o
+ \clearfloat
+ \section1 \l{Dialog Examples}{Dialogs}
+ \beginfloatleft
+ \l{Dialog Examples}{\inlineimage dialog-examples.png
+ }
+
+ \endfloat
Qt includes standard dialogs for many common operations, such as file
selection, printing, and color selection.
Custom dialogs can also be created for specialized modal or modeless
interactions with users.
- \row
- \o{2,1} \l{Main Window Examples}{\bold{Main Windows}}
- \o{2,1} \l{Layout Examples}{\bold Layouts}
+ \clearfloat
+ \section1 \l{Main Window Examples}{Main Windows}
+ \beginfloatleft
+ \l{Main Window Examples}{\inlineimage mainwindow-examples.png
+ }
- \row
- \o \image mainwindow-examples.png MainWindows
- \o All the standard features of application main windows are provided by Qt.
+ \endfloat
+ All the standard features of application main windows are provided by Qt.
Main windows can have pull down menus, tool bars, and dock windows. These
separate forms of user input are unified in an integrated action system that
also supports keyboard shortcuts and accelerator keys in menu items.
- \o \image layout-examples.png Layouts
- \o
+ \clearfloat
+ \section1 \l{Layout Examples}{Layouts}
+ \beginfloatleft
+ \l{Layout Examples}{\inlineimage layout-examples.png
+ }
+
+ \endfloat
Qt uses a layout-based approach to widget management. Widgets are arranged in
the optimal positions in windows based on simple layout rules, leading to a
consistent look and feel.
@@ -118,45 +128,58 @@
Custom layouts can be used to provide more control over the positions and
sizes of child widgets.
- \row
- \o{2,1} \l{Item Views Examples}{\bold{Item Views}}
- \o{2,1} \l{Graphics View Examples}{\bold{Graphics View}}
- \row
- \o \image itemview-examples.png ItemViews
- \o
+ \clearfloat
+ \section1 \l{Item Views Examples}{Item Views}
+ \beginfloatleft
+ \l{Item Views Examples}{\inlineimage itemview-examples.png
+ }
+
+ \endfloat
Item views are widgets that typically display data sets. Qt 4's model/view
framework lets you handle large data sets by separating the underlying data
from the way it is represented to the user, and provides support for
customized rendering through the use of delegates.
- \o \image graphicsview-examples.png GraphicsView
- \o
+ \clearfloat
+ \section1 \l{Graphics View Examples}{Graphics View}
+ \beginfloatleft
+ \l{Graphics View Examples}{\inlineimage graphicsview-examples.png
+ }
+
+ \endfloat
Qt is provided with a comprehensive canvas through the GraphicsView
classes.
- \row
- \o{2,1} \l{Painting Examples}{\bold{Painting}}
- \o{2,1} \l{Rich Text Examples}{\bold{Rich Text}}
- \row
- \o \image painting-examples.png Painting
- \o
+ \clearfloat
+ \section1 \l{Painting Examples}{Painting}
+ \beginfloatleft
+ \l{Painting Examples}{\inlineimage painting-examples.png
+ }
+
+ \endfloat
Qt's painting system is able to render vector graphics, images, and outline
font-based text with sub-pixel accuracy accuracy using anti-aliasing to
improve rendering quality.
- \o \image richtext-examples.png RichText
- \o
+ \clearfloat
+ \section1 \l{Rich Text Examples}{Rich Text}
+ \beginfloatleft
+ \l{Rich Text Examples}{\inlineimage richtext-examples.png
+ }
+
+ \endfloat
Qt provides powerful document-oriented rich text engine that supports Unicode
and right-to-left scripts. Documents can be manipulated using a cursor-based
API, and their contents can be imported and exported as both HTML and in a
custom XML format.
- \row
- \o{2,1} \l{Desktop Examples}{\bold Desktop}
- \o{2,1} \l{Drag and Drop Examples}{\bold{Drag and Drop}}
- \row
- \o \image desktop-examples.png
- \o
+ \clearfloat
+ \section1 \l{Desktop Examples}{Desktop}
+ \beginfloatleft
+ \l{Desktop Examples}{\inlineimage desktop-examples.png
+ }
+
+ \endfloat
Qt provides features to enable applications to integrate with the user's
preferred desktop environment.
@@ -164,20 +187,26 @@
support for desktop services can be used to improve the appearance of
applications and take advantage of underlying desktop facilities.
- \o \image draganddrop-examples.png DragAndDrop
- \o
+ \clearfloat
+ \section1 \l{Drag and Drop Examples}{Drag and Drop}
+ \beginfloatleft
+ \l{Drag and Drop Examples}{\inlineimage draganddrop-examples.png
+ }
+
+ \endfloat
Qt supports native drag and drop on all platforms via an extensible
MIME-based system that enables applications to send data to each other in the
most appropriate formats.
Drag and drop can also be implemented for internal use by applications.
- \row
- \o{2,1} \l{Threading and Concurrent Programming Examples}{\bold{Threading and Concurrent Programming}}
- \o{2,1} \l{Tools Examples}{\bold{Tools}}
- \row
- \o \image thread-examples.png
- \o
+ \clearfloat
+ \section1 \l{Threading and Concurrent Programming Examples}{Threading and Concurrent Programming}
+ \beginfloatleft
+ \l{Threading and Concurrent Programming Examples}{\inlineimage thread-examples.png
+ }
+
+ \endfloat
Qt 4 makes it easier than ever to write multithreaded applications. More
classes have been made usable from non-GUI threads, and the signals and slots
mechanism can now be used to communicate between threads.
@@ -185,32 +214,46 @@
The QtConcurrent namespace includes a collection of classes and functions
for straightforward concurrent programming.
- \o \image tool-examples.png Tools
- \o
+ \clearfloat
+ \section1 \l{Tools Examples}{Tools}
+ \beginfloatleft
+ \l{Tools Examples}{\inlineimage tool-examples.png
+ }
+
+ \endfloat
Qt is equipped with a range of capable tool classes, from containers and
iterators to classes for string handling and manipulation.
Other classes provide application infrastructure support, handling plugin
loading and managing configuration files.
- \row
- \o{2,1} \l{Network Examples}{\bold{Network}}
- \o{2,1} \l{Inter-Process Communication Examples}{\bold{Inter-Process Communication}}
- \row
- \o \image network-examples.png Network
- \o
+ \clearfloat
+ \section1 \l{Network Examples}{Network}
+ \beginfloatleft
+ \l{Network Examples}{\inlineimage network-examples.png
+ }
+
+ \endfloat
Qt is provided with an extensive set of network classes to support both
client-based and server side network programming.
- \o \image ipc-examples.png IPC
- \o
+ \clearfloat
+ \section1 \l{Inter-Process Communication Examples}{Inter-Process Communication}
+ \beginfloatleft
+ \l{Inter-Process Communication Examples}{\inlineimage ipc-examples.png
+ }
- \row
- \o{2,1} \l{OpenGL Examples}{\bold{OpenGL}}\bold{ and }\l{OpenVG Examples}{\bold{OpenVG}}\bold{ Examples}
- \o{2,1} \l{Multimedia Examples}{\bold{Multimedia Framework}}
- \row
- \o \image opengl-examples.png OpenGL
- \o
+ \endfloat
+ Simple, lightweight inter-process communication can be performed using shared
+ memory and local sockets.
+
+ \clearfloat
+ \section1 \l{OpenGL Examples}{OpenGL} and \l{OpenVG Examples}{OpenVG} Examples
+ \beginfloatleft
+ \l{OpenGL Examples}{\inlineimage opengl-examples.png
+ }
+
+ \endfloat
Qt provides support for integration with OpenGL implementations on all
platforms, giving developers the opportunity to display hardware accelerated
3D graphics alongside a more conventional user interface.
@@ -218,137 +261,191 @@
Qt provides support for integration with OpenVG implementations on
platforms with suitable drivers.
- \o \image phonon-examples.png
- \o
+ \clearfloat
+ \section1 \l{Multimedia Examples}{Multimedia Framework}
+ \beginfloatleft
+ \l{Multimedia Examples}{\inlineimage phonon-examples.png
+ }
+
+ \endfloat
Qt provides low-level audio support on linux,windows and mac platforms by default and
an audio plugin API to allow developers to implement there own audio support for
custom devices and platforms.
The Phonon Multimedia Framework brings multimedia support to Qt applications.
- \row
- \o{2,1} \l{SQL Examples}{\bold{SQL}}
- \o{2,1} \l{XML Examples}{\bold{XML}}
- \row
- \o \image sql-examples.png SQL
- \o
+ \clearfloat
+ \section1 \l{SQL Examples}{SQL}
+ \beginfloatleft
+ \l{SQL Examples}{\inlineimage sql-examples.png
+ }
+
+ \endfloat
Qt provides extensive database interoperability, with support for products
from both open source and proprietary vendors.
SQL support is integrated with Qt's model/view architecture, making it easier
to provide GUI integration for your database applications.
- \o \image xml-examples.png XML
- \o
+ \clearfloat
+ \section1 \l{XML Examples}{XML}
+ \beginfloatleft
+ \l{XML Examples}{\inlineimage xml-examples.png
+ }
+
+ \endfloat
XML parsing and handling is supported through SAX and DOM compliant APIs
as well as streaming classes.
The XQuery/XPath and XML Schema engines in the QtXmlPatterns modules
provide classes for querying XML files and custom data models.
- \row
- \o{2,1} \l{Qt Designer Examples}{\bold{Qt Designer}}
- \o{2,1} \l{UiTools Examples}{\bold UiTools}
- \row
- \o \image designer-examples.png Designer
- \o
+ \clearfloat
+ \section1 \l{Qt Designer Examples}{Qt Designer}
+ \beginfloatleft
+ \l{Qt Designer Examples}{\inlineimage designer-examples.png
+ }
+
+ \endfloat
Qt Designer is a capable graphical user interface designer that lets you
create and configure forms without writing code. GUIs created with
Qt Designer can be compiled into an application or created at run-time.
- \o \image uitools-examples.png UiTools
- \o
+ \clearfloat
+ \section1 \l{UiTools Examples}{UiTools}
+ \beginfloatleft
+ \l{UiTools Examples}{\inlineimage uitools-examples.png
+ }
+
+ \endfloat
+ User interfaces created with Qt Designer can be loaded and displayed at
+ run-time using the facilities of the QtUiTools module without the need
+ to generate code in advance.
- \row
- \o{2,1} \l{Qt Linguist Examples}{\bold{Qt Linguist}}
- \o{2,1} \l{Qt Script Examples}{\bold{Qt Script}}
- \row
- \o \image linguist-examples.png QtLinguist
- \o
+ \clearfloat
+ \section1 \l{Qt Linguist Examples}{Qt Linguist}
+ \beginfloatleft
+ \l{Qt Linguist Examples}{\inlineimage linguist-examples.png
+ }
+
+ \endfloat
Internationalization is a core feature of Qt.
- \o \image qtscript-examples.png
- \o
+ \clearfloat
+ \section1 \l{Qt Script Examples}{Qt Script}
+ \beginfloatleft
+ \l{Qt Script Examples}{\inlineimage qtscript-examples.png
+ }
+
+ \endfloat
Qt is provided with a powerful embedded scripting environment through the QtScript
classes.
- \row
- \o{2,1} \l{WebKit Examples}{\bold WebKit}
- \o{2,1} \l{Help System Examples}{\bold{Help System}}
- \row
- \o \image webkit-examples.png
- \o
+ \clearfloat
+ \section1 \l{WebKit Examples}{WebKit}
+ \beginfloatleft
+ \l{WebKit Examples}{\inlineimage webkit-examples.png
+ }
+
+ \endfloat
Qt provides an integrated Web browser component based on WebKit, the popular
open source browser engine.
- \o \image assistant-examples.png HelpSystem
- \o
+ \clearfloat
+ \section1 \l{Help System Examples}{Help System}
+ \beginfloatleft
+ \l{Help System Examples}{\inlineimage assistant-examples.png
+ }
+
+ \endfloat
Support for interactive help is provided by the Qt Assistant application.
Developers can take advantages of the facilities it offers to display
specially-prepared documentation to users of their applications.
- \row
- \o{2,1} \l{State Machine Examples}{\bold{State Machine}}
- \o{2,1} \l{Animation Framework Examples}{\bold{Animation Framework}}
- \row
- \o \image statemachine-examples.png
- \o
+ \clearfloat
+ \section1 \l{State Machine Examples}{State Machine}
+ \beginfloatleft
+ \l{State Machine Examples}{\inlineimage statemachine-examples.png
+ }
+
+ \endfloat
Qt provides a powerful hierarchical finite state machine through the Qt State
Machine classes.
- \o \image animation-examples.png
- \o
+ \clearfloat
+ \section1 \l{Animation Framework Examples}{Animation Framework}
+ \beginfloatleft
+ \l{Animation Framework Examples}{\inlineimage animation-examples.png
+ }
+
+ \endfloat
These examples show to to use the \l{The Animation Framework}{animation framework}
to build highly animated, high-performance GUIs.
- \row
- \o{2,1} \l{Multi-Touch Examples}{\bold{Multi-Touch Framework}}
- \o{2,1} \l{Gestures Examples}{\bold{Gestures}}
+ \clearfloat
+ \section1 \l{Multi-Touch Examples}{Multi-Touch Framework}
+ \beginfloatleft
+ \l{Multi-Touch Examples}{\inlineimage multitouch-examples.png
+ }
- \row
- \o \image multitouch-examples.png
- \o
+ \endfloat
Support for multi-touch input makes it possible for developers to create
extensible and intuitive user interfaces.
- \o \image gestures-examples.png
- \o
+ \clearfloat
+ \section1 \l{Gestures Examples}{Gestures}
+ \beginfloatleft
+ \l{Gestures Examples}{\inlineimage gestures-examples.png
+ }
+
+ \endfloat
Applications can be written to respond to gestures as a natural input method.
These examples show how to enable support for standard and custom gestures in
applications.
- \row
- \o{2,1} \l{D-Bus Examples}{\bold{D-Bus}}
- \o{2,1} \l{Qt for Embedded Linux Examples}{\bold{Qt for Embedded Linux}}
+ \clearfloat
+ \section1 \l{D-Bus Examples}{D-Bus}
+ \beginfloatleft
+ \l{D-Bus Examples}{\inlineimage dbus-examples.png
+ }
- \row
- \o \image qt-embedded-examples.png
- \o
+ \endfloat
Systems with limited resources, specialized hardware, and small
screens require special attention.
- \o \image dbus-examples.png D-Bus
- \o
+ \clearfloat
+ \section1 \l{Qt for Embedded Linux Examples}{Qt for Embedded Linux}
+ \beginfloatleft
+ \l{Qt for Embedded Linux Examples}{\inlineimage qt-embedded-examples.png
+ }
+
+ \endfloat
D-Bus is an inter-process communication protocol for Unix/Linux systems.
These examples demonstrate how to write application that communicate with
each other.
- \row
- \o{2,1} \l{ActiveQt Examples}{\bold ActiveQt}
- \o{2,1} \l{Qt Quarterly}{\bold{Qt Quarterly}}
+ \clearfloat
+ \section1 \l{ActiveQt Examples}{ActiveQt}
+ \beginfloatleft
+ \l{ActiveQt Examples}{\inlineimage activeqt-examples.png
+ }
- \row
- \o \image activeqt-examples.png ActiveQt
- \o
+ \endfloat
These examples demonstrate how to write ActiveX controls and control servers
with Qt, and how to use ActiveX controls and COM objects in a Qt application.
- \o \image qq-thumbnail.png QtQuarterly
- \o
+ \clearfloat
+ \section1 \l{Qt Quarterly}{Qt Quarterly}
+ \beginfloatleft
+ \l{Qt Quarterly}{\inlineimage qq-thumbnail.png
+ }
+
+ \endfloat
One more valuable source for examples and explanations of Qt
- features is the archive of the \l {Qt Quarterly}.
+ features is the archive of \l{Qt Quarterly}, a newsletter for
+ Qt developers.
- \endtable
+ \clearfloat
*/
/*!
@@ -385,12 +482,14 @@
\o \l{widgets/scribble}{Scribble}\raisedaster
\o \l{widgets/shapedclock}{Shaped Clock}\raisedaster
\o \l{widgets/sliders}{Sliders}\raisedaster
+ \o \l{widgets/softkeys}{Soft Keys}
\o \l{widgets/spinboxes}{Spin Boxes}\raisedaster
\o \l{widgets/styles}{Styles}\raisedaster
\o \l{widgets/stylesheet}{Style Sheet}\raisedaster
\o \l{widgets/tablet}{Tablet}\raisedaster
\o \l{widgets/tetrix}{Tetrix}\raisedaster
\o \l{widgets/tooltips}{Tooltips}\raisedaster
+ \o \l{widgets/validators}{Validators}
\o \l{widgets/wiggly}{Wiggly}\raisedaster
\o \l{widgets/windowflags}{Window Flags}\raisedaster
\endlist
@@ -546,6 +645,15 @@
\o \l{graphicsview/portedcanvas}{Ported Canvas}
\endlist
+ These examples show the use of graphics widgets and layouts.
+
+ \list
+ \o \l{graphicsview/anchorlayout}{Anchor Layout}
+ \o \l{graphicsview/flowlayout}{Flow Layout}
+ \o \l{graphicsview/simpleanchorlayout}{Simple Anchor Layout}
+ \o \l{graphicsview/weatheranchorlayout}{Weather Anchor Layout}
+ \endlist
+
Some examples demonstrate the use of graphics effects with canvas items.
\list
@@ -761,6 +869,8 @@
\o \l{network/blockingfortuneclient}{Blocking Fortune Client}\raisedaster
\o \l{network/broadcastreceiver}{Broadcast Receiver}
\o \l{network/broadcastsender}{Broadcast Sender}
+ \o \l{network/download}{Download}
+ \o \l{network/downloadmanager}{Download Manager}
\o \l{network/network-chat}{Network Chat}
\o \l{network/fortuneclient}{Fortune Client}\raisedaster
\o \l{network/fortuneserver}{Fortune Server}\raisedaster
@@ -1043,6 +1153,9 @@
\o \l{script/context2d}{Context2D}\raisedaster
\o \l{script/defaultprototypes}{Default Prototypes}\raisedaster
\o \l{script/helloscript}{Hello Script}\raisedaster
+ \o \l{script/marshal}{Qt Script Marshalling}
+ \o \l{script/qscript}{Qt Script Interpreter}
+ \o \l{script/qsdbg}{Qt Script Debugging}
\o \l{script/qstetrix}{Qt Script Tetrix}\raisedaster
\o \l{script/customclass}{Custom Script Class}\raisedaster
\endlist
@@ -1073,6 +1186,8 @@
\o A more advanced browser example, showing the use of jQuery to perform effects.
\row \o \l{webkit/formextractor}{Form Extractor}
\o How to use JavaScript and C++ together to read page content.
+ \row \o \l{webkit/framecapture}{Frame Capture}
+ \o How to use the WebKit browser engine to obtain images of Web pages.
\row \o \l{webkit/googlechat}{Google Chat}
\o A real-world example that shows how an existing Web-based service can be accessed
using QtWebKit.
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 3867b3b..5f95c5a 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -640,17 +640,38 @@ If you are using pre-built binaries, follow the instructions given in the
Congratulations, Qt is now ready to use.
- \o Running Qt demos
+ \o Installing Qt libraries on the device
- We've included a subset of the Qt demos in this package for you
- to try out. An excellent starting point is the "fluidlauncher"
- demo. To run the demo on a real device, you first have to install
+ To run the demo on a real device, you first have to install
the Qt libraries on the device:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 29
- \note You will need to supply certificate that allows installation
- of binaries with "All -Tcb" capability to your device.
+ The Qt libraries are built with "All -Tcb" capability, so that
+ they can support all types of application.
+ If you don't have a suitable certificate, it is possible to patch
+ the binaries as follows:
+
+ \list A
+ \o Installing Qt without a certificate
+
+ If you have no certificate, build a self signed Qt:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 34
+
+ \o Installing Qt with a Symbian developer certificate
+
+ If you have a symbian-signed developer certificate, specify the
+ capabilities you can sign for, for example:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 35
+ \endlist
+
+ \o Running Qt demos
+
+ We've included a subset of the Qt demos in this package for you
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo.
Similarly, install fluidlauncher to the device:
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc
index 298e0be..44d6ed6 100644
--- a/doc/src/modules.qdoc
+++ b/doc/src/modules.qdoc
@@ -1046,7 +1046,7 @@
distributed under the following license.
\legalese
- Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).\br
All rights reserved.\br
Contact: Nokia Corporation (qt-info@nokia.com)
diff --git a/doc/src/platforms/emb-install.qdoc b/doc/src/platforms/emb-install.qdoc
index c13fbef..623ba89 100644
--- a/doc/src/platforms/emb-install.qdoc
+++ b/doc/src/platforms/emb-install.qdoc
@@ -84,7 +84,9 @@
Before building the \l{Qt for Embedded Linux} library, run the \c
./configure script to configure the library for your development
architecture. You can list all of the configuration system's
- options by typing \c {./configure -help}.
+ options by typing
+
+ \snippet doc/src/snippets/code/doc_src_emb-install.qdoc embedded help
Note that by default, \l{Qt for Embedded Linux} is configured for
installation in the \c{/usr/local/Trolltech/QtEmbedded-%VERSION%}
diff --git a/doc/src/snippets/code/doc_src_emb-install.qdoc b/doc/src/snippets/code/doc_src_emb-install.qdoc
index 60775d2..f24f087 100644
--- a/doc/src/snippets/code/doc_src_emb-install.qdoc
+++ b/doc/src/snippets/code/doc_src_emb-install.qdoc
@@ -41,18 +41,22 @@
//! [0]
cd <anywhere>
-gunzip qt-embedded-linux-commercial-src-%VERSION%.tar.gz
-tar xf qt-embedded-linux-commercial-src-%VERSION%.tar
+gunzip qt-everywhere-opensource-src-%VERSION%.tar.gz
+tar xf qt-everywhere-opensource-src-%VERSION%.tar
//! [0]
//! [1]
-~/qt-embedded-linux-commercial-src-%VERSION%
+~/qt-everywhere-opensource-src-%VERSION%
//! [1]
+//! [embedded help]
+./configure -embedded -help
+//! [embedded help]
+
//! [2]
-cd ~/qt-embedded-linux-commercial-src-%VERSION%
+cd ~/qt-everywhere-opensource-src-%VERSION%
./configure -embedded [architecture]
//! [2]
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 7680ec8..b3c9903 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -222,3 +222,21 @@ abld build gcce urel
//! [33]
SYMBIANBUILD_DEPENDENCYOFF=1
//! [33]
+
+//! [34]
+cd src\s60installs
+patch_capabilities.pl Qt_template.pkg release-armv5
+make sis QT_SIS_OPTIONS=-i
+cd ..\3rdparty\webkit\WebCore
+patch_capabilities.pl QtWebkit_template.pkg release-armv5
+make sis QT_SIS_OPTIONS=-i
+//! [34]
+
+//! [35]
+cd src\s60installs
+patch_capabilities.pl Qt_template.pkg release-armv5 "ALL -Tcb -AllFiles -DRM"
+make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=<certificate file> QT_SIS_KEY=<certificate key file>
+cd ..\3rdparty\webkit\WebCore
+patch_capabilities.pl QtWebKit_template.pkg release-armv5 "ALL -Tcb -AllFiles -DRM"
+make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=<certificate file> QT_SIS_KEY=<certificate key file>
+//! [35]
diff --git a/doc/src/snippets/code/doc_src_qthelp.qdoc b/doc/src/snippets/code/doc_src_qthelp.qdoc
index 017879d..f7b880a 100644
--- a/doc/src/snippets/code/doc_src_qthelp.qdoc
+++ b/doc/src/snippets/code/doc_src_qthelp.qdoc
@@ -110,7 +110,7 @@ if (links.count()) {
//! [7]
<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
- <namespace>mycompany.com.myapplication.1_0</namespace>
+ <namespace>mycompany.com.myapplication.1.0</namespace>
<virtualFolder>doc</virtualFolder>
<customFilter name="My Application 1.0">
<filterAttribute>myapp</filterAttribute>
diff --git a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
index 483c675..4f27661 100644
--- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
+++ b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
@@ -260,3 +260,14 @@ class CustomItem : public QGraphicsItem
...
};
//! [QGraphicsItem type]
+
+//! [18]
+class QGraphicsPathItem : public QAbstractGraphicsShapeItem
+{
+ public:
+ enum { Type = 2 };
+ int type() const { return Type; }
+ ...
+};
+//! [18]
+
diff --git a/doc/src/snippets/qstring/main.cpp b/doc/src/snippets/qstring/main.cpp
index 629586e..3be504c 100644
--- a/doc/src/snippets/qstring/main.cpp
+++ b/doc/src/snippets/qstring/main.cpp
@@ -802,7 +802,7 @@ void Widget::toLowerFunction()
{
//! [75]
QString str = "Qt by NOKIA";
- str = str.toLower(); // str == "qy by nokia"
+ str = str.toLower(); // str == "qt by nokia"
//! [75]
}
diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc
index ea8411f..6adfa75 100644
--- a/doc/src/windows-and-dialogs/mainwindow.qdoc
+++ b/doc/src/windows-and-dialogs/mainwindow.qdoc
@@ -51,7 +51,7 @@
\nextpage The Application Main Window
- A \l{Widgets}{widget} that is not embedded in a parent widget is called a window.
+ A \l{Widgets Tutorial}{widget} that is not embedded in a parent widget is called a window.
Usually, windows have a frame and a title bar, although it is also possible to create
windows without such decoration using suitable window flags). In Qt, QMainWindow
and the various subclasses of QDialog are the most common window types.
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp
index 79bc448..0c85773 100644
--- a/examples/network/googlesuggest/googlesuggest.cpp
+++ b/examples/network/googlesuggest/googlesuggest.cpp
@@ -231,4 +231,5 @@ void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply)
networkReply->deleteLater();
}
-//! [9] \ No newline at end of file
+//! [9]
+
diff --git a/examples/network/googlesuggest/searchbox.cpp b/examples/network/googlesuggest/searchbox.cpp
index 69dc20e..8ef6f00 100644
--- a/examples/network/googlesuggest/searchbox.cpp
+++ b/examples/network/googlesuggest/searchbox.cpp
@@ -69,4 +69,5 @@ void SearchBox::doSearch()
QString url = QString(GSEARCH_URL).arg(text());
QDesktopServices::openUrl(QUrl(url));
}
-//! [2] \ No newline at end of file
+//! [2]
+
diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp
index d8bcb30..da65270 100644
--- a/examples/network/network-chat/chatdialog.cpp
+++ b/examples/network/network-chat/chatdialog.cpp
@@ -79,7 +79,7 @@ void ChatDialog::appendMessage(const QString &from, const QString &message)
QTextCursor cursor(textEdit->textCursor());
cursor.movePosition(QTextCursor::End);
QTextTable *table = cursor.insertTable(1, 2, tableFormat);
- table->cellAt(0, 0).firstCursorPosition().insertText("<" + from + "> ");
+ table->cellAt(0, 0).firstCursorPosition().insertText('<' + from + "> ");
table->cellAt(0, 1).firstCursorPosition().insertText(message);
QScrollBar *bar = textEdit->verticalScrollBar();
bar->setValue(bar->maximum());
diff --git a/examples/network/network-chat/client.cpp b/examples/network/network-chat/client.cpp
index 2b8725c..f516783 100644
--- a/examples/network/network-chat/client.cpp
+++ b/examples/network/network-chat/client.cpp
@@ -69,8 +69,8 @@ void Client::sendMessage(const QString &message)
QString Client::nickName() const
{
- return QString(peerManager->userName()) + "@" + QHostInfo::localHostName()
- + ":" + QString::number(server.serverPort());
+ return QString(peerManager->userName()) + '@' + QHostInfo::localHostName()
+ + ':' + QString::number(server.serverPort());
}
bool Client::hasConnection(const QHostAddress &senderIp, int senderPort) const
diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp
index 1df8a2d..5c636b9 100644
--- a/examples/network/network-chat/connection.cpp
+++ b/examples/network/network-chat/connection.cpp
@@ -83,7 +83,7 @@ bool Connection::sendMessage(const QString &message)
return false;
QByteArray msg = message.toUtf8();
- QByteArray data = "MESSAGE " + QByteArray::number(msg.size()) + " " + msg;
+ QByteArray data = "MESSAGE " + QByteArray::number(msg.size()) + ' ' + msg;
return write(data) == data.size();
}
@@ -118,7 +118,7 @@ void Connection::processReadyRead()
return;
}
- username = QString(buffer) + "@" + peerAddress().toString() + ":"
+ username = QString(buffer) + '@' + peerAddress().toString() + ':'
+ QString::number(peerPort());
currentDataType = Undefined;
numBytesForCurrentDataType = 0;
@@ -162,7 +162,7 @@ void Connection::sendPing()
void Connection::sendGreetingMessage()
{
QByteArray greeting = greetingMessage.toUtf8();
- QByteArray data = "GREETING " + QByteArray::number(greeting.size()) + " " + greeting;
+ QByteArray data = "GREETING " + QByteArray::number(greeting.size()) + ' ' + greeting;
if (write(data) == data.size())
isGreetingMessageSent = true;
}
diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp
index 5ad2dc7..430031b 100644
--- a/examples/network/network-chat/peermanager.cpp
+++ b/examples/network/network-chat/peermanager.cpp
@@ -61,7 +61,7 @@ PeerManager::PeerManager(Client *client)
foreach (QString string, envVariables) {
int index = environment.indexOf(QRegExp(string));
if (index != -1) {
- QStringList stringList = environment.at(index).split("=");
+ QStringList stringList = environment.at(index).split('=');
if (stringList.size() == 2) {
username = stringList.at(1).toUtf8();
break;
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
index ae3a2b6..3fd62f8 100644
--- a/examples/network/qftp/ftpwindow.cpp
+++ b/examples/network/qftp/ftpwindow.cpp
@@ -324,7 +324,8 @@ void FtpWindow::processItem(QTreeWidgetItem *item, int /*column*/)
if (isDirectory.value(name)) {
fileList->clear();
isDirectory.clear();
- currentPath += "/" + name;
+ currentPath += '/';
+ currentPath += name;
ftp->cd(name);
ftp->list();
cdToParentButton->setEnabled(true);
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 1422f1c..0d6a581 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -177,7 +177,7 @@ void SslClient::socketReadyRead()
void SslClient::sendData()
{
QString input = form->sessionInput->text();
- appendString(input + "\n");
+ appendString(input + '\n');
socket->write(input.toUtf8() + "\r\n");
form->sessionInput->clear();
}
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index 4f23d54..2397737 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -105,7 +105,7 @@ void TrackerClient::fetchPeerList()
QString passkey = "?";
if (fullUrl.contains("?passkey")) {
passkey = metaInfo.announceUrl().mid(fullUrl.indexOf("?passkey"), -1);
- passkey += "&";
+ passkey += '&';
}
// Percent encode the hash
diff --git a/examples/tools/customtype/message.cpp b/examples/tools/customtype/message.cpp
index 4ef041a..d27159e 100644
--- a/examples/tools/customtype/message.cpp
+++ b/examples/tools/customtype/message.cpp
@@ -64,7 +64,7 @@ Message::Message(const QString &body, const QStringList &headers)
}
//! [custom type streaming operator]
-QDebug &operator<<(QDebug &dbg, const Message &message)
+QDebug operator<<(QDebug dbg, const Message &message)
{
QStringList pieces = message.body().split("\r\n", QString::SkipEmptyParts);
if (pieces.isEmpty())
diff --git a/examples/tools/customtype/message.h b/examples/tools/customtype/message.h
index 361f803..4ef48d4 100644
--- a/examples/tools/customtype/message.h
+++ b/examples/tools/customtype/message.h
@@ -70,7 +70,7 @@ Q_DECLARE_METATYPE(Message);
//! [custom type meta-type declaration]
//! [custom type streaming operator]
-QDebug &operator<<(QDebug &dbg, const Message &message);
+QDebug operator<<(QDebug dbg, const Message &message);
//! [custom type streaming operator]
#endif
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 0f06b92..a2933e9 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -65,7 +65,7 @@ QMAKE_LINK_OBJECT_SCRIPT=
QMAKE_LIBS = -llibc -llibm -leuser -llibdl
QMAKE_LIBS_CORE = $$QMAKE_LIBS -llibpthread -lefsrv
-QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lhal -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc
+QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lhal -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lcentralrepository
QMAKE_LIBS_NETWORK =
QMAKE_LIBS_EGL = -llibEGL
QMAKE_LIBS_OPENGL =
diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf
new file mode 100644
index 0000000..c29d4ec
--- /dev/null
+++ b/mkspecs/features/symbian/def_files.prf
@@ -0,0 +1,26 @@
+# With DEF files enabled, removed exported symbols are treated as errors
+# and there is binary compatibility between successive builds.
+
+CONFIG -= def_files_disabled
+
+!isEmpty(defFilePath) {
+ defBlock = \
+ "$${LITERAL_HASH}ifdef WINSCW" \
+ "DEFFILE $$defFilePath/bwins/$${TARGET}.def" \
+ "$${LITERAL_HASH}elif defined EABI" \
+ "DEFFILE $$defFilePath/eabi/$${TARGET}.def" \
+ "$${LITERAL_HASH}endif"
+
+ MMP_RULES += defBlock
+} else {
+ # If defFilePath is not defined, then put the folders containing the DEF files at the
+ # same level as the .pro (and generated MMP) file(s)
+ defBlock = \
+ "$${LITERAL_HASH}ifdef WINSCW" \
+ "DEFFILE ./bwins/$${TARGET}.def" \
+ "$${LITERAL_HASH}elif defined EABI" \
+ "DEFFILE ./eabi/$${TARGET}.def" \
+ "$${LITERAL_HASH}endif"
+
+ MMP_RULES += defBlock
+}
diff --git a/mkspecs/features/symbian/def_files_disabled.prf b/mkspecs/features/symbian/def_files_disabled.prf
new file mode 100644
index 0000000..d5c9505
--- /dev/null
+++ b/mkspecs/features/symbian/def_files_disabled.prf
@@ -0,0 +1,7 @@
+# With DEF files disabled, binary compatibility is broken every time you build
+
+CONFIG -= def_files
+
+# with EXPORTUNFROZEN enabled, new exports are included in the dll without
+# needing to run abld/sbs freeze
+MMP_RULES += EXPORTUNFROZEN
diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf
index f5caae0..c723d8c 100644
--- a/mkspecs/features/symbian/platform_paths.prf
+++ b/mkspecs/features/symbian/platform_paths.prf
@@ -59,7 +59,7 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
# No platform specific paths provided, use default paths
- exists($${EPOCROOT}epoc32/include/platform) { # New SF structure
+ exists($${EPOCROOT}epoc32/include/mw) { # New SF structure
# ---------------------------------------
# Location, where the applications layer specific public headers are exported
diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf
index b0f3ca3..38c26a6 100644
--- a/mkspecs/linux-g++-maemo/qmake.conf
+++ b/mkspecs/linux-g++-maemo/qmake.conf
@@ -29,5 +29,7 @@ QMAKE_CXXFLAGS_RELEASE += -g -fno-omit-frame-pointer -fno-optimize-sibling-call
# Work round PowerVR SGX 1.3 driver bug with glScissor & FBOs:
DEFINES += QT_GL_NO_SCISSOR_TEST
+# Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:
+DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024
load(qt_config)
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 755f73f..f3e3c3a 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -46,7 +46,6 @@
#include <qsettings.h>
#include <qdebug.h>
-#define PLUGIN_STUB_DIR "qmakepluginstubs"
#define SYSBIN_DIR "\\sys\\bin"
#define SUFFIX_DLL "dll"
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
index 2f43818..e23e6a9 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.h
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -52,6 +52,8 @@
#include "epocroot.h"
+#define PLUGIN_STUB_DIR "qmakepluginstubs"
+
struct CopyItem
{
CopyItem(const QString& f, const QString& t) : from(f) , to(t) { }
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 6e76c9e..20e2d0e 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
#include "symmake.h"
-#include "initprojectdeploy_symbian.h"
#include <qstring.h>
#include <qhash.h>
@@ -62,6 +61,7 @@
#define BLD_INF_TAG_MMPFILES "prj_mmpfiles"
#define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles"
#define BLD_INF_TAG_EXTENSIONS "prj_extensions"
+#define BLD_INF_TAG_EXPORTS "prj_exports"
#define RSS_RULES "RSS_RULES"
#define RSS_RULES_BASE "RSS_RULES."
@@ -202,6 +202,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
// Generate pkg files if there are any actual files to deploy
bool generatePkg = false;
+ DeploymentList depList;
+
if (targetType == TypeExe) {
generatePkg = true;
} else {
@@ -214,10 +216,10 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
}
if (generatePkg) {
- generatePkgFile(iconFile);
+ generatePkgFile(iconFile, depList);
}
- writeBldInfContent(t, generatePkg, iconFile);
+ writeBldInfContent(t, generatePkg, iconFile, depList);
// Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile,
// but all required data is not yet available.
@@ -272,7 +274,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
return true;
}
-void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile)
+void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList)
{
QString pkgFilename = QString("%1_template.%2")
.arg(fixedTarget)
@@ -396,7 +398,6 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile)
}
// deploy any additional DEPLOYMENT files
- DeploymentList depList;
QString remoteTestPath;
remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
@@ -1171,7 +1172,7 @@ void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t)
}
}
-void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile)
+void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList)
{
// Read user defined bld inf rules
@@ -1300,6 +1301,25 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
t << item << endl;
userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS);
+ t << endl << BLD_INF_TAG_EXPORTS << endl << endl;
+
+ // Generate export rules
+
+ // Export any deployed plugin stubs under /epoc32/data/z to support ROM builds
+ for (int i = 0; i < depList.size(); ++i) {
+ int index = depList.at(i).from.indexOf(PLUGIN_STUB_DIR);
+ if (index != -1) {
+ t << QString("%1 /epoc32/data/z%2")
+ .arg(QString(depList.at(i).from).mid(index).replace('\\','/'))
+ .arg(QString(depList.at(i).to).mid(2).replace('\\','/')) << endl;
+ }
+ }
+
+ userItems = userBldInfRules.value(BLD_INF_TAG_EXPORTS);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(BLD_INF_TAG_EXPORTS);
+
// Add rest of the user defined content
for (QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) {
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 45209d1..77d61da 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -42,6 +42,7 @@
#ifndef SYMMAKEFILE_H
#define SYMMAKEFILE_H
+#include "initprojectdeploy_symbian.h"
#include <makefile.h>
QT_BEGIN_NAMESPACE
@@ -86,7 +87,7 @@ protected:
QString canonizePath(const QString& origPath);
virtual bool writeMakefile(QTextStream &t);
- void generatePkgFile(const QString &iconFile);
+ void generatePkgFile(const QString &iconFile, DeploymentList &depList);
bool containsStartWithItem(const QChar &c, const QStringList& src);
virtual void init();
@@ -106,7 +107,7 @@ protected:
QString &checkString);
void writeHeader(QTextStream &t);
- void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile);
+ void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList);
static bool removeDuplicatedStrings(QStringList& stringList);
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 2ad6112..c2e033e 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -79,7 +79,7 @@ enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST
E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND,
E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE,
- E_SIZE };
+ E_SIZE, E_GENERATE_UID };
QMap<QString, ExpandFunc> qmake_expandFunctions()
{
static QMap<QString, ExpandFunc> *qmake_expand_functions = 0;
@@ -111,6 +111,7 @@ QMap<QString, ExpandFunc> qmake_expandFunctions()
qmake_expand_functions->insert("prompt", E_PROMPT);
qmake_expand_functions->insert("replace", E_REPLACE);
qmake_expand_functions->insert("size", E_SIZE);
+ qmake_expand_functions->insert("generate_uid", E_GENERATE_UID);
}
return *qmake_expand_functions;
}
@@ -1864,6 +1865,9 @@ QMakeProject::doProjectExpand(QString func, QStringList args,
return doProjectExpand(func, args_list, place);
}
+// defined in symbian generator
+extern QString generate_test_uid(const QString& target);
+
QStringList
QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
QMap<QString, QStringList> &place)
@@ -2301,6 +2305,14 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret += QString::number(size);
}
break; }
+ case E_GENERATE_UID:
+ if (args.count() != 1) {
+ fprintf(stderr, "%s:%d: generate_uid(var) requires one argument.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
+ } else {
+ ret += generate_test_uid(args.first());
+ }
+ break;
default: {
fprintf(stderr, "%s:%d: Unknown replace function: %s\n",
parser.file.toLatin1().constData(), parser.line_no,
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp
index 091be16..95423c6 100644
--- a/src/3rdparty/phonon/ds9/videowidget.cpp
+++ b/src/3rdparty/phonon/ds9/videowidget.cpp
@@ -218,6 +218,9 @@ namespace Phonon
if (toNative && m_noNativeRendererSupported)
return current; //no switch here
+ if (!mediaObject())
+ return current;
+
//firt we delete the renderer
//initialization of the widgets
for(int i = 0; i < FILTER_COUNT; ++i) {
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
index 9878472..436e8e4 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
@@ -23,7 +23,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <AudioEffectBase.h>
-#include <Phonon/EffectInterface>
+#include <phonon/effectinterface.h>
#include "audioplayer.h"
#include "effectparameter.h"
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index dbcbe63..cec5568 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -19,8 +19,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_ABSTRACTPLAYER_H
#define PHONON_MMF_ABSTRACTPLAYER_H
-#include <Phonon/phononnamespace.h>
-#include <Phonon/MediaSource.h>
+#include <phonon/phononnamespace.h>
+#include <phonon/mediasource.h>
#include <QObject>
diff --git a/src/3rdparty/phonon/mmf/backend.h b/src/3rdparty/phonon/mmf/backend.h
index 6b85625..9361544 100644
--- a/src/3rdparty/phonon/mmf/backend.h
+++ b/src/3rdparty/phonon/mmf/backend.h
@@ -22,8 +22,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "ancestormovemonitor.h"
#include "effectfactory.h"
-#include <Phonon/MediaSource>
-#include <Phonon/BackendInterface>
+#include <phonon/mediasource.h>
+#include <phonon/backendinterface.h>
#include <QScopedPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/effectparameter.h b/src/3rdparty/phonon/mmf/effectparameter.h
index 27cc018..892ed4d 100644
--- a/src/3rdparty/phonon/mmf/effectparameter.h
+++ b/src/3rdparty/phonon/mmf/effectparameter.h
@@ -19,7 +19,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_EFFECTPARAMETER_H
#define PHONON_MMF_EFFECTPARAMETER_H
-#include <Phonon/EffectParameter>
+#include <phonon/effectparameter.h>
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index c87d755..d6248e2 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -19,8 +19,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_MEDIAOBJECT_H
#define PHONON_MMF_MEDIAOBJECT_H
-#include <Phonon/MediaSource>
-#include <Phonon/MediaObjectInterface>
+#include <phonon/mediasource.h>
+#include <phonon/mediaobjectinterface.h>
#include <QScopedPointer>
#include <QTimer>
diff --git a/src/3rdparty/phonon/mmf/mmf_medianode.h b/src/3rdparty/phonon/mmf/mmf_medianode.h
index 0ed21c4..f2f64e0 100644
--- a/src/3rdparty/phonon/mmf/mmf_medianode.h
+++ b/src/3rdparty/phonon/mmf/mmf_medianode.h
@@ -20,7 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#define PHONON_MMF_MEDIANODE_H
#include <QObject>
-#include <Phonon/EffectInterface>
+#include <phonon/effectinterface.h>
#include "audioplayer.h"
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h
index 2788401..3e9c036 100644
--- a/src/3rdparty/phonon/mmf/videooutput.h
+++ b/src/3rdparty/phonon/mmf/videooutput.h
@@ -24,7 +24,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QRect>
#include "defs.h"
-#include <Phonon/VideoWidget>
+#include <phonon/videowidget.h>
#include <e32std.h>
class RWindowBase;
diff --git a/src/3rdparty/phonon/mmf/videowidget.h b/src/3rdparty/phonon/mmf/videowidget.h
index a876748..899dca6 100644
--- a/src/3rdparty/phonon/mmf/videowidget.h
+++ b/src/3rdparty/phonon/mmf/videowidget.h
@@ -23,8 +23,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "videooutput.h"
#include <QtGui/QWidget>
-#include <Phonon/VideoWidget>
-#include <Phonon/VideoWidgetInterface>
+#include <phonon/videowidget.h>
+#include <phonon/videowidgetinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index e292418..b943840 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -10,17 +10,6 @@
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):
-2010-01-07 Norbert Leser <norbert.leser@nokia.com>
-
- Reviewed by NOBODY (OOPS!).
-
- Added time-based optimization and increased optimization level to O3,
- conditionally for COMPILER(RVCT),
- for increasing performance of JavaScript execution.
- (Default settings are Ospace and O2)
-
- * runtime/Structure.h:
-
2009-11-19 Thiago Macieira <thiago.macieira@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
index ecdd997..f355c53 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
@@ -45,12 +45,6 @@
#define DUMP_PROPERTYMAP_STATS 0
#endif
-#if COMPILER(RVCT)
-#pragma arm
-#pragma Otime
-#pragma O3
-#endif
-
namespace JSC {
class MarkStack;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index bc6d661..128df75 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- 8b9165d3bc84d1c8cc7df49a191cc3857b5530d4
+ ca7b2e1e1ca558050cf49dd8f7c9b35e4b9d4df5
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 02daf86..40a2149 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,113 @@
+2010-01-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable scrolling optimization for pages with embedded widgets
+
+ https://bugs.webkit.org/show_bug.cgi?id=33373
+
+ Added a basic manual test for scrolling of embedded QWidgets.
+
+ * manual-tests/qt/qtplugin-scrolling.html: Added.
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::setParent):
+ * platform/ScrollView.h:
+ * platform/qt/ScrollViewQt.cpp:
+ (WebCore::ScrollView::platformInit):
+ (WebCore::ScrollView::platformAddChild):
+ (WebCore::ScrollView::platformRemoveChild):
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::invalidateRect):
+
+2010-01-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Turn off websocket support by default for Qt 4.6.x
+ https://bugs.webkit.org/show_bug.cgi?id=34284
+
+ * WebCore.pro:
+
+2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] JavaScript prompt is currently broken.
+ https://bugs.webkit.org/show_bug.cgi?id=30914
+
+ Remove the manual test case in favor of an automated
+ test case in WebKit/qt/tests/qwebpage.
+
+ * manual-tests/qt/java-script-prompt.html: Removed.
+
+2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Phone backup support for QtWebkit for Symbian devices.
+ https://bugs.webkit.org/show_bug.cgi?id=34077
+
+ * WebCore.pro:
+
+2010-01-21 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix incorrect dependency to QtXmlPatterns in generated include/QtWebKit/QtWebKit header
+
+ The generated file includes QtXmlPatterns/QtXmlPatterns, which is neither used/required by
+ the public QtWebKit API nor will it be available if Qt is configured with -no-xmlpatterns.
+
+ * WebCore.pro: Trick syncqt to believe that xmlpatterns is not a dependency, so that it's not
+ included in the generated file. It'll still be used and linked to with this trick.
+
+2010-01-17 Srinidhi Shreedhara <srinidhi.shreedhara@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] [Symbian] SetWindow call in npapi plugin does not happen when the cooridnates are negative
+ https://bugs.webkit.org/show_bug.cgi?id=33573
+
+ * plugins/symbian/PluginViewSymbian.cpp:
+ (WebCore::PluginView::setNPWindowIfNeeded): Remove tests for negative
+ coordinates for early return.
+
+2010-01-14 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ Platform Symbian specific:
+ Added time-based optimization (-Otime) and increased optimization level to -O3,
+ conditionally for RVCT compiler (for ARM), for increasing performance
+ (primarily affecting JavaScript execution).
+ Default settings are -Ospace and -O2.
+
+ No new tests needed because no new funtionality is introduced,
+ only potential regression on existing tests needs to be evaluated.
+
+ * WebCore.pro:
+
+2010-01-13 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt/Win] Flash in QGraphicsWebView does not process hover correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33591
+
+ Mouse hover does not work as expected with the flash in some sites.
+ - http://www.bbc.co.uk/ Hover over the map
+ - http://www.barbie.com/ Hover over the menu items (Games, Videos)
+ The problem appears to be that Flash queries NPNVnetscapeWindow on every
+ mouse hover. I do not how flash uses this value but returning 0 when flash
+ is in windowless mode solves the problem (When using QGraphicsWebView we
+ inject wmode opaque, thereby putting the plugin in windowless mode).
+
+ * plugins/win/PluginViewWin.cpp:
+ (windowHandleForPageClient):
+
2010-01-13 Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 9432217..f364d3b 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -18,12 +18,17 @@ symbian: {
" "
webkitlibs.pkg_prerules = vendorinfo
- DEPLOYMENT += webkitlibs
+ webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
+ webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+
+ DEPLOYMENT += webkitlibs webkitbackup
TARGET.UID3 = 0x200267C2
# RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
# Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
MMP_RULES += "LINKEROPTION armcc --rw-base 0xE00000"
+ MMP_RULES += ALWAYS_BUILD_AS_ARM
+ QMAKE_CXXFLAGS.ARMCC += -OTime -O3
}
include($$PWD/../WebKit.pri)
@@ -181,7 +186,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
}
# Web Socket support.
-!contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
+!contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=0
# XSLT support with QtXmlPatterns
!contains(DEFINES, ENABLE_XSLT=.) {
@@ -2778,7 +2783,7 @@ unix:!mac:CONFIG += link_pkgconfig
contains(DEFINES, ENABLE_XSLT=1) {
FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
- QT += xmlpatterns
+ tobe|!tobe: QT += xmlpatterns
SOURCES += \
bindings/js/JSXSLTProcessorConstructor.cpp \
@@ -3413,14 +3418,8 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4
symbian {
shared {
- contains(MMP_RULES, defBlock) {
- MMP_RULES -= defBlock
-
- MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" \
- "DEFFILE ../WebKit/qt/symbian/bwins/$${TARGET}.def" \
- "$${LITERAL_HASH}elif defined EABI" \
- "DEFFILE ../WebKit/qt/symbian/eabi/$${TARGET}.def" \
- "$${LITERAL_HASH}endif"
+ contains(CONFIG, def_files) {
+ defFilePath=../WebKit/qt/symbian
}
}
}
diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
index 12edc42..d270e37 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
+++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
@@ -216,7 +216,6 @@
#include "JSWebKitCSSTransformValue.h"
#include "JSWebKitPoint.h"
#include "JSWebKitTransitionEvent.h"
-#include "JSWebSocket.h"
#include "JSWheelEvent.h"
#include "JSWorker.h"
#include "JSXMLHttpRequest.h"
@@ -247,7 +246,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSDOMWindow);
/* Hash table */
-static const HashTableValue JSDOMWindowTableValues[297] =
+static const HashTableValue JSDOMWindowTableValues[296] =
{
{ "screen", DontDelete|ReadOnly, (intptr_t)jsDOMWindowScreen, (intptr_t)0 },
{ "history", DontDelete|ReadOnly, (intptr_t)jsDOMWindowHistory, (intptr_t)0 },
@@ -540,7 +539,6 @@ static const HashTableValue JSDOMWindowTableValues[297] =
{ "MessageChannel", DontDelete, (intptr_t)jsDOMWindowMessageChannelConstructor, (intptr_t)setJSDOMWindowMessageChannelConstructor },
{ "Worker", DontDelete, (intptr_t)jsDOMWindowWorkerConstructor, (intptr_t)setJSDOMWindowWorkerConstructor },
{ "SharedWorker", DontDelete, (intptr_t)jsDOMWindowSharedWorkerConstructor, (intptr_t)setJSDOMWindowSharedWorkerConstructor },
- { "WebSocket", DontDelete, (intptr_t)jsDOMWindowWebSocketConstructor, (intptr_t)setJSDOMWindowWebSocketConstructor },
{ "Plugin", DontDelete, (intptr_t)jsDOMWindowPluginConstructor, (intptr_t)setJSDOMWindowPluginConstructor },
{ "PluginArray", DontDelete, (intptr_t)jsDOMWindowPluginArrayConstructor, (intptr_t)setJSDOMWindowPluginArrayConstructor },
{ "MimeType", DontDelete, (intptr_t)jsDOMWindowMimeTypeConstructor, (intptr_t)setJSDOMWindowMimeTypeConstructor },
@@ -588,7 +586,7 @@ static JSC_CONST_HASHTABLE HashTable JSDOMWindowTable =
#if ENABLE(PERFECT_HASH_SIZE)
{ 65535, JSDOMWindowTableValues, 0 };
#else
- { 1068, 1023, JSDOMWindowTableValues, 0 };
+ { 1067, 1023, JSDOMWindowTableValues, 0 };
#endif
/* Hash table for prototype */
@@ -3275,14 +3273,6 @@ JSValue jsDOMWindowSharedWorkerConstructor(ExecState* exec, const Identifier&, c
return castedThis->sharedWorker(exec);
}
-JSValue jsDOMWindowWebSocketConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
-{
- JSDOMWindow* castedThis = static_cast<JSDOMWindow*>(asObject(slot.slotBase()));
- if (!castedThis->allowsAccessFrom(exec))
- return jsUndefined();
- return castedThis->webSocket(exec);
-}
-
JSValue jsDOMWindowPluginConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
JSDOMWindow* castedThis = static_cast<JSDOMWindow*>(asObject(slot.slotBase()));
@@ -5678,14 +5668,6 @@ void setJSDOMWindowSharedWorkerConstructor(ExecState* exec, JSObject* thisObject
static_cast<JSDOMWindow*>(thisObject)->putDirect(Identifier(exec, "SharedWorker"), value);
}
-void setJSDOMWindowWebSocketConstructor(ExecState* exec, JSObject* thisObject, JSValue value)
-{
- if (!static_cast<JSDOMWindow*>(thisObject)->allowsAccessFrom(exec))
- return;
- // Shadowing a built-in constructor
- static_cast<JSDOMWindow*>(thisObject)->putDirect(Identifier(exec, "WebSocket"), value);
-}
-
void setJSDOMWindowPluginConstructor(ExecState* exec, JSObject* thisObject, JSValue value)
{
if (!static_cast<JSDOMWindow*>(thisObject)->allowsAccessFrom(exec))
diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
index afc8106..5a087e7 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
+++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
@@ -82,7 +82,6 @@ public:
JSC::JSValue messageChannel(JSC::ExecState*) const;
JSC::JSValue worker(JSC::ExecState*) const;
JSC::JSValue sharedWorker(JSC::ExecState*) const;
- JSC::JSValue webSocket(JSC::ExecState*) const;
JSC::JSValue audio(JSC::ExecState*) const;
// Custom functions
@@ -679,8 +678,6 @@ JSC::JSValue jsDOMWindowWorkerConstructor(JSC::ExecState*, const JSC::Identifier
void setJSDOMWindowWorkerConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowSharedWorkerConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
void setJSDOMWindowSharedWorkerConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsDOMWindowWebSocketConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
-void setJSDOMWindowWebSocketConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowPluginConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
void setJSDOMWindowPluginConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowPluginArrayConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
diff --git a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
index 2315f02..f2fffb5 100644
--- a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
+++ b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
@@ -44,6 +44,7 @@ typedef struct HBITMAP__* HBITMAP;
namespace WebCore {
class QWebPopup;
}
+class QGraphicsProxyWidget;
#elif PLATFORM(GTK)
typedef struct _GtkMenu GtkMenu;
typedef struct _GtkMenuItem GtkMenuItem;
@@ -147,6 +148,7 @@ private:
void clear();
void populate(const IntRect&);
QWebPopup* m_popup;
+ QGraphicsProxyWidget* m_proxy;
#elif PLATFORM(WIN)
// ScrollBarClient
virtual void valueChanged(Scrollbar*);
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
index ee8726a..e67daf9 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
@@ -507,7 +507,7 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
hostWindow()->repaint(panScrollIconDirtyRect, true);
}
- if (canBlitOnScroll() && !rootPreventsBlitting()) { // The main frame can just blit the WebView window
+ if (canBlitOnScroll()) { // The main frame can just blit the WebView window
// FIXME: Find a way to blit subframes without blitting overlapping content
hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
} else {
@@ -597,14 +597,6 @@ void ScrollView::setParent(ScrollView* parentView)
if (m_scrollbarsAvoidingResizer && parent())
parent()->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
-#if PLATFORM(QT)
- if (m_widgetsPreventingBlitting && parent())
- parent()->adjustWidgetsPreventingBlittingCount(-m_widgetsPreventingBlitting);
-
- if (m_widgetsPreventingBlitting && parentView)
- parentView->adjustWidgetsPreventingBlittingCount(m_widgetsPreventingBlitting);
-#endif
-
Widget::setParent(parentView);
if (m_scrollbarsAvoidingResizer && parent())
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
index 1950a54..5dacff5 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
@@ -305,16 +305,6 @@ private:
NSScrollView<WebCoreFrameScrollView>* scrollView() const;
#endif
-#if PLATFORM(QT)
-public:
- void adjustWidgetsPreventingBlittingCount(int delta);
-private:
- bool rootPreventsBlitting() const { return root()->m_widgetsPreventingBlitting > 0; }
- unsigned m_widgetsPreventingBlitting;
-#else
- bool rootPreventsBlitting() const { return false; }
-#endif
-
#if PLATFORM(GTK)
public:
void setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj);
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
index f6ec4f7..714cac9 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
@@ -1,6 +1,7 @@
/*
* This file is part of the popup menu implementation for <select> elements in WebCore.
*
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
@@ -35,6 +36,10 @@
#include <QAction>
#include <QDebug>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsScene>
+#include <QGraphicsView>
+#include <QGraphicsWebView>
#include <QListWidget>
#include <QListWidgetItem>
#include <QMenu>
@@ -46,13 +51,17 @@ namespace WebCore {
PopupMenu::PopupMenu(PopupMenuClient* client)
: m_popupClient(client)
+ , m_proxy(0)
{
m_popup = new QWebPopup(client);
}
PopupMenu::~PopupMenu()
{
- delete m_popup;
+ // If we create a proxy, then the deletion of the proxy and the
+ // combo will be done by the proxy's parent (QGraphicsWebView)
+ if (!m_proxy)
+ delete m_popup;
}
void PopupMenu::clear()
@@ -92,8 +101,18 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
rect.moveTopLeft(v->contentsToWindow(r.topLeft()));
rect.setHeight(m_popup->sizeHint().height());
- m_popup->setParent(client->ownerWidget());
- m_popup->setGeometry(rect);
+ if (QGraphicsView* view = qobject_cast<QGraphicsView*>(client->ownerWidget())) {
+ if (!m_proxy) {
+ m_proxy = new QGraphicsProxyWidget(qobject_cast<QGraphicsWebView*>(client->pluginParent()));
+ m_proxy->setWidget(m_popup);
+ } else
+ m_proxy->setVisible(true);
+ m_proxy->setGeometry(rect);
+ } else {
+ m_popup->setParent(client->ownerWidget());
+ m_popup->setGeometry(rect);
+ }
+
m_popup->setCurrentIndex(index);
m_popup->exec();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp b/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
index d077079..f6a8167 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
@@ -26,6 +26,7 @@
#include <QApplication>
#include <QInputContext>
#include <QMouseEvent>
+#include <QGraphicsProxyWidget>
namespace WebCore {
@@ -43,9 +44,16 @@ QWebPopup::QWebPopup(PopupMenuClient* client)
void QWebPopup::exec()
{
+ // QCursor::pos() is not a great idea for a touch screen, but we don't need the coordinates
+ // as comboboxes with Qt on Maemo 5 come up in their full width on the screen.
+ // On the other platforms it's okay to use QCursor::pos().
+#if defined(Q_WS_MAEMO_5)
+ showPopup();
+#else
QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
Qt::LeftButton, Qt::NoModifier);
QCoreApplication::sendEvent(this, &event);
+#endif
}
void QWebPopup::showPopup()
@@ -67,6 +75,10 @@ void QWebPopup::hidePopup()
}
QComboBox::hidePopup();
+
+ if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
+ proxy->setVisible(false);
+
if (!m_popupVisible)
return;
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
index ccbd751..17ad253 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
@@ -36,32 +36,19 @@ namespace WebCore {
void ScrollView::platformInit()
{
- m_widgetsPreventingBlitting = 0;
}
void ScrollView::platformDestroy()
{
}
-// Windowed plugins are using native windows and are thus preventing
-// us from doing any kind of scrolling optimization.
-
-void ScrollView::adjustWidgetsPreventingBlittingCount(int delta)
-{
- m_widgetsPreventingBlitting += delta;
- if (parent())
- parent()->adjustWidgetsPreventingBlittingCount(delta);
-}
-
void ScrollView::platformAddChild(Widget*)
{
- adjustWidgetsPreventingBlittingCount(1);
}
void ScrollView::platformRemoveChild(Widget* child)
{
child->hide();
- adjustWidgetsPreventingBlittingCount(-1);
}
}
diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
index e61736b..476ab8a 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
@@ -126,6 +126,10 @@ void PluginView::updatePluginWidget()
// scroll, we need to move/resize immediately.
if (!m_windowRect.intersects(frameView->frameRect()))
setNPWindowIfNeeded();
+
+ // Make sure we get repainted afterwards. This is necessary for downward
+ // scrolling to move the plugin widget properly.
+ invalidate();
}
void PluginView::setFocus()
@@ -657,7 +661,8 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
void PluginView::invalidateRect(const IntRect& rect)
{
if (m_isWindowed) {
- platformWidget()->update(rect);
+ if (platformWidget())
+ platformWidget()->update(rect);
return;
}
diff --git a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
index 14e25b1..cf69723 100644
--- a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -280,8 +280,6 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.width = m_windowRect.width();
m_npWindow.height = m_windowRect.height();
- if (m_npWindow.x < 0 || m_npWindow.y < 0 || m_npWindow.width <= 0 || m_npWindow.height <= 0)
- return;
PluginView::setCurrentPluginView(this);
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
index b313afb..ab71273 100644
--- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
@@ -86,7 +86,9 @@ static inline HWND windowHandleForPageClient(PlatformPageClient client)
#if PLATFORM(QT)
if (!client)
return 0;
- return client->ownerWidget()->winId();
+ if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))
+ return pluginParent->winId();
+ return 0;
#else
return client;
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 29bde0d..e4c2afc 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -1369,6 +1369,11 @@ void QWebFrame::print(QPrinter *printer) const
// paranoia check
fromPage = qMax(1, fromPage);
toPage = qMin(printContext.pageCount(), toPage);
+ if (toPage < fromPage) {
+ // if the user entered a page range outside the actual number
+ // of printable pages, just return
+ return;
+ }
if (printer->pageOrder() == QPrinter::LastPageFirst) {
int tmp = fromPage;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 6d08c32..a289ec0 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1708,8 +1708,14 @@ QWebPage::~QWebPage()
FrameLoader *loader = d->mainFrame->d->frame->loader();
if (loader)
loader->detachFromParent();
- if (d->inspector)
- d->inspector->setPage(0);
+ if (d->inspector) {
+ // Since we have to delete an internal inspector,
+ // call setInspector(0) directly to prevent potential crashes
+ if (d->inspectorIsInternalOnly)
+ d->setInspector(0);
+ else
+ d->inspector->setPage(0);
+ }
delete d;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 357b787..697570f 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,82 @@
+2010-01-28 Trond Kjernåsen <trond@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix for endless print loop when printing web pages
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+
+2010-01-26 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Show comboboxes on Maemo 5
+ https://bugs.webkit.org/show_bug.cgi?id=34088
+
+ Don't try to show the combobox by simulating a mouse event from QCursor::pos() to
+ get the combobox position right. The position on Maemo 5 is independent from the mouse
+ and there's no QCursor::pos().
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopup::show):
+
+2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] JavaScript prompt is currently broken
+ https://bugs.webkit.org/show_bug.cgi?id=30914
+
+ In r52152 a patch was landed to convert a null QString
+ to an empty WebCore::String in case the prompt was accepted
+ but the default implementation returned the null QString.
+
+ The patch tried to avoid assign to result twice and
+ was not checking the QString if it is null but the default
+ value. This lead to always returning an empty string on
+ successful prompts. Fix it by checking the variable 'x'
+ for isNull.
+
+ The manual test case used didn't cover the case of non
+ empty input, replace it with an automatic test case that
+ should cover all cases.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runJavaScriptPrompt): Fix the bug.
+ * tests/qwebpage/tst_qwebpage.cpp: Add automatic test case
+ (JSPromptPage::JSPromptPage):
+ (JSPromptPage::javaScriptPrompt):
+ (tst_QWebPage::testJSPrompt):
+
+2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Phone backup support for QtWebkit for Symbian devices.
+ https://bugs.webkit.org/show_bug.cgi?id=34077
+
+ * symbian/backup_registration.xml: Added.
+
+2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix QWebInspector destruction problem.
+ https://bugs.webkit.org/show_bug.cgi?id=31664
+
+ * Api/qwebpage.cpp:
+ (QWebPage::~QWebPage):
+
+2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Update Symbian .def symbol export files after private API additions.
+
+ * symbian/bwins/QtWebKitu.def:
+ * symbian/eabi/QtWebKitu.def:
+
2009-12-18 Joe Ligman <joseph.ligman@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index c5d2792..0c5df4a 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -281,7 +281,7 @@ bool ChromeClientQt::runJavaScriptPrompt(Frame* f, const String& message, const
// Fix up a quirk in the QInputDialog class. If no input happened the string should be empty
// but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914.
- if (rc && result.isNull())
+ if (rc && x.isNull())
result = String("");
else
result = x;
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/backup_registration.xml b/src/3rdparty/webkit/WebKit/qt/symbian/backup_registration.xml
new file mode 100644
index 0000000..e026140
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/backup_registration.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+ <system_backup/>
+ <restore requires_reboot = "no"/>
+</backup_registration>
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
index e5631f8..086e986 100644
--- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
@@ -620,4 +620,8 @@ EXPORTS
?staticMetaObject@QWebPage@@2UQMetaObject@@B @ 619 NONAME ; struct QMetaObject const QWebPage::staticMetaObject
?staticMetaObject@QWebView@@2UQMetaObject@@B @ 620 NONAME ; struct QMetaObject const QWebView::staticMetaObject
?attributeNames@QWebElement@@QBE?AVQStringList@@ABVQString@@@Z @ 621 NONAME ; class QStringList QWebElement::attributeNames(class QString const &) const
+ ?qt_networkAccessAllowed@@YAX_N@Z @ 622 NONAME ; void qt_networkAccessAllowed(bool)
+ ?qt_resumeActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 623 NONAME ; void qt_resumeActiveDOMObjects(class QWebFrame *)
+ ?qt_suspendActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 624 NONAME ; void qt_suspendActiveDOMObjects(class QWebFrame *)
+ ?qtwebkit_webframe_scrollRecursively@@YA_NPAVQWebFrame@@HH@Z @ 625 NONAME ; bool qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int)
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
index 4aad884..5dd2e20 100644
--- a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -690,4 +690,8 @@ EXPORTS
_ZThn8_N16QGraphicsWebView10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 689 NONAME
_ZThn8_NK16QGraphicsWebView16inputMethodQueryEN2Qt16InputMethodQueryE @ 690 NONAME
_ZNK11QWebElement14attributeNamesERK7QString @ 691 NONAME
+ _Z23qt_networkAccessAllowedb @ 692 NONAME
+ _Z25qt_resumeActiveDOMObjectsP9QWebFrame @ 693 NONAME
+ _Z26qt_suspendActiveDOMObjectsP9QWebFrame @ 694 NONAME
+ _Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameii @ 695 NONAME
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index ee1969d..0e04acc 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1,6 +1,7 @@
/*
Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ Copyright (C) 2010 Holger Hans Peter Freyther
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -154,6 +155,7 @@ private slots:
void screenshot();
void originatingObjectInNetworkRequests();
+ void testJSPrompt();
private:
QWebView* m_view;
@@ -1781,5 +1783,72 @@ void tst_QWebPage::originatingObjectInNetworkRequests()
#endif
}
+/**
+ * Test fixups for https://bugs.webkit.org/show_bug.cgi?id=30914
+ *
+ * From JS we test the following conditions.
+ *
+ * OK + QString() => SUCCESS, empty string (but not null)
+ * OK + "text" => SUCCESS, "text"
+ * CANCEL + QString() => CANCEL, null string
+ * CANCEL + "text" => CANCEL, null string
+ */
+class JSPromptPage : public QWebPage {
+ Q_OBJECT
+public:
+ JSPromptPage()
+ {}
+
+ bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result)
+ {
+ if (msg == QLatin1String("test1")) {
+ *result = QString();
+ return true;
+ } else if (msg == QLatin1String("test2")) {
+ *result = QLatin1String("text");
+ return true;
+ } else if (msg == QLatin1String("test3")) {
+ *result = QString();
+ return false;
+ } else if (msg == QLatin1String("test4")) {
+ *result = QLatin1String("text");
+ return false;
+ }
+
+ qFatal("Unknown msg.");
+ return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result);
+ }
+};
+
+void tst_QWebPage::testJSPrompt()
+{
+ JSPromptPage page;
+ bool res;
+
+ // OK + QString()
+ res = page.mainFrame()->evaluateJavaScript(
+ "var retval = prompt('test1');"
+ "retval=='' && retval.length == 0;").toBool();
+ QVERIFY(res);
+
+ // OK + "text"
+ res = page.mainFrame()->evaluateJavaScript(
+ "var retval = prompt('test2');"
+ "retval=='text' && retval.length == 4;").toBool();
+ QVERIFY(res);
+
+ // Cancel + QString()
+ res = page.mainFrame()->evaluateJavaScript(
+ "var retval = prompt('test3');"
+ "retval===null;").toBool();
+ QVERIFY(res);
+
+ // Cancel + "text"
+ res = page.mainFrame()->evaluateJavaScript(
+ "var retval = prompt('test4');"
+ "retval===null;").toBool();
+ QVERIFY(res);
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 2b4ab47..cedb43f 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -299,8 +299,6 @@ void QUnifiedTimer::registerRunningAnimation(QAbstractAnimation *animation)
return;
if (QAbstractAnimationPrivate::get(animation)->isPause) {
- if (animation->duration() == -1)
- qDebug() << "toto";
runningPauseAnimations << animation;
} else
runningLeafAnimations++;
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index eec5b30..cfd7cc2 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -256,7 +256,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
Q_D(QPropertyAnimation);
if (!d->target && oldState == Stopped) {
- qWarning("QPropertyAnimation::updateState: Changing state of an animation without target");
+ qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target",
+ d->propertyName.constData());
return;
}
@@ -279,10 +280,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
if (oldState == Stopped) {
d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData()));
//let's check if we have a start value and an end value
- if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without start value");
- if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without end value");
+ if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
+ if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
}
} else if (hash.value(key) == this) {
hash.remove(key);
diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h
index e015863..8c824f3 100644
--- a/src/corelib/arch/qatomic_ia64.h
+++ b/src/corelib/arch/qatomic_ia64.h
@@ -205,7 +205,7 @@ inline bool QBasicAtomicInt::deref()
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
{
- return (T *)_InterlockedExchangePointer(&_q_value, newValue);
+ return (T *)_InterlockedExchangePointer(reinterpret_cast<void * volatile*>(&_q_value), newValue);
}
template <typename T>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 52e9845..abdafc3 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -44,11 +44,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "4.6.1"
+#define QT_VERSION_STR "4.6.2"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x040601
+#define QT_VERSION 0x040602
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -2419,6 +2419,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
//enabling new graphics resources
#define QT_SYMBIAN_SUPPORTS_SGIMAGE
#define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+#endif
#endif
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 6395cc7..728c316 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -643,13 +643,14 @@ QFile::remove()
qWarning("QFile::remove: Empty or null file name");
return false;
}
+ unsetError();
close();
if(error() == QFile::NoError) {
if(fileEngine()->remove()) {
unsetError();
return true;
}
- d->setError(QFile::RemoveError, fileEngine()->errorString());
+ d->setError(QFile::RemoveError, d->fileEngine->errorString());
}
return false;
}
@@ -703,7 +704,7 @@ QFile::rename(const QString &newName)
if (fileEngine()->rename(newName)) {
unsetError();
// engine was able to handle the new name so we just reset it
- fileEngine()->setFileName(newName);
+ d->fileEngine->setFileName(newName);
d->fileName = newName;
return true;
}
@@ -739,7 +740,7 @@ QFile::rename(const QString &newName)
if (error) {
out.remove();
} else {
- fileEngine()->setFileName(newName);
+ d->fileEngine->setFileName(newName);
setPermissions(permissions());
unsetError();
setFileName(newName);
@@ -804,7 +805,7 @@ QFile::link(const QString &linkName)
unsetError();
return true;
}
- d->setError(QFile::RenameError, fileEngine()->errorString());
+ d->setError(QFile::RenameError, d->fileEngine->errorString());
return false;
}
@@ -993,10 +994,10 @@ bool QFile::open(OpenMode mode)
seek(size());
return true;
}
- QFile::FileError err = fileEngine()->error();
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::OpenError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
@@ -1151,12 +1152,11 @@ bool QFile::open(int fd, OpenMode mode)
int
QFile::handle() const
{
- if (!isOpen())
+ Q_D(const QFile);
+ if (!isOpen() || !d->fileEngine)
return -1;
- if (QAbstractFileEngine *engine = fileEngine())
- return engine->handle();
- return -1;
+ return d->fileEngine->handle();
}
/*!
@@ -1188,13 +1188,12 @@ QFile::handle() const
uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
{
Q_D(QFile);
- QAbstractFileEngine *engine = fileEngine();
- if (engine
- && engine->supportsExtension(QAbstractFileEngine::MapExtension)) {
+ if (fileEngine()
+ && d->fileEngine->supportsExtension(QAbstractFileEngine::MapExtension)) {
unsetError();
- uchar *address = engine->map(offset, size, flags);
+ uchar *address = d->fileEngine->map(offset, size, flags);
if (address == 0)
- d->setError(engine->error(), engine->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
return address;
}
return 0;
@@ -1211,13 +1210,12 @@ uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
bool QFile::unmap(uchar *address)
{
Q_D(QFile);
- QAbstractFileEngine *engine = fileEngine();
- if (engine
- && engine->supportsExtension(QAbstractFileEngine::UnMapExtension)) {
+ if (fileEngine()
+ && d->fileEngine->supportsExtension(QAbstractFileEngine::UnMapExtension)) {
unsetError();
- bool success = engine->unmap(address);
+ bool success = d->fileEngine->unmap(address);
if (!success)
- d->setError(engine->error(), engine->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
return success;
}
return false;
@@ -1250,13 +1248,14 @@ QFile::resize(qint64 sz)
Q_D(QFile);
if (!d->ensureFlushed())
return false;
- if (isOpen() && fileEngine()->pos() > sz)
+ fileEngine();
+ if (isOpen() && d->fileEngine->pos() > sz)
seek(sz);
- if(fileEngine()->setSize(sz)) {
+ if(d->fileEngine->setSize(sz)) {
unsetError();
return true;
}
- d->setError(QFile::ResizeError, fileEngine()->errorString());
+ d->setError(QFile::ResizeError, d->fileEngine->errorString());
return false;
}
@@ -1320,7 +1319,7 @@ QFile::setPermissions(Permissions permissions)
unsetError();
return true;
}
- d->setError(QFile::PermissionsError, fileEngine()->errorString());
+ d->setError(QFile::PermissionsError, d->fileEngine->errorString());
return false;
}
@@ -1353,23 +1352,27 @@ bool
QFile::flush()
{
Q_D(QFile);
+ if (!d->fileEngine) {
+ qWarning("QFile::flush: No file engine. Is IODevice open?");
+ return false;
+ }
+
if (!d->writeBuffer.isEmpty()) {
qint64 size = d->writeBuffer.size();
- if (_qfile_writeData(d->fileEngine ? d->fileEngine : fileEngine(),
- &d->writeBuffer) != size) {
- QFile::FileError err = fileEngine()->error();
+ if (_qfile_writeData(d->fileEngine, &d->writeBuffer) != size) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
}
- if (!fileEngine()->flush()) {
- QFile::FileError err = fileEngine()->error();
+ if (!d->fileEngine->flush()) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
return true;
@@ -1394,10 +1397,10 @@ QFile::close()
d->writeBuffer.clear();
// keep earlier error from flush
- if (fileEngine()->close() && flushed)
+ if (d->fileEngine->close() && flushed)
unsetError();
else if (flushed)
- d->setError(fileEngine()->error(), fileEngine()->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
}
/*!
@@ -1450,10 +1453,10 @@ bool QFile::atEnd() const
return false;
// If the file engine knows best, say what it says.
- if (fileEngine()->supportsExtension(QAbstractFileEngine::AtEndExtension)) {
+ if (d->fileEngine->supportsExtension(QAbstractFileEngine::AtEndExtension)) {
// Check if the file engine supports AtEndExtension, and if it does,
// check if the file engine claims to be at the end.
- return fileEngine()->atEnd();
+ return d->fileEngine->atEnd();
}
// Fall back to checking how much is available (will stat files).
@@ -1475,11 +1478,11 @@ bool QFile::seek(qint64 off)
if (!d->ensureFlushed())
return false;
- if (!fileEngine()->seek(off) || !QIODevice::seek(off)) {
- QFile::FileError err = fileEngine()->error();
+ if (!d->fileEngine->seek(off) || !QIODevice::seek(off)) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::PositionError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
unsetError();
@@ -1495,8 +1498,8 @@ qint64 QFile::readLineData(char *data, qint64 maxlen)
if (!d->ensureFlushed())
return -1;
- if (fileEngine()->supportsExtension(QAbstractFileEngine::FastReadLineExtension))
- return fileEngine()->readLine(data, maxlen);
+ if (d->fileEngine->supportsExtension(QAbstractFileEngine::FastReadLineExtension))
+ return d->fileEngine->readLine(data, maxlen);
// Fall back to QIODevice's readLine implementation if the engine
// cannot do it faster.
@@ -1514,18 +1517,14 @@ qint64 QFile::readData(char *data, qint64 len)
if (!d->ensureFlushed())
return -1;
- qint64 ret = -1;
- qint64 read = fileEngine()->read(data, len);
- if (read != -1)
- ret = read;
-
- if(ret < 0) {
- QFile::FileError err = fileEngine()->error();
+ qint64 read = d->fileEngine->read(data, len);
+ if(read < 0) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::ReadError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
}
- return ret;
+ return read;
}
/*!
@@ -1605,13 +1604,12 @@ QFile::writeData(const char *data, qint64 len)
// Write directly to the engine if the block size is larger than
// the write buffer size.
if (!buffered || len > QFILE_WRITEBUFFER_SIZE) {
- QAbstractFileEngine *fe = d->fileEngine ? d->fileEngine : fileEngine();
- qint64 ret = fe->write(data, len);
+ qint64 ret = d->fileEngine->write(data, len);
if(ret < 0) {
- QFile::FileError err = fileEngine()->error();
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
}
return ret;
}
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 722d6d3..9179485 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -98,7 +98,7 @@ static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QS
if (!fileName.isEmpty()
&& QT_STAT(QFile::encodeName(fileName), &statBuf) == 0
&& (statBuf.st_mode & S_IFMT) == S_IFREG) {
- mode += "+";
+ mode += '+';
} else {
mode = "wb+";
}
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 2c31509..64015ce 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1091,30 +1091,23 @@ static inline int pathHashKey(QSettings::Format format, QSettings::Scope scope)
return int((uint(format) << 1) | uint(scope == QSettings::SystemScope));
}
-static QString getPath(QSettings::Format format, QSettings::Scope scope)
+static void initDefaultPaths(QMutexLocker *locker)
{
- Q_ASSERT((int)QSettings::NativeFormat == 0);
- Q_ASSERT((int)QSettings::IniFormat == 1);
-
+ PathHash *pathHash = pathHashFunc();
QString homePath = QDir::homePath();
QString systemPath;
- QMutexLocker locker(globalMutex());
- PathHash *pathHash = pathHashFunc();
- bool loadSystemPath = pathHash->isEmpty();
- locker.unlock();
-
- if (loadSystemPath) {
- /*
- QLibraryInfo::location() uses QSettings, so in order to
- avoid a dead-lock, we can't hold the global mutex while
- calling it.
- */
- systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath);
- systemPath += QLatin1Char('/');
- }
+ locker->unlock();
+
+ /*
+ QLibraryInfo::location() uses QSettings, so in order to
+ avoid a dead-lock, we can't hold the global mutex while
+ calling it.
+ */
+ systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath);
+ systemPath += QLatin1Char('/');
- locker.relock();
+ locker->relock();
if (pathHash->isEmpty()) {
/*
Lazy initialization of pathHash. We initialize the
@@ -1155,6 +1148,17 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope)
#endif
#endif
}
+}
+
+static QString getPath(QSettings::Format format, QSettings::Scope scope)
+{
+ Q_ASSERT((int)QSettings::NativeFormat == 0);
+ Q_ASSERT((int)QSettings::IniFormat == 1);
+
+ QMutexLocker locker(globalMutex());
+ PathHash *pathHash = pathHashFunc();
+ if (pathHash->isEmpty())
+ initDefaultPaths(&locker);
QString result = pathHash->value(pathHashKey(format, scope));
if (!result.isEmpty())
@@ -3455,6 +3459,8 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
{
QMutexLocker locker(globalMutex());
PathHash *pathHash = pathHashFunc();
+ if (pathHash->isEmpty())
+ initDefaultPaths(&locker);
pathHash->insert(pathHashKey(format, scope), path + QDir::separator());
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 74e5f74..076cc33 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3241,8 +3241,11 @@ static QString qt_ACE_do(const QString &domain, AceOperation op)
while (1) {
int idx = nextDotDelimiter(domain, lastIdx);
int labelLength = idx - lastIdx;
- if (labelLength == 0)
+ if (labelLength == 0) {
+ if (idx == domain.length())
+ break;
return QString(); // two delimiters in a row -- empty label not allowed
+ }
// RFC 3490 says, about the ToASCII operation:
// 3. If the UseSTD3ASCIIRules flag is set, then perform these checks:
@@ -5932,7 +5935,7 @@ void QUrl::detach()
*/
bool QUrl::isDetached() const
{
- return d && d->ref == 1;
+ return !d || d->ref == 1;
}
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 1b167e2..3f69b4f 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -107,13 +107,13 @@ QT_BEGIN_NAMESPACE
\value ApplicationLayoutDirectionChange The default application layout direction has changed.
\value ApplicationPaletteChange The default application palette has changed.
\value ApplicationWindowIconChange The application's icon has changed.
- \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ChildAdded An object gets a child (QChildEvent).
\value ChildInserted An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead.
\value ChildPolished A widget child gets polished (QChildEvent).
\value ChildRemoved An object loses a child (QChildEvent).
\value Clipboard The clipboard contents have changed (QClipboardEvent).
\value Close Widget was closed (QCloseEvent).
+ \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ContentsRectChange The margins of the widget's content rect changed.
\value ContextMenu Context popup menu (QContextMenuEvent).
\value CursorChange The widget's cursor has changed.
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 79a7304..3bbb050 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -124,14 +124,16 @@ struct QMetaObjectPrivate
#ifndef QT_NO_QOBJECT
//defined in qobject.cpp
+ enum DisconnectType { DisconnectAll, DisconnectOne };
static bool connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
int type = 0, int *types = 0);
static bool disconnect(const QObject *sender, int signal_index,
- const QObject *receiver, int method_index);
+ const QObject *receiver, int method_index,
+ DisconnectType = DisconnectAll);
static inline bool disconnectHelper(QObjectPrivate::Connection *c,
const QObject *receiver, int method_index,
- QMutex *senderMutex);
+ QMutex *senderMutex, DisconnectType);
#endif
};
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 8346fe4..5298fff 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2945,7 +2945,6 @@ bool QMetaObjectPrivate::connect(const QObject *sender, int signal_index,
return true;
}
-
/*!\internal
*/
bool QMetaObject::disconnect(const QObject *sender, int signal_index,
@@ -2956,12 +2955,27 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index,
receiver, method_index);
}
+/*!\internal
+
+Disconnect a single signal connection. If QMetaObject::connect() has been called
+multiple times for the same sender, signal_index, receiver and method_index only
+one of these connections will be removed.
+ */
+bool QMetaObject::disconnectOne(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index)
+{
+ signal_index = methodIndexToSignalIndex(sender->metaObject(), signal_index);
+ return QMetaObjectPrivate::disconnect(sender, signal_index,
+ receiver, method_index,
+ QMetaObjectPrivate::DisconnectOne);
+}
+
/*! \internal
Helper function to remove the connection from the senders list and setting the receivers to 0
*/
bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
const QObject *receiver, int method_index,
- QMutex *senderMutex)
+ QMutex *senderMutex, DisconnectType disconnectType)
{
bool success = false;
while (c) {
@@ -2987,6 +3001,9 @@ bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
c->receiver = 0;
success = true;
+
+ if (disconnectType == DisconnectOne)
+ return success;
}
c = c->nextConnectionList;
}
@@ -2997,7 +3014,8 @@ bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
Same as the QMetaObject::disconnect, but \a signal_index must be the result of QObjectPrivate::signalIndex
*/
bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index,
- const QObject *receiver, int method_index)
+ const QObject *receiver, int method_index,
+ DisconnectType disconnectType)
{
if (!sender)
return false;
@@ -3021,7 +3039,7 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index,
for (signal_index = -1; signal_index < connectionLists->count(); ++signal_index) {
QObjectPrivate::Connection *c =
(*connectionLists)[signal_index].first;
- if (disconnectHelper(c, receiver, method_index, senderMutex)) {
+ if (disconnectHelper(c, receiver, method_index, senderMutex, disconnectType)) {
success = true;
connectionLists->dirty = true;
}
@@ -3029,7 +3047,7 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index,
} else if (signal_index < connectionLists->count()) {
QObjectPrivate::Connection *c =
(*connectionLists)[signal_index].first;
- if (disconnectHelper(c, receiver, method_index, senderMutex)) {
+ if (disconnectHelper(c, receiver, method_index, senderMutex, disconnectType)) {
success = true;
connectionLists->dirty = true;
}
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index a0d9cf3..8ed7f3f 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -334,6 +334,8 @@ struct Q_CORE_EXPORT QMetaObject
// internal index-based disconnect
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
+ static bool disconnectOne(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index);
// internal slot-name based connect
static void connectSlotsByName(QObject *o);
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d2fbf5a..556093f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -538,7 +538,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
forever {
ulong alloc = len;
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + alloc))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + alloc))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -551,7 +551,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
switch (res) {
case Z_OK:
if (len != alloc) {
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + len))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + len))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -561,6 +561,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->ref = 1;
d->alloc = d->size = len;
d->data = d->array;
+ d->array[len] = 0;
return QByteArray(d.take(), 0, 0);
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 0ef92d9..b6a2df4 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -125,7 +125,7 @@
\value OutCubic \inlineimage qeasingcurve-outcubic.png
\br
Easing curve for a cubic (t^3) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutCubic \inlineimage qeasingcurve-inoutcubic.png
\br
Easing curve for a cubic (t^3) function:
@@ -141,7 +141,7 @@
\value OutQuart \inlineimage qeasingcurve-outquart.png
\br
Easing curve for a cubic (t^4) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuart \inlineimage qeasingcurve-inoutquart.png
\br
Easing curve for a cubic (t^4) function:
@@ -157,7 +157,7 @@
\value OutQuint \inlineimage qeasingcurve-outquint.png
\br
Easing curve for a cubic (t^5) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuint \inlineimage qeasingcurve-inoutquint.png
\br
Easing curve for a cubic (t^5) function:
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 21816b9..1b4b356 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -130,7 +130,7 @@
multiple- or virtual-inheritance (that is, in cases where two different
pointer addresses can refer to the same object). In that case, if a
pointer is cast to a different type and its value changes,
- QSharedPointer's pointer tracking mechanism mail fail to detect that the
+ QSharedPointer's pointer tracking mechanism may fail to detect that the
object being tracked is the same.
\omit
diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp
index 3466d90..7defc9a 100644
--- a/src/dbus/qdbusargument.cpp
+++ b/src/dbus/qdbusargument.cpp
@@ -535,7 +535,6 @@ QDBusArgument &QDBusArgument::operator<<(const QByteArray &arg)
/*!
\internal
- Returns the type signature of the D-Bus type this QDBusArgument
\since 4.5
Appends the variant \a v.
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 30fa0b6..44abf7b 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1660,9 +1660,6 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError
}
QString busService = QLatin1String(DBUS_SERVICE_DBUS);
- WatchedServicesHash::mapped_type &bus = watchedServices[busService];
- bus.refcount = 1;
- bus.owner = getNameOwnerNoCache(busService);
connectSignal(busService, QString(), QString(), QLatin1String("NameAcquired"), QStringList(), QString(),
this, SLOT(registerService(QString)));
connectSignal(busService, QString(), QString(), QLatin1String("NameLost"), QStringList(), QString(),
@@ -2004,7 +2001,8 @@ bool QDBusConnectionPrivate::connectSignal(const QString &service,
entry.path == hook.path &&
entry.signature == hook.signature &&
entry.obj == hook.obj &&
- entry.midx == hook.midx) {
+ entry.midx == hook.midx &&
+ entry.argumentMatch == hook.argumentMatch) {
// no need to compare the parameters if it's the same slot
return true; // already there
}
@@ -2046,10 +2044,7 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook
// Do we need to watch for this name?
if (shouldWatchService(hook.service)) {
WatchedServicesHash::mapped_type &data = watchedServices[hook.service];
- if (data.refcount) {
- // already watching
- ++data.refcount;
- } else {
+ if (++data.refcount == 1) {
// we need to watch for this service changing
QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS);
connectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS),
@@ -2089,7 +2084,8 @@ bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
entry.path == hook.path &&
entry.signature == hook.signature &&
entry.obj == hook.obj &&
- entry.midx == hook.midx) {
+ entry.midx == hook.midx &&
+ entry.argumentMatch == hook.argumentMatch) {
// no need to compare the parameters if it's the same slot
disconnectSignal(it);
return true; // it was there
@@ -2105,19 +2101,6 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
{
const SignalHook &hook = it.value();
- WatchedServicesHash::Iterator sit = watchedServices.find(hook.service);
- if (sit != watchedServices.end()) {
- if (sit.value().refcount == 1) {
- watchedServices.erase(sit);
- QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS);
- disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS),
- QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(),
- this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
- } else {
- --sit.value().refcount;
- }
- }
-
bool erase = false;
MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule);
if (i == matchRefCounts.end()) {
@@ -2136,6 +2119,20 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
if (connection && erase) {
qDBusDebug("Removing rule: %s", hook.matchRule.constData());
q_dbus_bus_remove_match(connection, hook.matchRule, NULL);
+
+ // Successfully disconnected the signal
+ // Were we watching for this name?
+ WatchedServicesHash::Iterator sit = watchedServices.find(hook.service);
+ if (sit != watchedServices.end()) {
+ if (--sit.value().refcount == 0) {
+ watchedServices.erase(sit);
+ QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS);
+ disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS),
+ QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(),
+ this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+ }
+ }
+
}
return signalHooks.erase(it);
diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp
index f156e04..8ec328e 100644
--- a/src/dbus/qdbusmarshaller.cpp
+++ b/src/dbus/qdbusmarshaller.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qdbusargument_p.h"
+#include "qdbusmetatype_p.h"
#include "qdbusutil_p.h"
QT_BEGIN_NAMESPACE
@@ -167,7 +168,7 @@ inline bool QDBusMarshaller::append(const QDBusVariant &arg)
QByteArray tmpSignature;
const char *signature = 0;
- if (int(id) == qMetaTypeId<QDBusArgument>()) {
+ if (int(id) == QDBusMetaTypeId::argument) {
// take the signature from the QDBusArgument object we're marshalling
tmpSignature =
qvariant_cast<QDBusArgument>(value).currentSignature().toLatin1();
@@ -353,7 +354,7 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg)
}
// intercept QDBusArgument parameters here
- if (id == qMetaTypeId<QDBusArgument>()) {
+ if (id == QDBusMetaTypeId::argument) {
QDBusArgument dbusargument = qvariant_cast<QDBusArgument>(arg);
QDBusArgumentPrivate *d = QDBusArgumentPrivate::d(dbusargument);
if (!d->message)
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp
index e9031ac..83ecc30 100644
--- a/src/gui/dialogs/qcolordialog.cpp
+++ b/src/gui/dialogs/qcolordialog.cpp
@@ -68,6 +68,10 @@
#include "private/qt_s60_p.h"
#endif
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+# define QT_SMALL_COLORDIALOG
+#endif
+
QT_BEGIN_NAMESPACE
//////////// QWellArray BEGIN
@@ -1072,14 +1076,17 @@ QColorShower::QColorShower(QColorDialog *parent)
gl->setMargin(gl->spacing());
lab = new QColorShowLabel(this);
-#ifdef Q_WS_S60
+#ifdef QT_SMALL_COLORDIALOG
+# ifdef Q_WS_S60
QS60Data s60Data = QS60Data();
const bool nonTouchUI = !s60Data.hasTouchscreen;
+# elif defined Q_WS_MAEMO_5
+ const bool nonTouchUI = false;
+# endif
#endif
-
#ifndef Q_WS_WINCE
-#ifdef Q_WS_S60
+#ifdef QT_SMALL_COLORDIALOG
lab->setMinimumHeight(60);
#endif
lab->setMinimumWidth(60);
@@ -1090,7 +1097,7 @@ QColorShower::QColorShower(QColorDialog *parent)
// In S60, due to small screen and different screen layouts need to re-arrange the widgets.
// For QVGA screens only the comboboxes and color label are visible.
// For nHD screens only color and luminence pickers and color label are visible.
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lab, 0, 0, -1, 1);
#else
if (nonTouchUI)
@@ -1108,7 +1115,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblHue->setBuddy(hEd);
#endif
lblHue->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblHue, 0, 1);
gl->addWidget(hEd, 0, 2);
#else
@@ -1127,7 +1134,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblSat->setBuddy(sEd);
#endif
lblSat->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblSat, 1, 1);
gl->addWidget(sEd, 1, 2);
#else
@@ -1146,7 +1153,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblVal->setBuddy(vEd);
#endif
lblVal->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblVal, 2, 1);
gl->addWidget(vEd, 2, 2);
#else
@@ -1165,7 +1172,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblRed->setBuddy(rEd);
#endif
lblRed->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblRed, 0, 3);
gl->addWidget(rEd, 0, 4);
#else
@@ -1184,7 +1191,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblGreen->setBuddy(gEd);
#endif
lblGreen->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblGreen, 1, 3);
gl->addWidget(gEd, 1, 4);
#else
@@ -1203,7 +1210,7 @@ QColorShower::QColorShower(QColorDialog *parent)
lblBlue->setBuddy(bEd);
#endif
lblBlue->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblBlue, 2, 3);
gl->addWidget(bEd, 2, 4);
#else
@@ -1222,7 +1229,7 @@ QColorShower::QColorShower(QColorDialog *parent)
alphaLab->setBuddy(alphaEd);
#endif
alphaLab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
-#ifndef Q_WS_S60
+#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(alphaLab, 3, 1, 1, 3);
gl->addWidget(alphaEd, 3, 4);
#else
@@ -1467,7 +1474,7 @@ void QColorDialogPrivate::init(const QColor &initial)
leftLay = 0;
-#if (defined(Q_WS_WINCE) || defined(Q_WS_S60))
+#if defined(Q_WS_WINCE) || defined(QT_SMALL_COLORDIALOG)
smallDisplay = true;
const int lumSpace = 20;
#else
@@ -1497,9 +1504,13 @@ void QColorDialogPrivate::init(const QColor &initial)
}
#endif
-#if defined(Q_WS_S60)
+#if defined(QT_SMALL_COLORDIALOG)
+# if defined(Q_WS_S60)
QS60Data s60Data = QS60Data();
const bool nonTouchUI = !s60Data.hasTouchscreen;
+# elif defined(Q_WS_MAEMO_5)
+ const bool nonTouchUI = false;
+# endif
#endif
if (!smallDisplay) {
@@ -1532,7 +1543,7 @@ void QColorDialogPrivate::init(const QColor &initial)
leftLay->addWidget(addCusBt);
} else {
// better color picker size for small displays
-#ifdef Q_WS_S60
+#if defined(QT_SMALL_COLORDIALOG)
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
pWidth = pHeight = qMin(screenSize.width(), screenSize.height());
pHeight -= 20;
@@ -1558,7 +1569,7 @@ void QColorDialogPrivate::init(const QColor &initial)
cp->setFrameStyle(QFrame::Panel + QFrame::Sunken);
-#if defined(Q_WS_S60)
+#if defined(QT_SMALL_COLORDIALOG)
if (!nonTouchUI) {
pickLay->addWidget(cp);
cLay->addSpacing(lumSpace);
@@ -1572,7 +1583,7 @@ void QColorDialogPrivate::init(const QColor &initial)
cLay->addSpacing(lumSpace);
lp = new QColorLuminancePicker(q);
-#if defined(Q_WS_S60)
+#if defined(QT_SMALL_COLORDIALOG)
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
const int minDimension = qMin(screenSize.height(), screenSize.width());
//set picker to be finger-usable
@@ -1596,7 +1607,7 @@ void QColorDialogPrivate::init(const QColor &initial)
QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb)));
QObject::connect(cs, SIGNAL(currentColorChanged(QColor)),
q, SIGNAL(currentColorChanged(QColor)));
-#if defined(Q_WS_S60)
+#if defined(QT_SMALL_COLORDIALOG)
if (!nonTouchUI)
pWidth -= cp->size().width();
topLay->addWidget(cs);
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 3650051..9ff2ad8 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -265,6 +265,14 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f)
if (!qt_wince_is_smartphone())
setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
#endif
+
+#ifdef Q_WS_S60
+ if (S60->avkonComponentsSupportTransparency) {
+ bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
+ setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
+ setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
+ }
+#endif
}
#ifdef QT3_SUPPORT
@@ -294,6 +302,14 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
if (!qt_wince_is_smartphone())
setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
#endif
+
+#ifdef Q_WS_S60
+ if (S60->avkonComponentsSupportTransparency) {
+ bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
+ setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
+ setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
+ }
+#endif
}
/*!
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 3d59463..089e04a 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -229,11 +229,10 @@ Q_GUI_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_hook
\value ReadOnly Indicates that the model is readonly.
\value HideNameFilterDetails Indicates if the is hidden or not.
- This value is obsolete and does nothing since Qt 4.5:
\value DontUseSheet In previous versions of Qt, the static
functions would create a sheet by default if the static function
- was given a parent. This is no longer supported in Qt 4.5, The
+ was given a parent. This is no longer supported and does nothing in Qt 4.5, The
static functions will always be an application modal dialog. If
you want to use sheets, use QFileDialog::open() instead.
@@ -1222,12 +1221,6 @@ QFileDialog::ViewMode QFileDialog::viewMode() const
void QFileDialog::setFileMode(QFileDialog::FileMode mode)
{
Q_D(QFileDialog);
- if (d->nativeDialogInUse){
- d->model->setFilter(d->filterForMode(filter()));
- d->setFilter_sys();
- return;
- }
-
d->fileMode = mode;
d->retranslateWindowTitle();
@@ -1263,6 +1256,11 @@ void QFileDialog::setFileMode(QFileDialog::FileMode mode)
}
}
setLabelText(Accept, buttonText);
+ if (d->nativeDialogInUse){
+ d->setFilter_sys();
+ return;
+ }
+
d->qFileDialogUi->fileTypeCombo->setEnabled(!testOption(ShowDirsOnly));
d->_q_updateOkButton();
}
@@ -1300,6 +1298,10 @@ void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode)
d->qFileDialogUi->lookInCombo->setEditable(false);
}
d->retranslateWindowTitle();
+#if defined(Q_WS_MAC)
+ d->deleteNativeDialog_sys();
+ setAttribute(Qt::WA_DontShowOnScreen, false);
+#endif
}
/*
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index db5c356..67daced 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -639,9 +639,16 @@ void QFileDialogPrivate::setFilter_sys()
{
#ifndef QT_MAC_USE_COCOA
#else
+ Q_Q(QFileDialog);
QMacCocoaAutoReleasePool pool;
QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
*(delegate->mQDirFilter) = model->filter();
+ delegate->mFileMode = fileMode;
+ [delegate->mSavePanel setTitle:qt_mac_QStringToNSString(q->windowTitle())];
+ [delegate->mSavePanel setPrompt:[delegate strip:acceptLabel]];
+ if (fileNameLabelExplicitlySat)
+ [delegate->mSavePanel setNameFieldLabel:[delegate strip:qFileDialogUi->fileNameLabel->text()]];
+
[delegate updateProperties];
#endif
}
diff --git a/src/gui/dialogs/qprintdialog.h b/src/gui/dialogs/qprintdialog.h
index 390a4a0..ecd50c1 100644
--- a/src/gui/dialogs/qprintdialog.h
+++ b/src/gui/dialogs/qprintdialog.h
@@ -97,9 +97,9 @@ public:
void done(int result);
#if defined (Q_OS_UNIX) && defined (QT3_SUPPORT)
- void setPrinter(QPrinter *, bool = false);
- QPrinter *printer() const;
- void addButton(QPushButton *button);
+ QT3_SUPPORT void setPrinter(QPrinter *, bool = false);
+ QT3_SUPPORT QPrinter *printer() const;
+ QT3_SUPPORT void addButton(QPushButton *button);
#endif
void setOption(PrintDialogOption option, bool on = true);
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index 42be780..6723b53 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -207,6 +207,9 @@ public:
QActionGroup *printerGroup;
QAction *printAction;
QAction *pageSetupAction;
+#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
+ QAction *closeAction;
+#endif
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
@@ -287,6 +290,9 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer)
toolbar->addSeparator();
toolbar->addAction(pageSetupAction);
toolbar->addAction(printAction);
+#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
+ toolbar->addAction(closeAction);
+#endif
// Cannot use the actions' triggered signal here, since it doesn't autorepeat
QToolButton *zoomInButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomInAction));
@@ -406,6 +412,10 @@ void QPrintPreviewDialogPrivate::setupActions()
qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup"));
QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print()));
QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup()));
+#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
+ closeAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Close"));
+ QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(reject()));
+#endif
// Initial state:
fitPageAction->setChecked(true);
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index ad23df3..10ef5ea 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -383,9 +383,9 @@ void QGraphicsEffectSourcePrivate::invalidateCache(InvalidateReason reason) cons
{
if (m_cachedMode != QGraphicsEffect::PadToEffectiveBoundingRect
&& (reason == EffectRectChanged
- || reason == TransformChanged
- && m_cachedSystem == Qt::LogicalCoordinates))
+ || (reason == TransformChanged && m_cachedSystem == Qt::LogicalCoordinates))) {
return;
+ }
QPixmapCache::remove(m_cacheKey);
}
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index cae9660..b4e19d1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -268,6 +268,17 @@
*/
/*!
+ \variable QGraphicsItem::Type
+
+ The type value returned by the virtual type() function in standard
+ graphics item classes in Qt. All such standard graphics item
+ classes in Qt are associated with a unique value for Type,
+ e.g. the value returned by QGraphicsPathItem::type() is 2.
+
+ \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 18
+*/
+
+/*!
\variable QGraphicsItem::UserType
The lowest permitted type value for custom items (subclasses
@@ -276,6 +287,8 @@
and declaring a Type enum value. Example:
\snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 1
+
+ \note UserType = 65536
*/
/*!
@@ -798,8 +811,36 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch
return;
}
- foreach (QGraphicsItem *child, children)
- child->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
+ for (int i = 0; i < children.size(); ++i)
+ children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
+}
+
+void QGraphicsItemPrivate::updateAncestorFlags()
+{
+ int flags = 0;
+ if (parent) {
+ // Inherit the parent's ancestor flags.
+ QGraphicsItemPrivate *pd = parent->d_ptr.data();
+ flags = pd->ancestorFlags;
+
+ // Add in flags from the parent.
+ if (pd->filtersDescendantEvents)
+ flags |= AncestorFiltersChildEvents;
+ if (pd->handlesChildEvents)
+ flags |= AncestorHandlesChildEvents;
+ if (pd->flags & QGraphicsItem::ItemClipsChildrenToShape)
+ flags |= AncestorClipsChildren;
+ if (pd->flags & QGraphicsItem::ItemIgnoresTransformations)
+ flags |= AncestorIgnoresTransformations;
+ }
+
+ if (ancestorFlags == flags)
+ return; // No change; stop propagation.
+ ancestorFlags = flags;
+
+ // Propagate to children recursively.
+ for (int i = 0; i < children.size(); ++i)
+ children.at(i)->d_ptr->updateAncestorFlags();
}
/*!
@@ -984,25 +1025,17 @@ QVariant QGraphicsItemPrivate::inputMethodQueryHelper(Qt::InputMethodQuery query
prepareGeometryChange) if the item is in its destructor, i.e.
inDestructor is 1.
*/
-void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
+void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const QVariant *newParentVariant,
+ const QVariant *thisPointerVariant)
{
Q_Q(QGraphicsItem);
- if (newParent == q) {
- qWarning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this);
- return;
- }
- if (newParent == parent)
- return;
-
- const QVariant newParentVariant(q->itemChange(QGraphicsItem::ItemParentChange,
- qVariantFromValue<QGraphicsItem *>(newParent)));
- newParent = qVariantValue<QGraphicsItem *>(newParentVariant);
if (newParent == parent)
return;
if (scene) {
// Deliver the change to the index
- scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParentVariant);
+ if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex)
+ scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent);
// Disable scene pos notifications for old ancestors
if (scenePosDescendants || (flags & QGraphicsItem::ItemSendsScenePositionChanges))
@@ -1020,11 +1053,11 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
if (!inDestructor)
q_ptr->prepareGeometryChange();
- const QVariant thisPointerVariant(qVariantFromValue<QGraphicsItem *>(q));
if (parent) {
// Remove from current parent
parent->d_ptr->removeChild(q);
- parent->itemChange(QGraphicsItem::ItemChildRemovedChange, thisPointerVariant);
+ if (thisPointerVariant)
+ parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant);
}
// Update toplevelitem list. If this item is being deleted, its parent
@@ -1042,7 +1075,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *p = parent;
QGraphicsItem *parentFocusScopeItem = 0;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
// If this item's focus scope's focus scope item points
// to this item or a descendent, then clear it.
QGraphicsItem *fsi = p->d_ptr->focusScopeItem;
@@ -1055,6 +1088,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
p = p->d_ptr->parent;
}
+ // Update graphics effect optimization flag
+ if (newParent && (graphicsEffect || mayHaveChildWithGraphicsEffect))
+ newParent->d_ptr->updateChildWithGraphicsEffectFlagRecursively();
+
// Update focus scope item ptr in new scope.
QGraphicsItem *newFocusScopeItem = subFocusItem ? subFocusItem : parentFocusScopeItem;
if (newFocusScopeItem && newParent) {
@@ -1063,11 +1100,11 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *ancestorScope = 0;
QGraphicsItem *p = subFocusItem->d_ptr->parent;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope)
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope)
ancestorScope = p;
- if (p->isPanel())
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsPanel)
break;
- p = p->parentItem();
+ p = p->d_ptr->parent;
}
if (ancestorScope)
newFocusScopeItem = ancestorScope;
@@ -1075,7 +1112,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *p = newParent;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
p->d_ptr->focusScopeItem = newFocusScopeItem;
// Ensure the new item is no longer the subFocusItem. The
// only way to set focus on a child of a focus scope is
@@ -1089,52 +1126,45 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
if ((parent = newParent)) {
- bool implicitUpdate = false;
if (parent->d_func()->scene && parent->d_func()->scene != scene) {
// Move this item to its new parent's scene
parent->d_func()->scene->addItem(q);
- implicitUpdate = true;
} else if (!parent->d_func()->scene && scene) {
// Remove this item from its former scene
scene->removeItem(q);
}
parent->d_ptr->addChild(q);
- parent->itemChange(QGraphicsItem::ItemChildAddedChange, thisPointerVariant);
+ if (thisPointerVariant)
+ parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant);
if (scene) {
- if (!implicitUpdate)
- scene->d_func()->markDirty(q_ptr);
-
// Re-enable scene pos notifications for new ancestors
if (scenePosDescendants || (flags & QGraphicsItem::ItemSendsScenePositionChanges))
scene->d_func()->setScenePosItemEnabled(q, true);
}
+ // Propagate dirty flags to the new parent
+ markParentDirty(/*updateBoundingRect=*/true);
+
// Inherit ancestor flags from the new parent.
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2));
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));
- updateAncestorFlag(QGraphicsItem::ItemClipsChildrenToShape);
- updateAncestorFlag(QGraphicsItem::ItemIgnoresTransformations);
+ updateAncestorFlags();
// Update item visible / enabled.
- if (parent->isVisible() != visible) {
- if (!parent->isVisible() || !explicitlyHidden)
- setVisibleHelper(parent->isVisible(), /* explicit = */ false, /* update = */ !implicitUpdate);
+ if (parent->d_ptr->visible != visible) {
+ if (!parent->d_ptr->visible || !explicitlyHidden)
+ setVisibleHelper(parent->d_ptr->visible, /* explicit = */ false, /* update = */ false);
}
if (parent->isEnabled() != enabled) {
- if (!parent->isEnabled() || !explicitlyDisabled)
- setEnabledHelper(parent->isEnabled(), /* explicit = */ false, /* update = */ !implicitUpdate);
+ if (!parent->d_ptr->enabled || !explicitlyDisabled)
+ setEnabledHelper(parent->d_ptr->enabled, /* explicit = */ false, /* update = */ false);
}
// Auto-activate if visible and the parent is active.
- if (q->isVisible() && parent->isActive())
+ if (visible && parent->isActive())
q->setActive(true);
} else {
// Inherit ancestor flags from the new parent.
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2));
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));
- updateAncestorFlag(QGraphicsItem::ItemClipsChildrenToShape);
- updateAncestorFlag(QGraphicsItem::ItemIgnoresTransformations);
+ updateAncestorFlags();
if (!inDestructor) {
// Update item visible / enabled.
@@ -1142,10 +1172,6 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
setVisibleHelper(true, /* explicit = */ false);
if (!enabled && !explicitlyDisabled)
setEnabledHelper(true, /* explicit = */ false);
-
- // If the item is being deleted, the whole scene will be updated.
- if (scene)
- scene->d_func()->markDirty(q_ptr);
}
}
@@ -1161,7 +1187,8 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
// Deliver post-change notification
- q->itemChange(QGraphicsItem::ItemParentHasChanged, newParentVariant);
+ if (newParentVariant)
+ q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant);
if (isObject)
emit static_cast<QGraphicsObject *>(q)->parentChanged();
@@ -1350,7 +1377,7 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->scene->d_func()->removeItemHelper(this);
} else {
d_ptr->resetFocusProxy();
- d_ptr->setParentItemHelper(0);
+ setParentItem(0);
}
#ifndef QT_NO_GRAPHICSEFFECT
@@ -1543,21 +1570,36 @@ const QGraphicsObject *QGraphicsItem::toGraphicsObject() const
}
/*!
- Sets this item's parent item to \a parent. If this item already has a
- parent, it is first removed from the previous parent. If \a parent is 0,
- this item will become a top-level item.
+ Sets this item's parent item to \a newParent. If this item already
+ has a parent, it is first removed from the previous parent. If \a
+ newParent is 0, this item will become a top-level item.
- Note that this implicitly adds this graphics item to the scene of
- the parent. You should not \l{QGraphicsScene::addItem()}{add} the
- item to the scene yourself.
+ Note that this implicitly adds this graphics item to the scene of
+ the parent. You should not \l{QGraphicsScene::addItem()}{add} the
+ item to the scene yourself.
- Calling this function on an item that is an ancestor of \a parent have undefined behaviour.
+ Calling this function on an item that is an ancestor of \a newParent
+ have undefined behaviour.
- \sa parentItem(), childItems()
+ \sa parentItem(), childItems()
*/
-void QGraphicsItem::setParentItem(QGraphicsItem *parent)
+void QGraphicsItem::setParentItem(QGraphicsItem *newParent)
{
- d_ptr->setParentItemHelper(parent);
+ if (newParent == this) {
+ qWarning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this);
+ return;
+ }
+ if (newParent == d_ptr->parent)
+ return;
+
+ const QVariant newParentVariant(itemChange(QGraphicsItem::ItemParentChange,
+ qVariantFromValue<QGraphicsItem *>(newParent)));
+ newParent = qVariantValue<QGraphicsItem *>(newParentVariant);
+ if (newParent == d_ptr->parent)
+ return;
+
+ const QVariant thisPointerVariant(qVariantFromValue<QGraphicsItem *>(this));
+ d_ptr->setParentItemHelper(newParent, &newParentVariant, &thisPointerVariant);
}
/*!
@@ -1607,7 +1649,7 @@ bool QGraphicsItem::isWidget() const
*/
bool QGraphicsItem::isWindow() const
{
- return isWidget() && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
+ return d_ptr->isWidget && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
}
/*!
@@ -1644,9 +1686,9 @@ QGraphicsItem::GraphicsItemFlags QGraphicsItem::flags() const
void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)
{
if (enabled)
- setFlags(flags() | flag);
+ setFlags(GraphicsItemFlags(d_ptr->flags) | flag);
else
- setFlags(flags() & ~flag);
+ setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag);
}
/*!
@@ -1693,8 +1735,8 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
flags = GraphicsItemFlags(itemChange(ItemFlagsChange, quint32(flags)).toUInt());
if (quint32(d_ptr->flags) == quint32(flags))
return;
- if (d_ptr->scene)
- d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, quint32(flags));
+ if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex)
+ d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags);
// Flags that alter the geometry of the item (or its children).
const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable);
@@ -1703,7 +1745,7 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
// Keep the old flags to compare the diff.
- GraphicsItemFlags oldFlags = this->flags();
+ GraphicsItemFlags oldFlags = GraphicsItemFlags(d_ptr->flags);
// Update flags.
d_ptr->flags = flags;
@@ -1732,7 +1774,23 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->updateAncestorFlag(ItemIgnoresTransformations);
}
+ if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) {
+ // NB! We change the flags directly here, so we must also update d_ptr->flags.
+ // Note that this has do be done before the ItemStacksBehindParent check
+ // below; otherwise we will loose the change.
+
+ // Update stack-behind.
+ if (d_ptr->z < qreal(0.0))
+ flags |= ItemStacksBehindParent;
+ else
+ flags &= ~ItemStacksBehindParent;
+ d_ptr->flags = flags;
+ }
+
if ((flags & ItemStacksBehindParent) != (oldFlags & ItemStacksBehindParent)) {
+ // NB! This check has to come after the ItemNegativeZStacksBehindParent
+ // check above. Be careful.
+
// Ensure child item sorting is up to date when toggling this flag.
if (d_ptr->parent)
d_ptr->parent->d_ptr->needSortChildren = 1;
@@ -1746,10 +1804,6 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->scene->d_func()->updateInputMethodSensitivityInViews();
}
- if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) {
- // Update stack-behind.
- setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0));
- }
if ((d_ptr->panelModality != NonModal)
&& d_ptr->scene
@@ -2515,6 +2569,7 @@ void QGraphicsItem::setOpacity(qreal opacity)
if (newOpacity == d_ptr->opacity)
return;
+ bool wasFullyTransparent = d_ptr->isOpacityNull();
d_ptr->opacity = newOpacity;
// Notify change.
@@ -2523,12 +2578,16 @@ void QGraphicsItem::setOpacity(qreal opacity)
// Update.
if (d_ptr->scene) {
#ifndef QT_NO_GRAPHICSEFFECT
- d_ptr->invalidateGraphicsEffectsRecursively();
+ d_ptr->invalidateParentGraphicsEffectsRecursively();
+ if (!(d_ptr->flags & ItemDoesntPropagateOpacityToChildren))
+ d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
#endif //QT_NO_GRAPHICSEFFECT
d_ptr->scene->d_func()->markDirty(this, QRectF(),
/*invalidateChildren=*/true,
/*force=*/false,
- /*ignoreOpacity=*/true);
+ /*ignoreOpacity=*/d_ptr->isOpacityNull());
+ if (wasFullyTransparent)
+ d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
}
if (d_ptr->isObject)
@@ -2568,6 +2627,8 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)
if (d_ptr->graphicsEffect) {
delete d_ptr->graphicsEffect;
d_ptr->graphicsEffect = 0;
+ } else if (d_ptr->parent) {
+ d_ptr->parent->d_ptr->updateChildWithGraphicsEffectFlagRecursively();
}
if (effect) {
@@ -2581,6 +2642,19 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)
}
#endif //QT_NO_GRAPHICSEFFECT
+void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively()
+{
+#ifndef QT_NO_GRAPHICSEFFECT
+ QGraphicsItemPrivate *itemPrivate = this;
+ do {
+ // parent chain already notified?
+ if (itemPrivate->mayHaveChildWithGraphicsEffect)
+ return;
+ itemPrivate->mayHaveChildWithGraphicsEffect = 1;
+ } while ((itemPrivate = itemPrivate->parent ? itemPrivate->parent->d_ptr.data() : 0));
+#endif
+}
+
/*!
\internal
\since 4.6
@@ -2997,9 +3071,16 @@ void QGraphicsItem::setActive(bool active)
*/
bool QGraphicsItem::hasFocus() const
{
+ if (!d_ptr->scene || !d_ptr->scene->isActive())
+ return false;
+
if (d_ptr->focusProxy)
return d_ptr->focusProxy->hasFocus();
- return isActive() && (d_ptr->scene && d_ptr->scene->focusItem() == this);
+
+ if (d_ptr->scene->d_func()->focusItem != this)
+ return false;
+
+ return panel() == d_ptr->scene->d_func()->activePanel;
}
/*!
@@ -4257,9 +4338,9 @@ void QGraphicsItem::setZValue(qreal z)
if (newZ == d_ptr->z)
return;
- if (d_ptr->scene) {
+ if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex) {
// Z Value has changed, we have to notify the index.
- d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, newZVariant);
+ d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, &newZ);
}
d_ptr->z = newZ;
@@ -5026,7 +5107,7 @@ int QGraphicsItemPrivate::depth() const
\internal
*/
#ifndef QT_NO_GRAPHICSEFFECT
-void QGraphicsItemPrivate::invalidateGraphicsEffectsRecursively()
+void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()
{
QGraphicsItemPrivate *itemPrivate = this;
do {
@@ -5038,6 +5119,24 @@ void QGraphicsItemPrivate::invalidateGraphicsEffectsRecursively()
}
} while ((itemPrivate = itemPrivate->parent ? itemPrivate->parent->d_ptr.data() : 0));
}
+
+void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::InvalidateReason reason)
+{
+ if (!mayHaveChildWithGraphicsEffect)
+ return;
+
+ for (int i = 0; i < children.size(); ++i) {
+ QGraphicsItemPrivate *childPrivate = children.at(i)->d_ptr.data();
+ if (reason == OpacityChanged && (childPrivate->flags & QGraphicsItem::ItemIgnoresParentOpacity))
+ continue;
+ if (childPrivate->graphicsEffect) {
+ childPrivate->notifyInvalidated = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(childPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
+ }
+
+ childPrivate->invalidateChildGraphicsEffectsRecursively(reason);
+ }
+}
#endif //QT_NO_GRAPHICSEFFECT
/*!
@@ -5282,7 +5381,7 @@ void QGraphicsItem::update(const QRectF &rect)
// Make sure we notify effects about invalidated source.
#ifndef QT_NO_GRAPHICSEFFECT
- d_ptr->invalidateGraphicsEffectsRecursively();
+ d_ptr->invalidateParentGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
if (CacheMode(d_ptr->cacheMode) != NoCache) {
@@ -7158,7 +7257,9 @@ void QGraphicsItem::prepareGeometryChange()
QGraphicsScenePrivate *scenePrivate = d_ptr->scene->d_func();
scenePrivate->index->prepareBoundingRectChange(this);
- scenePrivate->markDirty(this, QRectF(), /*invalidateChildren=*/true);
+ scenePrivate->markDirty(this, QRectF(), /*invalidateChildren=*/true, /*force=*/false,
+ /*ignoreOpacity=*/ false, /*removingItemFromScene=*/ false,
+ /*updateBoundingRect=*/true);
// For compatibility reasons, we have to update the item's old geometry
// if someone is connected to the changed signal or the scene has no views.
@@ -7175,19 +7276,7 @@ void QGraphicsItem::prepareGeometryChange()
}
}
- QGraphicsItem *parent = this;
- while ((parent = parent->d_ptr->parent)) {
- QGraphicsItemPrivate *parentp = parent->d_ptr.data();
- parentp->dirtyChildrenBoundingRect = 1;
- // ### Only do this if the parent's effect applies to the entire subtree.
- parentp->notifyBoundingRectChanged = 1;
-#ifndef QT_NO_GRAPHICSEFFECT
- if (parentp->scene && parentp->graphicsEffect) {
- parentp->notifyInvalidated = 1;
- static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()->source->d_func())->invalidateCache();
- }
-#endif
- }
+ d_ptr->markParentDirty(/*updateBoundingRect=*/true);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 2d34b80..b3ca3b5 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -153,7 +153,7 @@ public:
dirtyChildren(0),
localCollisionHack(0),
inSetPosHelper(0),
- needSortChildren(1), // ### can be 0 by default?
+ needSortChildren(0),
allChildrenDirty(0),
fullUpdatePending(0),
flags(0),
@@ -178,6 +178,8 @@ public:
sequentialOrdering(1),
updateDueToGraphicsEffect(0),
scenePosDescendants(0),
+ pendingPolish(0),
+ mayHaveChildWithGraphicsEffect(0),
globalStackingOrder(-1),
q_ptr(0)
{
@@ -195,8 +197,10 @@ public:
return item->d_ptr.data();
}
+ void updateChildWithGraphicsEffectFlagRecursively();
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag,
AncestorFlag flag = NoFlag, bool enabled = false, bool root = true);
+ void updateAncestorFlags();
void setIsMemberOfGroup(bool enabled);
void remapItemPos(QEvent *event, QGraphicsItem *item);
QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const;
@@ -223,13 +227,18 @@ public:
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
int depth() const;
#ifndef QT_NO_GRAPHICSEFFECT
- void invalidateGraphicsEffectsRecursively();
+ enum InvalidateReason {
+ OpacityChanged
+ };
+ void invalidateParentGraphicsEffectsRecursively();
+ void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason);
#endif //QT_NO_GRAPHICSEFFECT
void invalidateDepthRecursively();
void resolveDepth();
void addChild(QGraphicsItem *child);
void removeChild(QGraphicsItem *child);
- void setParentItemHelper(QGraphicsItem *parent);
+ void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
+ const QVariant *thisPointerVariant);
void childrenBoundingRectHelper(QTransform *x, QRectF *rect);
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
const QRegion &exposedRegion, bool allItems = false) const;
@@ -349,14 +358,20 @@ public:
return o;
}
+ inline bool isOpacityNull() const
+ { return (opacity < qreal(0.001)); }
+
+ static inline bool isOpacityNull(qreal opacity)
+ { return (opacity < qreal(0.001)); }
+
inline bool isFullyTransparent() const
{
- if (opacity < 0.001)
+ if (isOpacityNull())
return true;
if (!parent)
return false;
- return calcEffectiveOpacity() < 0.001;
+ return isOpacityNull(calcEffectiveOpacity());
}
inline qreal effectiveOpacity() const {
@@ -397,6 +412,8 @@ public:
return !visible || (childrenCombineOpacity() && isFullyTransparent());
}
+ inline void markParentDirty(bool updateBoundingRect = false);
+
void setFocusHelper(Qt::FocusReason focusReason, bool climb);
void setSubFocus(QGraphicsItem *rootItem = 0);
void clearSubFocus(QGraphicsItem *rootItem = 0);
@@ -484,6 +501,8 @@ public:
quint32 sequentialOrdering : 1;
quint32 updateDueToGraphicsEffect : 1;
quint32 scenePosDescendants : 1;
+ quint32 pendingPolish : 1;
+ quint32 mayHaveChildWithGraphicsEffect : 1;
// Optional stacking order
int globalStackingOrder;
@@ -721,11 +740,13 @@ inline QTransform QGraphicsItemPrivate::transformToParent() const
inline void QGraphicsItemPrivate::ensureSortedChildren()
{
if (needSortChildren) {
- qSort(children.begin(), children.end(), qt_notclosestLeaf);
needSortChildren = 0;
sequentialOrdering = 1;
+ if (children.isEmpty())
+ return;
+ qSort(children.begin(), children.end(), qt_notclosestLeaf);
for (int i = 0; i < children.size(); ++i) {
- if (children[i]->d_ptr->siblingIndex != i) {
+ if (children.at(i)->d_ptr->siblingIndex != i) {
sequentialOrdering = 0;
break;
}
@@ -741,6 +762,37 @@ inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem
return a->d_ptr->siblingIndex < b->d_ptr->siblingIndex;
}
+/*!
+ \internal
+*/
+inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
+{
+ QGraphicsItemPrivate *parentp = this;
+ while (parentp->parent) {
+ parentp = parentp->parent->d_ptr.data();
+ parentp->dirtyChildren = 1;
+
+ if (updateBoundingRect) {
+ parentp->dirtyChildrenBoundingRect = 1;
+ // ### Only do this if the parent's effect applies to the entire subtree.
+ parentp->notifyBoundingRectChanged = 1;
+ }
+#ifndef QT_NO_GRAPHICSEFFECT
+ if (parentp->graphicsEffect) {
+ if (updateBoundingRect) {
+ parentp->notifyInvalidated = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+ ->source->d_func())->invalidateCache();
+ }
+ if (parentp->graphicsEffect->isEnabled()) {
+ parentp->dirty = 1;
+ parentp->fullUpdatePending = 1;
+ }
+ }
+#endif
+ }
+}
+
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index cea723c..842d368 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -292,7 +292,6 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
processDirtyItemsEmitted(false),
selectionChanging(0),
needSortTopLevelItems(true),
- unpolishedItemsModified(true),
holesInTopLevelSiblingIndex(false),
topLevelSequentialOrdering(true),
scenePosDescendantsUpdatePending(false),
@@ -429,22 +428,38 @@ void QGraphicsScenePrivate::unregisterTopLevelItem(QGraphicsItem *item)
*/
void QGraphicsScenePrivate::_q_polishItems()
{
- QSet<QGraphicsItem *>::Iterator it = unpolishedItems.begin();
+ if (unpolishedItems.isEmpty())
+ return;
+
const QVariant booleanTrueVariant(true);
- while (!unpolishedItems.isEmpty()) {
- QGraphicsItem *item = *it;
- it = unpolishedItems.erase(it);
- unpolishedItemsModified = false;
- if (!item->d_ptr->explicitlyHidden) {
+ QGraphicsItem *item = 0;
+ QGraphicsItemPrivate *itemd = 0;
+ const int oldUnpolishedCount = unpolishedItems.count();
+
+ for (int i = 0; i < oldUnpolishedCount; ++i) {
+ item = unpolishedItems.at(i);
+ if (!item)
+ continue;
+ itemd = item->d_ptr.data();
+ itemd->pendingPolish = false;
+ if (!itemd->explicitlyHidden) {
item->itemChange(QGraphicsItem::ItemVisibleChange, booleanTrueVariant);
item->itemChange(QGraphicsItem::ItemVisibleHasChanged, booleanTrueVariant);
}
- if (item->isWidget()) {
+ if (itemd->isWidget) {
QEvent event(QEvent::Polish);
QApplication::sendEvent((QGraphicsWidget *)item, &event);
}
- if (unpolishedItemsModified)
- it = unpolishedItems.begin();
+ }
+
+ if (unpolishedItems.count() == oldUnpolishedCount) {
+ // No new items were added to the vector.
+ unpolishedItems.clear();
+ } else {
+ // New items were appended; keep them and remove the old ones.
+ unpolishedItems.remove(0, oldUnpolishedCount);
+ unpolishedItems.squeeze();
+ QMetaObject::invokeMethod(q_ptr, "_q_polishItems", Qt::QueuedConnection);
}
}
@@ -599,7 +614,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
if (parentItem->scene()) {
Q_ASSERT_X(parentItem->scene() == q, "QGraphicsScene::removeItem",
"Parent item's scene is different from this item's scene");
- item->d_ptr->setParentItemHelper(0);
+ item->setParentItem(0);
}
} else {
unregisterTopLevelItem(item);
@@ -638,8 +653,12 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
selectedItems.remove(item);
hoverItems.removeAll(item);
cachedItemsUnderMouse.removeAll(item);
- unpolishedItems.remove(item);
- unpolishedItemsModified = true;
+ if (item->d_ptr->pendingPolish) {
+ const int unpolishedIndex = unpolishedItems.indexOf(item);
+ if (unpolishedIndex != -1)
+ unpolishedItems[unpolishedIndex] = 0;
+ item->d_ptr->pendingPolish = false;
+ }
resetDirtyItem(item);
//We remove all references of item from the sceneEventFilter arrays
@@ -1936,7 +1955,7 @@ QList<QGraphicsItem *> QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSe
\since 4.3
This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode).
-
+
This function is deprecated and returns incorrect results if the scene
contains items that ignore transformations. Use the overload that takes
a QTransform instead.
@@ -2482,12 +2501,12 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
qWarning("QGraphicsScene::addItem: cannot add null item");
return;
}
- if (item->scene() == this) {
+ if (item->d_ptr->scene == this) {
qWarning("QGraphicsScene::addItem: item has already been added to this scene");
return;
}
// Remove this item from its existing scene
- if (QGraphicsScene *oldScene = item->scene())
+ if (QGraphicsScene *oldScene = item->d_ptr->scene)
oldScene->removeItem(item);
// Notify the item that its scene is changing, and allow the item to
@@ -2496,15 +2515,20 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
qVariantFromValue<QGraphicsScene *>(this)));
QGraphicsScene *targetScene = qVariantValue<QGraphicsScene *>(newSceneVariant);
if (targetScene != this) {
- if (targetScene && item->scene() != targetScene)
+ if (targetScene && item->d_ptr->scene != targetScene)
targetScene->addItem(item);
return;
}
+ if (d->unpolishedItems.isEmpty())
+ QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection);
+ d->unpolishedItems.append(item);
+ item->d_ptr->pendingPolish = true;
+
// Detach this item from its parent if the parent's scene is different
// from this scene.
- if (QGraphicsItem *itemParent = item->parentItem()) {
- if (itemParent->scene() != this)
+ if (QGraphicsItem *itemParent = item->d_ptr->parent) {
+ if (itemParent->d_ptr->scene != this)
item->setParentItem(0);
}
@@ -2534,7 +2558,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
d->enableMouseTrackingOnViews();
}
#ifndef QT_NO_CURSOR
- if (d->allItemsUseDefaultCursor && item->hasCursor()) {
+ if (d->allItemsUseDefaultCursor && item->d_ptr->hasCursor) {
d->allItemsUseDefaultCursor = false;
if (d->allItemsIgnoreHoverEvents) // already enabled otherwise
d->enableMouseTrackingOnViews();
@@ -2542,7 +2566,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
#endif //QT_NO_CURSOR
// Enable touch events if the item accepts touch events.
- if (d->allItemsIgnoreTouchEvents && item->acceptTouchEvents()) {
+ if (d->allItemsIgnoreTouchEvents && item->d_ptr->acceptTouchEvents) {
d->allItemsIgnoreTouchEvents = false;
d->enableTouchEventsOnViews();
}
@@ -2575,17 +2599,14 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
}
// Add all children recursively
- foreach (QGraphicsItem *child, item->children())
- addItem(child);
+ item->d_ptr->ensureSortedChildren();
+ for (int i = 0; i < item->d_ptr->children.size(); ++i)
+ addItem(item->d_ptr->children.at(i));
// Resolve font and palette.
item->d_ptr->resolveFont(d->font.resolve());
item->d_ptr->resolvePalette(d->palette.resolve());
- if (d->unpolishedItems.isEmpty())
- QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection);
- d->unpolishedItems.insert(item);
- d->unpolishedItemsModified = true;
// Reenable selectionChanged() for individual items
--d->selectionChanging;
@@ -2619,7 +2640,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
}
}
- if (item->flags() & QGraphicsItem::ItemSendsScenePositionChanges)
+ if (item->d_ptr->flags & QGraphicsItem::ItemSendsScenePositionChanges)
d->registerScenePosItem(item);
// Ensure that newly added items that have subfocus set, gain
@@ -3766,10 +3787,10 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent)
bool QGraphicsScenePrivate::itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const
{
- return (!item->isBlockedByModalPanel() &&
- (item->acceptHoverEvents()
- || (item->isWidget()
- && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration())));
+ return (item->d_ptr->acceptsHover
+ || (item->d_ptr->isWidget
+ && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration()))
+ && !item->isBlockedByModalPanel();
}
/*!
@@ -4609,7 +4630,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
return; // Item has neither contents nor children!(?)
const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);
- const bool itemIsFullyTransparent = (opacity < 0.0001);
+ const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);
if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity()))
return;
@@ -4729,7 +4750,7 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q
qreal opacity, const QTransform *effectTransform,
bool wasDirtyParentSceneTransform, bool drawItem)
{
- const bool itemIsFullyTransparent = (opacity < 0.0001);
+ const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);
const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
const bool itemHasChildren = !item->d_ptr->children.isEmpty();
@@ -4811,7 +4832,8 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q
}
void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, bool invalidateChildren,
- bool force, bool ignoreOpacity, bool removingItemFromScene)
+ bool force, bool ignoreOpacity, bool removingItemFromScene,
+ bool updateBoundingRect)
{
Q_ASSERT(item);
if (updateAll)
@@ -4882,17 +4904,8 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
if (ignoreOpacity)
item->d_ptr->ignoreOpacity = 1;
- QGraphicsItem *p = item->d_ptr->parent;
- while (p) {
- p->d_ptr->dirtyChildren = 1;
-#ifndef QT_NO_GRAPHICSEFFECT
- if (p->d_ptr->graphicsEffect && p->d_ptr->graphicsEffect->isEnabled()) {
- p->d_ptr->dirty = 1;
- p->d_ptr->fullUpdatePending = 1;
- }
-#endif //QT_NO_GRAPHICSEFFECT
- p = p->d_ptr->parent;
- }
+ if (!updateBoundingRect)
+ item->d_ptr->markParentDirty();
}
static inline bool updateHelper(QGraphicsViewPrivate *view, QGraphicsItemPrivate *item,
@@ -4967,7 +4980,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
}
const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);
- const bool itemIsFullyTransparent = !item->d_ptr->ignoreOpacity && opacity < 0.0001;
+ const bool itemIsFullyTransparent = !item->d_ptr->ignoreOpacity
+ && QGraphicsItemPrivate::isOpacityNull(opacity);
if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity())) {
resetDirtyItem(item, /*recursive=*/itemHasChildren);
return;
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index d10811c..04ffe0f 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -108,10 +108,9 @@ public:
QPainterPath selectionArea;
int selectionChanging;
QSet<QGraphicsItem *> selectedItems;
- QSet<QGraphicsItem *> unpolishedItems;
+ QVector<QGraphicsItem *> unpolishedItems;
QList<QGraphicsItem *> topLevelItems;
bool needSortTopLevelItems;
- bool unpolishedItemsModified;
bool holesInTopLevelSiblingIndex;
bool topLevelSequentialOrdering;
@@ -223,7 +222,8 @@ public:
QRegion *, QWidget *, qreal, const QTransform *const, bool, bool);
void markDirty(QGraphicsItem *item, const QRectF &rect = QRectF(), bool invalidateChildren = false,
- bool force = false, bool ignoreOpacity = false, bool removingItemFromScene = false);
+ bool force = false, bool ignoreOpacity = false, bool removingItemFromScene = false,
+ bool updateBoundingRect = false);
void processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren = false,
qreal parentOpacity = qreal(1.0));
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
index 2e92b87..2a91348 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
@@ -635,16 +635,17 @@ void QGraphicsSceneBspTreeIndex::updateSceneRect(const QRectF &rect)
This method react to the \a change of the \a item and use the \a value to
update the BSP tree if necessary.
*/
-void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value)
+void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)
{
Q_D(QGraphicsSceneBspTreeIndex);
switch (change) {
case QGraphicsItem::ItemFlagsChange: {
// Handle ItemIgnoresTransformations
+ QGraphicsItem::GraphicsItemFlags newFlags = *static_cast<const QGraphicsItem::GraphicsItemFlags *>(value);
bool ignoredTransform = item->d_ptr->flags & QGraphicsItem::ItemIgnoresTransformations;
- bool willIgnoreTransform = value.toUInt() & QGraphicsItem::ItemIgnoresTransformations;
+ bool willIgnoreTransform = newFlags & QGraphicsItem::ItemIgnoresTransformations;
bool clipsChildren = item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape;
- bool willClipChildren = value.toUInt() & QGraphicsItem::ItemClipsChildrenToShape;
+ bool willClipChildren = newFlags & QGraphicsItem::ItemClipsChildrenToShape;
if ((ignoredTransform != willIgnoreTransform) || (clipsChildren != willClipChildren)) {
QGraphicsItem *thatItem = const_cast<QGraphicsItem *>(item);
// Remove item and its descendants from the index and append
@@ -661,7 +662,7 @@ void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphics
case QGraphicsItem::ItemParentChange: {
d->invalidateSortCache();
// Handle ItemIgnoresTransformations
- QGraphicsItem *newParent = qVariantValue<QGraphicsItem *>(value);
+ const QGraphicsItem *newParent = static_cast<const QGraphicsItem *>(value);
bool ignoredTransform = item->d_ptr->itemIsUntransformable();
bool willIgnoreTransform = (item->d_ptr->flags & QGraphicsItem::ItemIgnoresTransformations)
|| (newParent && newParent->d_ptr->itemIsUntransformable());
@@ -682,7 +683,6 @@ void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphics
default:
break;
}
- return QGraphicsSceneIndex::itemChange(item, change, value);
}
/*!
\reimp
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
index 119571b..f671fd9 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -97,7 +97,7 @@ protected:
void removeItem(QGraphicsItem *item);
void prepareBoundingRectChange(const QGraphicsItem *item);
- void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value);
+ void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value);
private :
Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp
index bc8a7dc..707c71f 100644
--- a/src/gui/graphicsview/qgraphicssceneindex.cpp
+++ b/src/gui/graphicsview/qgraphicssceneindex.cpp
@@ -279,7 +279,7 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe
return;
const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);
- const bool itemIsFullyTransparent = (opacity < 0.0001);
+ const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);
const bool itemHasChildren = !item->d_ptr->children.isEmpty();
if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity()))
return;
@@ -554,7 +554,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::estimateTopLevelItems(const QRectF &
/*!
\fn QList<QGraphicsItem *> QGraphicsSceneIndex::items(Qt::SortOrder order = Qt::DescendingOrder) const
-
+
This pure virtual function all items in the index and sort them using
\a order.
*/
@@ -624,7 +624,7 @@ void QGraphicsSceneIndex::deleteItem(QGraphicsItem *item)
\sa QGraphicsItem::GraphicsItemChange
*/
-void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value)
+void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)
{
Q_UNUSED(item);
Q_UNUSED(change);
diff --git a/src/gui/graphicsview/qgraphicssceneindex_p.h b/src/gui/graphicsview/qgraphicssceneindex_p.h
index def58f0..597a229 100644
--- a/src/gui/graphicsview/qgraphicssceneindex_p.h
+++ b/src/gui/graphicsview/qgraphicssceneindex_p.h
@@ -110,7 +110,7 @@ protected:
virtual void removeItem(QGraphicsItem *item) = 0;
virtual void deleteItem(QGraphicsItem *item);
- virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const QVariant &value);
+ virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const void *const value);
virtual void prepareBoundingRectChange(const QGraphicsItem *item);
QGraphicsSceneIndex(QGraphicsSceneIndexPrivate &dd, QGraphicsScene *scene);
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 854be2e..42e19b8 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -144,7 +144,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi)
static int calc_shift(int mask)
{
int result = 0;
- while (!(mask & 1)) {
+ while (mask && !(mask & 1)) {
result++;
mask >>= 1;
}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 4e10b5b..4f5efa1 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3992,7 +3992,7 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf
QSize newSize = size();
newSize.scale(s, aspectMode);
if (newSize == size())
- return copy();
+ return *this;
QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(), (qreal)newSize.height() / height());
QImage img = transformed(wm, mode);
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index 61d538f..ace4bb6 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -62,12 +62,12 @@ QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance()
return qt_image_and_pixmap_cleanup_hooks();
}
-void QImagePixmapCleanupHooks::addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm hook)
+void QImagePixmapCleanupHooks::addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapModificationHooks.append(hook);
}
-void QImagePixmapCleanupHooks::addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm hook)
+void QImagePixmapCleanupHooks::addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapDestructionHooks.append(hook);
}
@@ -78,12 +78,12 @@ void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook)
imageHooks.append(hook);
}
-void QImagePixmapCleanupHooks::removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm hook)
+void QImagePixmapCleanupHooks::removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapModificationHooks.removeAll(hook);
}
-void QImagePixmapCleanupHooks::removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm hook)
+void QImagePixmapCleanupHooks::removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapDestructionHooks.removeAll(hook);
}
@@ -93,24 +93,24 @@ void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook)
imageHooks.removeAll(hook);
}
-void QImagePixmapCleanupHooks::executePixmapModificationHooks(QPixmap* pm)
+void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
for (int i = 0; i < h->pixmapModificationHooks.count(); ++i)
- h->pixmapModificationHooks[i](pm);
+ h->pixmapModificationHooks[i](pmd);
if (qt_pixmap_cleanup_hook_64)
- qt_pixmap_cleanup_hook_64(pm->cacheKey());
+ qt_pixmap_cleanup_hook_64(pmd->cacheKey());
}
-void QImagePixmapCleanupHooks::executePixmapDestructionHooks(QPixmap* pm)
+void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i)
- h->pixmapDestructionHooks[i](pm);
+ h->pixmapDestructionHooks[i](pmd);
if (qt_pixmap_cleanup_hook_64)
- qt_pixmap_cleanup_hook_64(pm->cacheKey());
+ qt_pixmap_cleanup_hook_64(pmd->cacheKey());
}
void QImagePixmapCleanupHooks::executeImageHooks(qint64 key)
diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h
index 7176044..88dd3a6 100644
--- a/src/gui/image/qimagepixmapcleanuphooks_p.h
+++ b/src/gui/image/qimagepixmapcleanuphooks_p.h
@@ -58,7 +58,8 @@
QT_BEGIN_NAMESPACE
typedef void (*_qt_image_cleanup_hook_64)(qint64);
-typedef void (*_qt_pixmap_cleanup_hook_pm)(QPixmap*);
+typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPixmapData*);
+
class QImagePixmapCleanupHooks;
@@ -71,27 +72,27 @@ public:
static void enableCleanupHooks(const QPixmap &pixmap);
static void enableCleanupHooks(QPixmapData *pixmapData);
- // Gets called when a pixmap is about to be modified:
- void addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm);
+ // Gets called when a pixmap data is about to be modified:
+ void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
- // Gets called when a pixmap is about to be destroyed:
- void addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm);
+ // Gets called when a pixmap data is about to be destroyed:
+ void addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
// Gets called when an image is about to be modified or destroyed:
void addImageHook(_qt_image_cleanup_hook_64);
- void removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm);
- void removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm);
+ void removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
+ void removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
void removeImageHook(_qt_image_cleanup_hook_64);
- static void executePixmapModificationHooks(QPixmap*);
- static void executePixmapDestructionHooks(QPixmap*);
+ static void executePixmapDataModificationHooks(QPixmapData*);
+ static void executePixmapDataDestructionHooks(QPixmapData*);
static void executeImageHooks(qint64 key);
private:
QList<_qt_image_cleanup_hook_64> imageHooks;
- QList<_qt_pixmap_cleanup_hook_pm> pixmapModificationHooks;
- QList<_qt_pixmap_cleanup_hook_pm> pixmapDestructionHooks;
+ QList<_qt_pixmap_cleanup_hook_pmd> pixmapModificationHooks;
+ QList<_qt_pixmap_cleanup_hook_pmd> pixmapDestructionHooks;
};
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 674d5da..d1e5c40 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -320,8 +320,6 @@ QPixmap::QPixmap(const char * const xpm[])
QPixmap::~QPixmap()
{
Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again
- if (data && data->is_cached && data->ref == 1) // ref will be decrememnted after destructor returns
- QImagePixmapCleanupHooks::executePixmapDestructionHooks(this);
}
/*!
@@ -833,14 +831,21 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers
if (QPixmapCache::find(key, *this))
return true;
- QPixmapData *tmp = QPixmapData::create(0, 0, QPixmapData::PixmapType);
- if (tmp->fromFile(fileName, format, flags)) {
- data = tmp;
- QPixmapCache::insert(key, *this);
- return true;
+ bool ok;
+
+ if (data) {
+ ok = data->fromFile(fileName, format, flags);
+ } else {
+ QScopedPointer<QPixmapData> tmp(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ ok = tmp->fromFile(fileName, format, flags);
+ if (ok)
+ data = tmp.take();
}
- delete tmp;
- return false;
+
+ if (ok)
+ QPixmapCache::insert(key, *this);
+
+ return ok;
}
/*!
@@ -1018,12 +1023,8 @@ qint64 QPixmap::cacheKey() const
if (isNull())
return 0;
- int classKey = data->classId();
- if (classKey >= 1024)
- classKey = -(classKey >> 10);
- return ((((qint64) classKey) << 56)
- | (((qint64) data->serialNumber()) << 32)
- | ((qint64) (data->detach_no)));
+ Q_ASSERT(data);
+ return data->cacheKey();
}
static void sendResizeEvents(QWidget *target)
@@ -1936,7 +1937,7 @@ void QPixmap::detach()
}
if (data->is_cached && data->ref == 1)
- QImagePixmapCleanupHooks::executePixmapModificationHooks(this);
+ QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data());
#if defined(Q_WS_MAC)
QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data.data()) : 0;
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 0e66e09..e1e8a0d 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -68,6 +68,7 @@
#include "qx11info_x11.h"
#include <private/qdrawhelper_p.h>
#include <private/qimage_p.h>
+#include <private/qimagepixmapcleanuphooks_p.h>
#include <stdlib.h>
@@ -1228,6 +1229,12 @@ void QX11PixmapData::fill(const QColor &fillColor)
QX11PixmapData::~QX11PixmapData()
{
+ // Cleanup hooks have to be called before the handles are freed
+ if (is_cached) {
+ QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this);
+ is_cached = false;
+ }
+
release();
}
@@ -1236,8 +1243,13 @@ void QX11PixmapData::release()
delete pengine;
pengine = 0;
- if (!X11)
+ if (!X11) {
+#ifndef QT_NO_DEBUG
+ qWarning("~QX11PixmapData(): QPixmap objects must be destroyed before the QApplication"
+ " object, otherwise the native pixmap object will be leaked.");
+#endif
return;
+ }
if (x11_mask) {
#ifndef QT_NO_XRENDER
diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp
index 65032da..ea4fe6b 100644
--- a/src/gui/image/qpixmapdata.cpp
+++ b/src/gui/image/qpixmapdata.cpp
@@ -45,6 +45,7 @@
#include <QtGui/qimagereader.h>
#include <private/qgraphicssystem_p.h>
#include <private/qapplication_p.h>
+#include <private/qimagepixmapcleanuphooks_p.h>
QT_BEGIN_NAMESPACE
@@ -80,6 +81,16 @@ QPixmapData::QPixmapData(PixelType pixelType, int objectId)
QPixmapData::~QPixmapData()
{
+ // Sometimes the pixmap cleanup hooks will be called from derrived classes, which will
+ // then set is_cached to false. For example, on X11 QtOpenGL needs to delete the GLXPixmap
+ // or EGL Pixmap Surface for a given pixmap _before_ the native X11 pixmap is deleted,
+ // otherwise some drivers will leak the GL surface. In this case, QX11PixmapData will
+ // call the cleanup hooks itself before deleting the native pixmap and set is_cached to
+ // false.
+ if (is_cached) {
+ QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this);
+ is_cached = false;
+ }
}
QPixmapData *QPixmapData::createCompatiblePixmapData() const
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 1125515..827fa18 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -117,6 +117,14 @@ public:
inline int colorCount() const { return metric(QPaintDevice::PdmNumColors); }
inline int depth() const { return d; }
inline bool isNull() const { return is_null; }
+ inline qint64 cacheKey() const {
+ int classKey = id;
+ if (classKey >= 1024)
+ classKey = -(classKey >> 10);
+ return ((((qint64) classKey) << 56)
+ | (((qint64) ser_no) << 32)
+ | ((qint64) detach_no));
+ }
#if defined(Q_OS_SYMBIAN)
virtual void* toNativeType(NativeType type);
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 0b84e2f..f5034fc 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -57,6 +57,7 @@
#include "qinputcontext.h"
#include <qhash.h>
+#include <qtimer.h>
#include <private/qcore_symbian_p.h>
#include <private/qt_s60_p.h>
@@ -91,6 +92,9 @@ public:
TCoeInputCapabilities inputCapabilities();
+protected:
+ void timerEvent(QTimerEvent *timerEvent);
+
private:
void commitCurrentString(bool triggeredBySymbian);
void updateHints(bool mustUpdateInputCapabilities);
@@ -98,6 +102,7 @@ private:
void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
void queueInputCapabilitiesChanged();
bool needsInputPanel();
+ void commitTemporaryPreeditString();
private Q_SLOTS:
void ensureInputCapabilitiesChanged();
@@ -148,6 +153,8 @@ private:
MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler;
int m_longPress;
int m_cursorPos;
+ QBasicTimer m_tempPreeditStringTimeout;
+ bool m_hasTempPreeditString;
};
QT_END_NAMESPACE
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index d2f207a..793bcde 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -72,7 +72,8 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_formatRetriever(0),
m_pointerHandler(0),
m_longPress(0),
- m_cursorPos(0)
+ m_cursorPos(0),
+ m_hasTempPreeditString(false)
{
m_fepState->SetObjectProvider(this);
m_fepState->SetFlags(EAknEditorFlagDefault);
@@ -100,6 +101,8 @@ QCoeFepInputContext::~QCoeFepInputContext()
void QCoeFepInputContext::reset()
{
+ commitTemporaryPreeditString();
+
CCoeFep* fep = CCoeEnv::Static()->Fep();
if (fep)
fep->CancelTransaction();
@@ -200,7 +203,11 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
if (!focusWidget())
return false;
- if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
+ switch (event->type()) {
+ case QEvent::KeyPress:
+ commitTemporaryPreeditString();
+ // fall through intended
+ case QEvent::KeyRelease:
const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
switch (keyEvent->key()) {
case Qt::Key_F20:
@@ -223,6 +230,21 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
default:
break;
}
+
+ if (keyEvent->type() == QEvent::KeyPress
+ && focusWidget()->inputMethodHints() & Qt::ImhHiddenText
+ && !keyEvent->text().isEmpty()) {
+ // Send some temporary preedit text in order to make text visible for a moment.
+ m_preeditString = keyEvent->text();
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent imEvent(m_preeditString, attributes);
+ QApplication::sendEvent(focusWidget(), &imEvent);
+ m_tempPreeditStringTimeout.start(1000, this);
+ m_hasTempPreeditString = true;
+ update();
+ return true;
+ }
+ break;
}
if (!needsInputPanel())
@@ -253,6 +275,24 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
return false;
}
+void QCoeFepInputContext::timerEvent(QTimerEvent *timerEvent)
+{
+ if (timerEvent->timerId() == m_tempPreeditStringTimeout.timerId())
+ commitTemporaryPreeditString();
+}
+
+void QCoeFepInputContext::commitTemporaryPreeditString()
+{
+ if (m_tempPreeditStringTimeout.isActive())
+ m_tempPreeditStringTimeout.stop();
+
+ if (!m_hasTempPreeditString)
+ return;
+
+ commitCurrentString(false);
+ m_hasTempPreeditString = false;
+}
+
void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
{
Q_ASSERT(focusWidget());
@@ -310,6 +350,8 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
{
using namespace Qt;
+ commitTemporaryPreeditString();
+
bool numbersOnly = hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly
|| hints & ImhDialableCharactersOnly;
bool noOnlys = !(numbersOnly || hints & ImhUppercaseOnly
@@ -501,6 +543,8 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
if (!w)
return;
+ commitTemporaryPreeditString();
+
m_cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
QList<QInputMethodEvent::Attribute> attributes;
@@ -600,6 +644,8 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
if (!w)
return;
+ commitTemporaryPreeditString();
+
int pos = aCursorSelection.iAnchorPos;
int length = aCursorSelection.iCursorPos - pos;
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index f289c7d..19b1e8c 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2621,6 +2621,13 @@ bool QIconModeViewBase::filterDropEvent(QDropEvent *e)
const QSize contents = contentsSize;
QPoint offset(horizontalOffset(), verticalOffset());
QPoint end = e->pos() + offset;
+ if (qq->acceptDrops()) {
+ const Qt::ItemFlags dropableFlags = Qt::ItemIsDropEnabled|Qt::ItemIsEnabled;
+ const QVector<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
+ foreach (const QModelIndex &index, dropIndices)
+ if ((index.flags() & dropableFlags) == dropableFlags)
+ return false;
+ }
QPoint start = dd->pressedPosition;
QPoint delta = (dd->movement == QListView::Snap ? snapToGrid(end) - snapToGrid(start) : end - start);
QList<QModelIndex> indexes = dd->selectionModel->selectedIndexes();
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 7eefb0b..3111896 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -114,7 +114,9 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
}
} else if (old_height > span->height()) {
//remove the span from all the subspans lists that intersect the columns not covered anymore
- Index::iterator it_y = index.lowerBound(qMin(-span->bottom(), 0));
+ Index::iterator it_y = index.lowerBound(-span->bottom());
+ if (it_y == index.end())
+ it_y = index.find(-span->top()); // This is the only span remaining and we are deleting it.
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
while (-it_y.key() <= span->top() + old_height -1) {
if (-it_y.key() > span->bottom()) {
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 12fe797..4fe3900 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -121,8 +121,10 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
static void initResources()
{
-#ifdef Q_WS_WINCE
+#if defined(Q_WS_WINCE)
Q_INIT_RESOURCE(qstyle_wince);
+#elif defined(Q_OS_SYMBIAN)
+ Q_INIT_RESOURCE(qstyle_s60);
#else
Q_INIT_RESOURCE(qstyle);
#endif
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index 6aebef5..e8b821af 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -227,8 +227,29 @@ void onApplicationChangedActivation( bool activated );
static void qt_mac_read_fontsmoothing_settings()
{
- NSInteger appleFontSmoothing = [[NSUserDefaults standardUserDefaults] integerForKey:@"AppleFontSmoothing"];
- qt_applefontsmoothing_enabled = (appleFontSmoothing > 0);
+ qt_applefontsmoothing_enabled = true;
+ int w = 10, h = 10;
+ QImage image(w, h, QImage::Format_RGB32);
+ image.fill(0xffffffff);
+ QPainter p(&image);
+ p.drawText(0, h, "X\\");
+ p.end();
+
+ const int *bits = (const int *) ((const QImage &) image).bits();
+ int bpl = image.bytesPerLine() / 4;
+ for (int y=0; y<w; ++y) {
+ for (int x=0; x<h; ++x) {
+ int r = qRed(bits[x]);
+ int g = qGreen(bits[x]);
+ int b = qBlue(bits[x]);
+ if (r != g || r != b) {
+ qt_applefontsmoothing_enabled = true;
+ return;
+ }
+ }
+ bits += bpl;
+ }
+ qt_applefontsmoothing_enabled = false;
}
Q_GUI_EXPORT bool qt_mac_execute_apple_script(const char *script, long script_len, AEDesc *ret) {
@@ -772,11 +793,11 @@ static void qt_mac_update_intersected_gl_widgets(QWidget *widget)
qt_post_window_change_event(glWidget);
it->lastUpdateWidget = widget;
} else if (it->lastUpdateWidget == widget) {
- // Update the gl wigets that the widget intersected the last time around,
- // and that we are not intersecting now. This prevents paint errors when the
+ // Update the gl wigets that the widget intersected the last time around,
+ // and that we are not intersecting now. This prevents paint errors when the
// intersecting widget leaves a gl widget.
qt_post_window_change_event(glWidget);
- it->lastUpdateWidget = 0;
+ it->lastUpdateWidget = 0;
}
}
#else
@@ -808,8 +829,8 @@ Q_GUI_EXPORT void qt_event_request_window_change(QWidget *widget)
// Post a kEventQtRequestWindowChange event. This event is semi-public,
// don't remove this line!
qt_event_request_window_change();
-
- // Post update request on gl widgets unconditionally.
+
+ // Post update request on gl widgets unconditionally.
if (qt_widget_private(widget)->isGLWidget == true) {
qt_post_window_change_event(widget);
return;
@@ -1214,8 +1235,6 @@ void qt_init(QApplicationPrivate *priv, int)
if (QApplication::desktopSettingsAware())
QApplicationPrivate::qt_mac_apply_settings();
- qt_mac_read_fontsmoothing_settings();
-
// Cocoa application delegate
#ifdef QT_MAC_USE_COCOA
NSApplication *cocoaApp = [NSApplication sharedApplication];
@@ -1253,6 +1272,7 @@ void qt_init(QApplicationPrivate *priv, int)
}
priv->native_modal_dialog_active = false;
+ qt_mac_read_fontsmoothing_settings();
}
void qt_release_apple_event_handler()
@@ -1705,7 +1725,7 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
// kEventMouseWheelMoved events if we dont eat this event
// (actually two events; one for horizontal and one for vertical).
// As a results of this, and to make sure we dont't receive duplicate events,
- // we try to detect when this happend by checking the 'compatibilityEvent'.
+ // we try to detect when this happend by checking the 'compatibilityEvent'.
SInt32 mdelt = 0;
GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0,
sizeof(mdelt), 0, &mdelt);
@@ -2576,7 +2596,7 @@ void QApplicationPrivate::closePopup(QWidget *popup)
if (QApplicationPrivate::popupWidgets->isEmpty()) { // this was the last popup
delete QApplicationPrivate::popupWidgets;
QApplicationPrivate::popupWidgets = 0;
-
+
// Special case for Tool windows: since they are activated and deactived together
// with a normal window they never become the QApplicationPrivate::active_window.
QWidget *appFocusWidget = QApplication::focusWidget();
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index f8943a8..9c001ab 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -501,9 +501,9 @@ public:
static TUint resolveS60ScanCode(TInt scanCode, TUint keysym);
QSet<WId> nativeWindows;
- int symbianProcessWsEvent(const TWsEvent *event);
- int symbianHandleCommand(int command);
- int symbianResourceChange(int type);
+ int symbianProcessWsEvent(const QSymbianEvent *symbianEvent);
+ int symbianHandleCommand(const QSymbianEvent *symbianEvent);
+ int symbianResourceChange(const QSymbianEvent *symbianEvent);
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS)
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 3ee0a71..6caac9f 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -71,6 +71,7 @@
# include <private/qcoefepinputcontext_p.h>
# endif
# include <private/qs60mainapplication_p.h>
+# include <centralrepository.h>
#endif
#include "private/qstylesheetstyle_p.h"
@@ -807,6 +808,15 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const
void QSymbianControl::Draw(const TRect& controlRect) const
{
+ // Set flag to avoid calling DrawNow in window surface
+ QWExtra *extra = qwidget->d_func()->extraData();
+ if (extra && !extra->inExpose) {
+ extra->inExpose = true;
+ QRect exposeRect = qt_TRect2QRect(controlRect);
+ qwidget->d_func()->syncBackingStore(exposeRect);
+ extra->inExpose = false;
+ }
+
QWindowSurface *surface = qwidget->windowSurface();
QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL;
@@ -855,8 +865,6 @@ void QSymbianControl::Draw(const TRect& controlRect) const
default:
Q_ASSERT(false);
}
- } else {
- surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
}
if (sendNativePaintEvents) {
@@ -1197,6 +1205,24 @@ void qt_init(QApplicationPrivate * /* priv */, int)
S60->virtualMouseRequired = false;
}
+ S60->avkonComponentsSupportTransparency = false;
+
+#ifdef Q_WS_S60
+ TUid KCRUidAvkon = { 0x101F876E };
+ TUint32 KAknAvkonTransparencyEnabled = 0x0000000D;
+
+ CRepository* repository = 0;
+ TRAP(err, repository = CRepository::NewL(KCRUidAvkon));
+
+ if(err == KErrNone) {
+ TInt value = 0;
+ err = repository->Get(KAknAvkonTransparencyEnabled, value);
+ if(err == KErrNone) {
+ S60->avkonComponentsSupportTransparency = (value==1) ? true : false;
+ }
+ }
+#endif
+
if (touch) {
QApplicationPrivate::navigationMode = Qt::NavigationModeNone;
} else {
@@ -1521,6 +1547,12 @@ void QApplication::beep()
qt_S60Beep->Play();
}
+static inline bool callSymbianEventFilters(const QSymbianEvent *event)
+{
+ long unused;
+ return qApp->filterEvent(const_cast<QSymbianEvent *>(event), &unused);
+}
+
/*!
\warning This function is only available on Symbian.
\since 4.6
@@ -1537,6 +1569,9 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
QScopedLoopLevelCounter counter(d->threadData);
+ if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
+ return 1;
+
QWidget *w = qApp ? qApp->focusWidget() : 0;
if (w) {
QInputContext *ic = w->inputContext();
@@ -1549,29 +1584,34 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
switch (event->type()) {
case QSymbianEvent::WindowServerEvent:
- return d->symbianProcessWsEvent(event->windowServerEvent());
+ return d->symbianProcessWsEvent(event);
case QSymbianEvent::CommandEvent:
- return d->symbianHandleCommand(event->command());
+ return d->symbianHandleCommand(event);
case QSymbianEvent::ResourceChangeEvent:
- return d->symbianResourceChange(event->resourceChangeType());
+ return d->symbianResourceChange(event);
default:
return -1;
}
}
-int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
+int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent)
{
// Qt event handling. Handle some events regardless of if the handle is in our
// widget map or not.
+ const TWsEvent *event = symbianEvent->windowServerEvent();
CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle());
const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control);
switch (event->Type()) {
case EEventPointerEnter:
- if (controlInMap)
+ if (controlInMap) {
+ callSymbianEventFilters(symbianEvent);
return 1; // Qt::Enter will be generated in HandlePointerL
+ }
break;
case EEventPointerExit:
if (controlInMap) {
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60) {
// mouseEvent outside our window, send leave event to last focused widget
QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos,
@@ -1584,6 +1624,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
}
break;
case EEventScreenDeviceChanged:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60)
S60->updateScreenSize();
if (qt_desktopWidget) {
@@ -1596,6 +1638,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
return 0; // Propagate to CONE
case EEventWindowVisibilityChanged:
if (controlInMap) {
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
QWidget *w = QWidgetPrivate::mapper->value(control);
if (!w->d_func()->maybeTopData())
@@ -1613,6 +1657,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
}
break;
case EEventFocusGained:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
#ifndef QT_NO_CURSOR
//re-enable mouse interaction
if (S60->mouseInteractionEnabled) {
@@ -1626,6 +1672,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
#endif
break;
case EEventFocusLost:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
#ifndef QT_NO_CURSOR
//disable mouse as may be moving to application that does not support it
if (S60->mouseInteractionEnabled) {
@@ -1677,11 +1725,16 @@ bool QApplication::symbianEventFilter(const QSymbianEvent *event)
\sa s60EventFilter(), s60ProcessEvent()
*/
-int QApplicationPrivate::symbianHandleCommand(int command)
+int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent)
{
Q_Q(QApplication);
int ret = 0;
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
+
+ int command = symbianEvent->command();
+
switch (command) {
#ifdef Q_WS_S60
case EAknSoftkeyExit: {
@@ -1721,14 +1774,18 @@ int QApplicationPrivate::symbianHandleCommand(int command)
Currently, KEikDynamicLayoutVariantSwitch and
KAknsMessageSkinChange are handled.
*/
-int QApplicationPrivate::symbianResourceChange(int type)
+int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent)
{
int ret = 0;
+ int type = symbianEvent->resourceChangeType();
+
switch (type) {
#ifdef Q_WS_S60
case KEikDynamicLayoutVariantSwitch:
{
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60)
S60->updateScreenSize();
@@ -1753,6 +1810,8 @@ int QApplicationPrivate::symbianResourceChange(int type)
#ifndef QT_NO_STYLE_S60
case KAknsMessageSkinChange:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) {
s60Style->d_func()->handleSkinChange();
ret = 1;
diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm
index 9f90cec..18b3772 100644
--- a/src/gui/kernel/qcocoamenuloader_mac.mm
+++ b/src/gui/kernel/qcocoamenuloader_mac.mm
@@ -110,6 +110,12 @@ QT_USE_NAMESPACE
}
}
+- (void)removeActionsFromAppMenu
+{
+ for (NSMenuItem *item in [appMenu itemArray])
+ [item setTag:nil];
+}
+
- (void)dealloc
{
[lastAppSpecificItem release];
diff --git a/src/gui/kernel/qcocoamenuloader_mac_p.h b/src/gui/kernel/qcocoamenuloader_mac_p.h
index 432a7a6..81c136e 100644
--- a/src/gui/kernel/qcocoamenuloader_mac_p.h
+++ b/src/gui/kernel/qcocoamenuloader_mac_p.h
@@ -70,6 +70,7 @@
}
- (void)ensureAppMenuInMenu:(NSMenu *)menu;
+- (void)removeActionsFromAppMenu;
- (NSMenu *)applicationMenu;
- (NSMenu *)menu;
- (NSMenuItem *)quitMenuItem;
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index c14798a..d255604 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -510,7 +510,7 @@ extern "C" {
}
// Make sure the opengl context is updated on resize.
- if (0 && qwidgetprivate->isGLWidget) {
+ if (qwidgetprivate->isGLWidget) {
qwidgetprivate->needWindowChange = true;
QEvent event(QEvent::MacGLWindowChange);
qApp->sendEvent(qwidget, &event);
@@ -644,6 +644,8 @@ extern "C" {
- (void)mouseEntered:(NSEvent *)event
{
+ if (qwidgetprivate->data.in_destructor)
+ return;
QEvent enterEvent(QEvent::Enter);
NSPoint windowPoint = [event locationInWindow];
NSPoint globalPoint = [[event window] convertBaseToScreen:windowPoint];
diff --git a/src/gui/kernel/qdesktopwidget.cpp b/src/gui/kernel/qdesktopwidget.cpp
index c8a4373..24b4e57 100644
--- a/src/gui/kernel/qdesktopwidget.cpp
+++ b/src/gui/kernel/qdesktopwidget.cpp
@@ -47,6 +47,11 @@ QT_BEGIN_NAMESPACE
const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
{
+ if (!widget) {
+ qWarning("QDesktopWidget::screenGeometry(): Attempt "
+ "to get the screen geometry of a null widget");
+ return QRect();
+ }
QRect rect = QWidgetPrivate::screenGeometry(widget);
if (rect.isNull())
return screenGeometry(screenNumber(widget));
@@ -55,6 +60,11 @@ const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const
{
+ if (!widget) {
+ qWarning("QDesktopWidget::availableGeometry(): Attempt "
+ "to get the available geometry of a null widget");
+ return QRect();
+ }
QRect rect = QWidgetPrivate::screenGeometry(widget);
if (rect.isNull())
return availableGeometry(screenNumber(widget));
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index eda75db..c7c7caf 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -569,7 +569,7 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
// in cocoa. [NSApp run] should be called at least once for any cocoa app.
if (NSModalSession session = d->currentModalSession()) {
QBoolBlocker execGuard(d->currentExecIsNSAppRun, false);
- while (!d->interrupt && [NSApp runModalSession:session] == NSRunContinuesResponse)
+ while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt)
qt_mac_waitForMoreModalSessionEvents();
if (!d->interrupt && session == d->currentModalSessionCached) {
// INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index b44cd50..aebc3a5 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -1925,11 +1925,11 @@ void QFormLayoutPrivate::arrangeWidgets(const QVector<QLayoutStruct>& layouts, Q
/*
If the field on the right-hand side is tall,
we want the label to be top-aligned, but not too
- much. So we introduce a 5 / 4 factor so that it
- gets a few extra pixels at the top.
+ much. So we introduce a 7 / 4 factor so that it
+ gets some extra pixels at the top.
*/
height = qMin(height,
- qMin(label->sizeHint.height() * 5 / 4,
+ qMin(label->sizeHint.height() * 7 / 4,
label->maxSize.height()));
}
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index e36ab9b..e06a810 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -143,6 +143,9 @@ extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp
void macWindowFade(void * /*OSWindowRef*/ window, float durationSeconds)
{
+#ifdef QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
+#endif
OSWindowRef wnd = static_cast<OSWindowRef>(window);
if (wnd) {
QWidget *widget;
@@ -1278,4 +1281,17 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor)
}
#endif
+QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool()
+{
+#ifndef QT_MAC_USE_COCOA
+ NSApplicationLoad();
+#endif
+ pool = (void*)[[NSAutoreleasePool alloc] init];
+}
+
+QMacCocoaAutoReleasePool::~QMacCocoaAutoReleasePool()
+{
+ [(NSAutoreleasePool*)pool release];
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index b417065..1163055 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -121,6 +121,7 @@ public:
int virtualMouseRequired : 1;
int qtOwnsS60Environment : 1;
int supportsPremultipliedAlpha : 1;
+ int avkonComponentsSupportTransparency : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
static inline void updateScreenSize();
static inline RWsSession& wsSession();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 81a9a80..ffad38b 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -2026,6 +2026,14 @@ void QWidgetPrivate::updateIsOpaque()
}
#endif
+#ifdef Q_WS_S60
+ if (q->windowType() == Qt::Dialog && q->testAttribute(Qt::WA_TranslucentBackground)
+ && S60->avkonComponentsSupportTransparency) {
+ setOpaque(false);
+ return;
+ }
+#endif
+
if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) {
setOpaque(true);
return;
@@ -3344,7 +3352,7 @@ QPoint QWidget::pos() const
\note Setting the size to \c{QSize(0, 0)} will cause the widget to not
appear on screen. This also applies to windows.
- \sa pos, geometry, minimumSize, maximumSize, resizeEvent()
+ \sa pos, geometry, minimumSize, maximumSize, resizeEvent(), adjustSize()
*/
/*!
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 354a666..78c1562 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -110,6 +110,7 @@
#include "qevent_p.h"
#include "qdnd_p.h"
#include <QtGui/qgraphicsproxywidget.h>
+#include "qmainwindow.h"
QT_BEGIN_NAMESPACE
@@ -403,7 +404,7 @@ inline static void qt_mac_set_fullscreen_mode(bool b)
return;
qt_mac_app_fullscreen = b;
if (b) {
- SetSystemUIMode(kUIModeAllSuppressed, 0);
+ SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
} else {
SetSystemUIMode(kUIModeNormal, 0);
}
@@ -1721,6 +1722,15 @@ bool QWidgetPrivate::qt_widget_rgn(QWidget *widget, short wcode, RgnHandle rgn,
void QWidgetPrivate::determineWindowClass()
{
Q_Q(QWidget);
+#if !defined(QT_NO_MAINWINDOW) && !defined(QT_NO_TOOLBAR)
+ // Make sure that QMainWindow has the MacWindowToolBarButtonHint when the
+ // unifiedTitleAndToolBarOnMac property is ON. This is to avoid reentry of
+ // setParent() triggered by the QToolBar::event(QEvent::ParentChange).
+ QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q);
+ if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
+ data.window_flags |= Qt::MacWindowToolBarButtonHint;
+ }
+#endif
#ifndef QT_MAC_USE_COCOA
// ### COCOA:Interleave these better!
@@ -2743,7 +2753,9 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
}
if (wasWindow) {
oldToolbar = [oldWindow toolbar];
+ [oldToolbar retain];
oldToolbarVisible = [oldToolbar isVisible];
+ [oldWindow setToolbar:nil];
}
#endif
}
@@ -2787,6 +2799,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
if (oldToolbar && !(f & Qt::FramelessWindowHint)) {
OSWindowRef newWindow = qt_mac_window_for(q);
[newWindow setToolbar:oldToolbar];
+ [oldToolbar release];
[oldToolbar setVisible:oldToolbarVisible];
}
#endif
@@ -3401,6 +3414,38 @@ void QWidgetPrivate::hide_sys()
ShowHide(window, false);
#else
[window orderOut:window];
+ // Unfortunately it is not as easy as just hiding the window, we need
+ // to find out if we were in full screen mode. If we were and this is
+ // the last window in full screen mode then we need to unset the full screen
+ // mode. If this is not the last visible window in full screen mode then we
+ // don't change the full screen mode.
+ if(q->isFullScreen())
+ {
+ bool keepFullScreen = false;
+ QWidgetList windowList = qApp->topLevelWidgets();
+ int windowCount = windowList.count();
+ for(int i = 0; i < windowCount; i++)
+ {
+ QWidget *w = windowList[i];
+ // If it is the same window, we don't need to check :-)
+ if(q == w)
+ continue;
+ // If they are not visible or if they are minimized then
+ // we just ignore them.
+ if(!w->isVisible() || w->isMinimized())
+ continue;
+ // Is it full screen?
+ // Notice that if there is one window in full screen mode then we
+ // cannot switch the full screen mode off, therefore we just abort.
+ if(w->isFullScreen()) {
+ keepFullScreen = true;
+ break;
+ }
+ }
+ // No windows in full screen mode, so let just unset that flag.
+ if(!keepFullScreen)
+ qt_mac_set_fullscreen_mode(false);
+ }
#endif
toggleDrawers(false);
#ifndef QT_MAC_USE_COCOA
@@ -3465,6 +3510,8 @@ void QWidgetPrivate::hide_sys()
if (!QWidget::mouseGrabber()){
QWidget *enterWidget = QApplication::widgetAt(QCursor::pos());
+ if (enterWidget && enterWidget->data->in_destructor)
+ enterWidget = 0;
QApplicationPrivate::dispatchEnterLeave(enterWidget, qt_mouseover);
qt_mouseover = enterWidget;
}
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index ec8d20f..b1eb3c3 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -229,6 +229,7 @@ struct QWExtra {
#endif
#elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian
uint activated : 1; // RWindowBase::Activated has been called
+ uint inExpose : 1; // Prevents drawing recursion
/**
* Defines the behaviour of QSymbianControl::Draw.
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index c65a162..00f2213 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -389,9 +389,13 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
if (!isOpaque) {
RWindow *const window = static_cast<RWindow *>(drawableWindow);
+#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+ window->SetSurfaceTransparency(true);
+#else
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
if (window->SetTransparencyAlphaChannel() == KErrNone)
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
+#endif
}
}
@@ -707,12 +711,16 @@ void QWidgetPrivate::s60UpdateIsOpaque()
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
+#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+ window->SetSurfaceTransparency(!isOpaque);
+#else
if (!isOpaque) {
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
if (window->SetTransparencyAlphaChannel() == KErrNone)
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
} else
window->SetTransparentRegion(TRegionFix<1>());
+#endif
}
void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
@@ -883,6 +891,7 @@ void QWidgetPrivate::createSysExtra()
extra->activated = 0;
extra->nativePaintMode = QWExtra::Default;
extra->receiveNativePaintEvents = 0;
+ extra->inExpose = 0;
}
void QWidgetPrivate::deleteSysExtra()
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index f51dc36..d6d288e 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -934,8 +934,7 @@ void QColor::setRgb(int r, int g, int b, int a)
/*!
\fn QRgb QColor::rgba() const
- Returns the RGB value of the color. Unlike rgb(), the alpha is not
- stripped.
+ Returns the RGB value of the color, including its alpha.
For an invalid color, the alpha value of the returned color is unspecified.
@@ -950,8 +949,7 @@ QRgb QColor::rgba() const
}
/*!
- Sets the RGBA value to \a rgba. Unlike setRgb(QRgb rgb), this function does
- not ignore the alpha.
+ Sets the RGB value to \a rgba, including its alpha.
\sa rgba(), rgb()
*/
@@ -968,8 +966,7 @@ void QColor::setRgba(QRgb rgba)
/*!
\fn QRgb QColor::rgb() const
- Returns the RGB value of the color. The alpha is stripped for
- compatibility.
+ Returns the RGB value of the color. The alpha value is opaque.
\sa getRgb(), rgba()
*/
@@ -983,7 +980,7 @@ QRgb QColor::rgb() const
/*!
\overload
- Sets the RGB value to \a rgb, ignoring the alpha.
+ Sets the RGB value to \a rgb. The alpha value is set to opaque.
*/
void QColor::setRgb(QRgb rgb)
{
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index e441a6b..5e5d9b8 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -267,13 +267,13 @@ private:
#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE
inline void ensureBrush(const QBrush &brush) {
- if (!qbrush_fast_equals(state()->lastBrush, brush) || state()->fillFlags)
+ if (!qbrush_fast_equals(state()->lastBrush, brush) || (brush.style() != Qt::NoBrush && state()->fillFlags))
updateBrush(brush);
}
inline void ensureBrush() { ensureBrush(state()->brush); }
inline void ensurePen(const QPen &pen) {
- if (!qpen_fast_equals(state()->lastPen, pen) || state()->strokeFlags)
+ if (!qpen_fast_equals(state()->lastPen, pen) || (pen.style() != Qt::NoPen && state()->strokeFlags))
updatePen(pen);
}
inline void ensurePen() { ensurePen(state()->pen); }
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index b61821d..faf5a37 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -418,13 +418,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
} else if (style == Qt::NoPen) {
d->activeStroker = 0;
} else {
- // ### re-enable...
- if (pen.isCosmetic()) {
- d->dasher.setClipRect(d->exDeviceRect);
- } else {
- QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect));
- d->dasher.setClipRect(clipRect);
- }
d->dasher.setDashPattern(pen.dashPattern());
d->dasher.setDashOffset(pen.dashOffset());
d->activeStroker = &d->dasher;
@@ -435,6 +428,15 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
return;
}
+ if (pen.style() > Qt::SolidLine) {
+ if (pen.isCosmetic()) {
+ d->activeStroker->setClipRect(d->exDeviceRect);
+ } else {
+ QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect));
+ d->activeStroker->setClipRect(clipRect);
+ }
+ }
+
const QPainterPath::ElementType *types = path.elements();
const qreal *points = path.points();
int pointCount = path.elementCount();
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 4f675ae..4338a5f 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1376,9 +1376,6 @@ void QPainterPrivate::updateState(QPainterState *newState)
opacity with non-smooth transformation mode
(\c QPainter::SmoothPixmapTransform not enabled as a render hint).
- \o Text drawing with regular font sizes with simple
- transformations with solid colors using no or 8-bit antialiasing.
-
\o Rectangle fills with solid color, two-color linear gradients
and simple transforms.
@@ -1986,9 +1983,14 @@ QPaintEngine *QPainter::paintEngine() const
/*!
\since 4.6
- Flushes the painting pipeline and prepares for the user issuing
- commands directly to the underlying graphics context. Must be
- followed by a call to endNativePainting().
+ Flushes the painting pipeline and prepares for the user issuing commands
+ directly to the underlying graphics context. Must be followed by a call to
+ endNativePainting().
+
+ Note that only the states the underlying paint engine changes will be reset
+ to their respective default states. If, for example, the OpenGL polygon
+ mode is changed by the user inside a beginNativePaint()/endNativePainting()
+ block, it will not be reset to the default state by endNativePainting().
Here is an example that shows intermixing of painter commands
and raw OpenGL commands:
@@ -2012,9 +2014,9 @@ void QPainter::beginNativePainting()
/*!
\since 4.6
- Restores the painter after manually issuing native painting commands.
- Lets the painter restore any native state that it relies on before
- calling any other painter commands.
+ Restores the painter after manually issuing native painting commands. Lets
+ the painter restore any native state that it relies on before calling any
+ other painter commands.
\sa beginNativePainting()
*/
@@ -7502,10 +7504,15 @@ struct QPaintDeviceRedirection
typedef QList<QPaintDeviceRedirection> QPaintDeviceRedirectionList;
Q_GLOBAL_STATIC(QPaintDeviceRedirectionList, globalRedirections)
Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex)
+Q_GLOBAL_STATIC(QAtomicInt, globalRedirectionAtomic)
/*!
\threadsafe
+ \obsolete
+
+ Please use QWidget::render() instead.
+
Redirects all paint commands for the given paint \a device, to the
\a replacement device. The optional point \a offset defines an
offset within the source device.
@@ -7515,9 +7522,10 @@ Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex)
device's painter (if any) before redirecting. Call
restoreRedirected() to restore the previous redirection.
- In general, you'll probably find that calling
- QPixmap::grabWidget() or QPixmap::grabWindow() is an easier
- solution.
+ \warning Making use of redirections in the QPainter API implies
+ that QPainter::begin() and QPaintDevice destructors need to hold
+ a mutex for a short period. This can impact performance. Use of
+ QWidget::render is strongly encouraged.
\sa redirected(), restoreRedirected()
*/
@@ -7549,14 +7557,24 @@ void QPainter::setRedirected(const QPaintDevice *device,
Q_ASSERT(redirections != 0);
*redirections += QPaintDeviceRedirection(device, rdev ? rdev : replacement, offset + roffset,
hadInternalWidgetRedirection ? redirections->size() - 1 : -1);
+ globalRedirectionAtomic()->ref();
}
/*!
\threadsafe
+ \obsolete
+
+ Using QWidget::render() obsoletes the use of this function.
+
Restores the previous redirection for the given \a device after a
call to setRedirected().
+ \warning Making use of redirections in the QPainter API implies
+ that QPainter::begin() and QPaintDevice destructors need to hold
+ a mutex for a short period. This can impact performance. Use of
+ QWidget::render is strongly encouraged.
+
\sa redirected()
*/
void QPainter::restoreRedirected(const QPaintDevice *device)
@@ -7567,6 +7585,7 @@ void QPainter::restoreRedirected(const QPaintDevice *device)
Q_ASSERT(redirections != 0);
for (int i = redirections->size()-1; i >= 0; --i) {
if (redirections->at(i) == device) {
+ globalRedirectionAtomic()->deref();
const int internalWidgetRedirectionIndex = redirections->at(i).internalWidgetRedirectionIndex;
redirections->removeAt(i);
// Restore the internal widget redirection, i.e. remove it from the global
@@ -7588,9 +7607,18 @@ void QPainter::restoreRedirected(const QPaintDevice *device)
/*!
\threadsafe
+ \obsolete
+
+ Using QWidget::render() obsoletes the use of this function.
+
Returns the replacement for given \a device. The optional out
parameter \a offset returns the offset within the replaced device.
+ \warning Making use of redirections in the QPainter API implies
+ that QPainter::begin() and QPaintDevice destructors need to hold
+ a mutex for a short period. This can impact performance. Use of
+ QWidget::render is strongly encouraged.
+
\sa setRedirected(), restoreRedirected()
*/
QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
@@ -7603,6 +7631,9 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
return widgetPrivate->redirected(offset);
}
+ if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
+ return 0;
+
QMutexLocker locker(globalRedirectionsMutex());
QPaintDeviceRedirectionList *redirections = globalRedirections();
Q_ASSERT(redirections != 0);
@@ -7620,6 +7651,9 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
void qt_painter_removePaintDevice(QPaintDevice *dev)
{
+ if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
+ return;
+
QMutex *mutex = 0;
QT_TRY {
mutex = globalRedirectionsMutex();
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index e3a2461..b8bf15e 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -931,14 +931,24 @@ void QPdfEnginePrivate::writeHeader()
void QPdfEnginePrivate::writeInfo()
{
info = addXrefEntry(-1);
- xprintf("<<\n"
- "/Title (%s)\n"
-// "/Author (%s)\n"
- "/Creator (%s)\n"
- "/Producer (Qt " QT_VERSION_STR " (C) 2009 Nokia Corporation and/or its subsidiary(-ies))\n",
- title.toUtf8().constData(),
-// author.toUtf8().constData(),
- creator.toUtf8().constData());
+
+ // The 'text string' type in PDF is encoded either as PDFDocEncoding, or
+ // Unicode UTF-16 with a Unicode byte order mark as the first character
+ // (0xfeff), with the high-order byte first.
+ QByteArray array("<<\n/Title (\xfe\xff");
+ const ushort *utf16Title = title.utf16();
+ for (int i=0; i < title.size(); ++i) {
+ array.append((*(utf16Title + i)) >> 8);
+ array.append((*(utf16Title + i)) & 0xff);
+ }
+ array.append(")\n/Creator (\xfe\xff");
+ const ushort *utf16Creator = creator.utf16();
+ for (int i=0; i < creator.size(); ++i) {
+ array.append((*(utf16Creator + i)) >> 8);
+ array.append((*(utf16Creator + i)) & 0xff);
+ }
+ array.append(")\n/Producer (Qt " QT_VERSION_STR " (C) 2010 Nokia Corporation and/or its subsidiary(-ies))\n");
+ write(array);
QDateTime now = QDateTime::currentDateTime().toUTC();
QTime t = now.time();
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index b8eaead..b41dc2c 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -145,10 +145,12 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget)
void QS60WindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &)
{
- const QVector<QRect> subRects = region.rects();
- for (int i = 0; i < subRects.count(); ++i) {
- TRect tr = qt_QRect2TRect(subRects[i]);
+ QWExtra *extra = widget->d_func()->extraData();
+ if (extra && !extra->inExpose) {
+ extra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again
+ TRect tr = qt_QRect2TRect(region.boundingRect());
widget->winId()->DrawNow(tr);
+ extra->inExpose = false;
}
}
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index abb9e1e..b5f052b 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1106,8 +1106,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
// ### Note: Ubuntulooks breaks when the proper widget is passed
// Murrine engine requires a widget not to get RGBA check - warnings
GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
- gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton"));
-
+ QString key(QLS("radiobutton"));
+ if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag
+ key += QLatin1Char('f');
+ GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+ }
+ gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, key);
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
}
break;
@@ -1128,6 +1134,11 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
int spacing;
GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
+ QString key(QLS("checkbutton"));
+ if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag
+ key += QLatin1Char('f');
+ GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+ }
// Some styles such as aero-clone assume they can paint in the spacing area
gtkPainter.setClipRect(option->rect);
@@ -1137,7 +1148,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing);
gtkPainter.paintCheckbox(gtkCheckButton, checkRect, state, shadow, gtkCheckButton->style,
- QLS("checkbutton"));
+ key);
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+
}
break;
@@ -1377,7 +1391,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else {
gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect,
option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
- GTK_SHADOW_NONE, gtkCombo->style, entryPath + QString::number(focus));
+ GTK_SHADOW_NONE, gtkEntry->style, entryPath + QString::number(focus));
}
gtkCachedPainter.paintShadow(gtkEntry, comboBox->editable ? "entry" : "frame", frameRect, frameState,
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 97d69b2..7a680f2 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -667,32 +667,47 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
switch (ct) {
case QStyle::CT_PushButton: {
- const QPushButton *psh = static_cast<const QPushButton *>(widg);
- QString buttonText = qt_mac_removeMnemonics(psh->text());
- if (buttonText.contains(QLatin1Char('\n')))
- ret = QSize(-1, -1);
- else if (sz == QAquaSizeLarge)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
- else if (sz == QAquaSizeSmall)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
- else if (sz == QAquaSizeMini)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
-
- if (!psh->icon().isNull()){
- // If the button got an icon, and the icon is larger than the
- // button, we can't decide on a default size
- ret.setWidth(-1);
- if (ret.height() < psh->iconSize().height())
- ret.setHeight(-1);
- }
- else if (buttonText == QLatin1String("OK") || buttonText == QLatin1String("Cancel")){
- // Aqua Style guidelines restrict the size of OK and Cancel buttons to 68 pixels.
- // However, this doesn't work for German, therefore only do it for English,
- // I suppose it would be better to do some sort of lookups for languages
- // that like to have really long words.
- ret.setWidth(77 - 8);
- }
-
+ const QPushButton *psh = qobject_cast<const QPushButton *>(widg);
+ // If this comparison is false, then the widget was not a push button.
+ // This is bad and there's very little we can do since we were requested to find a
+ // sensible size for a widget that pretends to be a QPushButton but is not.
+ if(psh) {
+ QString buttonText = qt_mac_removeMnemonics(psh->text());
+ if (buttonText.contains(QLatin1Char('\n')))
+ ret = QSize(-1, -1);
+ else if (sz == QAquaSizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
+ else if (sz == QAquaSizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
+ else if (sz == QAquaSizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
+
+ if (!psh->icon().isNull()){
+ // If the button got an icon, and the icon is larger than the
+ // button, we can't decide on a default size
+ ret.setWidth(-1);
+ if (ret.height() < psh->iconSize().height())
+ ret.setHeight(-1);
+ }
+ else if (buttonText == QLatin1String("OK") || buttonText == QLatin1String("Cancel")){
+ // Aqua Style guidelines restrict the size of OK and Cancel buttons to 68 pixels.
+ // However, this doesn't work for German, therefore only do it for English,
+ // I suppose it would be better to do some sort of lookups for languages
+ // that like to have really long words.
+ ret.setWidth(77 - 8);
+ }
+ } else {
+ // The only sensible thing to do is to return whatever the style suggests...
+ if (sz == QAquaSizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
+ else if (sz == QAquaSizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
+ else if (sz == QAquaSizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
+ else
+ // Since there's no default size we return the large size...
+ ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
+ }
#if 0 //Not sure we are applying the rules correctly for RadioButtons/CheckBoxes --Sam
} else if (ct == QStyle::CT_RadioButton) {
QRadioButton *rdo = static_cast<QRadioButton *>(widg);
@@ -749,23 +764,30 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
if (sz == QAquaSizeSmall) {
int width = 0, height = 0;
if (szHint == QSize(-1, -1)) { //just 'guess'..
- const QToolButton *bt = static_cast<const QToolButton *>(widg);
- if (!bt->icon().isNull()) {
- QSize iconSize = bt->iconSize();
- QSize pmSize = bt->icon().actualSize(QSize(32, 32), QIcon::Normal);
- width = qMax(width, qMax(iconSize.width(), pmSize.width()));
- height = qMax(height, qMax(iconSize.height(), pmSize.height()));
- }
- if (!bt->text().isNull() && bt->toolButtonStyle() != Qt::ToolButtonIconOnly) {
- int text_width = bt->fontMetrics().width(bt->text()),
- text_height = bt->fontMetrics().height();
- if (bt->toolButtonStyle() == Qt::ToolButtonTextUnderIcon) {
- width = qMax(width, text_width);
- height += text_height;
- } else {
- width += text_width;
- width = qMax(height, text_height);
+ const QToolButton *bt = qobject_cast<const QToolButton *>(widg);
+ // If this conversion fails then the widget was not what it claimed to be.
+ if(bt) {
+ if (!bt->icon().isNull()) {
+ QSize iconSize = bt->iconSize();
+ QSize pmSize = bt->icon().actualSize(QSize(32, 32), QIcon::Normal);
+ width = qMax(width, qMax(iconSize.width(), pmSize.width()));
+ height = qMax(height, qMax(iconSize.height(), pmSize.height()));
+ }
+ if (!bt->text().isNull() && bt->toolButtonStyle() != Qt::ToolButtonIconOnly) {
+ int text_width = bt->fontMetrics().width(bt->text()),
+ text_height = bt->fontMetrics().height();
+ if (bt->toolButtonStyle() == Qt::ToolButtonTextUnderIcon) {
+ width = qMax(width, text_width);
+ height += text_height;
+ } else {
+ width += text_width;
+ width = qMax(height, text_height);
+ }
}
+ } else {
+ // Let's return the size hint...
+ width = szHint.width();
+ height = szHint.height();
}
} else {
width = szHint.width();
@@ -778,37 +800,47 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
break;
case QStyle::CT_Slider: {
int w = -1;
- const QSlider *sld = static_cast<const QSlider *>(widg);
- if (sz == QAquaSizeLarge) {
- if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
- } else {
- w = qt_mac_aqua_get_metric(kThemeMetricVSliderWidth);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricVSliderTickWidth);
- }
- } else if (sz == QAquaSizeSmall) {
- if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricSmallHSliderHeight);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricSmallHSliderTickHeight);
- } else {
- w = qt_mac_aqua_get_metric(kThemeMetricSmallVSliderWidth);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricSmallVSliderTickWidth);
- }
- } else if (sz == QAquaSizeMini) {
- if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricMiniHSliderHeight);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricMiniHSliderTickHeight);
- } else {
- w = qt_mac_aqua_get_metric(kThemeMetricMiniVSliderWidth);
- if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricMiniVSliderTickWidth);
+ const QSlider *sld = qobject_cast<const QSlider *>(widg);
+ // If this conversion fails then the widget was not what it claimed to be.
+ if(sld) {
+ if (sz == QAquaSizeLarge) {
+ if (sld->orientation() == Qt::Horizontal) {
+ w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
+ } else {
+ w = qt_mac_aqua_get_metric(kThemeMetricVSliderWidth);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricVSliderTickWidth);
+ }
+ } else if (sz == QAquaSizeSmall) {
+ if (sld->orientation() == Qt::Horizontal) {
+ w = qt_mac_aqua_get_metric(kThemeMetricSmallHSliderHeight);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricSmallHSliderTickHeight);
+ } else {
+ w = qt_mac_aqua_get_metric(kThemeMetricSmallVSliderWidth);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricSmallVSliderTickWidth);
+ }
+ } else if (sz == QAquaSizeMini) {
+ if (sld->orientation() == Qt::Horizontal) {
+ w = qt_mac_aqua_get_metric(kThemeMetricMiniHSliderHeight);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricMiniHSliderTickHeight);
+ } else {
+ w = qt_mac_aqua_get_metric(kThemeMetricMiniVSliderWidth);
+ if (sld->tickPosition() != QSlider::NoTicks)
+ w += qt_mac_aqua_get_metric(kThemeMetricMiniVSliderTickWidth);
+ }
}
+ } else {
+ // This is tricky, we were requested to find a size for a slider which is not
+ // a slider. We don't know if this is vertical or horizontal or if we need to
+ // have tick marks or not.
+ // For this case we will return an horizontal slider without tick marks.
+ w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
+ w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
}
if (sld->orientation() == Qt::Horizontal)
ret.setHeight(w);
@@ -4309,8 +4341,6 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
rect.setY(0);
rect.setHeight(widget->height());
}
- if (opt->direction == Qt::RightToLeft)
- rect.adjust(15, 0, -20, 0);
}
break;
case SE_ProgressBarGroove:
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index ca0b8c7..9b99161 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -68,6 +68,10 @@
#include "qtoolbutton.h"
#include "qfocusframe.h"
#include "qformlayout.h"
+#include "qradiobutton.h"
+#include "qcheckbox.h"
+#include "qdesktopwidget.h"
+#include "qprogressbar.h"
#include "private/qtoolbarextension_p.h"
#include "private/qcombobox_p.h"
@@ -564,9 +568,11 @@ QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part,
const QSize &size, QPainter *painter, SkinElementFlags flags)
{
QPixmap result;
+ const int animationFrame = (flags & SF_Animation) ? currentAnimationFrame(part) : 0;
+
const QString cacheKey =
- QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4")
- .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
+ QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4 AnimationFrame=%5")
+ .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags).arg(animationFrame);
if (!QPixmapCache::find(cacheKey, result)) {
result = QS60StylePrivate::part(part, size, painter, flags);
QPixmapCache::insert(cacheKey, result);
@@ -672,8 +678,7 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const
s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0));
// set background image as a texture brush
palette->setBrush(QPalette::Window, backgroundTexture());
- // set these as transparent so that styled full screen theme background is visible
- palette->setColor(QPalette::AlternateBase, Qt::transparent);
+ // set as transparent so that styled full screen theme background is visible
palette->setBrush(QPalette::Base, Qt::transparent);
// set button and tooltipbase based on pixel colors
const QColor buttonColor = colorFromFrameGraphics(SF_ButtonNormal);
@@ -685,6 +690,9 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const
palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125));
palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150));
palette->setColor(QPalette::Shadow, Qt::black);
+ QColor alternateBase = palette->light().color();
+ alternateBase.setAlphaF(0.8);
+ palette->setColor(QPalette::AlternateBase, alternateBase);
QApplication::setPalette(*palette); //calling QApplication::setPalette clears palette hash
setThemePaletteHash(palette);
@@ -775,6 +783,11 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
QApplication::setPalette(widgetPalette, "QComboBox");
widgetPalette = *palette;
+ widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 7, 0));
+ QApplication::setPalette(widgetPalette, "QRadioButton");
+ QApplication::setPalette(widgetPalette, "QCheckBox");
+ widgetPalette = *palette;
+
widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor);
widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button));
widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker());
@@ -813,13 +826,13 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag
//ratio of 1:2 for horizontal tab bars (and 2:1 for vertical ones).
result.setWidth(result.height() >> 1);
break;
-
+
case QS60StyleEnums::SP_QgnGrafNsliderEndLeft:
case QS60StyleEnums::SP_QgnGrafNsliderEndRight:
case QS60StyleEnums::SP_QgnGrafNsliderMiddle:
result.setWidth(result.height() >> 1);
break;
-
+
case QS60StyleEnums::SP_QgnGrafNsliderMarker:
case QS60StyleEnums::SP_QgnGrafNsliderMarkerSelected:
result.scale(pixelMetric(QStyle::PM_SliderLength),
@@ -922,10 +935,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical;
QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags);
- const QStyle::SubControls subControls = optionSlider->subControls;
+ const SubControls subControls = optionSlider->subControls;
// select correct slider (horizontal/vertical/pressed)
- const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider));
+ const bool sliderPressed = ((optionSlider->state & State_Sunken) && (subControls & SC_ScrollBarSlider));
const QS60StylePrivate::SkinElements handleElement =
horizontal ?
( sliderPressed ?
@@ -946,13 +959,13 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
const bool horizontal = optionSlider->orientation == Qt::Horizontal;
//Highlight
-/* if (optionSlider->state & QStyle::State_HasFocus)
+/* if (optionSlider->state & State_HasFocus)
drawPrimitive(PE_FrameFocusRect, optionSlider, painter, widget);*/
-
+
//Groove graphics
if (QS60StylePrivate::hasSliderGrooveGraphic()) {
- const QS60StylePrivate::SkinElements grooveElement = horizontal ?
- QS60StylePrivate::SE_SliderGrooveHorizontal :
+ const QS60StylePrivate::SkinElements grooveElement = horizontal ?
+ QS60StylePrivate::SE_SliderGrooveHorizontal :
QS60StylePrivate::SE_SliderGrooveVertical;
QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
} else {
@@ -972,10 +985,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
//Handle graphics
const QRect sliderHandle = subControlRect(control, optionSlider, SC_SliderHandle, widget);
QS60StylePrivate::SkinElements handleElement;
- if (optionSlider->state & QStyle::State_Sunken)
+ if (optionSlider->state & State_Sunken)
handleElement =
horizontal ? QS60StylePrivate::SE_SliderHandleSelectedHorizontal : QS60StylePrivate::SE_SliderHandleSelectedVertical;
- else
+ else
handleElement =
horizontal ? QS60StylePrivate::SE_SliderHandleHorizontal : QS60StylePrivate::SE_SliderHandleVertical;
QS60StylePrivate::drawSkinElement(handleElement, painter, sliderHandle, flags);
@@ -994,7 +1007,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
buttonOption.QStyleOption::operator=(*cmb);
const int maxHeight = cmbxFrame.height();
const int maxWidth = cmbxFrame.width() - cmbxEditField.width();
- const int topLeftPoint = direction ?
+ const int topLeftPoint = direction ?
(cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxWidth);
const QRect buttonRect(topLeftPoint, cmbxEditField.top(), maxWidth, maxHeight);
buttonOption.rect = buttonRect;
@@ -1020,102 +1033,62 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
#ifndef QT_NO_TOOLBUTTON
case CC_ToolButton:
if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
- const State bflags = toolBtn->state;
+ State bflags = toolBtn->state & ~State_Sunken;
+
+ if (bflags & State_AutoRaise) {
+ if (!(bflags & State_MouseOver) || !(bflags & State_Enabled)) {
+ bflags &= ~State_Raised;
+ }
+ }
+ State mflags = bflags;
+ if (toolBtn->state & State_Sunken) {
+ if (toolBtn->activeSubControls & SC_ToolButton)
+ bflags |= State_Sunken;
+ mflags |= State_Sunken;
+ }
+
const QRect button(subControlRect(control, toolBtn, SC_ToolButton, widget));
QRect menuRect = QRect();
if (toolBtn->subControls & SC_ToolButtonMenu)
menuRect = subControlRect(control, toolBtn, SC_ToolButtonMenu, widget);
- QStyleOptionToolButton toolButton = *toolBtn;
-
- if (sub&SC_ToolButton) {
+ if (toolBtn->subControls & SC_ToolButton) {
QStyleOption tool(0);
tool.palette = toolBtn->palette;
- // Check if toolbutton is in toolbar.
- QToolBar *toolBar = 0;
- if (widget)
- toolBar = qobject_cast<QToolBar *>(widget->parentWidget());
-
- if (bflags & (State_Sunken | State_On | State_Raised)) {
+ if (bflags & (State_Sunken | State_On | State_Raised | State_Enabled)) {
tool.rect = button.unite(menuRect);
tool.state = bflags;
-
- // todo: I'd like to move extension button next to where last button is
- // however, the painter seems to want to clip the button rect even if I turn of the clipping.
- if (toolBar && (qobject_cast<const QToolBarExtension *>(widget))){
- /*QList<QAction *> actionList = toolBar->actions();
- const int actionCount = actionList.count();
- const int toolbarWidth = toolBar->width();
- const int extButtonWidth = pixelMetric(PM_ToolBarExtensionExtent, option, widget);
- const int toolBarButtonWidth = pixelMetric(PM_ToolBarIconSize, option, widget);
- const int frame = pixelMetric(PM_ToolBarFrameWidth, option, widget);
- const int margin = pixelMetric(PM_ToolBarItemMargin, option, widget);
- const int border = frame + margin;
- const int spacing = pixelMetric(PM_ToolBarItemSpacing, option, widget);
- const int toolBarButtonArea = toolbarWidth - extButtonWidth - spacing - 2*border;
- const int numberOfVisibleButtons = toolBarButtonArea / toolBarButtonWidth;
- // new extension button place is after border and all the other visible buttons (with spacings)
- const int newXForExtensionButton = numberOfVisibleButtons * toolBarButtonWidth + (numberOfVisibleButtons-1)*spacing + border;
- painter->save();
- painter->setClipping(false);
- tool.rect.translate(-newXForExtensionButton,0);
- painter->restore();*/
- }
-
- if (toolBar){
- /*if (toolBar->orientation() == Qt::Vertical){
- // todo: I'd like to make all vertical buttons the same size, but again the painter
- // prefers to use clipping for button rects, even though clipping has been set off.
- painter->save();
- painter->setClipping(false);
-
- const int origWidth = tool.rect.width();
- const int newWidth = toolBar->width()-2*pixelMetric(PM_ToolBarFrameWidth, option, widget);
- painter->translate(origWidth-newWidth,0);
- tool.rect.translate(origWidth-tool.rect.width(),0);
- tool.rect.setWidth(newWidth);
-
- if (option->state & QStyle::State_Sunken)
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButtonPressed, painter, tool.rect, flags);
- else
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButton, painter, tool.rect, flags);
-
- }*/
- if (option->state & QStyle::State_Sunken)
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButtonPressed, painter, tool.rect, flags);
- else
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButton, painter, tool.rect, flags);
- /*
- if (toolBar->orientation() == Qt::Vertical)
- painter->restore();
- */
- } else {
- drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
- }
-
- if (toolButton.subControls & SC_ToolButtonMenu) {
- tool.rect = menuRect;
- tool.state = bflags;
- drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
- }
+ const QToolButton *toolButtonWidget = qobject_cast<const QToolButton *>(widget);
+ QS60StylePrivate::SkinElements element;
+ if (toolButtonWidget)
+ element = (toolButtonWidget->isDown()) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
+ else
+ element = (option->state & State_Sunken) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
+ QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
+ drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
+ }
+ if (toolBtn->subControls & SC_ToolButtonMenu) {
+ tool.rect = menuRect;
+ tool.state = mflags;
+ drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
}
}
-
+ QStyleOptionToolButton toolButton = *toolBtn;
if (toolBtn->features & QStyleOptionToolButton::Arrow) {
- QStyle::PrimitiveElement pe;
+ PrimitiveElement pe;
switch (toolBtn->arrowType) {
case Qt::LeftArrow:
- pe = QStyle::PE_IndicatorArrowLeft;
+ pe = PE_IndicatorArrowLeft;
break;
case Qt::RightArrow:
- pe = QStyle::PE_IndicatorArrowRight;
+ pe = PE_IndicatorArrowRight;
break;
case Qt::UpArrow:
- pe = QStyle::PE_IndicatorArrowUp;
+ pe = PE_IndicatorArrowUp;
break;
case Qt::DownArrow:
- pe = QStyle::PE_IndicatorArrowDown;
+ pe = PE_IndicatorArrowDown;
break;
default:
break; }
@@ -1199,7 +1172,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Draw frame
const QRect textRect = subControlRect(CC_GroupBox, option, SC_GroupBoxLabel, widget);
const QRect checkBoxRect = subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget);
- if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
+ if (groupBox->subControls & SC_GroupBoxFrame) {
QStyleOptionFrameV2 frame;
frame.QStyleOption::operator=(*groupBox);
frame.features = groupBox->features;
@@ -1210,14 +1183,14 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
}
// Draw title
- if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
+ if ((groupBox->subControls & SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
const QColor textColor = groupBox->textColor;
painter->save();
if (textColor.isValid())
painter->setPen(textColor);
int alignment = int(groupBox->textAlignment);
- if (!styleHint(QStyle::SH_UnderlineShortcut, option, widget))
+ if (!styleHint(SH_UnderlineShortcut, option, widget))
alignment |= Qt::TextHideMnemonic;
drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | Qt::AlignVCenter | alignment,
@@ -1249,6 +1222,31 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
Q_D(const QS60Style);
const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
switch (element) {
+ case CE_CheckBox:
+ case CE_RadioButton:
+ if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ bool isRadio = (element == CE_RadioButton);
+ // Highlight needs to be drawn first, as it goes "underneath" the text and indicator.
+ if (btn->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*btn);
+ fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect
+ : SE_CheckBoxFocusRect, btn, widget);
+ drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
+ QStyleOptionButton subopt = *btn;
+
+ subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator
+ : SE_CheckBoxIndicator, btn, widget);
+ drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox,
+ &subopt, painter, widget);
+ subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents
+ : SE_CheckBoxContents, btn, widget);
+
+ drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget);
+ }
+ break;
+
case CE_PushButton:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
@@ -1261,13 +1259,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
break;
case CE_PushButtonBevel:
if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- const bool isDisabled = !(option->state & QStyle::State_Enabled);
+ const bool isDisabled = !(option->state & State_Enabled);
const bool isFlat = button->features & QStyleOptionButton::Flat;
QS60StyleEnums::SkinParts skinPart;
QS60StylePrivate::SkinElements skinElement;
if (!isDisabled) {
- const bool isPressed = (option->state & QStyle::State_Sunken) ||
- (option->state & QStyle::State_On);
+ const bool isPressed = (option->state & State_Sunken) ||
+ (option->state & State_On);
if (isFlat) {
skinPart =
isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter;
@@ -1292,7 +1290,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
QStyleOptionToolButton optionToolButton = *toolBtn;
- if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
+ if (!optionToolButton.icon.isNull() && (optionToolButton.state & State_Sunken)
&& (optionToolButton.state & State_Enabled)) {
const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off;
@@ -1351,8 +1349,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
painter->save();
painter->setClipRect(voptAdj.rect);
- const bool isSelected = (vopt->state & QStyle::State_Selected);
- const bool hasFocus = (vopt->state & QStyle::State_HasFocus);
+ const bool isSelected = (vopt->state & State_Selected);
+ const bool hasFocus = (vopt->state & State_HasFocus);
bool isScrollBarVisible = false;
int scrollBarWidth = 0;
@@ -1426,8 +1424,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
// draw the icon
- const QIcon::Mode mode = (voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
- const QIcon::State state = voptAdj.state & QStyle::State_Open ? QIcon::On : QIcon::Off;
+ const QIcon::Mode mode = (voptAdj.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ const QIcon::State state = voptAdj.state & State_Open ? QIcon::On : QIcon::Off;
voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state);
// Draw selection check mark. Show check mark only in multi selection modes.
@@ -1439,29 +1437,29 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QStyleOptionViewItemV4 checkMarkOption(voptAdj);
// Draw selection mark.
- if (voptAdj.state & QStyle::State_Selected && !singleSelection) {
+ if (voptAdj.state & State_Selected && !singleSelection) {
checkMarkOption.rect = selectionRect;
- drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
+ drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
if ( textRect.right() > selectionRect.left() )
textRect.setRight(selectionRect.left());
} else if (singleSelection &&
voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator &&
selectionRect.isValid()) {
checkMarkOption.rect = selectionRect;
- checkMarkOption.state = checkMarkOption.state & ~QStyle::State_HasFocus;
+ checkMarkOption.state = checkMarkOption.state & ~State_HasFocus;
switch (vopt->checkState) {
case Qt::Unchecked:
- checkMarkOption.state |= QStyle::State_Off;
+ checkMarkOption.state |= State_Off;
break;
case Qt::PartiallyChecked:
- checkMarkOption.state |= QStyle::State_NoChange;
+ checkMarkOption.state |= State_NoChange;
break;
case Qt::Checked:
- checkMarkOption.state |= QStyle::State_On;
+ checkMarkOption.state |= State_On;
break;
}
- drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
+ drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
}
}
@@ -1486,7 +1484,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_TabBarTabShape:
if (const QStyleOptionTabV3 *optionTab = qstyleoption_cast<const QStyleOptionTabV3 *>(option)) {
QStyleOptionTabV3 optionTabAdj = *optionTab;
- const bool isSelected = optionTab->state & QStyle::State_Selected;
+ const bool isSelected = optionTab->state & State_Selected;
const bool directionMirrored = (optionTab->direction == Qt::RightToLeft);
QS60StylePrivate::SkinElements skinElement;
switch (optionTab->shape) {
@@ -1521,9 +1519,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
skinElement==QS60StylePrivate::SE_TabBarTabSouthActive||
skinElement==QS60StylePrivate::SE_TabBarTabWestActive) {
const int borderThickness =
- QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
+ QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
const int tabOverlap =
- QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
+ QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap) - borderThickness;
//todo: draw navi wipe behind tabbar - must be drawn with first draw
if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
@@ -1546,9 +1544,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QStyleOptionTabV3 optionTab = *tab;
QRect tr = optionTab.rect;
const bool directionMirrored = (optionTab.direction == Qt::RightToLeft);
- const int borderThickness = QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
+ const int borderThickness = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
const int tabOverlap =
- QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
+ QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap) - borderThickness;
const QRect windowRect = painter->window();
switch (tab->shape) {
@@ -1602,12 +1600,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
m.rotate(newRotation);
painter->setTransform(m, true);
}
- tr.adjust(0, 0, pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget),
- pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget));
+ tr.adjust(0, 0, pixelMetric(PM_TabBarTabShiftHorizontal, tab, widget),
+ pixelMetric(PM_TabBarTabShiftVertical, tab, widget));
if (selected) {
- tr.setBottom(tr.bottom() - pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget));
- tr.setRight(tr.right() - pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget));
+ tr.setBottom(tr.bottom() - pixelMetric(PM_TabBarTabShiftVertical, tab, widget));
+ tr.setRight(tr.right() - pixelMetric(PM_TabBarTabShiftHorizontal, tab, widget));
}
int alignment = Qt::AlignCenter | Qt::TextShowMnemonic;
@@ -1648,17 +1646,20 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
// busy indicator
const QS60StylePrivate::SkinElementFlag orientationFlag = optionProgressBar->orientation == Qt::Horizontal ?
QS60StylePrivate::SF_PointNorth : QS60StylePrivate::SF_PointWest;
- QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect, flags | orientationFlag);
+
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWaitAnim,
+ painter, progressRect, flags | orientationFlag | QS60StylePrivate::SF_Animation );
} else {
const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0
: (qreal)optionProgressBar->progress / optionProgressBar->maximum;
+ const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
if (optionProgressBar->orientation == Qt::Horizontal) {
progressRect.setWidth(int(progressRect.width() * progressFactor));
if(optionProgressBar->direction == Qt::RightToLeft)
- progressRect.translate(optionProgressBar->rect.width()-progressRect.width(), 0);
- progressRect.adjust(1, 0, -1, 0);
+ progressRect.translate(optionProgressBar->rect.width() - progressRect.width(), 0);
+ progressRect.adjust(frameWidth, 0, -frameWidth, 0);
} else {
- progressRect.adjust(0, 1, 0, -1);
+ progressRect.adjust(0, frameWidth, 0, -frameWidth);
progressRect.setTop(progressRect.bottom() - int(progressRect.height() * progressFactor));
}
@@ -1714,9 +1715,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
//todo: move the vertical spacing stuff into subElementRect
- const int vSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
+ const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
if (checkable){
- const int hSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
+ const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
QStyleOptionMenuItem optionCheckBox;
optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
@@ -1754,7 +1755,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QStyleOptionMenuItem arrowOptions;
arrowOptions.QStyleOption::operator=(*menuItem);
const int indicatorWidth = (pixelMetric(PM_ListViewIconSize, option, widget) >> 1) +
- pixelMetric(QStyle::PM_LayoutVerticalSpacing, option, widget);
+ pixelMetric(PM_LayoutVerticalSpacing, option, widget);
if (optionMenuItem.direction == Qt::LeftToRight)
arrowOptions.rect.setLeft(textRect.right());
arrowOptions.rect.setWidth(indicatorWidth);
@@ -1925,8 +1926,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
break;
case CE_MenuScroller:
break;
- case CE_FocusFrame:
- {
+ case CE_FocusFrame: {
// The pen width should nearly fill the layoutspacings around the widget
const int penWidth =
qMin(pixelMetric(QS60Style::PM_LayoutVerticalSpacing), pixelMetric(QS60Style::PM_LayoutHorizontalSpacing))
@@ -1985,11 +1985,21 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
*/
void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
- Q_D(const QS60Style);
const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
bool commonStyleDraws = false;
switch (element) {
+ case PE_FrameFocusRect: {
+ //Draw themed highlight to radiobuttons and checkboxes.
+ //For other widgets skip, unless palette has been modified. In that case, draw with commonstyle.
+ if (option->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color())
+ if ((qstyleoption_cast<const QStyleOptionFocusRect *>(option) &&
+ (qobject_cast<const QRadioButton *>(widget) || qobject_cast<const QCheckBox *>(widget))))
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
+ else
+ commonStyleDraws = true;
+ }
+ break;
#ifndef QT_NO_LINEEDIT
case PE_PanelLineEdit:
if (const QStyleOptionFrame *lineEdit = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
@@ -2004,15 +2014,14 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
break;
#endif // QT_NO_LINEEDIT
- case PE_IndicatorCheckBox:
- {
+ case PE_IndicatorCheckBox: {
// Draw checkbox indicator as color skinned graphics.
- const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
+ const QS60StyleEnums::SkinParts skinPart = (option->state & State_On) ?
QS60StyleEnums::SP_QgnIndiCheckboxOn : QS60StyleEnums::SP_QgnIndiCheckboxOff;
painter->save();
- QColor themeColor = QS60StylePrivate::themePalette()->windowText().color();
- QColor windowTextColor = option->palette.windowText().color();
+ const QColor themeColor = QS60StylePrivate::themePalette()->windowText().color();
+ const QColor windowTextColor = option->palette.windowText().color();
if (themeColor != windowTextColor)
painter->setPen(windowTextColor);
@@ -2032,7 +2041,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if (checkBoxVisible && singleSelection) {
drawPrimitive(PE_IndicatorCheckBox, option, painter, widget);
// ... or normal "tick" selection at the end.
- } else if (option->state & QStyle::State_Selected) {
+ } else if (option->state & State_Selected) {
QRect tickRect = option->rect;
const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
// adjust tickmark rect to exclude frame border
@@ -2059,15 +2068,15 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
buttonRect.adjust(0, -newY, -1, -newY);
painter->save();
- QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option);
- QColor buttonTextColor = option->palette.buttonText().color();
+ const QColor themeColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option);
+ const QColor buttonTextColor = option->palette.buttonText().color();
if (themeColor != buttonTextColor)
painter->setPen(buttonTextColor);
else
painter->setPen(themeColor);
// Draw radiobutton indicator as color skinned graphics.
- QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
+ QS60StyleEnums::SkinParts skinPart = (option->state & State_On) ?
QS60StyleEnums::SP_QgnIndiRadiobuttOn : QS60StyleEnums::SP_QgnIndiRadiobuttOff;
QS60StylePrivate::drawSkinPart(skinPart, painter, buttonRect,
(flags | QS60StylePrivate::SF_ColorSkinned));
@@ -2077,15 +2086,14 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelButtonCommand:
case PE_PanelButtonTool:
case PE_PanelButtonBevel:
- case PE_FrameButtonBevel: {
+ case PE_FrameButtonBevel:
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) {
- const bool isPressed = option->state & QStyle::State_Sunken;
+ const bool isPressed = option->state & State_Sunken;
const QS60StylePrivate::SkinElements skinElement =
isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
} else {
commonStyleDraws = true;
- }
}
break;
#ifndef QT_NO_TOOLBUTTON
@@ -2207,7 +2215,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
break;
#ifndef QT_NO_ITEMVIEWS
case PE_PanelItemViewItem:
- case PE_PanelItemViewRow: // ### Qt 5: remove
break;
#endif //QT_NO_ITEMVIEWS
@@ -2276,7 +2283,23 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
}
break;
-
+ case PE_PanelItemViewRow: // ### Qt 5: remove
+#ifndef QT_NO_ITEMVIEWS
+ if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
+ if (vopt->palette.base().texture().cacheKey() != QS60StylePrivate::m_themePalette->base().texture().cacheKey()) {
+ //QPalette::Base has been changed, let commonstyle draw the item
+ commonStyleDraws = true;
+ } else {
+ QPalette::ColorGroup cg = vopt->state & State_Enabled ? QPalette::Normal : QPalette::Disabled;
+ if (cg == QPalette::Normal && !(vopt->state & State_Active))
+ cg = QPalette::Inactive;
+ if (vopt->features & QStyleOptionViewItemV2::Alternate)
+ painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase));
+ //apart from alternate base, no background for list item is drawn for S60Style
+ }
+ }
+#endif
+ break;
case PE_PanelScrollAreaCorner:
break;
@@ -2361,8 +2384,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
sz += QSize(2 * f->lineWidth, 4 * f->lineWidth);
break;
- case CT_TabBarTab:
- {
+ case CT_TabBarTab: {
const QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
if (naviPaneSize.height() > sz.height())
@@ -2374,8 +2396,26 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
if (QS60StylePrivate::isTouchSupported())
//Make itemview easier to use in touch devices
//QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- sz.setHeight(sz.height() + 2 * pixelMetric(QStyle::PM_FocusFrameVMargin));
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
break;
+#ifndef QT_NO_COMBOBOX
+ case CT_ComboBox:
+ if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+ const int frameWidth = cmb->frame ? pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0;
+ const int textMargins = 2*(pixelMetric(PM_FocusFrameHMargin) + 1);
+ const int smallestExtraWidth = 23;
+ // QItemDelegate::sizeHint expands the textMargins two times, thus the 2*textMargins...
+ const int extra =
+ qMax(smallestExtraWidth, 2*textMargins + pixelMetric(PM_ScrollBarExtent, opt, widget));
+ sz = QSize(sz.width() + frameWidth + extra, sz.height() + frameWidth);
+ int maxScreenWidth = QApplication::desktop()->availableGeometry().size().width();
+ if (sz.width() > maxScreenWidth) {
+ maxScreenWidth = maxScreenWidth - (extra + frameWidth);
+ sz.setWidth(maxScreenWidth);
+ }
+ }
+ break;
+#endif
default:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
break;
@@ -2414,7 +2454,7 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
retValue = QPalette::Base;
break;
case SH_ItemView_ActivateItemOnSingleClick:
- retValue = true;
+ retValue = QS60StylePrivate::isSingleClickUi();
break;
case SH_ProgressDialog_TextLabelAlignment:
retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ?
@@ -2526,7 +2566,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
const int frameThickness = spinbox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;
const int buttonMargin = spinbox->frame ? 2 : 0;
- const int buttonWidth = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize) + 2 * buttonMargin;
+ const int buttonWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
QSize buttonSize;
buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness));
//width should at least be equal to height
@@ -2575,34 +2615,36 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
ret = cmb->rect;
const int width = cmb->rect.width();
const int height = cmb->rect.height();
- const int buttonIconSize = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize);
+ const int buttonIconSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize);
const int buttonMargin = cmb->frame ? 2 : 0;
// lets use spinbox frame here as well, as no combobox specific value available.
const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0;
const int buttonWidth = qMax(cmb->rect.height(), buttonIconSize);
- const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth;
- const int ypos = cmb->rect.y();
QSize buttonSize;
buttonSize.setWidth(buttonWidth + 2 * buttonMargin);
buttonSize.setHeight(qMax(8, (cmb->rect.height() >> 1) - frameThickness)); //buttons should be squares
buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
switch (scontrol) {
- case SC_ComboBoxArrow:
+ case SC_ComboBoxArrow: {
+ const int xposMod = cmb->rect.x() + width - buttonMargin - buttonWidth;
+ const int ypos = cmb->rect.y();
ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2 * buttonMargin);
+ }
break;
case SC_ComboBoxEditField: {
- const int withFrameX = cmb->rect.x() + cmb->rect.width() - frameThickness - buttonSize.width();
+ const int withFrameX = cmb->rect.x() + width - frameThickness - buttonSize.width();
ret = QRect(
frameThickness,
frameThickness,
withFrameX - frameThickness,
- cmb->rect.height() - 2 * frameThickness);
+ height - 2 * frameThickness);
}
break;
default:
break;
}
+ ret = visualRect(cmb->direction, cmb->rect, ret);
}
break;
case CC_GroupBox:
@@ -2613,7 +2655,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
case SC_GroupBoxLabel: {
//slightly indent text and boxes, so that dialog border does not mess with them.
const int horizontalSpacing =
- QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
+ QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
ret.adjust(2, horizontalSpacing - 3, 0, 0);
}
break;
@@ -2668,6 +2710,9 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
{
QRect ret;
switch (element) {
+ case SE_RadioButtonFocusRect:
+ ret = opt->rect;
+ break;
case SE_LineEditContents: {
// in S60 the input text box doesn't start from line Edit's TL, but
// a bit indented.
@@ -2686,9 +2731,9 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
const int tabOverlapNoBorder =
- QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap);
+ QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap);
const int tabOverlap =
- tabOverlapNoBorder-QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
+ tabOverlapNoBorder-QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
const QTabWidget *tab = qobject_cast<const QTabWidget *>(widget);
int gain = (tab) ? tabOverlap * tab->count() : 0;
switch (twf->shape) {
@@ -2737,8 +2782,8 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
multiSelection &&
(vopt->features & QStyleOptionViewItemV2::HasCheckIndicator)) {
const int verticalSpacing =
- QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
- //const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
+ QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
+ //const int horizontalSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
const int checkBoxRectWidth = subElementRect(SE_ItemViewItemCheckIndicator, opt, widget).width();
ret.adjust(-checkBoxRectWidth - verticalSpacing, 0, -checkBoxRectWidth - verticalSpacing, 0);
}
@@ -2784,9 +2829,9 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
singleSelection;
// Selection check mark rect.
- const int indicatorWidth = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorWidth);
- const int indicatorHeight = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorHeight);
- const int spacing = QS60StylePrivate::pixelMetric(QStyle::PM_CheckBoxLabelSpacing);
+ const int indicatorWidth = QS60StylePrivate::pixelMetric(PM_IndicatorWidth);
+ const int indicatorHeight = QS60StylePrivate::pixelMetric(PM_IndicatorHeight);
+ const int spacing = QS60StylePrivate::pixelMetric(PM_CheckBoxLabelSpacing);
const int itemHeight = opt->rect.height();
int heightOffset = 0;
@@ -2818,6 +2863,25 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
}
ret = visualRect(opt->direction, opt->rect, ret);
break;
+ case SE_RadioButtonIndicator: {
+ const int height = pixelMetric(PM_ExclusiveIndicatorHeight, opt, widget);
+ ret.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - height) >> 1),
+ pixelMetric(PM_ExclusiveIndicatorWidth, opt, widget), height);
+ ret.translate(2, 0); //move indicator slightly to avoid highlight crossing over it
+ ret = visualRect(opt->direction, opt->rect, ret);
+ }
+ break;
+ case SE_CheckBoxIndicator: {
+ const int height = pixelMetric(PM_IndicatorHeight, opt, widget);
+ ret.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - height) >> 1),
+ pixelMetric(PM_IndicatorWidth, opt, widget), height);
+ ret.translate(2, 0); //move indicator slightly to avoid highlight crossing over it
+ ret = visualRect(opt->direction, opt->rect, ret);
+ }
+ break;
+ case SE_CheckBoxFocusRect:
+ ret = opt->rect;
+ break;
default:
ret = QCommonStyle::subElementRect(element, opt, widget);
}
@@ -2835,6 +2899,12 @@ void QS60Style::polish(QWidget *widget)
if (!widget)
return;
+ //Currently we only support animations in QProgressBar.
+#ifndef QT_NO_PROGRESSBAR
+ if (qobject_cast<QProgressBar *>(widget))
+ widget->installEventFilter(this);
+#endif
+
if (false
#ifndef QT_NO_SCROLLBAR
|| qobject_cast<QScrollBar *>(widget)
@@ -2867,6 +2937,8 @@ void QS60Style::polish(QWidget *widget)
*/
void QS60Style::unpolish(QWidget *widget)
{
+ Q_D(QS60Style);
+
if (false
#ifndef QT_NO_SCROLLBAR
|| qobject_cast<QScrollBar *>(widget)
@@ -2893,6 +2965,14 @@ void QS60Style::unpolish(QWidget *widget)
if (widget)
widget->setPalette(QPalette());
+#if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR)
+ if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) {
+ widget->removeEventFilter(this);
+ d->m_bars.removeAll(bar);
+ }
+#else
+ Q_UNUSED(d)
+#endif
QCommonStyle::unpolish(widget);
}
@@ -2924,10 +3004,23 @@ void QS60Style::unpolish(QApplication *application)
bool QS60Style::event(QEvent *e)
{
#ifdef QT_KEYPAD_NAVIGATION
- if (QS60StylePrivate::isTouchSupported())
- return false;
Q_D(QS60Style);
+ const QEvent::Type eventType = e->type();
+ if ((eventType == QEvent::FocusIn ||
+ eventType == QEvent::FocusOut ||
+ eventType == QEvent::EnterEditFocus ||
+ eventType == QEvent::LeaveEditFocus) &&
+ QS60StylePrivate::isTouchSupported())
+ return false;
+#endif
+
switch (e->type()) {
+ case QEvent::Timer: {
+ QTimerEvent *te = static_cast<QTimerEvent*>(e);
+ timerEvent(te);
+ }
+ break;
+#ifdef QT_KEYPAD_NAVIGATION
case QEvent::FocusIn:
if (QWidget *focusWidget = QApplication::focusWidget()) {
if (!d->m_focusFrame)
@@ -2946,12 +3039,10 @@ bool QS60Style::event(QEvent *e)
if (d->m_focusFrame)
d->m_focusFrame->update();
break;
+#endif
default:
break;
}
-#else
- Q_UNUSED(e)
-#endif
return false;
}
@@ -2961,7 +3052,7 @@ bool QS60Style::event(QEvent *e)
QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option, const QWidget *widget) const
{
- const int iconDimension = QS60StylePrivate::pixelMetric(QStyle::PM_ToolBarIconSize);
+ const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize);
const QRect iconSize = (!option) ? QRect(0, 0, iconDimension, iconDimension) : option->rect;
QS60StyleEnums::SkinParts part;
QS60StylePrivate::SkinElementFlags adjustedFlags;
@@ -2971,67 +3062,67 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
QS60StylePrivate::SF_StateDisabled;
switch(standardIcon) {
- case QStyle::SP_MessageBoxWarning:
+ case SP_MessageBoxWarning:
part = QS60StyleEnums::SP_QgnNoteWarning;
break;
- case QStyle::SP_MessageBoxInformation:
+ case SP_MessageBoxInformation:
part = QS60StyleEnums::SP_QgnNoteInfo;
break;
- case QStyle::SP_MessageBoxCritical:
+ case SP_MessageBoxCritical:
part = QS60StyleEnums::SP_QgnNoteError;
break;
- case QStyle::SP_MessageBoxQuestion:
+ case SP_MessageBoxQuestion:
part = QS60StyleEnums::SP_QgnNoteQuery;
break;
- case QStyle::SP_ArrowRight:
+ case SP_ArrowRight:
part = QS60StyleEnums::SP_QgnIndiNaviArrowRight;
break;
- case QStyle::SP_ArrowLeft:
+ case SP_ArrowLeft:
part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
break;
- case QStyle::SP_ArrowUp:
+ case SP_ArrowUp:
part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
adjustedFlags |= QS60StylePrivate::SF_PointEast;
break;
- case QStyle::SP_ArrowDown:
+ case SP_ArrowDown:
part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
adjustedFlags |= QS60StylePrivate::SF_PointWest;
break;
- case QStyle::SP_ArrowBack:
+ case SP_ArrowBack:
if (QApplication::layoutDirection() == Qt::RightToLeft)
return QS60Style::standardIcon(SP_ArrowRight, option, widget);
return QS60Style::standardIcon(SP_ArrowLeft, option, widget);
- case QStyle::SP_ArrowForward:
+ case SP_ArrowForward:
if (QApplication::layoutDirection() == Qt::RightToLeft)
return QS60Style::standardIcon(SP_ArrowLeft, option, widget);
return QS60Style::standardIcon(SP_ArrowRight, option, widget);
- case QStyle::SP_ComputerIcon:
+ case SP_ComputerIcon:
part = QS60StyleEnums::SP_QgnPropPhoneMemcLarge;
break;
- case QStyle::SP_DirClosedIcon:
+ case SP_DirClosedIcon:
part = QS60StyleEnums::SP_QgnPropFolderSmall;
break;
- case QStyle::SP_DirOpenIcon:
+ case SP_DirOpenIcon:
part = QS60StyleEnums::SP_QgnPropFolderCurrent;
break;
- case QStyle::SP_DirIcon:
+ case SP_DirIcon:
part = QS60StyleEnums::SP_QgnPropFolderSmall;
break;
- case QStyle::SP_FileDialogNewFolder:
+ case SP_FileDialogNewFolder:
part = QS60StyleEnums::SP_QgnPropFolderSmallNew;
break;
- case QStyle::SP_FileIcon:
+ case SP_FileIcon:
part = QS60StyleEnums::SP_QgnPropFileSmall;
break;
- case QStyle::SP_TrashIcon:
+ case SP_TrashIcon:
part = QS60StyleEnums::SP_QgnNoteErased;
break;
- case QStyle::SP_ToolBarHorizontalExtensionButton:
+ case SP_ToolBarHorizontalExtensionButton:
part = QS60StyleEnums::SP_QgnIndiSubMenu;
if (QApplication::layoutDirection() == Qt::RightToLeft)
adjustedFlags |= QS60StylePrivate::SF_PointSouth;
break;
- case QStyle::SP_ToolBarVerticalExtensionButton:
+ case SP_ToolBarVerticalExtensionButton:
adjustedFlags |= QS60StylePrivate::SF_PointEast;
part = QS60StyleEnums::SP_QgnIndiSubMenu;
break;
@@ -3045,6 +3136,72 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap);
}
+/*!
+ \internal
+ Animate indeterminate progress bars only when visible
+*/
+bool QS60Style::eventFilter(QObject *object, QEvent *event)
+{
+#ifdef Q_WS_S60
+#ifndef QT_NO_PROGRESSBAR
+ Q_D(QS60Style);
+ switch(event->type()) {
+ case QEvent::StyleChange:
+ case QEvent::Show:
+ if (QProgressBar *bar = qobject_cast<QProgressBar *>(object)) {
+ if (!d->m_bars.contains(bar))
+ d->m_bars << bar;
+ if (d->m_bars.size() == 1) //only start with first animated progressbar
+ d->startAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
+ }
+ break;
+ case QEvent::Destroy:
+ case QEvent::Hide:
+ d->stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
+ d->m_bars.removeAll(reinterpret_cast<QProgressBar *>(object));
+ break;
+ default:
+ break;
+ }
+#endif // QT_NO_PROGRESSBAR
+#endif // Q_WS_S60
+ return QStyle::eventFilter(object, event);
+}
+
+/*!
+ \internal
+ Handle the timer \a event.
+*/
+void QS60Style::timerEvent(QTimerEvent *event)
+{
+#ifdef Q_WS_S60
+#ifndef QT_NO_PROGRESSBAR
+ Q_D(QS60Style);
+
+ QS60StyleAnimation *progressBarAnimation =
+ QS60StylePrivate::animationDefinition(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
+
+ if (event->timerId() == progressBarAnimation->timerId()) {
+
+ Q_ASSERT(progressBarAnimation->interval() > 0);
+
+ if (progressBarAnimation->currentFrame() == progressBarAnimation->frameCount() )
+ if (progressBarAnimation->playMode() == QS60StyleEnums::AM_Looping)
+ progressBarAnimation->setCurrentFrame(0);
+ else
+ d->stopAnimation(progressBarAnimation->animationId());
+
+ foreach (QProgressBar *bar, d->m_bars) {
+ if ((bar->minimum() == 0 && bar->maximum() == 0))
+ bar->update();
+ }
+ progressBarAnimation->setCurrentFrame(progressBarAnimation->currentFrame() + 1);
+ }
+#endif // QT_NO_PROGRESSBAR
+#endif // Q_WS_S60
+ event->ignore();
+}
+
extern QPoint qt_s60_fill_background_offset(const QWidget *targetWidget);
bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush)
@@ -3056,11 +3213,13 @@ bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QBrush
const QPaintDevice *target = painter->device();
if (target->devType() == QInternal::Widget) {
const QWidget *widget = static_cast<const QWidget *>(target);
- const QVector<QRect> &rects = rgn.rects();
- for (int i = 0; i < rects.size(); ++i) {
- const QRect rect(rects.at(i));
- painter->drawPixmap(rect.topLeft(), backgroundTexture,
- rect.translated(qt_s60_fill_background_offset(widget)));
+ if (!widget->testAttribute(Qt::WA_TranslucentBackground)) {
+ const QVector<QRect> &rects = rgn.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ const QRect rect(rects.at(i));
+ painter->drawPixmap(rect.topLeft(), backgroundTexture,
+ rect.translated(qt_s60_fill_background_offset(widget)));
+ }
}
}
return true;
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index adcb313..82cc21c 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -94,6 +94,9 @@ protected Q_SLOTS:
QIcon standardIconImplementation(
StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const;
+protected:
+ void timerEvent(QTimerEvent *event);
+ bool eventFilter(QObject *o, QEvent *e);
private:
Q_DISABLE_COPY(QS60Style)
friend class QStyleFactory;
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 1417552..eae2291 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -74,7 +74,6 @@ typedef struct {
unsigned short width;
int major_version;
int minor_version;
- bool mirroring; // TODO: (nice to have) Use Qt::LayoutDirection
const char* layoutName;
} layoutHeader;
@@ -93,6 +92,29 @@ class QS60StyleEnums
#endif // !Q_WS_S60
public:
+
+ // S60 definitions within theme
+ enum ThemeDefinitions {
+ TD_AnimationData,
+ };
+
+ //Defines which values are contained within animation data (retrieved using TD_AnimationData).
+ //Additionally defines the order in which the items are given out in QList<QVariant>.
+ enum AnimationData {
+ AD_Interval = 0,
+ AD_NumberOfFrames,
+ AD_AnimationPlayMode, //currently not used as themes seem to contain invalid data
+ };
+
+ // Animation modes
+ enum AnimationMode {
+ AM_PlayOnce = 0, //animation is played exactly once
+ AM_Looping, //animation is repeated until stopped
+ AM_Bounce //animation is played repeatedly until stopped,
+ //but frames are played in reverse order every second time
+ //(no support yet)
+ };
+
// S60 look-and-feel font categories
enum FontCategories {
FC_Undefined,
@@ -104,7 +126,7 @@ public:
};
enum SkinParts {
- SP_QgnGrafBarWait,
+ SP_QgnGrafBarWaitAnim,
SP_QgnGrafBarFrameCenter,
SP_QgnGrafBarFrameSideL,
SP_QgnGrafBarFrameSideR,
@@ -287,7 +309,70 @@ public:
};
};
+#ifdef Q_WS_S60
+class CAknBitmapAnimation;
+NONSHARABLE_CLASS (AnimationData) : public QObject
+{
+public:
+ AnimationData(const QS60StyleEnums::SkinParts part, int frames, int interval);
+
+ const QS60StyleEnums::SkinParts m_id;
+ int m_frames;
+ int m_interval;
+ QS60StyleEnums::AnimationMode m_mode;
+};
+
+
+NONSHARABLE_CLASS (AnimationDataV2) : public AnimationData
+{
+public:
+ AnimationDataV2(const AnimationData &data);
+ ~AnimationDataV2();
+
+ CAknBitmapAnimation *m_animation;
+ int m_currentFrame;
+ bool m_resourceBased;
+ int m_timerId;
+};
+
+
+class QS60StyleAnimation : public QObject
+{
+public:
+ QS60StyleAnimation(const QS60StyleEnums::SkinParts part, int frames, int interval);
+ ~QS60StyleAnimation();
+
+public:
+ QS60StyleEnums::SkinParts animationId() const {return m_currentData->m_id;}
+ int frameCount() const { return m_currentData->m_frames;}
+ int interval() const {return m_currentData->m_interval;}
+ QS60StyleEnums::AnimationMode playMode() const {return m_currentData->m_mode;}
+ CAknBitmapAnimation* animationObject() const {return m_currentData->m_animation;}
+ bool isResourceBased() const {return m_currentData->m_resourceBased;}
+ int timerId() const {return m_currentData->m_timerId;}
+ int currentFrame() const {return m_currentData->m_currentFrame;}
+
+ void setFrameCount(int frameCount) {m_currentData->m_frames = frameCount;}
+ void setInterval(int interval) {m_currentData->m_interval = interval;}
+ void setAnimationObject(CAknBitmapAnimation* animation);
+ void setResourceBased(bool resourceBased) {m_currentData->m_resourceBased = resourceBased;}
+ void setTimerId(int timerId) {m_currentData->m_timerId = timerId;}
+ void setCurrentFrame(int currentFrame) {m_currentData->m_currentFrame = currentFrame;}
+
+ void resetToDefaults();
+
+private: //data members
+ //TODO: consider changing these to non-pointers as the classes are rather small anyway
+ AnimationData *m_defaultData;
+ AnimationDataV2 *m_currentData;
+};
+
+#endif //Q_WS_S60
+
+
class QFocusFrame;
+class QProgressBar;
+class QS60StyleAnimation;
// Private class
#ifdef Q_OS_SYMBIAN
@@ -371,6 +456,7 @@ public:
SF_StateEnabled = 0x0010, // Enabled = the default
SF_StateDisabled = 0x0020,
SF_ColorSkinned = 0x0040, // pixmap is colored with foreground pen color
+ SF_Animation = 0x0080,
};
enum CacheClearReason {
@@ -412,6 +498,7 @@ public:
static bool isTouchSupported();
static bool isToolBarBackground();
static bool hasSliderGrooveGraphic();
+ static bool isSingleClickUi();
// calculates average color based on button skin graphics (minus borders).
QColor colorFromFrameGraphics(SkinFrameElements frame) const;
@@ -455,6 +542,16 @@ public:
//so that theme graphic background can be drawn.
static bool canDrawThemeBackground(const QBrush &backgroundBrush);
+ static int currentAnimationFrame(QS60StyleEnums::SkinParts part);
+#ifdef Q_WS_S60
+
+ //No support for animations on emulated style
+ void startAnimation(QS60StyleEnums::SkinParts animation);
+ void stopAnimation(QS60StyleEnums::SkinParts animation);
+ static QS60StyleAnimation* animationDefinition(QS60StyleEnums::SkinParts part);
+
+#endif
+
private:
static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter,
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
@@ -497,6 +594,12 @@ private:
QPalette m_originalPalette;
QPointer<QFocusFrame> m_focusFrame;
+
+#ifdef Q_WS_S60
+ //list of progress bars having animation running
+ QList<QProgressBar *> m_bars;
+#endif
+
};
QT_END_NAMESPACE
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index be61073..872bc2b 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -63,6 +63,7 @@
#include <aknutils.h>
#include <aknnavi.h>
#include <gulicon.h>
+#include <AknBitmapAnimation.h>
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
@@ -72,6 +73,7 @@ enum TDrawType {
EDrawIcon,
EDrawGulIcon,
EDrawBackground,
+ EDrawAnimation,
ENoDraw
};
@@ -97,6 +99,47 @@ typedef struct {
int newMinorSkinId;
} partMapEntry;
+AnimationData::AnimationData(const QS60StyleEnums::SkinParts part, int frames, int interval) : m_id(part),
+ m_frames(frames), m_interval(interval), m_mode(QS60StyleEnums::AM_Looping)
+{
+}
+
+AnimationDataV2::AnimationDataV2(const AnimationData &data) : AnimationData(data.m_id, data.m_frames, data.m_interval),
+ m_animation(0), m_currentFrame(0), m_resourceBased(false), m_timerId(0)
+{
+}
+AnimationDataV2::~AnimationDataV2()
+{
+ delete m_animation;
+}
+
+QS60StyleAnimation::QS60StyleAnimation(const QS60StyleEnums::SkinParts part, int frames, int interval)
+{
+ QT_TRAP_THROWING(m_defaultData = new (ELeave) AnimationData(part, frames, interval));
+ QT_TRAP_THROWING(m_currentData = new (ELeave) AnimationDataV2(*m_defaultData));
+}
+
+QS60StyleAnimation::~QS60StyleAnimation()
+{
+ delete m_currentData;
+ delete m_defaultData;
+}
+
+void QS60StyleAnimation::setAnimationObject(CAknBitmapAnimation* animation)
+{
+ Q_ASSERT(animation);
+ if (m_currentData->m_animation)
+ delete m_currentData->m_animation;
+ m_currentData->m_animation = animation;
+}
+
+void QS60StyleAnimation::resetToDefaults()
+{
+ delete m_currentData;
+ m_currentData = 0;
+ QT_TRAP_THROWING(m_currentData = new (ELeave) AnimationDataV2(*m_defaultData));
+}
+
class QS60StyleModeSpecifics
{
public:
@@ -113,6 +156,8 @@ public:
static QSize naviPaneSize();
static TAknsItemID partSpecificThemeId(int part);
+ static QVariant themeDefinition(QS60StyleEnums::ThemeDefinitions definition, QS60StyleEnums::SkinParts part);
+
private:
static QPixmap createSkinnedGraphicsLX(QS60StyleEnums::SkinParts part,
const QSize &size, QS60StylePrivate::SkinElementFlags flags);
@@ -128,7 +173,7 @@ private:
};
const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
- /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_All, -1,-1},
+ /* SP_QgnGrafBarWaitAnim */ {KAknsIIDQgnGrafBarWaitAnim, EDrawAnimation, ES60_All, -1,-1},
/* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_All, -1,-1},
/* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1},
/* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1},
@@ -371,7 +416,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics(
void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylePart, TInt &fallbackIndex)
{
switch(stylePart) {
- case QS60StyleEnums::SP_QgnGrafBarWait:
+ case QS60StyleEnums::SP_QgnGrafBarWaitAnim:
fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1;
break;
case QS60StyleEnums::SP_QgnGrafBarFrameCenter:
@@ -604,6 +649,11 @@ bool QS60StylePrivate::hasSliderGrooveGraphic()
return QSysInfo::s60Version() != QSysInfo::SV_S60_3_1;
}
+bool QS60StylePrivate::isSingleClickUi()
+{
+ return (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0);
+}
+
QPoint qt_s60_fill_background_offset(const QWidget *targetWidget)
{
CCoeControl *control = targetWidget->effectiveWinId();
@@ -709,6 +759,69 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
// QS60WindowSurface::lockBitmapHeap();
break;
}
+ case EDrawAnimation: {
+ CFbsBitmap* animationFrame;
+ CFbsBitmap* frameMask;
+ CAknBitmapAnimation* aknAnimation = 0;
+ TBool constructedFromTheme = ETrue;
+
+ QS60StyleAnimation* animation = QS60StylePrivate::animationDefinition(part); //ownership is not passed
+ if (animation) {
+ if (!animation->animationObject() && !animation->isResourceBased()) {// no pre-made item exists, create new animation
+ CAknBitmapAnimation* newAnimation = CAknBitmapAnimation::NewL();
+ CleanupStack::PushL(newAnimation);
+ if (newAnimation)
+ constructedFromTheme = newAnimation->ConstructFromSkinL(skinId);
+ if (constructedFromTheme && newAnimation->BitmapAnimData()->FrameArray().Count() > 0) {
+ animation->setResourceBased(false);
+ animation->setAnimationObject(newAnimation); //animation takes ownership
+ }
+ CleanupStack::Pop(newAnimation);
+ }
+ //fill-in stored information
+ aknAnimation = animation->animationObject();
+ constructedFromTheme = !animation->isResourceBased();
+ }
+
+ const int currentFrame = QS60StylePrivate::currentAnimationFrame(part);
+ if (constructedFromTheme && aknAnimation && aknAnimation->BitmapAnimData()->FrameArray().Count() > 0) {
+ //Animation was created succesfully and contains frames, just fetch current frame
+ if(currentFrame >= aknAnimation->BitmapAnimData()->FrameArray().Count())
+ User::Leave(KErrOverflow);
+ const CBitmapFrameData* frameData = aknAnimation->BitmapAnimData()->FrameArray().At(currentFrame);
+ if (frameData) {
+ animationFrame = frameData->Bitmap();
+ frameMask = frameData->Mask();
+ }
+ } else {
+ //Theme does not contain animation theming, create frames from resource file
+ TInt fallbackGraphicID = -1;
+ fallbackInfo(part, fallbackGraphicID);
+ fallbackGraphicID = fallbackGraphicID + (currentFrame * 2); //skip masks
+ TInt fallbackGraphicsMaskID =
+ (fallbackGraphicID == KErrNotFound) ? KErrNotFound : fallbackGraphicID + 1; //masks are auto-generated as next in mif files
+ if (fallbackGraphicsMaskID != KErrNotFound)
+ fallbackGraphicsMaskID = fallbackGraphicsMaskID + (currentFrame * 2); //skip actual graphics
+
+ //Then draw animation frame
+ AknsUtils::CreateIconL(
+ skinInstance,
+ KAknsIIDDefault, //animation is not themed, lets force fallback graphics
+ animationFrame,
+ frameMask,
+ AknIconUtils::AvkonIconFileName(),
+ fallbackGraphicID ,
+ fallbackGraphicsMaskID);
+ }
+ result = fromFbsBitmap(animationFrame, frameMask, flags, targetSize);
+ if (!constructedFromTheme) {
+ delete animationFrame;
+ animationFrame = 0;
+ delete frameMask;
+ frameMask = 0;
+ }
+ break;
+ }
}
if (!result)
result = QPixmap();
@@ -731,7 +844,6 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(QS60StylePrivate::SkinFr
MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
QPixmap result;
-// QS60WindowSurface::unlockBitmapHeap();
static const TDisplayMode displayMode = S60->supportsPremultipliedAlpha ? Q_SYMBIAN_ECOLOR16MAP : EColor16MA;
static const TInt drawParam = S60->supportsPremultipliedAlpha ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly;
@@ -985,8 +1097,13 @@ void QS60StylePrivate::setActiveLayout()
m_pmPointer = data[activeLayoutIndex];
}
+Q_GLOBAL_STATIC(QList<QS60StyleAnimation *>, m_animations)
+
QS60StylePrivate::QS60StylePrivate()
{
+ //Animation defaults need to be created when style is instantiated
+ QS60StyleAnimation* progressBarAnimation = new QS60StyleAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim, 7, 100);
+ m_animations()->append(progressBarAnimation);
// No need to set active layout, if dynamic metrics API is available
setActiveLayout();
}
@@ -1187,6 +1304,11 @@ void QS60StylePrivate::handleSkinChange()
setThemePalette(topLevelWidget);
topLevelWidget->ensurePolished();
}
+#ifndef QT_NO_PROGRESSBAR
+ //re-start animation timer
+ stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim); //todo: once we have more animations, we could say "stop all running ones"
+ startAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim); //and "re-start all previously running ones"
+#endif
}
QSize QS60StylePrivate::naviPaneSize()
@@ -1206,6 +1328,121 @@ QSize QS60StyleModeSpecifics::naviPaneSize()
return QSize(0,0);
}
+int QS60StylePrivate::currentAnimationFrame(QS60StyleEnums::SkinParts part)
+{
+ QS60StyleAnimation *animation = animationDefinition(part);
+ // todo: looping could be done in QS60Style::timerEvent
+ if (animation->frameCount() == animation->currentFrame())
+ animation->setCurrentFrame(0);
+ return animation->currentFrame();
+}
+
+QS60StyleAnimation* QS60StylePrivate::animationDefinition(QS60StyleEnums::SkinParts part)
+{
+ int i = 0;
+ const int animationsCount = m_animations()->isEmpty() ? 0 : m_animations()->count();
+ for(; i < animationsCount; i++) {
+ if (part == m_animations()->at(i)->animationId())
+ break;
+ }
+ return m_animations()->at(i);
+}
+
+void QS60StylePrivate::startAnimation(QS60StyleEnums::SkinParts animationPart)
+{
+ Q_Q(QS60Style);
+
+ //Query animation data from theme and store values to local struct.
+ QVariant themeAnimationDataVariant = QS60StyleModeSpecifics::themeDefinition(
+ QS60StyleEnums::TD_AnimationData, animationPart);
+ QList<QVariant> themeAnimationData = themeAnimationDataVariant.toList();
+
+ QS60StyleAnimation *animation = QS60StylePrivate::animationDefinition(animationPart);
+ if (animation) {
+ if (themeAnimationData.at(QS60StyleEnums::AD_Interval).toInt() != 0)
+ animation->setInterval(themeAnimationData.at(QS60StyleEnums::AD_Interval).toInt());
+
+ if (themeAnimationData.at(QS60StyleEnums::AD_NumberOfFrames).toInt() != 0)
+ animation->setFrameCount(themeAnimationData.at(QS60StyleEnums::AD_NumberOfFrames).toInt());
+
+ //todo: playmode is ignored for now, since it seems to return invalid data on some themes
+ //lets use the table values for play mode
+
+ animation->setCurrentFrame(0); //always initialize
+ const int timerId = q->startTimer(animation->interval());
+ animation->setTimerId(timerId);
+ }
+}
+
+void QS60StylePrivate::stopAnimation(QS60StyleEnums::SkinParts animationPart)
+{
+ Q_Q(QS60Style);
+
+ QS60StyleAnimation *animation = QS60StylePrivate::animationDefinition(animationPart);
+ if (animation) {
+ animation->setCurrentFrame(0);
+ if (animation->timerId() != 0) {
+ q->killTimer(animation->timerId());
+ animation->setTimerId(0);
+ }
+ animation->resetToDefaults();
+ }
+}
+
+QVariant QS60StyleModeSpecifics::themeDefinition(
+ QS60StyleEnums::ThemeDefinitions definition, QS60StyleEnums::SkinParts part)
+{
+ MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+
+ Q_ASSERT(skinInstance);
+
+ switch(definition) {
+ //Animation definitions
+ case QS60StyleEnums::TD_AnimationData:
+ {
+ CAknsBmpAnimItemData *animationData;
+ TAknsItemID animationSkinId = partSpecificThemeId(part);
+ QList<QVariant> list;
+
+ TRAPD( error, QT_TRYCATCH_LEAVING(
+ animationData = static_cast<CAknsBmpAnimItemData*>(skinInstance->CreateUncachedItemDataL(
+ animationSkinId, EAknsITBmpAnim))));
+ if (error)
+ return list;
+
+ if (animationData) {
+ list.append((int)animationData->FrameInterval());
+ list.append((int)animationData->NumberOfImages());
+
+ QS60StyleEnums::AnimationMode playMode;
+ switch(animationData->PlayMode()) {
+ case CBitmapAnimClientData::EPlay:
+ playMode = QS60StyleEnums::AM_PlayOnce;
+ break;
+ case CBitmapAnimClientData::ECycle:
+ playMode = QS60StyleEnums::AM_Looping;
+ break;
+ case CBitmapAnimClientData::EBounce:
+ playMode = QS60StyleEnums::AM_Bounce;
+ break;
+ default:
+ break;
+ }
+ list.append(QVariant((int)playMode));
+ delete animationData;
+ } else {
+ list.append(0);
+ list.append(0);
+ }
+ return list;
+ }
+ break;
+ default:
+ break;
+ }
+ return QVariant();
+}
+
#endif // Q_WS_S60
QT_END_NAMESPACE
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index bd43eb7..f87cf28 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -342,6 +342,11 @@ bool QS60StylePrivate::hasSliderGrooveGraphic()
return false;
}
+bool QS60StylePrivate::isSingleClickUi()
+{
+ return false;
+}
+
QFont QS60StylePrivate::s60Font_specific(
QS60StyleEnums::FontCategories fontCategory,
int pointSize, bool resolveFontSize)
@@ -364,6 +369,11 @@ QFont QS60StylePrivate::s60Font_specific(
return result;
}
+int QS60StylePrivate::currentAnimationFrame(QS60StyleEnums::SkinParts part)
+{
+ return 0;
+}
+
/*!
Constructs a QS60Style object.
*/
diff --git a/src/gui/styles/qstyle_s60.qrc b/src/gui/styles/qstyle_s60.qrc
new file mode 100644
index 0000000..dbee38b
--- /dev/null
+++ b/src/gui/styles/qstyle_s60.qrc
@@ -0,0 +1,137 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/trolltech/styles/commonstyle">
+<!-- <file>images/filelink-16.png</file> -->
+<file>images/filelink-32.png</file>
+<!-- <file>images/filelink-128.png</file> -->
+<!-- <file>images/file-16.png</file> -->
+<file>images/file-32.png</file>
+<!-- <file>images/file-128.png</file> -->
+<!-- <file>images/newdirectory-16.png</file> -->
+<file>images/newdirectory-32.png</file>
+<!-- <file>images/newdirectory-128.png</file> -->
+<!-- <file>images/parentdir-16.png</file> -->
+<file>images/parentdir-32.png</file>
+<!-- <file>images/parentdir-128.png</file> -->
+<!-- <file>images/dvd-16.png</file> -->
+<!-- <file>images/dvd-32.png</file> -->
+<!-- <file>images/dvd-128.png</file> -->
+<!-- <file>images/cdr-16.png</file> -->
+<!-- <file>images/cdr-32.png</file> -->
+<!-- <file>images/cdr-128.png</file> -->
+<!-- <file>images/floppy-16.png</file> -->
+<!-- <file>images/floppy-32.png</file> -->
+<!-- <file>images/floppy-128.png</file> -->
+<!-- <file>images/harddrive-16.png</file> -->
+<file>images/harddrive-32.png</file>
+<!-- <file>images/harddrive-128.png</file> -->
+<!-- <file>images/trash-16.png</file> -->
+<!-- <file>images/trash-32.png</file> -->
+<!-- <file>images/trash-128.png</file> -->
+<!-- <file>images/networkdrive-16.png</file> -->
+<!-- <file>images/networkdrive-32.png</file> -->
+<!-- <file>images/networkdrive-128.png</file> -->
+<!-- <file>images/computer-16.png</file> -->
+<!-- <file>images/computer-32.png</file> -->
+<!-- <file>images/desktop-16.png</file> -->
+<file>images/desktop-32.png</file>
+<!-- <file>images/dirclosed-16.png</file> -->
+<file>images/dirclosed-32.png</file>
+<!-- <file>images/dirclosed-128.png</file> -->
+<!-- <file>images/dirlink-16.png</file> -->
+<file>images/dirlink-32.png</file>
+<!-- <file>images/dirlink-128.png</file> -->
+<!-- <file>images/diropen-16.png</file> -->
+<file>images/diropen-32.png</file>
+<!-- <file>images/diropen-128.png</file> -->
+<!-- <file>images/left-16.png</file> -->
+<file>images/left-32.png</file>
+<!-- <file>images/left-128.png</file> -->
+<!-- <file>images/right-16.png</file> -->
+<file>images/right-32.png</file>
+<!-- <file>images/right-128.png</file> -->
+<!-- <file>images/up-16.png</file> -->
+<file>images/up-32.png</file>
+<!-- <file>images/up-128.png</file> -->
+<!-- <file>images/down-16.png</file> -->
+<file>images/down-32.png</file>
+<!-- <file>images/down-128.png</file> -->
+<!-- <file>images/filecontents-16.png</file> -->
+<file>images/filecontents-32.png</file>
+<!-- <file>images/filecontents-128.png</file> -->
+<!-- <file>images/fileinfo-16.png</file> -->
+<file>images/fileinfo-32.png</file>
+<!-- <file>images/fileinfo-128.png</file> -->
+<!-- <file>images/viewdetailed-16.png</file> -->
+<file>images/viewdetailed-32.png</file>
+<!-- <file>images/viewdetailed-128.png</file> -->
+<!-- <file>images/viewlist-16.png</file> -->
+<file>images/viewlist-32.png</file>
+<!-- <file>images/viewlist-128.png</file> -->
+<file>images/fontbitmap-16.png</file>
+<file>images/fonttruetype-16.png</file>
+<!-- <file>images/standardbutton-apply-128.png</file> -->
+<!-- <file>images/standardbutton-apply-16.png</file> -->
+<file>images/standardbutton-apply-32.png</file>
+<!-- <file>images/standardbutton-cancel-128.png</file> -->
+<!-- <file>images/standardbutton-cancel-16.png</file> -->
+<file>images/standardbutton-cancel-32.png</file>
+<!-- <file>images/standardbutton-clear-128.png</file> -->
+<!-- <file>images/standardbutton-clear-16.png</file> -->
+<file>images/standardbutton-clear-32.png</file>
+<!-- <file>images/standardbutton-close-128.png</file> -->
+<!-- <file>images/standardbutton-close-16.png</file> -->
+<file>images/standardbutton-close-32.png</file>
+<!-- <file>images/standardbutton-delete-128.png</file> -->
+<!-- <file>images/standardbutton-delete-16.png</file> -->
+<file>images/standardbutton-delete-32.png</file>
+<!-- <file>images/standardbutton-help-128.png</file> -->
+<!-- <file>images/standardbutton-help-16.png</file> -->
+<file>images/standardbutton-help-32.png</file>
+<!-- <file>images/standardbutton-no-128.png</file> -->
+<!-- <file>images/standardbutton-no-16.png</file> -->
+<file>images/standardbutton-no-32.png</file>
+<!-- <file>images/standardbutton-ok-128.png</file> -->
+<!-- <file>images/standardbutton-ok-16.png</file> -->
+<file>images/standardbutton-ok-32.png</file>
+<!-- <file>images/standardbutton-open-128.png</file> -->
+<!-- <file>images/standardbutton-open-16.png</file> -->
+<file>images/standardbutton-open-32.png</file>
+<!-- <file>images/standardbutton-save-128.png</file> -->
+<!-- <file>images/standardbutton-save-16.png</file> -->
+<file>images/standardbutton-save-32.png</file>
+<!-- <file>images/standardbutton-yes-128.png</file> -->
+<!-- <file>images/standardbutton-yes-16.png</file> -->
+<file>images/standardbutton-yes-32.png</file>
+<file>images/standardbutton-closetab-16.png</file>
+<file>images/standardbutton-closetab-down-16.png</file>
+<file>images/standardbutton-closetab-hover-16.png</file>
+<!-- <file>images/refresh-24.png</file> -->
+<file>images/refresh-32.png</file>
+<!-- <file>images/stop-24.png</file> -->
+<file>images/stop-32.png</file>
+<!-- <file>images/media-stop-16.png</file> -->
+<file>images/media-stop-32.png</file>
+<!-- <file>images/media-play-16.png</file> -->
+<file>images/media-play-32.png</file>
+<!-- <file>images/media-pause-16.png</file> -->
+<file>images/media-pause-32.png</file>
+<!-- <file>images/media-seek-forward-16.png</file> -->
+<file>images/media-seek-forward-32.png</file>
+<!-- <file>images/media-seek-backward-16.png</file> -->
+<file>images/media-seek-backward-32.png</file>
+<!-- <file>images/media-skip-forward-16.png</file> -->
+<file>images/media-skip-forward-32.png</file>
+<!-- <file>images/media-skip-backward-16.png</file> -->
+<file>images/media-skip-backward-32.png</file>
+<file>images/media-volume-16.png</file>
+<file>images/media-volume-muted-16.png</file>
+</qresource>
+<!--
+<qresource prefix="/trolltech/styles/macstyle">
+<file>images/closedock-16.png</file>
+<file>images/closedock-down-16.png</file>
+<file>images/dockdock-16.png</file>
+<file>images/dockdock-down-16.png</file>
+</qresource>
+-->
+</RCC>
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 7e5c55a..676f59e 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -23,10 +23,12 @@ SOURCES += \
styles/qstylesheetstyle.cpp \
styles/qstylesheetstyle_default.cpp
-!wince* {
- RESOURCES += styles/qstyle.qrc
+wince* {
+ RESOURCES += styles/qstyle_wince.qrc
+} else:symbian {
+ RESOURCES += styles/qstyle_s60.qrc
} else {
- RESOURCES += styles/qstyle_wince.qrc
+ RESOURCES += styles/qstyle.qrc
}
contains( styles, all ) {
@@ -168,7 +170,7 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) {
SOURCES += styles/qs60style.cpp
symbian {
SOURCES += styles/qs60style_s60.cpp
- LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul
+ LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul -lbmpanim
} else {
SOURCES += styles/qs60style_simulated.cpp
RESOURCES += styles/qstyle_s60_simulated.qrc
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 4c57dff..bbd35f1 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1614,7 +1614,11 @@ bool QFont::operator==(const QFont &f) const
&& f.d->overline == d->overline
&& f.d->strikeOut == d->strikeOut
&& f.d->kerning == d->kerning
- && f.d->capital == d->capital));
+ && f.d->capital == d->capital
+ && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute
+ && f.d->letterSpacing == d->letterSpacing
+ && f.d->wordSpacing == d->wordSpacing
+ ));
}
@@ -1648,6 +1652,10 @@ bool QFont::operator<(const QFont &f) const
#endif // Q_WS_X11
if (f.d->capital != d->capital) return f.d->capital < d->capital;
+ if (f.d->letterSpacingIsAbsolute != d->letterSpacingIsAbsolute) return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;
+ if (f.d->letterSpacing != d->letterSpacing) return f.d->letterSpacing < d->letterSpacing;
+ if (f.d->wordSpacing != d->wordSpacing) return f.d->wordSpacing < d->wordSpacing;
+
int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning;
int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning;
return f1attrs < f2attrs;
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 9343cb7..c000457 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -357,9 +357,6 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform
++i;
}
} else {
- positions.resize(glyphs.numGlyphs);
- glyphs_out.resize(glyphs.numGlyphs);
- int i = 0;
while (i < glyphs.numGlyphs) {
if (!glyphs.attributes[i].dontPrint) {
QFixed gpos_x = xpos + glyphs.offsets[i].x;
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 0c8aeec..c1e254c 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -52,6 +52,9 @@ struct QTextOptionPrivate
/*!
Constructs a text option with default properties for text.
+ The text alignment property is set to Qt::AlignLeft. The
+ word wrap property is set to QTextOption::WordWrap. The
+ using of design metrics flag is set to false.
*/
QTextOption::QTextOption()
: align(Qt::AlignLeft),
@@ -67,6 +70,8 @@ QTextOption::QTextOption()
/*!
Constructs a text option with the given \a alignment for text.
+ The word wrap property is set to QTextOption::WordWrap. The using
+ of design metrics flag is set to false.
*/
QTextOption::QTextOption(Qt::Alignment alignment)
: align(alignment),
diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm
index ae805f6..0265a83 100644
--- a/src/gui/util/qsystemtrayicon_mac.mm
+++ b/src/gui/util/qsystemtrayicon_mac.mm
@@ -569,16 +569,3 @@ private:
}
@end
-
-/* Done here because this is the only .mm for now! -Sam */
-QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool()
-{
- NSApplicationLoad();
- pool = (void*)[[NSAutoreleasePool alloc] init];
-}
-
-QMacCocoaAutoReleasePool::~QMacCocoaAutoReleasePool()
-{
- [(NSAutoreleasePool*)pool release];
-}
-
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 414c2ed..b0a64ea 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -524,8 +524,11 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl
m_textLayout.draw(painter, offset, selections, clip);
if (flags & DrawCursor){
+ int cursor = m_cursor;
+ if (m_preeditCursor != -1)
+ cursor += m_preeditCursor;
if(!m_blinkPeriod || m_blinkStatus)
- m_textLayout.drawCursor(painter, offset, m_cursor, m_cursorWidth);
+ m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth);
}
}
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index 301ff72..d6f2705 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -549,7 +549,10 @@ inline qreal QLineControl::cursorToX(int cursor) const
inline qreal QLineControl::cursorToX() const
{
- return cursorToX(m_cursor);
+ int cursor = m_cursor;
+ if (m_preeditCursor != -1)
+ cursor += m_preeditCursor;
+ return cursorToX(cursor);
}
inline bool QLineControl::isReadOnly() const
diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm
index e41c2be..d92168a 100644
--- a/src/gui/widgets/qmainwindowlayout_mac.mm
+++ b/src/gui/widgets/qmainwindowlayout_mac.mm
@@ -472,10 +472,27 @@ void QMainWindowLayout::removeFromMacToolbar(QToolBar *toolbar)
void QMainWindowLayout::cleanUpMacToolbarItems()
{
- for (int i = 0; i < toolbarItemsCopy.size(); ++i)
+#ifdef QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
+#endif
+ for (int i = 0; i < toolbarItemsCopy.size(); ++i) {
+#ifdef QT_MAC_USE_COCOA
+ NSToolbarItem *item = static_cast<NSToolbarItem *>(toolbarItemsCopy.at(i));
+ [item setView:0];
+#endif
CFRelease(toolbarItemsCopy.at(i));
+ }
toolbarItemsCopy.clear();
unifiedToolbarHash.clear();
+
+#ifdef QT_MAC_USE_COCOA
+ OSWindowRef window = qt_mac_window_for(layoutState.mainWindow);
+ NSToolbar *macToolbar = [window toolbar];
+ if (macToolbar) {
+ [[macToolbar delegate] release];
+ [macToolbar setDelegate:nil];
+ }
+#endif
}
void QMainWindowLayout::fixSizeInUnifiedToolbar(QToolBar *tb) const
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 5031d88..8ce7cc0 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -1588,10 +1588,9 @@ QAction *QMenu::insertSeparator(QAction *before)
}
/*!
- This will set the default action to \a act. The default action may
- have a visual queue depending on the current QStyle. A default
- action is usually meant to indicate what will defaultly happen on a
- drop, as shown in a context menu.
+ This sets the default action to \a act. The default action may have
+ a visual cue, depending on the current QStyle. A default action
+ usually indicates what will happen by default when a drop occurs.
\sa defaultAction()
*/
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index cd7f9bd..7e4bbb5 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -175,6 +175,22 @@ static quint32 constructModifierMask(quint32 accel_key)
return ret;
}
+static void cancelAllMenuTracking()
+{
+#ifdef QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
+ NSMenu *mainMenu = [NSApp mainMenu];
+ [mainMenu cancelTracking];
+ for (NSMenuItem *item in [mainMenu itemArray]) {
+ if ([item submenu]) {
+ [[item submenu] cancelTracking];
+ }
+ }
+#else
+ CancelMenuTracking(AcquireRootMenu(), true, 0);
+#endif
+}
+
static bool actualMenuItemVisibility(const QMenuBarPrivate::QMacMenuBarPrivate *mbp,
const QMacMenuAction *action)
{
@@ -1830,6 +1846,12 @@ void QMenuBarPrivate::macDestroyMenuBar()
mac_menubar = 0;
if (qt_mac_current_menubar.qmenubar == q) {
+#ifdef QT_MAC_USE_COCOA
+ QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
+ [loader removeActionsFromAppMenu];
+#else
+ cancelAllMenuTracking();
+#endif
extern void qt_event_request_menubarupdate(); //qapplication_mac.cpp
qt_event_request_menubarupdate();
}
@@ -1933,20 +1955,6 @@ static bool qt_mac_should_disable_menu(QMenuBar *menuBar, QWidget *modalWidget)
return qt_mac_is_ancestor(menuBar->parentWidget(), modalWidget);
}
-static void cancelAllMenuTracking()
-{
-#ifdef QT_MAC_USE_COCOA
- QMacCocoaAutoReleasePool pool;
- NSMenu *mainMenu = [NSApp mainMenu];
- [mainMenu cancelTracking];
- for (NSMenuItem *item in [mainMenu itemArray]) {
- if ([item submenu]) {
- [[item submenu] cancelTracking];
- }
- }
-#endif
-}
-
/*!
\internal
diff --git a/src/network/access/qfilenetworkreply.cpp b/src/network/access/qfilenetworkreply.cpp
index 44dd9e7..4ac9a8c 100644
--- a/src/network/access/qfilenetworkreply.cpp
+++ b/src/network/access/qfilenetworkreply.cpp
@@ -44,35 +44,37 @@
#include "QtCore/qdatetime.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
+#include <QDebug>
QT_BEGIN_NAMESPACE
QFileNetworkReplyPrivate::QFileNetworkReplyPrivate()
- : QNetworkReplyPrivate(), realFileSize(0), finished(false)
+ : QNetworkReplyPrivate(), fileEngine(0), fileSize(0), filePos(0)
{
}
-QFileNetworkReply::QFileNetworkReply(QObject *parent, const QNetworkRequest &req)
- : QNetworkReply(*new QFileNetworkReplyPrivate(), parent)
+QFileNetworkReplyPrivate::~QFileNetworkReplyPrivate()
{
- setRequest(req);
- setUrl(req.url());
- setOperation(QNetworkAccessManager::GetOperation);
- QMetaObject::invokeMethod(this, "_q_startOperation", Qt::QueuedConnection);
- QNetworkReply::open(QIODevice::ReadOnly);
+ delete fileEngine;
}
QFileNetworkReply::~QFileNetworkReply()
{
}
-// This code is mostly inspired by QNetworkAccessFileBackend
-// We also use its translation context for error messages
-void QFileNetworkReplyPrivate::_q_startOperation()
+QFileNetworkReply::QFileNetworkReply(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op)
+ : QNetworkReply(*new QFileNetworkReplyPrivate(), parent)
{
- Q_Q(QFileNetworkReply);
+ setRequest(req);
+ setUrl(req.url());
+ setOperation(op);
+ QNetworkReply::open(QIODevice::ReadOnly);
+
+ qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");
- QUrl url = q->url();
+ QFileNetworkReplyPrivate *d = (QFileNetworkReplyPrivate*) d_func();
+
+ QUrl url = req.url();
if (url.host() == QLatin1String("localhost"))
url.setHost(QString());
@@ -81,97 +83,93 @@ void QFileNetworkReplyPrivate::_q_startOperation()
if (!url.host().isEmpty()) {
// we handle only local files
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend", "Request for opening non-local file %1").arg(url.toString());
- q->setError(QNetworkReply::ProtocolInvalidOperationError, msg);
- emit q->error(QNetworkReply::ProtocolInvalidOperationError);
- doFinished();
+ setError(QNetworkReply::ProtocolInvalidOperationError, msg);
+ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProtocolInvalidOperationError));
+ QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
return;
}
#endif
if (url.path().isEmpty())
url.setPath(QLatin1String("/"));
- q->setUrl(url);
+ setUrl(url);
QString fileName = url.toLocalFile();
if (fileName.isEmpty()) {
fileName = url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery);
}
- realFile.setFileName(fileName);
- QFileInfo fi(realFile);
+ QFileInfo fi(fileName);
if (fi.isDir()) {
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend", "Cannot open %1: Path is a directory").arg(url.toString());
- q->setError(QNetworkReply::ContentOperationNotPermittedError, msg);
- emit q->error(QNetworkReply::ContentOperationNotPermittedError);
- doFinished();
+ setError(QNetworkReply::ContentOperationNotPermittedError, msg);
+ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentOperationNotPermittedError));
+ QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
return;
}
- bool opened = realFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
+ d->fileEngine = QAbstractFileEngine::create(fileName);
+ bool opened = d->fileEngine->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
// could we open the file?
if (!opened) {
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend", "Error opening %1: %2")
- .arg(realFile.fileName(), realFile.errorString());
+ .arg(fileName, d->fileEngine->errorString());
- if (realFile.exists()) {
- q->setError(QNetworkReply::ContentAccessDenied, msg);
- emit q->error(QNetworkReply::ContentAccessDenied);
+ if (fi.exists()) {
+ setError(QNetworkReply::ContentAccessDenied, msg);
+ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentAccessDenied));
} else {
- q->setError(QNetworkReply::ContentNotFoundError, msg);
- emit q->error(QNetworkReply::ContentNotFoundError);
+ setError(QNetworkReply::ContentNotFoundError, msg);
+ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentNotFoundError));
}
- doFinished();
+ QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
return;
}
- realFileSize = fi.size();
- q->setHeader(QNetworkRequest::LastModifiedHeader, fi.lastModified());
- q->setHeader(QNetworkRequest::ContentLengthHeader, realFileSize);
+ d->fileSize = fi.size();
+ setHeader(QNetworkRequest::LastModifiedHeader, fi.lastModified());
+ setHeader(QNetworkRequest::ContentLengthHeader, d->fileSize);
- emit q->metaDataChanged();
- emit q->downloadProgress(realFileSize, realFileSize);
- emit q->readyRead();
- doFinished();
+ QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection,
+ Q_ARG(qint64, d->fileSize), Q_ARG(qint64, d->fileSize));
+ QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
}
bool QFileNetworkReplyPrivate::isFinished() const
{
- return finished;
-}
-
-void QFileNetworkReplyPrivate::doFinished()
-{
- Q_Q(QFileNetworkReply);
- finished = true;
- emit q->finished();
+ return true;
}
-
void QFileNetworkReply::close()
{
Q_D(QFileNetworkReply);
QNetworkReply::close();
- d->realFile.close();
-
- if (!d->finished)
- d->doFinished();
+ if (d->fileEngine)
+ d->fileEngine->close();
}
void QFileNetworkReply::abort()
{
Q_D(QFileNetworkReply);
QNetworkReply::close();
- d->realFile.close();
-
- if (!d->finished)
- d->doFinished();
+ if (d->fileEngine)
+ d->fileEngine->close();
}
qint64 QFileNetworkReply::bytesAvailable() const
{
Q_D(const QFileNetworkReply);
- return QNetworkReply::bytesAvailable() + d->realFile.bytesAvailable();
+ if (!d->fileEngine)
+ return 0;
+
+ return QNetworkReply::bytesAvailable() + d->fileSize - d->filePos;
}
bool QFileNetworkReply::isSequential () const
@@ -182,7 +180,7 @@ bool QFileNetworkReply::isSequential () const
qint64 QFileNetworkReply::size() const
{
Q_D(const QFileNetworkReply);
- return d->realFileSize;
+ return d->fileSize;
}
/*!
@@ -191,11 +189,17 @@ qint64 QFileNetworkReply::size() const
qint64 QFileNetworkReply::readData(char *data, qint64 maxlen)
{
Q_D(QFileNetworkReply);
- qint64 ret = d->realFile.read(data, maxlen);
- if (ret == 0 && bytesAvailable() == 0)
+ if (!d->fileEngine)
+ return -1;
+
+ qint64 ret = d->fileEngine->read(data, maxlen);
+ if (ret == 0 && bytesAvailable() == 0) {
return -1; // everything had been read
- else
- return ret;
+ } else if (ret > 0) {
+ d->filePos += ret;
+ }
+
+ return ret;
}
diff --git a/src/network/access/qfilenetworkreply_p.h b/src/network/access/qfilenetworkreply_p.h
index 6f10672..710ec9f 100644
--- a/src/network/access/qfilenetworkreply_p.h
+++ b/src/network/access/qfilenetworkreply_p.h
@@ -57,6 +57,7 @@
#include "qnetworkreply_p.h"
#include "qnetworkaccessmanager.h"
#include <QFile>
+#include <QAbstractFileEngine>
QT_BEGIN_NAMESPACE
@@ -66,7 +67,7 @@ class QFileNetworkReply: public QNetworkReply
{
Q_OBJECT
public:
- QFileNetworkReply(QObject *parent, const QNetworkRequest &req);
+ QFileNetworkReply(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op);
~QFileNetworkReply();
virtual void abort();
@@ -76,28 +77,22 @@ public:
virtual bool isSequential () const;
qint64 size() const;
-
virtual qint64 readData(char *data, qint64 maxlen);
Q_DECLARE_PRIVATE(QFileNetworkReply)
- Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
-
};
class QFileNetworkReplyPrivate: public QNetworkReplyPrivate
{
public:
QFileNetworkReplyPrivate();
+ ~QFileNetworkReplyPrivate();
- QFile realFile;
- qint64 realFileSize;
-
- void _q_startOperation();
+ QAbstractFileEngine *fileEngine;
+ qint64 fileSize;
+ qint64 filePos;
virtual bool isFinished() const;
- void doFinished();
- bool finished;
-
Q_DECLARE_PUBLIC(QFileNetworkReply)
};
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 20baac8..fff7097 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -564,7 +564,8 @@ bool QHttpNetworkConnectionPrivate::fillPipeline(QList<HttpMessagePair> &queue,
}
-QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket)
+QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket,
+ const QString &extraDetail)
{
Q_ASSERT(socket);
@@ -581,7 +582,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e
errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed"));
break;
case QNetworkReply::TimeoutError:
- errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out"));
break;
case QNetworkReply::ProxyAuthenticationRequiredError:
errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication"));
@@ -600,7 +601,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e
break;
default:
// all other errors are treated as QNetworkReply::UnknownNetworkError
- errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
+ errorString = extraDetail;
break;
}
return errorString;
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 76da883..03cf09c 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -185,7 +185,8 @@ public:
void createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request);
- QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket);
+ QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket,
+ const QString &extraDetail = QString());
#ifndef QT_NO_COMPRESS
bool expand(QAbstractSocket *socket, QHttpNetworkReply *reply, bool dataComplete);
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 39d09aa..b80ae9a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -260,7 +260,7 @@ bool QHttpNetworkConnectionChannel::sendRequest()
// ensure we try to receive a reply in all cases, even if _q_readyRead_ hat not been called
// this is needed if the sends an reply before we have finished sending the request. In that
// case receiveReply had been called before but ignored the server reply
- QMetaObject::invokeMethod(connection, "_q_receiveReply", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "_q_receiveReply", Qt::QueuedConnection);
break;
}
case QHttpNetworkConnectionChannel::ReadingState:
@@ -872,7 +872,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
break;
}
QPointer<QObject> that = connection;
- QString errorString = connection->d_func()->errorDetail(errorCode, socket);
+ QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString());
if (send2Reply) {
if (reply) {
reply->d_func()->errorString = errorString;
diff --git a/src/network/access/qhttpnetworkheader.cpp b/src/network/access/qhttpnetworkheader.cpp
index c2cc69c..669f9cf 100644
--- a/src/network/access/qhttpnetworkheader.cpp
+++ b/src/network/access/qhttpnetworkheader.cpp
@@ -80,7 +80,7 @@ QByteArray QHttpNetworkHeaderPrivate::headerField(const QByteArray &name, const
QByteArray result;
bool first = true;
- foreach (QByteArray value, allValues) {
+ foreach (const QByteArray &value, allValues) {
if (!first)
result += ", ";
first = false;
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 58123b2..61a95fe 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -753,7 +753,7 @@ void QNetworkAccessHttpBackend::replyHeaderChanged()
QByteArray value = rawHeader(it->first);
if (!value.isEmpty()) {
if (qstricmp(it->first.constData(), "set-cookie") == 0)
- value += "\n";
+ value += '\n';
else
value += ", ";
}
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index d27fbe7..e16aedc 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -687,10 +687,10 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
// Also if the scheme is empty we consider it a file.
// The QNetworkAccessFileBackend will right now only be used
// for PUT or qrc://
- if (op == QNetworkAccessManager::GetOperation
+ if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation)
&& (req.url().scheme() == QLatin1String("file")
|| req.url().scheme().isEmpty())) {
- return new QFileNetworkReply(this, req);
+ return new QFileNetworkReply(this, req, op);
}
QNetworkRequest request = req;
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index 49a287f..0a8ea5d 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -239,7 +239,10 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
\note Do not delete the object in the slot connected to this
signal. Use deleteLater().
- \sa QNetworkAccessManager::finished()
+ You can also use isFinished() to check if a QNetworkReply
+ has finished even before you receive the finished() signal.
+
+ \sa QNetworkAccessManager::finished(), isFinished()
*/
/*!
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 6dcd05d..a2bef67 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -649,7 +649,7 @@ static QVariant parseCookieHeader(const QByteArray &raw)
{
QList<QNetworkCookie> result;
QList<QByteArray> cookieList = raw.split(';');
- foreach (QByteArray cookie, cookieList) {
+ foreach (const QByteArray &cookie, cookieList) {
QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());
if (parsed.count() != 1)
return QVariant(); // invalid Cookie: header
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 193a043..e4023c8 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -270,7 +270,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
break;
case Ntlm:
// #### extract from header
- realm = QString();
+ realm.clear();
break;
case DigestMd5: {
realm = QString::fromLatin1(options.value("realm"));
@@ -281,7 +281,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
break;
}
default:
- realm = QString();
+ realm.clear();
challenge = QByteArray();
phase = Invalid;
}
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 367e3c4..1115c63 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -541,7 +541,7 @@ QList<QNetworkInterface> QNetworkInterface::allInterfaces()
{
QList<QSharedDataPointer<QNetworkInterfacePrivate> > privs = manager()->allInterfaces();
QList<QNetworkInterface> result;
- foreach (QSharedDataPointer<QNetworkInterfacePrivate> p, privs) {
+ foreach (const QSharedDataPointer<QNetworkInterfacePrivate> &p, privs) {
QNetworkInterface item;
item.d = p;
result << item;
@@ -560,7 +560,7 @@ QList<QHostAddress> QNetworkInterface::allAddresses()
{
QList<QSharedDataPointer<QNetworkInterfacePrivate> > privs = manager()->allInterfaces();
QList<QHostAddress> result;
- foreach (const QSharedDataPointer<QNetworkInterfacePrivate> p, privs) {
+ foreach (const QSharedDataPointer<QNetworkInterfacePrivate> &p, privs) {
foreach (const QNetworkAddressEntry &entry, p->addressEntries)
result += entry.ip();
}
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index ede3c89..ef7fc02 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -122,9 +122,9 @@ void QLocalServer::close()
qDeleteAll(d->pendingConnections);
d->pendingConnections.clear();
d->closeServer();
- d->serverName = QString();
- d->fullServerName = QString();
- d->errorString = QString();
+ d->serverName.clear();
+ d->fullServerName.clear();
+ d->errorString.clear();
d->error = QAbstractSocket::UnknownSocketError;
}
@@ -226,8 +226,8 @@ bool QLocalServer::listen(const QString &name)
}
if (!d->listen(name)) {
- d->serverName = QString();
- d->fullServerName = QString();
+ d->serverName.clear();
+ d->fullServerName.clear();
return false;
}
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp
index 9f574d4..5b5e84f 100644
--- a/src/network/socket/qlocalsocket_tcp.cpp
+++ b/src/network/socket/qlocalsocket_tcp.cpp
@@ -102,8 +102,8 @@ void QLocalSocketPrivate::_q_stateChanged(QAbstractSocket::SocketState newState)
switch(newState) {
case QAbstractSocket::UnconnectedState:
state = QLocalSocket::UnconnectedState;
- serverName = QString();
- fullServerName = QString();
+ serverName.clear();
+ fullServerName.clear();
break;
case QAbstractSocket::ConnectingState:
state = QLocalSocket::ConnectingState;
@@ -218,7 +218,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
|| state() == ConnectingState)
return;
- d->errorString = QString();
+ d->errorString.clear();
d->state = ConnectingState;
emit stateChanged(d->state);
@@ -333,8 +333,8 @@ void QLocalSocket::close()
{
Q_D(QLocalSocket);
d->tcpSocket->close();
- d->serverName = QString();
- d->fullServerName = QString();
+ d->serverName.clear();
+ d->fullServerName.clear();
QIODevice::close();
}
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index 73c2465..1ca11d8 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -109,8 +109,8 @@ void QLocalSocketPrivate::_q_stateChanged(QAbstractSocket::SocketState newState)
switch(newState) {
case QAbstractSocket::UnconnectedState:
state = QLocalSocket::UnconnectedState;
- serverName = QString();
- fullServerName = QString();
+ serverName.clear();
+ fullServerName.clear();
break;
case QAbstractSocket::ConnectingState:
state = QLocalSocket::ConnectingState;
@@ -225,7 +225,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
|| state() == ConnectingState)
return;
- d->errorString = QString();
+ d->errorString.clear();
d->unixSocket.setSocketState(QAbstractSocket::ConnectingState);
d->state = ConnectingState;
emit stateChanged(d->state);
@@ -341,7 +341,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
errorOccurred(QLocalSocket::UnknownSocketError, function);
}
connectingSocket = -1;
- connectingName = QString();
+ connectingName.clear();
connectingOpenMode = 0;
}
@@ -438,10 +438,10 @@ void QLocalSocket::close()
if (d->connectingSocket != -1)
::close(d->connectingSocket);
d->connectingSocket = -1;
- d->connectingName = QString();
+ d->connectingName.clear();
d->connectingOpenMode = 0;
- d->serverName = QString();
- d->fullServerName = QString();
+ d->serverName.clear();
+ d->fullServerName.clear();
QIODevice::close();
}
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index 6e1df93..a890b3b 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -778,6 +778,14 @@ qint64 QNativeSocketEngine::read(char *data, qint64 maxSize)
QNativeSocketEnginePrivate::RemoteHostClosedErrorString);
close();
return -1;
+ } else if (readBytes == -1) {
+ if (!d->hasSetSocketError) {
+ d->hasSetSocketError = true;
+ d->socketError = QAbstractSocket::NetworkError;
+ d->socketErrorString = qt_error_string();
+ }
+ close();
+ return -1;
}
return readBytes;
}
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index d3b0fe5..9a2c349 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -903,7 +903,7 @@ qint64 QNativeSocketEnginePrivate::nativeRead(char *data, qint64 maxSize)
case EBADF:
case EINVAL:
case EIO:
- setError(QAbstractSocket::NetworkError, ReadErrorString);
+ //error string is now set in read(), not here in nativeRead()
break;
#ifdef Q_OS_SYMBIAN
case EPIPE:
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 81bffd9..8177b4f 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -994,9 +994,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
{
Q_Q(QNativeSocketEngine);
qint64 ret = 0;
- // don't send more than 49152 per call to WSASendTo to avoid getting a WSAENOBUFS
+ qint64 bytesToSend = len;
+
for (;;) {
- qint64 bytesToSend = qMin<qint64>(49152, len - ret);
WSABUF buf;
buf.buf = (char*)data + ret;
buf.len = bytesToSend;
@@ -1007,15 +1007,21 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
ret += qint64(bytesWritten);
+ int err;
if (socketRet != SOCKET_ERROR) {
if (ret == len)
break;
else
continue;
- } else if (WSAGetLastError() == WSAEWOULDBLOCK) {
+ } else if ((err = WSAGetLastError()) == WSAEWOULDBLOCK) {
break;
+ } else if (err == WSAENOBUFS) {
+ // this function used to not send more than 49152 per call to WSASendTo
+ // to avoid getting a WSAENOBUFS. However this is a performance regression
+ // and we think it only appears with old windows versions. We now handle the
+ // WSAENOBUFS and hope it never appears anyway.
+ // just go on, the next loop run we will try a smaller number
} else {
- int err = WSAGetLastError();
WS_ERROR_DEBUG(err);
switch (err) {
case WSAECONNRESET:
@@ -1029,6 +1035,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
}
break;
}
+
+ // for next send:
+ bytesToSend = qMin<qint64>(49152, len - ret);
}
#if defined (QNATIVESOCKETENGINE_DEBUG)
@@ -1059,7 +1068,7 @@ qint64 QNativeSocketEnginePrivate::nativeRead(char *data, qint64 maxLength)
break;
case WSAEBADF:
case WSAEINVAL:
- setError(QAbstractSocket::NetworkError, ReadErrorString);
+ //error string is now set in read(), not here in nativeRead()
break;
case WSAECONNRESET:
case WSAECONNABORTED:
@@ -1190,8 +1199,10 @@ void QNativeSocketEnginePrivate::nativeClose()
#if defined (QTCPSOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativeClose()");
#endif
- linger l = {1, 0};
- ::setsockopt(socketDescriptor, SOL_SOCKET, SO_DONTLINGER, (char*)&l, sizeof(l));
+ // We were doing a setsockopt here before with SO_DONTLINGER. (However with kind of wrong
+ // usage of parameters, it wants a BOOL but we used a struct and pretended it to be bool).
+ // We don't think setting this option should be done here, if a user wants it she/he can
+ // do it manually with socketDescriptor()/setSocketDescriptor();
::closesocket(socketDescriptor);
}
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index dd50c38..fd647e2 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -304,6 +304,7 @@ static QString _q_SubjectInfoToString(QSslCertificate::SubjectInfo info)
*/
QString QSslCertificate::issuerInfo(SubjectInfo info) const
{
+ // lazy init
if (d->issuerInfo.isEmpty() && d->x509)
d->issuerInfo =
_q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0));
@@ -320,7 +321,11 @@ QString QSslCertificate::issuerInfo(SubjectInfo info) const
*/
QString QSslCertificate::issuerInfo(const QByteArray &tag) const
{
- // ### Use a QByteArray for the keys in the map
+ // lazy init
+ if (d->issuerInfo.isEmpty() && d->x509)
+ d->issuerInfo =
+ _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0));
+
return d->issuerInfo.value(QString::fromLatin1(tag));
}
@@ -335,6 +340,7 @@ QString QSslCertificate::issuerInfo(const QByteArray &tag) const
*/
QString QSslCertificate::subjectInfo(SubjectInfo info) const
{
+ // lazy init
if (d->subjectInfo.isEmpty() && d->x509)
d->subjectInfo =
_q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0));
@@ -350,7 +356,11 @@ QString QSslCertificate::subjectInfo(SubjectInfo info) const
*/
QString QSslCertificate::subjectInfo(const QByteArray &tag) const
{
- // ### Use a QByteArray for the keys in the map
+ // lazy init
+ if (d->subjectInfo.isEmpty() && d->x509)
+ d->subjectInfo =
+ _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0));
+
return d->subjectInfo.value(QString::fromLatin1(tag));
}
@@ -624,11 +634,11 @@ QByteArray QSslCertificatePrivate::QByteArray_from_X509(X509 *x509, QSsl::Encodi
QByteArray tmp;
for (int i = 0; i <= array.size() - 64; i += 64) {
tmp += QByteArray::fromRawData(array.data() + i, 64);
- tmp += "\n";
+ tmp += '\n';
}
if (int remainder = array.size() % 64) {
tmp += QByteArray::fromRawData(array.data() + array.size() - remainder, remainder);
- tmp += "\n";
+ tmp += '\n';
}
return BEGINCERTSTRING "\n" + tmp + ENDCERTSTRING "\n";
@@ -686,11 +696,11 @@ QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509)
static bool matchLineFeed(const QByteArray &pem, int *offset)
{
- char ch = pem.at(*offset);
+ char ch;
// ignore extra whitespace at the end of the line
- while (ch == ' ' && *offset < pem.size())
- ch = pem.at(++*offset);
+ while (*offset < pem.size() && (ch = pem.at(*offset)) == ' ')
+ ++*offset;
if (ch == '\n') {
*offset += 1;
@@ -722,7 +732,7 @@ QList<QSslCertificate> QSslCertificatePrivate::certificatesFromPem(const QByteAr
break;
offset = endPos + sizeof(ENDCERTSTRING) - 1;
- if (!matchLineFeed(pem, &offset))
+ if (offset < pem.size() && !matchLineFeed(pem, &offset))
break;
QByteArray decoded = QByteArray::fromBase64(
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 6947aa7..9623570 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1109,7 +1109,7 @@ void QSslSocket::setCiphers(const QString &ciphers)
{
Q_D(QSslSocket);
d->configuration.ciphers.clear();
- foreach (QString cipherName, ciphers.split(QLatin1String(":"),QString::SkipEmptyParts)) {
+ foreach (const QString &cipherName, ciphers.split(QLatin1String(":"),QString::SkipEmptyParts)) {
for (int i = 0; i < 3; ++i) {
// ### Crude
QSslCipher cipher(cipherName, QSsl::SslProtocol(i));
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index de1583e..ce2aee1 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -553,6 +553,12 @@ void QSslSocketBackendPrivate::transmit()
#endif
writeBuffer.free(writtenBytes);
totalBytesWritten += writtenBytes;
+
+ if (writtenBytes < nextDataBlockSize) {
+ // break out of the writing loop and try again after we had read
+ transmitting = true;
+ break;
+ }
}
if (totalBytesWritten > 0) {
@@ -586,12 +592,26 @@ void QSslSocketBackendPrivate::transmit()
while ((pendingBytes = plainSocket->bytesAvailable()) > 0) {
// Read encrypted data from the socket into a buffer.
data.resize(pendingBytes);
- int decryptedBytesRead = plainSocket->read(data.data(), pendingBytes);
+ // just peek() here because q_BIO_write could write less data than expected
+ int encryptedBytesRead = plainSocket->peek(data.data(), pendingBytes);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocketBackendPrivate::transmit: read" << decryptedBytesRead << "encrypted bytes from the socket";
+ qDebug() << "QSslSocketBackendPrivate::transmit: read" << encryptedBytesRead << "encrypted bytes from the socket";
#endif
// Write encrypted data from the buffer into the read BIO.
- q_BIO_write(readBio, data.constData(), decryptedBytesRead);
+ int writtenToBio = q_BIO_write(readBio, data.constData(), encryptedBytesRead);
+
+ // do the actual read() here and throw away the results.
+ if (writtenToBio > 0) {
+ // ### TODO: make this cheaper by not making it memcpy. E.g. make it work with data=0x0 or make it work with seek
+ plainSocket->read(data.data(), writtenToBio);
+ } else {
+ // ### Better error handling.
+ q->setErrorString(QSslSocket::tr("Unable to decrypt data: %1").arg(SSL_ERRORSTR()));
+ q->setSocketError(QAbstractSocket::UnknownSocketError);
+ emit q->error(QAbstractSocket::UnknownSocketError);
+ return;
+ }
+
transmitting = true;
}
@@ -798,7 +818,7 @@ bool QSslSocketBackendPrivate::startHandshake()
QRegExp regexp(commonName, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.exactMatch(peerName)) {
bool matched = false;
- foreach (QString altName, configuration.peerCertificate
+ foreach (const QString &altName, configuration.peerCertificate
.alternateSubjectNames().values(QSsl::DnsEntry)) {
regexp.setPattern(altName);
if (regexp.exactMatch(peerName)) {
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 556b888..8183f08 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -184,6 +184,9 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
simpleShaderProg->addShader(vertexShader);
simpleShaderProg->addShader(fragShader);
simpleShaderProg->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR);
+ simpleShaderProg->bindAttributeLocation("pmvMatrix1", QT_PMV_MATRIX_1_ATTR);
+ simpleShaderProg->bindAttributeLocation("pmvMatrix2", QT_PMV_MATRIX_2_ATTR);
+ simpleShaderProg->bindAttributeLocation("pmvMatrix3", QT_PMV_MATRIX_3_ATTR);
simpleShaderProg->link();
if (!simpleShaderProg->isLinked()) {
qCritical() << "Errors linking simple shader:"
@@ -324,6 +327,11 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
newProg->program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR);
if (newProg->useOpacityAttribute)
newProg->program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR);
+ if (newProg->usePmvMatrix) {
+ newProg->program->bindAttributeLocation("pmvMatrix1", QT_PMV_MATRIX_1_ATTR);
+ newProg->program->bindAttributeLocation("pmvMatrix2", QT_PMV_MATRIX_2_ATTR);
+ newProg->program->bindAttributeLocation("pmvMatrix3", QT_PMV_MATRIX_3_ATTR);
+ }
newProg->program->link();
if (!newProg->program->isLinked()) {
@@ -424,7 +432,6 @@ GLuint QGLEngineShaderManager::getUniformLocation(Uniform id)
"patternColor",
"globalOpacity",
"depth",
- "pmvMatrix",
"maskTexture",
"fragmentColor",
"linearData",
@@ -743,6 +750,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
}
requiredProgram.useTextureCoords = texCoords;
requiredProgram.useOpacityAttribute = (opacityMode == AttributeOpacity);
+ requiredProgram.usePmvMatrix = true;
// At this point, requiredProgram is fully populated so try to find the program in the cache
currentShaderProg = sharedShaders->findProgramInCache(requiredProgram);
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index c52e5c0..3ab4ebe 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -253,6 +253,9 @@ struct QGLEngineCachedShaderProg
static const GLuint QT_VERTEX_COORDS_ATTR = 0;
static const GLuint QT_TEXTURE_COORDS_ATTR = 1;
static const GLuint QT_OPACITY_ATTR = 2;
+static const GLuint QT_PMV_MATRIX_1_ATTR = 3;
+static const GLuint QT_PMV_MATRIX_2_ATTR = 4;
+static const GLuint QT_PMV_MATRIX_3_ATTR = 5;
class QGLEngineShaderProg;
@@ -397,6 +400,7 @@ public:
bool useTextureCoords;
bool useOpacityAttribute;
+ bool usePmvMatrix;
bool operator==(const QGLEngineShaderProg& other) {
// We don't care about the program
@@ -431,7 +435,6 @@ public:
PatternColor,
GlobalOpacity,
Depth,
- PmvMatrix,
MaskTexture,
FragmentColor,
LinearData,
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index d9a61e9..ee04166 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -63,210 +63,229 @@ QT_BEGIN_NAMESPACE
QT_MODULE(OpenGL)
-static const char* const qglslMainVertexShader = "\
- uniform highp float depth;\
- void setPosition();\
- void main(void)\
- {\
- setPosition();\
- gl_Position.z = depth * gl_Position.w;\
- }";
-
-static const char* const qglslMainWithTexCoordsVertexShader = "\
- attribute highp vec2 textureCoordArray; \
- varying highp vec2 textureCoords; \
- uniform highp float depth;\
- void setPosition();\
- void main(void) \
- {\
- setPosition();\
- gl_Position.z = depth * gl_Position.w;\
- textureCoords = textureCoordArray; \
- }";
-
-static const char* const qglslMainWithTexCoordsAndOpacityVertexShader = "\
- attribute highp vec2 textureCoordArray; \
- attribute lowp float opacityArray; \
- varying highp vec2 textureCoords; \
- varying lowp float opacity; \
- uniform highp float depth; \
- void setPosition(); \
- void main(void) \
- { \
- setPosition(); \
- gl_Position.z = depth * gl_Position.w; \
- textureCoords = textureCoordArray; \
- opacity = opacityArray; \
- }";
+static const char* const qglslMainVertexShader = "\n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ }\n";
+
+static const char* const qglslMainWithTexCoordsVertexShader = "\n\
+ attribute highp vec2 textureCoordArray; \n\
+ varying highp vec2 textureCoords; \n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ textureCoords = textureCoordArray; \n\
+ }\n";
+
+static const char* const qglslMainWithTexCoordsAndOpacityVertexShader = "\n\
+ attribute highp vec2 textureCoordArray; \n\
+ attribute lowp float opacityArray; \n\
+ varying highp vec2 textureCoords; \n\
+ varying lowp float opacity; \n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ textureCoords = textureCoordArray; \n\
+ opacity = opacityArray; \n\
+ }\n";
// NOTE: We let GL do the perspective correction so texture lookups in the fragment
// shader are also perspective corrected.
-static const char* const qglslPositionOnlyVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- void setPosition(void)\
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position = vec4(transformedPos.xy, 0.0, transformedPos.z); \
- }";
-
-static const char* const qglslUntransformedPositionVertexShader = "\
- attribute highp vec4 vertexCoordsArray;\
- void setPosition(void)\
- {\
- gl_Position = vertexCoordsArray;\
- }";
+static const char* const qglslPositionOnlyVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position = vec4(transformedPos.xy, 0.0, transformedPos.z); \n\
+ }\n";
+
+static const char* const qglslUntransformedPositionVertexShader = "\n\
+ attribute highp vec4 vertexCoordsArray; \n\
+ void setPosition(void) \n\
+ { \n\
+ gl_Position = vertexCoordsArray; \n\
+ }\n";
// Pattern Brush - This assumes the texture size is 8x8 and thus, the inverted size is 0.125
-static const char* const qglslPositionWithPatternBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec2 invertedTextureSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 patternTexCoords; \
- void setPosition(void) { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1.0); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithPatternBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec2 invertedTextureSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 patternTexCoords; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1.0); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithPatternBrushVertexShader
= qglslPositionWithPatternBrushVertexShader;
-static const char* const qglslPatternBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture;\
- uniform lowp vec4 patternColor; \
- varying highp vec2 patternTexCoords;\
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \
+static const char* const qglslPatternBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ uniform lowp vec4 patternColor; \n\
+ varying highp vec2 patternTexCoords;\n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \n\
}\n";
// Linear Gradient Brush
-static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec3 linearData; \
- uniform highp mat3 brushTransform; \
- varying mediump float index; \
- void setPosition() { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec3 linearData; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying mediump float index; \n\
+ void setPosition() \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithLinearGradientBrushVertexShader
= qglslPositionWithLinearGradientBrushVertexShader;
-static const char* const qglslLinearGradientBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture; \
- varying mediump float index; \
- lowp vec4 srcPixel() { \
- mediump vec2 val = vec2(index, 0.5); \
- return texture2D(brushTexture, val); \
+static const char* const qglslLinearGradientBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ varying mediump float index; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ mediump vec2 val = vec2(index, 0.5); \n\
+ return texture2D(brushTexture, val); \n\
}\n";
// Conical Gradient Brush
-static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 A; \
- void setPosition(void)\
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 A; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ A = hTexCoords.xy * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithConicalGradientBrushVertexShader
= qglslPositionWithConicalGradientBrushVertexShader;
static const char* const qglslConicalGradientBrushSrcFragmentShader = "\n\
#define INVERSE_2PI 0.1591549430918953358 \n\
- uniform lowp sampler2D brushTexture; \n\
- uniform mediump float angle; \
- varying highp vec2 A; \
- lowp vec4 srcPixel() { \
- highp float t; \
- if (abs(A.y) == abs(A.x)) \
- t = (atan(-A.y + 0.002, A.x) + angle) * INVERSE_2PI; \
- else \
- t = (atan(-A.y, A.x) + angle) * INVERSE_2PI; \
- return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \
- }";
+ uniform lowp sampler2D brushTexture; \n\
+ uniform mediump float angle; \n\
+ varying highp vec2 A; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ highp float t; \n\
+ if (abs(A.y) == abs(A.x)) \n\
+ t = (atan(-A.y + 0.002, A.x) + angle) * INVERSE_2PI; \n\
+ else \n\
+ t = (atan(-A.y, A.x) + angle) * INVERSE_2PI; \n\
+ return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \n\
+ }\n";
// Radial Gradient Brush
-static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- uniform highp vec2 fmp; \
- varying highp float b; \
- varying highp vec2 A; \
- void setPosition(void) \
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- b = 2.0 * dot(A, fmp); \
- }";
+static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray;\n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ uniform highp vec2 fmp; \n\
+ varying highp float b; \n\
+ varying highp vec2 A; \n\
+ void setPosition(void) \n\
+ {\n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ A = hTexCoords.xy * invertedHTexCoordsZ; \n\
+ b = 2.0 * dot(A, fmp); \n\
+ }\n";
static const char* const qglslAffinePositionWithRadialGradientBrushVertexShader
= qglslPositionWithRadialGradientBrushVertexShader;
-static const char* const qglslRadialGradientBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture; \
- uniform highp float fmp2_m_radius2; \
- uniform highp float inverse_2_fmp2_m_radius2; \
- varying highp float b; \
- varying highp vec2 A; \
- lowp vec4 srcPixel() { \
- highp float c = -dot(A, A); \
- highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \
- return texture2D(brushTexture, val); \
- }";
+static const char* const qglslRadialGradientBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ uniform highp float fmp2_m_radius2; \n\
+ uniform highp float inverse_2_fmp2_m_radius2; \n\
+ varying highp float b; \n\
+ varying highp vec2 A; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ highp float c = -dot(A, A); \n\
+ highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \n\
+ return texture2D(brushTexture, val); \n\
+ }\n";
// Texture Brush
-static const char* const qglslPositionWithTextureBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec2 invertedTextureSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 textureCoords; \
- void setPosition(void) { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \
- }";
+static const char* const qglslPositionWithTextureBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec2 invertedTextureSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 textureCoords; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\
+ }\n";
static const char* const qglslAffinePositionWithTextureBrushVertexShader
= qglslPositionWithTextureBrushVertexShader;
@@ -275,148 +294,165 @@ static const char* const qglslAffinePositionWithTextureBrushVertexShader
// OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead,
// we emulate GL_REPEAT by only taking the fractional part of the texture coords.
// TODO: Special case POT textures which don't need this emulation
-static const char* const qglslTextureBrushSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(brushTexture, fract(textureCoords)); \
- }";
+static const char* const qglslTextureBrushSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() { \n\
+ return texture2D(brushTexture, fract(textureCoords)); \n\
+ }\n";
#else
-static const char* const qglslTextureBrushSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(brushTexture, textureCoords); \
- }";
+static const char* const qglslTextureBrushSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return texture2D(brushTexture, textureCoords); \n\
+ }\n";
#endif
-static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp vec4 patternColor; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \
- }";
+static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp vec4 patternColor; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \n\
+ }\n";
// Solid Fill Brush
-static const char* const qglslSolidBrushSrcFragmentShader = "\
- uniform lowp vec4 fragmentColor; \
- lowp vec4 srcPixel() { \
- return fragmentColor; \
- }";
-
-static const char* const qglslImageSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(imageTexture, textureCoords); \
- }";
-
-static const char* const qglslCustomSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \
- lowp vec4 srcPixel() { \
- return customShader(imageTexture, textureCoords); \
- }";
-
-static const char* const qglslImageSrcWithPatternFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp vec4 patternColor; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \
- }\n";
-
-static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- lowp vec4 sample = texture2D(imageTexture, textureCoords); \
- sample.rgb = sample.rgb * sample.a; \
- return sample; \
- }";
-
-static const char* const qglslShockingPinkSrcFragmentShader = "\
- lowp vec4 srcPixel() { \
- return vec4(0.98, 0.06, 0.75, 1.0); \
- }";
-
-static const char* const qglslMainFragmentShader_ImageArrays = "\
- varying lowp float opacity; \
- lowp vec4 srcPixel(); \
- void main() { \
- gl_FragColor = srcPixel() * opacity; \
- }";
-
-static const char* const qglslMainFragmentShader_CMO = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(compose(srcPixel()*globalOpacity))); \
- }";
-
-static const char* const qglslMainFragmentShader_CM = "\
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(compose(srcPixel())); \
- }";
-
-static const char* const qglslMainFragmentShader_MO = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(srcPixel()*globalOpacity); \
- }";
-
-static const char* const qglslMainFragmentShader_M = "\
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(srcPixel()); \
- }";
-
-static const char* const qglslMainFragmentShader_CO = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = compose(srcPixel()*globalOpacity); \
- }";
-
-static const char* const qglslMainFragmentShader_C = "\
- lowp vec4 srcPixel(); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = compose(srcPixel()); \
- }";
-
-static const char* const qglslMainFragmentShader_O = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- void main() { \
- gl_FragColor = srcPixel()*globalOpacity; \
- }";
-
-static const char* const qglslMainFragmentShader = "\
- lowp vec4 srcPixel(); \
- void main() { \
- gl_FragColor = srcPixel(); \
- }";
-
-static const char* const qglslMaskFragmentShader = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src * mask.a; \
- }";
+static const char* const qglslSolidBrushSrcFragmentShader = "\n\
+ uniform lowp vec4 fragmentColor; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return fragmentColor; \n\
+ }\n";
+
+static const char* const qglslImageSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return texture2D(imageTexture, textureCoords); \n\
+ }\n";
+
+static const char* const qglslCustomSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return customShader(imageTexture, textureCoords); \n\
+ }\n";
+
+static const char* const qglslImageSrcWithPatternFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp vec4 patternColor; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \n\
+ }\n";
+
+static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ lowp vec4 sample = texture2D(imageTexture, textureCoords); \n\
+ sample.rgb = sample.rgb * sample.a; \n\
+ return sample; \n\
+ }\n";
+
+static const char* const qglslShockingPinkSrcFragmentShader = "\n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return vec4(0.98, 0.06, 0.75, 1.0); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_ImageArrays = "\n\
+ varying lowp float opacity; \n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel() * opacity; \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CMO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(compose(srcPixel()*globalOpacity))); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CM = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(compose(srcPixel())); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_MO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(srcPixel()*globalOpacity); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_M = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(srcPixel()); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = compose(srcPixel()*globalOpacity); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_C = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = compose(srcPixel()); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_O = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel()*globalOpacity; \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader = "\n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel(); \n\
+ }\n";
+
+static const char* const qglslMaskFragmentShader = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ {\n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src * mask.a; \n\
+ }\n";
// For source over with subpixel antialiasing, the final color is calculated per component as follows
// (.a is alpha component, .c is red, green or blue component):
@@ -433,23 +469,23 @@ static const char* const qglslMaskFragmentShader = "\
// dest.c = dest.c * (1 - mask.c) + src.c * alpha
//
-static const char* const qglslRgbMaskFragmentShaderPass1 = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src.a * mask; \
- }";
-
-static const char* const qglslRgbMaskFragmentShaderPass2 = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src * mask; \
- }";
+static const char* const qglslRgbMaskFragmentShaderPass1 = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ { \n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src.a * mask; \n\
+ }\n";
+
+static const char* const qglslRgbMaskFragmentShaderPass2 = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ { \n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src * mask; \n\
+ }\n";
/*
Left to implement:
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 544d327..eff02b2 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -169,12 +169,6 @@ void QGL2PaintEngineExPrivate::useSimpleShader()
if (matrixDirty)
updateMatrix();
-
- if (simpleShaderMatrixUniformDirty) {
- const GLuint location = shaderManager->simpleProgram()->uniformLocation("pmvMatrix");
- glUniformMatrix3fv(location, 1, GL_FALSE, (GLfloat*)pmvMatrix);
- simpleShaderMatrixUniformDirty = false;
- }
}
void QGL2PaintEngineExPrivate::updateBrushTexture()
@@ -393,9 +387,11 @@ void QGL2PaintEngineExPrivate::updateMatrix()
matrixDirty = false;
- // The actual data has been updated so both shader program's uniforms need updating
- simpleShaderMatrixUniformDirty = true;
- shaderMatrixUniformDirty = true;
+ // Set the PMV matrix attribute. As we use an attributes rather than uniforms, we only
+ // need to do this once for every matrix change and persists across all shader programs.
+ glVertexAttrib3fv(QT_PMV_MATRIX_1_ATTR, pmvMatrix[0]);
+ glVertexAttrib3fv(QT_PMV_MATRIX_2_ATTR, pmvMatrix[1]);
+ glVertexAttrib3fv(QT_PMV_MATRIX_3_ATTR, pmvMatrix[2]);
dasher.setInvScale(inverseScale);
stroker.setInvScale(inverseScale);
@@ -563,6 +559,9 @@ void QGL2PaintEngineExPrivate::resetGLState()
glStencilMask(0xff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_ALWAYS, 0, 0xff);
+ glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
+ glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glDisableVertexAttribArray(QT_OPACITY_ATTR);
}
void QGL2PaintEngineEx::endNativePainting()
@@ -933,18 +932,12 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
if (changed) {
// The shader program has changed so mark all uniforms as dirty:
brushUniformsDirty = true;
- shaderMatrixUniformDirty = true;
opacityUniformDirty = true;
}
if (brushUniformsDirty && mode != ImageDrawingMode && mode != ImageArrayDrawingMode)
updateBrushUniforms();
- if (shaderMatrixUniformDirty) {
- glUniformMatrix3fv(location(QGLEngineShaderManager::PmvMatrix), 1, GL_FALSE, (GLfloat*)pmvMatrix);
- shaderMatrixUniformDirty = false;
- }
-
if (opacityMode == QGLEngineShaderManager::UniformOpacity && opacityUniformDirty) {
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::GlobalOpacity), (GLfloat)q->state()->opacity);
opacityUniformDirty = false;
@@ -2065,11 +2058,8 @@ void QGL2PaintEngineEx::setState(QPainterState *new_state)
if (old_state == s || old_state->renderHintsChanged)
renderHintsChanged();
- if (old_state == s || old_state->matrixChanged) {
+ if (old_state == s || old_state->matrixChanged)
d->matrixDirty = true;
- d->simpleShaderMatrixUniformDirty = true;
- d->shaderMatrixUniformDirty = true;
- }
if (old_state == s || old_state->compositionModeChanged)
d->compositionModeDirty = true;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 4ef1bb9..70a1621 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -254,8 +254,6 @@ public:
bool compositionModeDirty;
bool brushTextureDirty;
bool brushUniformsDirty;
- bool simpleShaderMatrixUniformDirty;
- bool shaderMatrixUniformDirty;
bool opacityUniformDirty;
bool stencilClean; // Has the stencil not been used for clipping so far?
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 0720170..fed1658 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 393893c..2a8a782 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 3f32cf3..dd977cb 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1590,10 +1590,8 @@ QGLTextureCache::QGLTextureCache()
Q_ASSERT(qt_gl_texture_cache == 0);
qt_gl_texture_cache = this;
- QImagePixmapCleanupHooks::instance()->addPixmapModificationHook(cleanupTextures);
-#ifdef Q_WS_X11
- QImagePixmapCleanupHooks::instance()->addPixmapDestructionHook(cleanupPixmapSurfaces);
-#endif
+ QImagePixmapCleanupHooks::instance()->addPixmapDataModificationHook(cleanupTextures);
+ QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->addImageHook(imageCleanupHook);
}
@@ -1601,10 +1599,8 @@ QGLTextureCache::~QGLTextureCache()
{
qt_gl_texture_cache = 0;
- QImagePixmapCleanupHooks::instance()->removePixmapModificationHook(cleanupTextures);
-#ifdef Q_WS_X11
- QImagePixmapCleanupHooks::instance()->removePixmapDestructionHook(cleanupPixmapSurfaces);
-#endif
+ QImagePixmapCleanupHooks::instance()->removePixmapDataModificationHook(cleanupTextures);
+ QImagePixmapCleanupHooks::instance()->removePixmapDataDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->removeImageHook(imageCleanupHook);
}
@@ -1672,30 +1668,30 @@ void QGLTextureCache::imageCleanupHook(qint64 cacheKey)
}
-void QGLTextureCache::cleanupTextures(QPixmap* pixmap)
+void QGLTextureCache::cleanupTextures(QPixmapData* pmd)
{
// ### remove when the GL texture cache becomes thread-safe
if (qApp->thread() == QThread::currentThread()) {
- const qint64 cacheKey = pixmap->cacheKey();
+ const qint64 cacheKey = pmd->cacheKey();
QGLTexture *texture = instance()->getTexture(cacheKey);
if (texture && texture->options & QGLContext::MemoryManagedBindOption)
instance()->remove(cacheKey);
}
}
-#if defined(Q_WS_X11)
-void QGLTextureCache::cleanupPixmapSurfaces(QPixmap* pixmap)
+void QGLTextureCache::cleanupBeforePixmapDestruction(QPixmapData* pmd)
{
// Remove any bound textures first:
- cleanupTextures(pixmap);
+ cleanupTextures(pmd);
+ Q_ASSERT(instance()->getTexture(pmd->cacheKey()) == 0);
- QPixmapData *pd = pixmap->data_ptr().data();
- if (pd->classId() == QPixmapData::X11Class) {
- Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken
- QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
+#if defined(Q_WS_X11)
+ if (pmd->classId() == QPixmapData::X11Class) {
+ Q_ASSERT(pmd->ref == 0); // Make sure reference counting isn't broken
+ QGLContextPrivate::destroyGlSurfaceForPixmap(pmd);
}
-}
#endif
+}
void QGLTextureCache::deleteIfEmpty()
{
@@ -4393,6 +4389,13 @@ static void qt_gl_draw_text(QPainter *p, int x, int y, const QString &str,
\note This function temporarily disables depth-testing when the
text is drawn.
+ \note This function can only be used inside a
+ QPainter::beginNativePainting()/QPainter::endNativePainting() block
+ if the default OpenGL paint engine is QPaintEngine::OpenGL. To make
+ QPaintEngine::OpenGL the default GL engine, call
+ QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the
+ QApplication constructor.
+
\l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
*/
@@ -4412,8 +4415,17 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
bool auto_swap = autoBufferSwap();
QPaintEngine::Type oldEngineType = qgl_engine_selector()->preferredPaintEngine();
- qgl_engine_selector()->setPreferredPaintEngine(QPaintEngine::OpenGL);
+
QPaintEngine *engine = paintEngine();
+ if (engine && (oldEngineType == QPaintEngine::OpenGL2) && engine->isActive()) {
+ qWarning("QGLWidget::renderText(): Calling renderText() while a GL 2 paint engine is"
+ " active on the same device is not allowed.");
+ return;
+ }
+
+ // this changes what paintEngine() returns
+ qgl_engine_selector()->setPreferredPaintEngine(QPaintEngine::OpenGL);
+ engine = paintEngine();
QPainter *p;
bool reuse_painter = false;
if (engine->isActive()) {
@@ -4506,8 +4518,17 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
win_y = height - win_y; // y is inverted
QPaintEngine::Type oldEngineType = qgl_engine_selector()->preferredPaintEngine();
- qgl_engine_selector()->setPreferredPaintEngine(QPaintEngine::OpenGL);
QPaintEngine *engine = paintEngine();
+
+ if (engine && (oldEngineType == QPaintEngine::OpenGL2) && engine->isActive()) {
+ qWarning("QGLWidget::renderText(): Calling renderText() while a GL 2 paint engine is"
+ " active on the same device is not allowed.");
+ return;
+ }
+
+ // this changes what paintEngine() returns
+ qgl_engine_selector()->setPreferredPaintEngine(QPaintEngine::OpenGL);
+ engine = paintEngine();
QPainter *p;
bool reuse_painter = false;
bool use_depth_testing = glIsEnabled(GL_DEPTH_TEST);
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 0104f07..713b067 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -522,7 +522,7 @@ public:
QSize bindCompressedTexturePVR(const char *buf, int len);
};
-class QGLTextureCache {
+class Q_AUTOTEST_EXPORT QGLTextureCache {
public:
QGLTextureCache();
~QGLTextureCache();
@@ -539,11 +539,8 @@ public:
static QGLTextureCache *instance();
static void deleteIfEmpty();
static void imageCleanupHook(qint64 cacheKey);
- static void cleanupTextures(QPixmap* pixmap);
-#ifdef Q_WS_X11
- // X11 needs to catch pixmap data destruction to delete EGL/GLX pixmap surfaces
- static void cleanupPixmapSurfaces(QPixmap* pixmap);
-#endif
+ static void cleanupTextures(QPixmapData* pixmap);
+ static void cleanupBeforePixmapDestruction(QPixmapData* pixmap);
private:
QCache<qint64, QGLTexture> m_cache;
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index f4cc7c7..61a16be 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1651,8 +1651,12 @@ static bool qt_resolveTextureFromPixmap(QPaintDevice *paintDevice)
{
return false; // Can't use TFP without NPOT
}
+
const QX11Info *xinfo = qt_x11Info(paintDevice);
- QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));
+ Display *display = xinfo ? xinfo->display() : X11->display;
+ int screen = xinfo ? xinfo->screen() : X11->defaultScreen;
+
+ QGLExtensionMatcher extensions(glXQueryExtensionsString(display, screen));
if (extensions.match("GLX_EXT_texture_from_pixmap")) {
glXBindTexImageEXT = (qt_glXBindTexImageEXT) qglx_getProcAddress("glXBindTexImageEXT");
glXReleaseTexImageEXT = (qt_glXReleaseTexImageEXT) qglx_getProcAddress("glXReleaseTexImageEXT");
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 11011ee..37bb7c0 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -319,14 +319,14 @@ public:
~QGLBlurTextureCache();
QGLBlurTextureInfo *takeBlurTextureInfo(const QPixmap &pixmap);
- bool hasBlurTextureInfo(const QPixmap &pixmap) const;
+ bool hasBlurTextureInfo(quint64 cacheKey) const;
void insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info);
- void clearBlurTextureInfo(const QPixmap &pixmap);
+ void clearBlurTextureInfo(quint64 cacheKey);
void timerEvent(QTimerEvent *event);
private:
- static void pixmapDestroyed(QPixmap *pixmap);
+ static void pixmapDestroyed(QPixmapData *pixmap);
QCache<quint64, QGLBlurTextureInfo > cache;
@@ -379,21 +379,21 @@ QGLBlurTextureInfo *QGLBlurTextureCache::takeBlurTextureInfo(const QPixmap &pixm
return cache.take(pixmap.cacheKey());
}
-void QGLBlurTextureCache::clearBlurTextureInfo(const QPixmap &pixmap)
+void QGLBlurTextureCache::clearBlurTextureInfo(quint64 cacheKey)
{
- cache.remove(pixmap.cacheKey());
+ cache.remove(cacheKey);
}
-bool QGLBlurTextureCache::hasBlurTextureInfo(const QPixmap &pixmap) const
+bool QGLBlurTextureCache::hasBlurTextureInfo(quint64 cacheKey) const
{
- return cache.contains(pixmap.cacheKey());
+ return cache.contains(cacheKey);
}
void QGLBlurTextureCache::insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info)
{
static bool hookAdded = false;
if (!hookAdded) {
- QImagePixmapCleanupHooks::instance()->addPixmapDestructionHook(pixmapDestroyed);
+ QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(pixmapDestroyed);
hookAdded = true;
}
@@ -406,11 +406,11 @@ void QGLBlurTextureCache::insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTe
timerId = startTimer(8000);
}
-void QGLBlurTextureCache::pixmapDestroyed(QPixmap *pixmap)
+void QGLBlurTextureCache::pixmapDestroyed(QPixmapData *pmd)
{
foreach (QGLBlurTextureCache *cache, blurTextureCaches) {
- if (cache->hasBlurTextureInfo(*pixmap))
- cache->clearBlurTextureInfo(*pixmap);
+ if (cache->hasBlurTextureInfo(pmd->cacheKey()))
+ cache->clearBlurTextureInfo(pmd->cacheKey());
}
}
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 5e2f1f5..79484fa 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -106,6 +106,19 @@ QT_BEGIN_NAMESPACE
\snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 2
+ \section1 Binary shaders and programs
+
+ Binary shaders may be specified using \c{glShaderBinary()} on
+ the return value from QGLShader::shaderId(). The QGLShader instance
+ containing the binary can then be added to the shader program with
+ addShader() and linked in the usual fashion with link().
+
+ Binary programs may be specified using \c{glProgramBinaryOES()}
+ on the return value from programId(). Then the application should
+ call link(), which will notice that the program has already been
+ specified and linked, allowing other operations to be performed
+ on the shader program.
+
\sa QGLShader
*/
@@ -632,8 +645,6 @@ bool QGLShaderProgram::addShader(QGLShader *shader)
qWarning("QGLShaderProgram::addShader: Program and shader are not associated with same context.");
return false;
}
- if (!shader->d_func()->compiled)
- return false;
if (!shader->d_func()->shaderGuard.id())
return false;
glAttachShader(d->programGuard.id(), shader->d_func()->shaderGuard.id());
@@ -820,8 +831,20 @@ bool QGLShaderProgram::link()
GLuint program = d->programGuard.id();
if (!program)
return false;
+ GLint value;
+ if (d->shaders.isEmpty()) {
+ // If there are no explicit shaders, then it is possible that the
+ // application added a program binary with glProgramBinaryOES(),
+ // or otherwise populated the shaders itself. Check to see if the
+ // program is already linked and bail out if so.
+ value = 0;
+ glGetProgramiv(program, GL_LINK_STATUS, &value);
+ d->linked = (value != 0);
+ if (d->linked)
+ return true;
+ }
glLinkProgram(program);
- GLint value = 0;
+ value = 0;
glGetProgramiv(program, GL_LINK_STATUS, &value);
d->linked = (value != 0);
value = 0;
@@ -928,6 +951,15 @@ void QGLShaderProgram::release()
GLuint QGLShaderProgram::programId() const
{
Q_D(const QGLShaderProgram);
+ GLuint id = d->programGuard.id();
+ if (id)
+ return id;
+
+ // Create the identifier if we don't have one yet. This is for
+ // applications that want to create the attached shader configuration
+ // themselves, particularly those using program binaries.
+ if (!const_cast<QGLShaderProgram *>(this)->init())
+ return 0;
return d->programGuard.id();
}
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 1bfb6e3..aa80664 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -341,7 +341,7 @@ void QGLPixmapData::ensureCreated() const
if (!m_source.isNull()) {
if (external_format == GL_RGB) {
- const QImage tx = m_source.convertToFormat(QImage::Format_RGB888);
+ const QImage tx = m_source.convertToFormat(QImage::Format_RGB888).mirrored(false, true);
glBindTexture(target, m_texture.id);
glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index a5e0239..55aa1d0 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -39,10 +39,19 @@
**
****************************************************************************/
+#include <QDebug>
+
#include <private/qgl_p.h>
#include <private/qegl_p.h>
#include <private/qeglproperties_p.h>
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
#include <private/qpaintengineex_opengl2_p.h>
+#endif
+
+#ifndef QT_OPENGL_ES_2
+#include <private/qpaintengine_opengl_p.h>
+#endif
#include "qpixmapdata_x11gl_p.h"
@@ -187,7 +196,14 @@ QX11GLPixmapData::~QX11GLPixmapData()
{
}
-static QGL2PaintEngineEx* qt_gl2_engine_for_pixmaps = 0;
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_pixmap_engine)
+#endif
+
QPaintEngine* QX11GLPixmapData::paintEngine() const
{
@@ -202,18 +218,41 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const
: qPixmapRGBSharedEglContext);
}
- if (!qt_gl2_engine_for_pixmaps)
- qt_gl2_engine_for_pixmaps = new QGL2PaintEngineEx();
+ QPaintEngine* engine;
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = qt_gl_pixmap_engine();
+#elif defined(QT_OPENGL_ES_2)
+ engine = qt_gl_pixmap_2_engine();
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = qt_gl_pixmap_2_engine();
+ else
+ engine = qt_gl_pixmap_engine();
+#endif
+
+
// Support multiple painters on multiple pixmaps simultaniously
- if (qt_gl2_engine_for_pixmaps->isActive()) {
+ if (engine->isActive()) {
qWarning("Pixmap paint engine already active");
- QPaintEngine* engine = new QGL2PaintEngineEx();
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = new QOpenGLPaintEngine;
+#elif defined(QT_OPENGL_ES_2)
+ engine = new QGL2PaintEngineEx;
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = new QGL2PaintEngineEx;
+ else
+ engine = new QOpenGLPaintEngine;
+#endif
+
engine->setAutoDestruct(true);
return engine;
}
- return qt_gl2_engine_for_pixmaps;
+ return engine;
}
void QX11GLPixmapData::beginPaint()
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 1cbfdaf..f27440e 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -552,6 +552,34 @@ QImage *QDirectFBPixmapData::buffer()
return &lockedImage;
}
+
+bool QDirectFBPixmapData::scroll(int dx, int dy, const QRect &rect)
+{
+ if (!dfbSurface) {
+ return false;
+ }
+ unlockSurface();
+ DFBResult result = dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBPixmapData::scroll", result);
+ return false;
+ }
+ result = dfbSurface->SetPorterDuff(dfbSurface, DSPD_NONE);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBPixmapData::scroll", result);
+ return false;
+ }
+
+ const DFBRectangle source = { rect.x(), rect.y(), rect.width(), rect.height() };
+ result = dfbSurface->Blit(dfbSurface, dfbSurface, &source, source.x + dx, source.y + dy);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBPixmapData::scroll", result);
+ return false;
+ }
+
+ return true;
+}
+
void QDirectFBPixmapData::invalidate()
{
if (dfbSurface) {
@@ -568,6 +596,3 @@ void QDirectFBPixmapData::invalidate()
QT_END_NAMESPACE
#endif // QT_NO_QWS_DIRECTFB
-
-
-
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
index f9b14a9..da6edc6 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
@@ -81,6 +81,7 @@ public:
virtual QImage toImage() const;
virtual QPaintEngine *paintEngine() const;
virtual QImage *buffer();
+ virtual bool scroll(int dx, int dy, const QRect &rect);
// Pure virtual in QPixmapData, so re-implement here and delegate to QDirectFBPaintDevice
virtual int metric(QPaintDevice::PaintDeviceMetric m) const { return QDirectFBPaintDevice::metric(m); }
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index cb9c921..6764e75 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -378,9 +378,6 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
return;
}
screen->flipSurface(dfbSurface, flipFlags, region, offset);
- if (noSystemBackground) {
- dfbSurface->Clear(dfbSurface, 0, 0, 0, 0);
- }
#else
setOpaque(windowOpacity != 0xff);
if (mode == Offscreen) {
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 4f49476..b2351fa 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -556,7 +556,11 @@ QImage ICOReader::iconAt(int index)
else // # colors used
icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
icoAttrib.w = iconEntry.bWidth;
+ if (icoAttrib.w == 0)
+ icoAttrib.w = header.biWidth;
icoAttrib.h = iconEntry.bHeight;
+ if (icoAttrib.h == 0)
+ icoAttrib.h = header.biHeight/2;
QImage::Format format = QImage::Format_ARGB32;
if (icoAttrib.nbits == 24)
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
index b66f8f9..3af8b40 100644
--- a/src/plugins/qpluginbase.pri
+++ b/src/plugins/qpluginbase.pri
@@ -1,6 +1,6 @@
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.6.1
+ VERSION=4.6.2
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/src/qbase.pri b/src/qbase.pri
index d1a2a75..710a2b6 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -4,7 +4,7 @@ INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat
isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.6.1
+ VERSION=4.6.2
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
@@ -94,31 +94,17 @@ symbian {
DEFINES+=QT_MAKEDLL
TARGET.CAPABILITY = All -Tcb
- defBlock = \
- "$${LITERAL_HASH}ifdef WINSCW" \
- "DEFFILE ../s60installs/bwins/$${TARGET}.def" \
- "$${LITERAL_HASH}elif defined EABI" \
- "DEFFILE ../s60installs/eabi/$${TARGET}.def" \
- "$${LITERAL_HASH}endif"
-
- contains(QT_CONFIG, private_tests) {
- #When building autotest configuration, there are extra exports from
- #the Qt DLLs, which we don't want in the frozen DEF files.
- MMP_RULES += EXPORTUNFROZEN
- } else {
- #When building without autotests, DEF files are used by default.
- #This is to maintain binary compatibility with previous releases.
-
- #with defBlock enabled, removed exported symbols are treated as errors
- #and there is binary compatibility between successive builds.
- #with defBlock disabled, binary compatibility is broken every time you build
- MMP_RULES += defBlock
-
- #with EXPORTUNFROZEN enabled, new exports are included in the dll without
- #needing to run abld freeze, however binary compatibility is only maintained
- #for symbols that are frozen (and only if defBlock is also enabled)
- #the downside of EXPORTUNFROZEN is that the linker gets run twice
- #MMP_RULES += EXPORTUNFROZEN
+ # When building without autotests, DEF files are used by default.
+ # This is to maintain binary compatibility with previous releases.
+ # To explicitly disable DEF files usage, eg. when lots of code churn is
+ # going on, and functions may be added and removed before shipping,
+ # configure with -no-usedeffiles
+ # WARNING - disabling DEF files *will* break BC with previous released versions
+ # of Qt, and the only compatibility will be between this build of Qt and anything
+ # built in this exact environment. *Never* use this when building a version
+ # for release.
+ contains(CONFIG, def_files) {
+ defFilePath=../s60installs
}
}
load(armcc_warnings)
diff --git a/src/s60installs/backup_registration.xml b/src/s60installs/backup_registration.xml
new file mode 100644
index 0000000..e026140
--- /dev/null
+++ b/src/s60installs/backup_registration.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+ <system_backup/>
+ <restore requires_reboot = "no"/>
+</backup_registration>
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index fe752c8..e7e890c 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4398,4 +4398,5 @@ EXPORTS
?object@WrappedEvent@QStateMachine@@QBEPAVQObject@@XZ @ 4397 NONAME ; class QObject * QStateMachine::WrappedEvent::object(void) const
?sender@SignalEvent@QStateMachine@@QBEPAVQObject@@XZ @ 4398 NONAME ; class QObject * QStateMachine::SignalEvent::sender(void) const
?signalIndex@SignalEvent@QStateMachine@@QBEHXZ @ 4399 NONAME ; int QStateMachine::SignalEvent::signalIndex(void) const
+ ?disconnectOne@QMetaObject@@SA_NPBVQObject@@H0H@Z @ 4400 NONAME ; bool QMetaObject::disconnectOne(class QObject const *, int, class QObject const *, int)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 7a629d7..da65230 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -10694,10 +10694,10 @@ EXPORTS
?swipeAngle@QSwipeGesture@@QBEMXZ @ 10693 NONAME ; float QSwipeGesture::swipeAngle(void) const
?symbianEventFilter@QApplication@@UAE_NPBVQSymbianEvent@@@Z @ 10694 NONAME ; bool QApplication::symbianEventFilter(class QSymbianEvent const *)
?symbianFilterEvent@QInputContext@@UAE_NPAVQWidget@@PBVQSymbianEvent@@@Z @ 10695 NONAME ; bool QInputContext::symbianFilterEvent(class QWidget *, class QSymbianEvent const *)
- ?symbianHandleCommand@QApplicationPrivate@@QAEHH@Z @ 10696 NONAME ; int QApplicationPrivate::symbianHandleCommand(int)
+ ?symbianHandleCommand@QApplicationPrivate@@QAEHH@Z @ 10696 NONAME ABSENT ; int QApplicationPrivate::symbianHandleCommand(int)
?symbianProcessEvent@QApplication@@QAEHPBVQSymbianEvent@@@Z @ 10697 NONAME ; int QApplication::symbianProcessEvent(class QSymbianEvent const *)
- ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVTWsEvent@@@Z @ 10698 NONAME ; int QApplicationPrivate::symbianProcessWsEvent(class TWsEvent const *)
- ?symbianResourceChange@QApplicationPrivate@@QAEHH@Z @ 10699 NONAME ; int QApplicationPrivate::symbianResourceChange(int)
+ ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVTWsEvent@@@Z @ 10698 NONAME ABSENT ; int QApplicationPrivate::symbianProcessWsEvent(class TWsEvent const *)
+ ?symbianResourceChange@QApplicationPrivate@@QAEHH@Z @ 10699 NONAME ABSENT ; int QApplicationPrivate::symbianResourceChange(int)
?symbol@Parser@QCss@@QBEABUSymbol@2@XZ @ 10700 NONAME ; struct QCss::Symbol const & QCss::Parser::symbol(void) const
?sync@QPaintEngineEx@@UAEXXZ @ 10701 NONAME ; void QPaintEngineEx::sync(void)
?syncBackingStore@QWidgetPrivate@@QAEXABVQRegion@@@Z @ 10702 NONAME ; void QWidgetPrivate::syncBackingStore(class QRegion const &)
@@ -12525,4 +12525,12 @@ EXPORTS
??0Tab@QTextOption@@QAE@ABU01@@Z @ 12524 NONAME ; QTextOption::Tab::Tab(struct QTextOption::Tab const &)
?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@ABV2@@Z @ 12525 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QRectF const &) const
?glyphCache@QFontEngine@@QBEPAVQFontEngineGlyphCache@@PAXW4Type@2@ABVQTransform@@@Z @ 12526 NONAME ; class QFontEngineGlyphCache * QFontEngine::glyphCache(void *, enum QFontEngineGlyphCache::Type, class QTransform const &) const
+ ?qt_blurImage@@YAXAAVQImage@@M_NH@Z @ 12527 NONAME ; void qt_blurImage(class QImage &, float, bool, int)
+ ?qt_blurImage@@YAXPAVQPainter@@AAVQImage@@M_N2H@Z @ 12528 NONAME ; void qt_blurImage(class QPainter *, class QImage &, float, bool, bool, int)
+ ?qt_halfScaled@@YA?AVQImage@@ABV1@@Z @ 12529 NONAME ; class QImage qt_halfScaled(class QImage const &)
+ ?qt_memrotate90@@YAXPBIHHHPAIH@Z @ 12530 NONAME ; void qt_memrotate90(unsigned int const *, int, int, int, unsigned int *, int)
+ ?qt_memrotate90_gl@@YAXPBIHHHPAIH@Z @ 12531 NONAME ; void qt_memrotate90_gl(unsigned int const *, int, int, int, unsigned int *, int)
+ ?symbianHandleCommand@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12532 NONAME ; int QApplicationPrivate::symbianHandleCommand(class QSymbianEvent const *)
+ ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12533 NONAME ; int QApplicationPrivate::symbianProcessWsEvent(class QSymbianEvent const *)
+ ?symbianResourceChange@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12534 NONAME ; int QApplicationPrivate::symbianResourceChange(class QSymbianEvent const *)
diff --git a/src/s60installs/bwins/QtScriptu.def b/src/s60installs/bwins/QtScriptu.def
index 8b53524..19f7037 100644
--- a/src/s60installs/bwins/QtScriptu.def
+++ b/src/s60installs/bwins/QtScriptu.def
@@ -369,4 +369,5 @@ EXPORTS
?willExecuteProgram@QScriptEngineAgentPrivate@@UAEXABVDebuggerCallFrame@QTJSC@@HH@Z @ 368 NONAME ; void QScriptEngineAgentPrivate::willExecuteProgram(class QTJSC::DebuggerCallFrame const &, int, int)
?staticMetaObject@QScriptExtensionPlugin@@2UQMetaObject@@B @ 369 NONAME ; struct QMetaObject const QScriptExtensionPlugin::staticMetaObject
?staticMetaObject@QScriptEngine@@2UQMetaObject@@B @ 370 NONAME ; struct QMetaObject const QScriptEngine::staticMetaObject
+ ?isQObject@QScriptDeclarativeClass@@UBE_NXZ @ 371 NONAME ; bool QScriptDeclarativeClass::isQObject(void) const
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 89fa76f..a427ff9 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3633,4 +3633,5 @@ EXPORTS
_ZTIN13QStateMachine12WrappedEventE @ 3632 NONAME
_ZTVN13QStateMachine11SignalEventE @ 3633 NONAME
_ZTVN13QStateMachine12WrappedEventE @ 3634 NONAME
+ _ZN11QMetaObject13disconnectOneEPK7QObjectiS2_i @ 3635 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b6862e5..05f620c 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -11629,9 +11629,9 @@ EXPORTS
_ZN18QTapAndHoldGestureC1EP7QObject @ 11628 NONAME
_ZN18QTapAndHoldGestureC2EP7QObject @ 11629 NONAME
_ZN19QAbstractScrollArea18setViewportMarginsERK8QMargins @ 11630 NONAME
- _ZN19QApplicationPrivate20symbianHandleCommandEi @ 11631 NONAME
- _ZN19QApplicationPrivate21symbianProcessWsEventEPK8TWsEvent @ 11632 NONAME
- _ZN19QApplicationPrivate21symbianResourceChangeEi @ 11633 NONAME
+ _ZN19QApplicationPrivate20symbianHandleCommandEi @ 11631 NONAME ABSENT
+ _ZN19QApplicationPrivate21symbianProcessWsEventEPK8TWsEvent @ 11632 NONAME ABSENT
+ _ZN19QApplicationPrivate21symbianResourceChangeEi @ 11633 NONAME ABSENT
_ZN19QGraphicsBlurEffect12setBlurHintsE6QFlagsINS_8BlurHintEE @ 11634 NONAME
_ZN19QGraphicsBlurEffect13setBlurRadiusEf @ 11635 NONAME
_ZN19QGraphicsBlurEffect16blurHintsChangedE6QFlagsINS_8BlurHintEE @ 11636 NONAME
@@ -11784,4 +11784,12 @@ EXPORTS
_ZNK14QEglProperties8toStringEv @ 11783 NONAME ABSENT
_ZNK11QFontEngine10glyphCacheEPvN21QFontEngineGlyphCache4TypeERK10QTransform @ 11784 NONAME
_ZNK20QGraphicsItemPrivate21effectiveBoundingRectERK6QRectF @ 11785 NONAME
+ _Z12qt_blurImageP8QPainterR6QImagefbbi @ 11786 NONAME
+ _Z12qt_blurImageR6QImagefbi @ 11787 NONAME
+ _Z13qt_halfScaledRK6QImage @ 11788 NONAME
+ _Z14qt_memrotate90PKjiiiPji @ 11789 NONAME
+ _Z17qt_memrotate90_glPKjiiiPji @ 11790 NONAME
+ _ZN19QApplicationPrivate20symbianHandleCommandEPK13QSymbianEvent @ 11791 NONAME
+ _ZN19QApplicationPrivate21symbianProcessWsEventEPK13QSymbianEvent @ 11792 NONAME
+ _ZN19QApplicationPrivate21symbianResourceChangeEPK13QSymbianEvent @ 11793 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 8df03c2..8a4be2c 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -393,4 +393,5 @@ EXPORTS
_ZNK23QScriptDeclarativeClass7contextEv @ 392 NONAME
_ZTI23QScriptDeclarativeClass @ 393 NONAME
_ZTV23QScriptDeclarativeClass @ 394 NONAME
+ _ZNK23QScriptDeclarativeClass9isQObjectEv @ 395 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index f24ac4b..bdd668c 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -90,27 +90,27 @@ file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll
S60_APP_RESOURCE(s60main)
// imageformats stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
// codecs stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
// iconengines stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
// Phonon MMF backend
-data=\epoc32\data\qt\qtlibspluginstubs\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
// graphicssystems
-data=\epoc32\data\qt\qtlibspluginstubs\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
// Stub sis file
data=ZSYSTEM\install\qt.sis System\Install\qt.sis
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index bbc758b..aaecf6c 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -78,7 +78,11 @@ symbian: {
DEPLOYMENT += phonon_backend_plugins
}
- DEPLOYMENT += qtresources qtlibraries imageformats_plugins codecs_plugins graphicssystems_plugins
+ # Support backup & restore for Qt libraries
+ qtbackup.sources = backup_registration.xml
+ qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+
+ DEPLOYMENT += qtresources qtlibraries qtbackup imageformats_plugins codecs_plugins graphicssystems_plugins
contains(QT_CONFIG, svg): {
qtlibraries.sources += QtSvg.dll
@@ -112,9 +116,4 @@ symbian: {
BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)"
BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)"
- PLUGIN_STUBS = $$files(qmakepluginstubs/*)
- for(STUB, PLUGIN_STUBS) {
- STUB_FILENAME = $$basename(STUB)
- BLD_INF_RULES.prj_exports += "qmakepluginstubs/$${STUB_FILENAME} /epoc32/data/qt/qtlibspluginstubs/$${STUB_FILENAME}"
- }
}
diff --git a/src/s60installs/sqlite3_selfsigned.sis b/src/s60installs/sqlite3_selfsigned.sis
new file mode 100644
index 0000000..a025ac5
--- /dev/null
+++ b/src/s60installs/sqlite3_selfsigned.sis
Binary files differ
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 1db2e1b..5bfe46a 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1148,10 +1148,15 @@ bool QScriptValue::strictlyEquals(const QScriptValue &other) const
}
if (d->type != other.d_ptr->type) {
- if (d->type == QScriptValuePrivate::JavaScriptCore)
- return JSC::JSValue::strictEqual(d->jscValue, d->engine->scriptValueToJSCValue(other));
- else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore)
- return JSC::JSValue::strictEqual(other.d_ptr->engine->scriptValueToJSCValue(*this), other.d_ptr->jscValue);
+ if (d->type == QScriptValuePrivate::JavaScriptCore) {
+ QScriptEnginePrivate *eng_p = d->engine ? d->engine : other.d_ptr->engine;
+ if (eng_p)
+ return JSC::JSValue::strictEqual(d->jscValue, eng_p->scriptValueToJSCValue(other));
+ } else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore) {
+ QScriptEnginePrivate *eng_p = other.d_ptr->engine ? other.d_ptr->engine : d->engine;
+ if (eng_p)
+ return JSC::JSValue::strictEqual(eng_p->scriptValueToJSCValue(*this), other.d_ptr->jscValue);
+ }
return false;
}
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index fb0dddb..db312bc 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -978,7 +978,8 @@ JSC::JSValue QtFunction::execute(JSC::ExecState *exec, JSC::JSValue thisValue,
QScriptObjectDelegate *delegate = scriptObject->delegate();
Q_ASSERT(delegate && (delegate->type() == QScriptObjectDelegate::QtObject));
QObject *qobj = static_cast<QScript::QObjectDelegate*>(delegate)->value();
- Q_ASSERT_X(qobj != 0, "QtFunction::call", "handle the case when QObject has been deleted");
+ if (!qobj)
+ return JSC::throwError(exec, JSC::GeneralError, QString::fromLatin1("cannot call function of deleted QObject"));
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
const QMetaObject *meta = qobj->metaObject();
@@ -2219,7 +2220,14 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv)
JSC::call(exec, slot, callType, callData, thisObject, jscArgs);
if (exec->hadException()) {
- engine->emitSignalHandlerException();
+ if (slot.inherits(&QtFunction::info) && !static_cast<QtFunction*>(JSC::asObject(slot))->qobject()) {
+ // The function threw an error because the target QObject has been deleted.
+ // The connections list is stale; remove the signal handler and ignore the exception.
+ removeSignalHandler(sender(), signalIndex, receiver, slot);
+ exec->clearException();
+ } else {
+ engine->emitSignalHandlerException();
+ }
}
}
diff --git a/src/src.pro b/src/src.pro
index 8dec49b..f2070ae 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -106,6 +106,7 @@ src_declarative.target = sub-declarative
contains(QT_CONFIG, webkit) {
src_webkit.depends = src_gui src_sql src_network src_xml
contains(QT_CONFIG, phonon):src_webkit.depends += src_phonon
+ contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns
contains(QT_CONFIG, declarative):src_declarative.depends += src_webkit
#exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore
}
diff --git a/src/tools/uic3/converter.cpp b/src/tools/uic3/converter.cpp
index 8fe2a24..2bf293d 100644
--- a/src/tools/uic3/converter.cpp
+++ b/src/tools/uic3/converter.cpp
@@ -121,7 +121,7 @@ static inline bool isKDEClass(const QString &className)
return className.at(1) .isUpper() && className.at(2).isLower();
}
-DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes)
+DomUI *Ui3Reader::generateUi4(const QDomElement &widget)
{
QDomNodeList nl;
candidateCustomWidgets.clear();
@@ -474,7 +474,7 @@ DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes)
// Magic header generation feature for legacy KDE forms
// (for example, filesharing/advanced/kcm_sambaconf/share.ui)
- if (implicitIncludes && isKDEClass(customClass)) {
+ if ((m_options & ImplicitIncludes) && isKDEClass(customClass)) {
QString header = customClass.toLower();
header += QLatin1String(".h");
DomHeader *domHeader = new DomHeader;
@@ -710,10 +710,13 @@ DomWidget *Ui3Reader::createWidget(const QDomElement &w, const QString &widgetCl
ui_action_list.append(a);
} else if (t == QLatin1String("property")) {
// skip the property it is already handled by createProperties
-
- QString name = e.attribute(QLatin1String("name")); // change the varname this widget
- if (name == QLatin1String("name"))
- ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString());
+ const QString name = e.attribute(QLatin1String("name")); // change the varname this widget
+ if (name == QLatin1String("name")) {
+ // Do not name QLayoutWidget if layout names are to be used.
+ const bool applyName = !(m_options & PreserveLayoutNames) || className != QLatin1String("QLayoutWidget");
+ if (applyName)
+ ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString());
+ }
} else if (t == QLatin1String("row")) {
DomRow *row = new DomRow();
row->read(e);
@@ -797,6 +800,11 @@ DomLayout *Ui3Reader::createLayout(const QDomElement &w)
createProperties(w, &ui_property_list, className);
createAttributes(w, &ui_attribute_list, className);
+ if (m_options & PreserveLayoutNames) {
+ const QString layoutName = getLayoutName(w);
+ if (!layoutName.isEmpty())
+ lay->setAttributeName(layoutName);
+ }
QDomElement e = w.firstChild().toElement();
while (!e.isNull()) {
diff --git a/src/tools/uic3/form.cpp b/src/tools/uic3/form.cpp
index ac2668b..df1314f 100644
--- a/src/tools/uic3/form.cpp
+++ b/src/tools/uic3/form.cpp
@@ -100,7 +100,7 @@ QByteArray combinePath(const char *infile, const char *outfile)
\sa createFormImpl()
*/
-void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
+void Ui3Reader::createFormDecl(const QDomElement &e)
{
QDomElement body = e;
@@ -138,7 +138,7 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
QString tagName = n3.tagName().toLower();
if (tagName == QLatin1String("class")) {
cl = n3.firstChild().toText().data();
- if (!nofwd)
+ if (m_options & CustomWidgetForwardDeclarations)
forwardDecl << cl;
customWidgets.insert(cl, 0);
} else if (tagName == QLatin1String("header")) {
@@ -257,10 +257,10 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
d.option().copyrightHeader = false;
d.option().extractImages = m_extractImages;
d.option().qrcOutputFile = m_qrcOutputFile;
- d.option().implicitIncludes = implicitIncludes;
+ d.option().implicitIncludes = (m_options & ImplicitIncludes) ? 1 : 0;
if (trmacro.size())
d.option().translateFunction = trmacro;
- DomUI *ui = generateUi4(e, implicitIncludes);
+ DomUI *ui = generateUi4(e);
d.uic(fileName, ui, &out);
delete ui;
diff --git a/src/tools/uic3/main.cpp b/src/tools/uic3/main.cpp
index ecc345e..6acc94f 100644
--- a/src/tools/uic3/main.cpp
+++ b/src/tools/uic3/main.cpp
@@ -78,13 +78,11 @@ int runUic3(int argc, char * argv[])
QByteArray image_tmpfile;
const char* projectName = 0;
const char* trmacro = 0;
- bool nofwd = false;
bool fix = false;
bool deps = false;
- bool implicitIncludes = true;
+ unsigned readerOptions = Ui3Reader::ImplicitIncludes|Ui3Reader::CustomWidgetForwardDeclarations;
QByteArray pchFile;
-
QApplication app(argc, argv, false);
for (int n = 1; n < argc && error == 0; n++) {
@@ -146,9 +144,11 @@ int runUic3(int argc, char * argv[])
} else if (opt == "d") {
deps = true;
} else if (opt == "no-implicit-includes") {
- implicitIncludes = false;
+ readerOptions &= ~Ui3Reader::ImplicitIncludes;
} else if (opt == "nofwd") {
- nofwd = true;
+ readerOptions &= ~Ui3Reader::CustomWidgetForwardDeclarations;
+ } else if (opt == "layout-names") {
+ readerOptions |= Ui3Reader::PreserveLayoutNames;
} else if (opt == "nounload") {
// skip
} else if (opt == "convert") {
@@ -253,6 +253,7 @@ int runUic3(int argc, char * argv[])
"\t-extract qrcFile Create resource file and extract embedded images into \"image\" dir\n"
"\t-pch file Add #include \"file\" as the first statement in implementation\n"
"\t-nofwd Omit forward declarations of custom classes\n"
+ "\t-layout-names Preserve layout names of Qt Designer 3\n"
"\t-no-implicit-includes Do not generate #include-directives for custom classes\n"
"\t-nounload Do not unload plugins after processing\n"
"\t-tr func Use func() instead of tr() for i18n\n"
@@ -289,9 +290,8 @@ int runUic3(int argc, char * argv[])
QTextStream out(&fileOut);
- Ui3Reader ui3(out);
+ Ui3Reader ui3(out, readerOptions);
ui3.setExtractImages(extract, qrcOutputFile);
-
if (projectName && imagecollection) {
out.setEncoding(QTextStream::Latin1);
ui3.embed(projectName, images);
@@ -349,7 +349,7 @@ int runUic3(int argc, char * argv[])
return 0;
} else if (convert) {
- ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc, implicitIncludes);
+ ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc);
return 0;
}
@@ -388,8 +388,6 @@ int runUic3(int argc, char * argv[])
subcl,
QString::fromUtf8(trmacro),
QString::fromUtf8(className),
- nofwd,
- implicitIncludes,
convertedUi);
if (!protector.isEmpty()) {
diff --git a/src/tools/uic3/ui3reader.cpp b/src/tools/uic3/ui3reader.cpp
index 6c5bda3..fd50a19 100644
--- a/src/tools/uic3/ui3reader.cpp
+++ b/src/tools/uic3/ui3reader.cpp
@@ -176,7 +176,6 @@ void Ui3Reader::init()
{
outputFileName.clear();
trmacro.clear();
- nofwd = false;
fileName.clear();
writeFunctImpl = true;
@@ -241,11 +240,10 @@ QDomElement Ui3Reader::parse(const QDomDocument &doc)
return widget;
}
-Ui3Reader::Ui3Reader(QTextStream &outStream)
- : out(outStream), trout(&languageChangeBody)
+Ui3Reader::Ui3Reader(QTextStream &outStream, unsigned options) :
+ m_options(options), out(outStream), trout(&languageChangeBody),
+ m_porting(new Porting), m_extractImages(false)
{
- m_porting = new Porting();
- m_extractImages = false;
}
Ui3Reader::~Ui3Reader()
@@ -255,14 +253,13 @@ Ui3Reader::~Ui3Reader()
void Ui3Reader::generate(const QString &fn, const QString &outputFn,
QDomDocument doc, bool decl, bool subcl, const QString &trm,
- const QString& subClass, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile)
+ const QString& subClass, const QString &convertedUiFile)
{
init();
fileName = fn;
outputFileName = outputFn;
trmacro = trm;
- nofwd = omitForwardDecls;
QDomElement e = parse(doc);
@@ -281,21 +278,21 @@ void Ui3Reader::generate(const QString &fn, const QString &outputFn,
createSubImpl(e, subClass);
} else {
if (decl)
- createFormDecl(e, implicitIncludes);
+ createFormDecl(e);
else
createFormImpl(e);
}
}
-void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes)
+void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc)
{
init();
fileName = fn;
outputFileName = outputFn;
- DomUI *ui = generateUi4(parse(doc), implicitIncludes);
+ DomUI *ui = generateUi4(parse(doc));
if (!ui)
return;
@@ -317,11 +314,6 @@ void Ui3Reader::setTrMacro(const QString &trmacro)
this->trmacro = trmacro;
}
-void Ui3Reader::setForwardDeclarationsEnabled(bool b)
-{
- nofwd = !b;
-}
-
void Ui3Reader::setOutputFileName(const QString &fileName)
{
outputFileName = fileName;
diff --git a/src/tools/uic3/ui3reader.h b/src/tools/uic3/ui3reader.h
index cd17835..144ef05 100644
--- a/src/tools/uic3/ui3reader.h
+++ b/src/tools/uic3/ui3reader.h
@@ -68,23 +68,24 @@ typedef QList<QPair<int, Color> > ColorGroup;
class Ui3Reader
{
public:
- Ui3Reader(QTextStream &stream);
+ enum Options { CustomWidgetForwardDeclarations = 0x1, ImplicitIncludes = 0x2, PreserveLayoutNames = 0x4 };
+
+ explicit Ui3Reader(QTextStream &stream, unsigned options);
~Ui3Reader();
void computeDeps(const QDomElement &e, QStringList &globalIncludes, QStringList &localIncludes, bool impl = false);
- void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes);
+ void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc);
void generate(const QString &fn, const QString &outputFn,
QDomDocument doc, bool decl, bool subcl, const QString &trm,
- const QString& subclname, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile);
+ const QString& subclname, const QString &convertedUiFile);
void embed(const char *project, const QStringList &images);
void setTrMacro(const QString &trmacro);
- void setForwardDeclarationsEnabled(bool b);
void setOutputFileName(const QString &fileName);
- void createFormDecl(const QDomElement &e, bool implicitIncludes);
+ void createFormDecl(const QDomElement &e);
void createFormImpl(const QDomElement &e);
void createWrapperDecl(const QDomElement &e, const QString &convertedUiFile);
@@ -125,7 +126,7 @@ private:
void errorInvalidSlot(const QString &slot, const QString &widgetName, const QString &widgetClass,
int line, int col);
- DomUI *generateUi4(const QDomElement &e, bool implicitIncludes);
+ DomUI *generateUi4(const QDomElement &e);
DomWidget *createWidget(const QDomElement &w, const QString &widgetClass = QString());
void createProperties(const QDomElement &e, QList<DomProperty*> *properties, const QString &className);
void createAttributes(const QDomElement &e, QList<DomProperty*> *properties, const QString &className);
@@ -145,6 +146,8 @@ private:
void fixLayoutMargin(DomLayout *ui_layout);
+ const unsigned m_options;
+
QTextStream &out;
QTextOStream trout;
QString languageChangeBody;
@@ -157,7 +160,6 @@ private:
QString formName;
QString lastItem;
QString trmacro;
- bool nofwd;
struct Buddy
{
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 657c79a..cae959b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2596,11 +2596,15 @@ QDomNode QDomNode::removeChild(const QDomNode& oldChild)
already has an element node as a child, \a newChild is not added as
a child and a null node is returned.
- Calling this function on a null node(created, for example, with the
- default constructor) does nothing.
+ Returns a new reference to \a newChild on success or a \link
+ isNull() null node\endlink on failure.
- The DOM specification disallow inserting attribute nodes, but due
- to historical reasons QDom accept them nevertheless.
+ Calling this function on a null node(created, for example, with
+ the default constructor) does nothing and returns a \link isNull()
+ null node\endlink.
+
+ The DOM specification disallow inserting attribute nodes, but for
+ historical reasons, QDom accepts them anyway.
\sa insertBefore() insertAfter() replaceChild() removeChild()
*/
diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp
index c250d0c..6daa470 100644
--- a/src/xmlpatterns/parser/qquerytransformparser.cpp
+++ b/src/xmlpatterns/parser/qquerytransformparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/xmlpatterns/parser/qquerytransformparser_p.h b/src/xmlpatterns/parser/qquerytransformparser_p.h
index 204b6f8..0b316ec 100644
--- a/src/xmlpatterns/parser/qquerytransformparser_p.h
+++ b/src/xmlpatterns/parser/qquerytransformparser_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/xmlpatterns/parser/qxslttokenlookup.cpp b/src/xmlpatterns/parser/qxslttokenlookup.cpp
index a46ec8a..781ba0d 100644
--- a/src/xmlpatterns/parser/qxslttokenlookup.cpp
+++ b/src/xmlpatterns/parser/qxslttokenlookup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/xmlpatterns/parser/qxslttokenlookup_p.h b/src/xmlpatterns/parser/qxslttokenlookup_p.h
index b45407d..6d004b0 100644
--- a/src/xmlpatterns/parser/qxslttokenlookup_p.h
+++ b/src/xmlpatterns/parser/qxslttokenlookup_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4215e97..3198a65 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -8,10 +8,14 @@ TEMPLATE = subdirs
compiler \
compilerwarnings \
linguist \
+ maketestselftest \
moc \
uic \
uic3 \
- guiapplauncher
+ guiapplauncher \
+ #atwrapper \ # These tests need significant updating,
+ #uiloader \ # they have hardcoded machine names etc.
+
Q3SUBDIRS += \
q3accel \
q3action \
@@ -130,6 +134,7 @@ SUBDIRS += \
qdoublevalidator \
qdrag \
qerrormessage \
+ qevent \
qeventloop \
qexplicitlyshareddatapointer \
qfile \
@@ -478,7 +483,8 @@ embedded:!wince* {
}
symbian {
- SUBDIRS += qsoftkeymanager
+ SUBDIRS += qsoftkeymanager \
+ qs60mainapplication
}
# Enable the tests specific to QtXmlPatterns. If you add a test, remember to
@@ -563,3 +569,21 @@ contains(QT_CONFIG, webkit): SUBDIRS += \
qwebhistory
contains(QT_CONFIG, declarative): SUBDIRS += declarative
+
+# Following tests depends on private API
+!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+ qcssparser \
+ qgraphicssceneindex \
+ qhttpnetworkconnection \
+ qhttpnetworkreply \
+ qnativesocketengine \
+ qnetworkreply \
+ qpathclipper \
+ qsocketnotifier \
+ qsocks5socketengine \
+ qstylesheetstyle \
+ qtextpiecetable \
+ xmlpatternsdiagnosticsts \
+ xmlpatternsview \
+ xmlpatternsxqts \
+ xmlpatternsxslts
diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore
index 389f2dc..a11e8d1 100644
--- a/tests/auto/linguist/lupdate/.gitignore
+++ b/tests/auto/linguist/lupdate/.gitignore
@@ -1,4 +1,4 @@
tst_lupdate
-testdata/good/*/project.ts
-testdata/good/*/*/project.ts
-testdata/recursivescan/*.ts
+testdata/*/*.ts
+testdata/*/*/*.ts
+testdata/*/*/*/*.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd
new file mode 100644
index 0000000..301d839
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd
@@ -0,0 +1,2 @@
+cd ../../recursivescan
+lupdate sub/finddialog.cpp -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result
index 5c3c21c..5c3c21c 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd
new file mode 100644
index 0000000..1814e67
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd
@@ -0,0 +1,2 @@
+cd ../../recursivescan
+lupdate . -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result
index 95a34fa..95a34fa 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt
new file mode 100644
index 0000000..feecdda
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt
@@ -0,0 +1 @@
+lupdate warning: Codec for tr\(\) 'ISO-8859-1' disagrees with existing file's codec 'UTF-8'\. Expect trouble\.
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp
new file mode 100644
index 0000000..e4210c5
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+int main(int argc, char **argv)
+{
+ QObject::tr("hi");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro
new file mode 100644
index 0000000..00a4dc4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro
@@ -0,0 +1,4 @@
+SOURCES += main.cpp
+
+TRANSLATIONS = project.ts
+CODECFORTR = latin1
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before
new file mode 100644
index 0000000..07ad79b
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>UTF-8</defaultcodec>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="44"/>
+ <source>hi</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result
new file mode 100644
index 0000000..b6899c1
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="44"/>
+ <source>hi</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp
new file mode 100644
index 0000000..e4210c5
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+int main(int argc, char **argv)
+{
+ QObject::tr("hi");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro
new file mode 100644
index 0000000..4fddb02
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro
@@ -0,0 +1,4 @@
+SOURCES += main.cpp
+
+TRANSLATIONS = project.ts
+CODECFORTR = latin2
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before
new file mode 100644
index 0000000..e18e34e
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>ISO-8859-2</defaultcodec>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="44"/>
+ <source>hi</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result
new file mode 100644
index 0000000..e18e34e
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>ISO-8859-2</defaultcodec>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="44"/>
+ <source>hi</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd
new file mode 100644
index 0000000..8a5b4ad
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd
@@ -0,0 +1 @@
+lupdate translations/translations.pro
diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result
new file mode 100644
index 0000000..7167cf3
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="src/main.cpp" line="49"/>
+ <source>string in main.cpp</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="src/main.h" line="45"/>
+ <source>string in main.h</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp
new file mode 100644
index 0000000..1a24ab2
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+#include "main.h"
+
+int main(char **argv, int argc)
+{
+ return QApplication::tr("string in main.cpp");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h
new file mode 100644
index 0000000..cc07d7c
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+QT_TRANSLATE_NOOP("QApplication", "string in main.h")
diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro b/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro
new file mode 100644
index 0000000..1815c37
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro
@@ -0,0 +1,7 @@
+VPATH = ../src
+INCLUDEPATH = ../src
+
+SOURCES += main.cpp
+HEADERS += main.h
+
+TRANSLATIONS += ../project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd
new file mode 100644
index 0000000..40987e2
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd
@@ -0,0 +1,2 @@
+TRANSLATION: project.ts project_sub.ts
+cd ../../subdirs_full
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result
new file mode 100644
index 0000000..7d9a6f4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>subdir1</name>
+ <message>
+ <location filename="subdir1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>subsub1</name>
+ <message>
+ <location filename="subdir2/subsub1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result
new file mode 100644
index 0000000..cddb963
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>ISO-8859-2</defaultcodec>
+<context>
+ <name>subsub2</name>
+ <message>
+ <location filename="subdir2/subsub2/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt
new file mode 100644
index 0000000..fd7a158
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt
@@ -0,0 +1,2 @@
+lupdate warning: TS files from command line will override TRANSLATIONS in project\.pro\.
+lupdate warning: TS files from command line prevent recursing into .*/subdir2/subsub2/subsub2\.pro\.
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd
new file mode 100644
index 0000000..33296c3
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd
@@ -0,0 +1,3 @@
+TRANSLATION: project.ts project_sub.ts
+cd ../../subdirs_full
+lupdate project.pro -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result
new file mode 100644
index 0000000..7d9a6f4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>subdir1</name>
+ <message>
+ <location filename="subdir1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>subsub1</name>
+ <message>
+ <location filename="subdir2/subsub1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd
new file mode 100644
index 0000000..628acc0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd
@@ -0,0 +1,2 @@
+cd ../../subdirs_full
+lupdate subdir1/subdir1.pro subdir2/subsub1/subsub1.pro -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result
new file mode 100644
index 0000000..7d9a6f4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>subdir1</name>
+ <message>
+ <location filename="subdir1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>subsub1</name>
+ <message>
+ <location filename="subdir2/subsub1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt
new file mode 100644
index 0000000..808db18
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt
@@ -0,0 +1 @@
+lupdate warning: no TS files specified\. Only diagnostics will be produced for 'project\.pro'\.
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd
new file mode 100644
index 0000000..3e15bc7
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd
@@ -0,0 +1,2 @@
+TRANSLATION: project.ts project_sub.ts
+cd ../../subdirs_part
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result
new file mode 100644
index 0000000..cddb963
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>ISO-8859-2</defaultcodec>
+<context>
+ <name>subsub2</name>
+ <message>
+ <location filename="subdir2/subsub2/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt
new file mode 100644
index 0000000..b904390
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt
@@ -0,0 +1 @@
+lupdate warning: TS files from command line prevent recursing into .*/subdir2/subsub2/subsub2\.pro\.
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd
new file mode 100644
index 0000000..41bfcec
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd
@@ -0,0 +1,3 @@
+TRANSLATION: project.ts project_sub.ts
+cd ../../subdirs_part
+lupdate project.pro -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result
new file mode 100644
index 0000000..7d9a6f4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>subdir1</name>
+ <message>
+ <location filename="subdir1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>subsub1</name>
+ <message>
+ <location filename="subdir2/subsub1/main.cpp" line="45"/>
+ <source>minimal test</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before
diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd
index da6103f..90f609b 100644
--- a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd
+++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd
@@ -1,2 +1 @@
TRANSLATION: translations/project.ts
-lupdate project.pro -ts translations/project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro
new file mode 100644
index 0000000..1f744a7
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS = subdir1 subdir2/subdir2.pro
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp
new file mode 100644
index 0000000..0f1dc70
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subdir1","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro
new file mode 100644
index 0000000..28dcadc
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro
@@ -0,0 +1 @@
+SOURCES += main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro
new file mode 100644
index 0000000..f8d03df
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = subsub1 subsub2
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp
new file mode 100644
index 0000000..8c82c80
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subsub1","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro
new file mode 100644
index 0000000..28dcadc
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro
@@ -0,0 +1 @@
+SOURCES += main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp
new file mode 100644
index 0000000..ff85936
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subsub2","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro
new file mode 100644
index 0000000..3499222
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro
@@ -0,0 +1,4 @@
+SOURCES += main.cpp
+
+TRANSLATIONS = ../../project_sub.ts
+CODECFORTR = ISO-8859-2
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro
new file mode 100644
index 0000000..d803c37
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = subdir1 subdir2/subdir2.pro
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp
new file mode 100644
index 0000000..0f1dc70
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subdir1","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro
new file mode 100644
index 0000000..28dcadc
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro
@@ -0,0 +1 @@
+SOURCES += main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro
new file mode 100644
index 0000000..f8d03df
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = subsub1 subsub2
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp
new file mode 100644
index 0000000..8c82c80
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subsub1","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro
new file mode 100644
index 0000000..28dcadc
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro
@@ -0,0 +1 @@
+SOURCES += main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp
new file mode 100644
index 0000000..ff85936
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+QString foo()
+{
+ QCoreApplication::translate("subsub2","minimal test");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro
new file mode 100644
index 0000000..3499222
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro
@@ -0,0 +1,4 @@
+SOURCES += main.cpp
+
+TRANSLATIONS = ../../project_sub.ts
+CODECFORTR = ISO-8859-2
diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp
index 568be37..c179462 100644
--- a/tests/auto/linguist/lupdate/tst_lupdate.cpp
+++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp
@@ -59,8 +59,6 @@ public:
private slots:
void good_data();
void good();
- void commandline_data();
- void commandline();
#if CHECK_SIMTEXTH
void simtexth();
void simtexth_data();
@@ -245,10 +243,10 @@ void tst_lupdate::good()
qDebug() << "Checking...";
- QString generatedtsfile(dir + QLatin1String("/project.ts"));
-
- // look for a command
+ QString workDir = dir;
+ QStringList generatedtsfiles(QLatin1String("project.ts"));
QString lupdatecmd;
+
QFile file(dir + "/lupdatecmd");
if (file.exists()) {
QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(file.fileName()));
@@ -262,23 +260,32 @@ void tst_lupdate::good()
break;
} else if (cmdstring.startsWith("TRANSLATION:")) {
cmdstring.remove(0, 12);
- generatedtsfile = dir + QLatin1Char('/') + cmdstring.trimmed();
+ generatedtsfiles.clear();
+ foreach (const QByteArray &s, cmdstring.split(' '))
+ if (!s.isEmpty())
+ generatedtsfiles << s;
+ } else if (cmdstring.startsWith("cd ")) {
+ cmdstring.remove(0, 3);
+ workDir = QDir::cleanPath(dir + QLatin1Char('/') + cmdstring);
}
}
file.close();
}
- QFile::remove(generatedtsfile);
- QString beforetsfile = generatedtsfile + QLatin1String(".before");
- if (QFile::exists(beforetsfile))
- QVERIFY2(QFile::copy(beforetsfile, generatedtsfile), qPrintable(beforetsfile));
+ foreach (const QString &ts, generatedtsfiles) {
+ QString genTs = workDir + QLatin1Char('/') + ts;
+ QFile::remove(genTs);
+ QString beforetsfile = dir + QLatin1Char('/') + ts + QLatin1String(".before");
+ if (QFile::exists(beforetsfile))
+ QVERIFY2(QFile::copy(beforetsfile, genTs), qPrintable(beforetsfile));
+ }
if (lupdatecmd.isEmpty())
lupdatecmd = QLatin1String("project.pro");
lupdatecmd.prepend("-silent ");
QProcess proc;
- proc.setWorkingDirectory(dir);
+ proc.setWorkingDirectory(workDir);
proc.setProcessChannelMode(QProcess::MergedChannels);
proc.start(m_cmdLupdate + ' ' + lupdatecmd, QIODevice::ReadWrite | QIODevice::Text);
QVERIFY2(proc.waitForFinished(5000), qPrintable(lupdatecmd));
@@ -287,7 +294,7 @@ void tst_lupdate::good()
"\"lupdate " + lupdatecmd.toLatin1() + "\" crashed\n" + output);
QVERIFY2(!proc.exitCode(),
"\"lupdate " + lupdatecmd.toLatin1() + "\" exited with code " +
- QByteArray::number(proc.exitCode()) + "\n" + proc.readAll());
+ QByteArray::number(proc.exitCode()) + "\n" + output);
// If the file expectedoutput.txt exists, compare the
// console output with the content of that file
@@ -299,47 +306,9 @@ void tst_lupdate::good()
return;
}
- QString expectedFile = generatedtsfile + QLatin1String(".result");
- doCompare(generatedtsfile, expectedFile, false);
-}
-
-void tst_lupdate::commandline_data()
-{
- QTest::addColumn<QString>("currentPath");
- QTest::addColumn<QString>("commandline");
- QTest::addColumn<QString>("generatedtsfile");
- QTest::addColumn<QString>("expectedtsfile");
-
- QTest::newRow("Recursive scan") << QString("recursivescan")
- << QString(". -ts foo.ts") << QString("foo.ts") << QString("foo.ts.result");
- QTest::newRow("Deep path argument") << QString("recursivescan")
- << QString("sub/finddialog.cpp -ts bar.ts") << QString("bar.ts") << QString("bar.ts.result");
-}
-
-void tst_lupdate::commandline()
-{
- QFETCH(QString, currentPath);
- QFETCH(QString, commandline);
- QFETCH(QString, generatedtsfile);
- QFETCH(QString, expectedtsfile);
-
- QString generated =
- m_basePath + currentPath + QLatin1Char('/') + generatedtsfile;
- QFile gen(generated);
- if (gen.exists())
- QVERIFY(gen.remove());
- QProcess proc;
- proc.setWorkingDirectory(m_basePath + currentPath);
- proc.setProcessChannelMode(QProcess::MergedChannels);
- proc.start(m_cmdLupdate + " -silent " + commandline, QIODevice::ReadWrite | QIODevice::Text);
- QVERIFY2(proc.waitForFinished(5000), qPrintable(commandline));
- QVERIFY2(proc.exitStatus() == QProcess::NormalExit,
- "\"lupdate -silent " + commandline.toLatin1() + "\" crashed\n" + proc.readAll());
- QVERIFY2(!proc.exitCode(),
- "\"lupdate -silent " + commandline.toLatin1() + "\" exited with code " +
- QByteArray::number(proc.exitCode()) + "\n" + proc.readAll());
-
- doCompare(generated, m_basePath + currentPath + QLatin1Char('/') + expectedtsfile, false);
+ foreach (const QString &ts, generatedtsfiles)
+ doCompare(workDir + QLatin1Char('/') + ts,
+ dir + QLatin1Char('/') + ts + QLatin1String(".result"), false);
}
#if CHECK_SIMTEXTH
diff --git a/tests/auto/maketestselftest/maketestselftest.pro b/tests/auto/maketestselftest/maketestselftest.pro
new file mode 100644
index 0000000..6cc1744
--- /dev/null
+++ b/tests/auto/maketestselftest/maketestselftest.pro
@@ -0,0 +1,9 @@
+load(qttest_p4)
+
+SOURCES += tst_maketestselftest.cpp
+QT = core
+
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
+requires(!cross_compile)
+
diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp
new file mode 100644
index 0000000..c674202
--- /dev/null
+++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDir>
+#include <QFile>
+#include <QRegExp>
+#include <QStringList>
+#include <QTest>
+
+class tst_MakeTestSelfTest: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void auto_dot_pro();
+ void auto_dot_pro_data();
+};
+
+/* Verify that all tests are listed somewhere in auto.pro */
+void tst_MakeTestSelfTest::auto_dot_pro()
+{
+ static QStringList lines;
+
+ if (lines.isEmpty()) {
+ QString filename = QString::fromLatin1(SRCDIR "/../auto.pro");
+ QFile file(filename);
+ if (!file.open(QIODevice::ReadOnly)) {
+ QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString())));
+ }
+ while (!file.atEnd()) {
+ lines << file.readLine().trimmed();
+ }
+ }
+
+ QFETCH(QString, subdir);
+ QRegExp re(QString("( |=|^|#)%1( |\\\\|$)").arg(QRegExp::escape(subdir)));
+ foreach (const QString& line, lines) {
+ if (re.indexIn(line) != -1) {
+ return;
+ }
+ }
+
+ QFAIL(qPrintable(QString(
+ "Subdir `%1' is missing from tests/auto/auto.pro\n"
+ "This means the test won't be compiled or run on any platform.\n"
+ "If this is intentional, please put the test name in a comment in auto.pro.").arg(subdir))
+ );
+}
+
+void tst_MakeTestSelfTest::auto_dot_pro_data()
+{
+ QTest::addColumn<QString>("subdir");
+ QDir dir(SRCDIR "/..");
+ QStringList subdirs = dir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot);
+
+ foreach (const QString& subdir, subdirs) {
+ QTest::newRow(qPrintable(subdir)) << subdir;
+ }
+}
+
+QTEST_MAIN(tst_MakeTestSelfTest)
+#include "tst_maketestselftest.moc"
diff --git a/tests/auto/mediaobject/dummy/dummy.pro b/tests/auto/mediaobject/dummy/dummy.pro
index 5417b50..2f27c4a 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.1
+ VERSION=4.6.2
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 35e4463..5c72c7a 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -76,6 +76,7 @@ private slots:
void qCompress();
void qUncompress_data();
void qUncompress();
+ void qCompressionZeroTermination();
#endif
void constByteArray();
void leftJustified();
@@ -261,6 +262,14 @@ void tst_QByteArray::qUncompress()
}
QCOMPARE(res, out);
}
+
+void tst_QByteArray::qCompressionZeroTermination()
+{
+ QString s = "Hello, I'm a string.";
+ QByteArray ba = ::qUncompress(::qCompress(s.toLocal8Bit()));
+ QVERIFY((int) *(ba.data() + ba.size()) == 0);
+}
+
#endif
void tst_QByteArray::constByteArray()
diff --git a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
index b9d9d7e..d846615 100644
--- a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -64,6 +64,7 @@ private slots:
void screenNumberForQWidget();
void screenNumberForQPoint();
void availableGeometry();
+ void screenGeometry();
};
tst_QDesktopWidget::tst_QDesktopWidget()
@@ -98,6 +99,9 @@ void tst_QDesktopWidget::primaryScreen()
void tst_QDesktopWidget::availableGeometry()
{
QDesktopWidget desktop;
+ QTest::ignoreMessage(QtWarningMsg, "QDesktopWidget::availableGeometry(): Attempt "
+ "to get the available geometry of a null widget");
+ desktop.availableGeometry((QWidget *)0);
QRect total;
QRect available;
@@ -158,6 +162,27 @@ void tst_QDesktopWidget::screenNumberForQPoint()
QVERIFY(screen >= 0 && screen < desktopWidget->numScreens());
}
+void tst_QDesktopWidget::screenGeometry()
+{
+ QDesktopWidget *desktopWidget = QApplication::desktop();
+ QTest::ignoreMessage(QtWarningMsg, "QDesktopWidget::screenGeometry(): Attempt "
+ "to get the screen geometry of a null widget");
+ QRect r = desktopWidget->screenGeometry((QWidget *)0);
+ QVERIFY(r.isNull());
+ QWidget widget;
+ widget.show();
+ QTest::qWaitForWindowShown(&widget);
+ r = desktopWidget->screenGeometry(&widget);
+
+ QRect total;
+ QRect available;
+ for (int i = 0; i < desktopWidget->screenCount(); ++i) {
+ total = desktopWidget->screenGeometry(i);
+ available = desktopWidget->availableGeometry(i);
+ }
+ QVERIFY(total.contains(r));
+}
+
QTEST_MAIN(tst_QDesktopWidget)
#include "tst_qdesktopwidget.moc"
diff --git a/tests/auto/qgl/qgl.pro b/tests/auto/qgl/qgl.pro
index 420c4bb..9116f39 100644
--- a/tests/auto/qgl/qgl.pro
+++ b/tests/auto/qgl/qgl.pro
@@ -6,6 +6,6 @@ load(qttest_p4)
requires(contains(QT_CONFIG,opengl))
QT += opengl
-SOURCES += tst_qgl.cpp
-
+SOURCES += tst_qgl.cpp
+RESOURCES = qgl.qrc
diff --git a/tests/auto/qgl/qgl.qrc b/tests/auto/qgl/qgl.qrc
new file mode 100644
index 0000000..653794a
--- /dev/null
+++ b/tests/auto/qgl/qgl.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="designer.png">../qpixmap/images/designer.png</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index cf4616e..d37d727 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -56,6 +56,7 @@
#ifdef QT_BUILD_INTERNAL
#include <QtOpenGL/private/qgl_p.h>
+#include <QtGui/private/qpixmapdata_p.h>
#endif
//TESTED_CLASS=
@@ -91,6 +92,8 @@ private slots:
void clipTest();
void destroyFBOAfterContext();
void shareRegister();
+ void qglContextDefaultBindTexture();
+ void textureCleanup();
};
tst_QGL::tst_QGL()
@@ -1938,5 +1941,242 @@ void tst_QGL::shareRegister()
#endif
}
+// Tests QGLContext::bindTexture with default options
+void tst_QGL::qglContextDefaultBindTexture()
+{
+#ifdef QT_BUILD_INTERNAL
+ QGLWidget w;
+ w.makeCurrent();
+
+ QGLContext *ctx = const_cast<QGLContext*>(w.context());
+
+ QImage *boundImage = new QImage(256, 256, QImage::Format_RGB32);
+ boundImage->fill(0xFFFFFFFF);
+ QPixmap *boundPixmap = new QPixmap(256, 256);
+ boundPixmap->fill(Qt::red);
+
+ // Check that calling QGLContext::bindTexture with default args adds textures to cache
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ GLuint boundImageTextureId = ctx->bindTexture(*boundImage);
+ GLuint boundPixmapTextureId = ctx->bindTexture(*boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Make sure the texture IDs returned are valid:
+ QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_TRUE);
+ QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_TRUE);
+
+ // Make sure the textures are still there after we delete the image/pixmap:
+ delete boundImage;
+ boundImage = 0;
+ delete boundPixmap;
+ boundPixmap = 0;
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Make sure the textures are deleted from the cache after calling QGLContext::deleteTexture()
+ ctx->deleteTexture(boundImageTextureId);
+ ctx->deleteTexture(boundPixmapTextureId);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ // Finally, make sure QGLContext::deleteTexture also deleted the texture IDs:
+ QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_FALSE);
+ QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_FALSE);
+#endif
+}
+
+void tst_QGL::textureCleanup()
+{
+#ifdef QT_BUILD_INTERNAL
+ QGLWidget w;
+ w.resize(200,200);
+ w.show();
+ w.makeCurrent();
+
+ // Test pixmaps which have been loaded via QPixmapCache are removed from the texture cache
+ // when the pixmap cache is cleared
+ {
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ QPainter p(&w);
+
+ QPixmap boundPixmap(":designer.png");
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawPixmap(0, 0, boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ // Check that the texture doesn't get removed from the cache when the pixmap is cleared
+ // as it should still be in the cache:
+ boundPixmap = QPixmap();
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ QPixmapCache::clear();
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+ }
+
+ // Test pixmaps which have been loaded via QPixmapCache are removed from the texture cache
+ // when they are explicitly removed from the pixmap cache
+ {
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ QPainter p(&w);
+
+ QPixmap boundPixmap(128, 128);
+ QString cacheKey = QString::fromLatin1("myPixmap");
+ QPixmapCache::insert(cacheKey, boundPixmap);
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawPixmap(0, 0, boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ // Check that the texture doesn't get removed from the cache when the pixmap is cleared
+ // as it should still be in the cache:
+ boundPixmap = QPixmap();
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ // Finally, we check that the texture cache entry is removed when we remove the
+ // pixmap cache entry, which should hold the last reference:
+ QPixmapCache::remove(cacheKey);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+ }
+
+ // Check images & pixmaps are removed from the cache when they are deleted
+ {
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ QPainter p(&w);
+
+ QImage *boundImage = new QImage(256, 256, QImage::Format_RGB32);
+ boundImage->fill(0xFFFFFFFF);
+ QPixmap *boundPixmap = new QPixmap(256, 256);
+ boundPixmap->fill(Qt::red);
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawImage(0, 0, *boundImage);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ p.drawPixmap(0, 0, *boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ delete boundImage;
+ boundImage = 0;
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ delete boundPixmap;
+ boundPixmap = 0;
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+ }
+
+ // Check images & pixmaps are removed from the cache when they are assigned to
+ {
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ QPainter p(&w);
+
+ QImage boundImage(256, 256, QImage::Format_RGB32);
+ boundImage.fill(0xFFFFFFFF);
+ QPixmap boundPixmap(256, 256);
+ boundPixmap.fill(Qt::red);
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawImage(0, 0, boundImage);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ p.drawPixmap(0, 0, boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ boundImage = QImage(64, 64, QImage::Format_RGB32);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ boundPixmap = QPixmap(64, 64);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+ }
+
+ // Check images & pixmaps are removed from the cache when they are modified (detached)
+ {
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ QPainter p(&w);
+
+ QImage boundImage(256, 256, QImage::Format_RGB32);
+ boundImage.fill(0xFFFFFFFF);
+ QPixmap boundPixmap(256, 256);
+ boundPixmap.fill(Qt::red);
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawImage(0, 0, boundImage);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ p.drawPixmap(0, 0, boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ boundImage.fill(0x00000000);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ boundPixmap.fill(Qt::blue);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+ }
+
+ // Check that images/pixmaps aren't removed from the cache if a shallow copy has been made
+ QImage copyOfImage;
+ QPixmap copyOfPixmap;
+ int startCacheItemCount = QGLTextureCache::instance()->size();
+ {
+ QPainter p(&w);
+
+ QImage boundImage(256, 256, QImage::Format_RGB32);
+ boundImage.fill(0xFFFFFFFF);
+ QPixmap boundPixmap(256, 256);
+ boundPixmap.fill(Qt::red);
+
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+
+ p.drawImage(0, 0, boundImage);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ p.drawPixmap(0, 0, boundPixmap);
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ // Need to call end for the GL2 paint engine to release references to pixmap if using tfp
+ p.end();
+
+ copyOfImage = boundImage;
+ copyOfPixmap = boundPixmap;
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+ } // boundImage & boundPixmap would have been deleted when they went out of scope
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2);
+
+ copyOfImage = QImage();
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
+
+ copyOfPixmap = QPixmap();
+ QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
+#endif
+}
+
QTEST_MAIN(tst_QGL)
#include "tst_qgl.moc"
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index 51e2a57..795431b 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -71,6 +71,7 @@ private slots:
void colorize();
void drawPixmapItem();
void deviceCoordinateTranslateCaching();
+ void inheritOpacity();
};
void tst_QGraphicsEffect::initTestCase()
@@ -79,8 +80,8 @@ void tst_QGraphicsEffect::initTestCase()
class CustomItem : public QGraphicsRectItem
{
public:
- CustomItem(qreal x, qreal y, qreal width, qreal height)
- : QGraphicsRectItem(x, y, width, height), numRepaints(0),
+ CustomItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = 0)
+ : QGraphicsRectItem(x, y, width, height, parent), numRepaints(0),
m_painter(0), m_styleOption(0)
{}
@@ -560,6 +561,35 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching()
QVERIFY(item->numRepaints == numRepaints);
}
+void tst_QGraphicsEffect::inheritOpacity()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem *rectItem = new QGraphicsRectItem(0, 0, 10, 10);
+ CustomItem *item = new CustomItem(0, 0, 10, 10, rectItem);
+
+ scene.addItem(rectItem);
+
+ item->setGraphicsEffect(new DeviceEffect);
+ item->setPen(Qt::NoPen);
+ item->setBrush(Qt::red);
+
+ rectItem->setOpacity(0.5);
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QTRY_VERIFY(item->numRepaints >= 1);
+
+ int numRepaints = item->numRepaints;
+
+ rectItem->setOpacity(1);
+ QTest::qWait(50);
+
+ // item should have been rerendered due to opacity changing
+ QTRY_VERIFY(item->numRepaints > numRepaints);
+}
+
QTEST_MAIN(tst_QGraphicsEffect)
#include "tst_qgraphicseffect.moc"
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 8e43bce..ae038e7 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -251,6 +251,21 @@ public:
QBrush brush;
};
+class MyGraphicsView : public QGraphicsView
+{
+public:
+ int repaints;
+ QRegion paintedRegion;
+ MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {}
+ void paintEvent(QPaintEvent *e)
+ {
+ paintedRegion += e->region();
+ ++repaints;
+ QGraphicsView::paintEvent(e);
+ }
+ void reset() { repaints = 0; paintedRegion = QRegion(); }
+};
+
class tst_QGraphicsItem : public QObject
{
Q_OBJECT
@@ -316,6 +331,7 @@ private slots:
void childrenBoundingRectTransformed();
void childrenBoundingRect2();
void childrenBoundingRect3();
+ void childrenBoundingRect4();
void group();
void setGroup();
void setGroup2();
@@ -417,6 +433,9 @@ private slots:
void task197802_childrenVisibility();
void QTBUG_4233_updateCachedWithSceneRect();
void QTBUG_5418_textItemSetDefaultColor();
+ void QTBUG_6738_missingUpdateWithSetParent();
+ void QTBUG_7714_fullUpdateDiscardingOpacityUpdate2();
+ void QT_2653_fullUpdateDiscardingOpacityUpdate();
private:
QList<QGraphicsItem *> paintedItems;
@@ -3163,7 +3182,6 @@ void tst_QGraphicsItem::childrenBoundingRect()
childChild->setPos(500, 500);
child->rotate(90);
-
scene.addPolygon(parent->mapToScene(parent->boundingRect() | parent->childrenBoundingRect()))->setPen(QPen(Qt::red));;
QGraphicsView view(&scene);
@@ -3257,6 +3275,32 @@ void tst_QGraphicsItem::childrenBoundingRect3()
QCOMPARE(subTreeRect.height(), qreal(251.7766952966369));
}
+void tst_QGraphicsItem::childrenBoundingRect4()
+{
+ QGraphicsScene scene;
+
+ QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 10, 10));
+ QGraphicsRectItem *rect2 = scene.addRect(QRectF(0, 0, 20, 20));
+ QGraphicsRectItem *rect3 = scene.addRect(QRectF(0, 0, 30, 30));
+ rect2->setParentItem(rect);
+ rect3->setParentItem(rect);
+
+ QGraphicsView view(&scene);
+ view.show();
+
+ QTest::qWaitForWindowShown(&view);
+
+ // Try to mess up the cached bounding rect.
+ rect->childrenBoundingRect();
+ rect2->childrenBoundingRect();
+
+ rect3->setOpacity(0.0);
+ rect3->setParentItem(rect2);
+
+ QCOMPARE(rect->childrenBoundingRect(), rect3->boundingRect());
+ QCOMPARE(rect2->childrenBoundingRect(), rect3->boundingRect());
+}
+
void tst_QGraphicsItem::group()
{
QGraphicsScene scene;
@@ -6224,13 +6268,6 @@ void tst_QGraphicsItem::opacity2()
QGraphicsScene scene;
scene.addItem(parent);
- class MyGraphicsView : public QGraphicsView
- { public:
- int repaints;
- MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {}
- void paintEvent(QPaintEvent *e) { ++repaints; QGraphicsView::paintEvent(e); }
- };
-
MyGraphicsView view(&scene);
view.show();
QTest::qWaitForWindowShown(&view);
@@ -6308,20 +6345,6 @@ void tst_QGraphicsItem::opacityZeroUpdates()
QGraphicsScene scene;
scene.addItem(parent);
- class MyGraphicsView : public QGraphicsView
- { public:
- int repaints;
- QRegion paintedRegion;
- MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {}
- void paintEvent(QPaintEvent *e)
- {
- ++repaints;
- paintedRegion += e->region();
- QGraphicsView::paintEvent(e);
- }
- void reset() { repaints = 0; paintedRegion = QRegion(); }
- };
-
MyGraphicsView view(&scene);
view.show();
QTest::qWaitForWindowShown(&view);
@@ -7048,21 +7071,6 @@ void tst_QGraphicsItem::deviceTransform()
QCOMPARE(rect3->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult3);
}
-class MyGraphicsView : public QGraphicsView
-{
-public:
- int repaints;
- QRegion paintedRegion;
- MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {}
- void paintEvent(QPaintEvent *e)
- {
- paintedRegion += e->region();
- ++repaints;
- QGraphicsView::paintEvent(e);
- }
- void reset() { repaints = 0; paintedRegion = QRegion(); }
-};
-
void tst_QGraphicsItem::update()
{
QGraphicsScene scene;
@@ -9807,7 +9815,7 @@ void tst_QGraphicsItem::scenePosChange()
QCOMPARE(child2->changes.count(QGraphicsItem::ItemScenePositionHasChanged), 0);
}
-void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
+void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
{
struct Item : public QGraphicsTextItem
{
@@ -9869,5 +9877,126 @@ void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
QCOMPARE(i->painted, 0); //same color as before should not trigger an update (QTBUG-6242)
}
+void tst_QGraphicsItem::QTBUG_6738_missingUpdateWithSetParent()
+{
+ // In all 3 test cases below the reparented item should disappear
+ EventTester *parent = new EventTester;
+ EventTester *child = new EventTester(parent);
+ EventTester *child2 = new EventTester(parent);
+ EventTester *child3 = new EventTester(parent);
+ EventTester *child4 = new EventTester(parent);
+
+ child->setPos(10, 10);
+ child2->setPos(20, 20);
+ child3->setPos(30, 30);
+ child4->setPos(40, 40);
+
+ QGraphicsScene scene;
+ scene.addItem(parent);
+
+ MyGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_VERIFY(view.repaints > 0);
+
+ // test case #1
+ view.reset();
+ child2->setVisible(false);
+ child2->setParentItem(child);
+
+ QTRY_VERIFY(view.repaints == 1);
+
+ // test case #2
+ view.reset();
+ child3->setOpacity(0.0);
+ child3->setParentItem(child);
+
+ QTRY_VERIFY(view.repaints == 1);
+
+ // test case #3
+ view.reset();
+ child4->setParentItem(child);
+ child4->setVisible(false);
+
+ QTRY_VERIFY(view.repaints == 1);
+}
+
+void tst_QGraphicsItem::QT_2653_fullUpdateDiscardingOpacityUpdate()
+{
+ QGraphicsScene scene(0, 0, 200, 200);
+ MyGraphicsView view(&scene);
+
+ EventTester *parentGreen = new EventTester();
+ parentGreen->setGeometry(QRectF(20, 20, 100, 100));
+ parentGreen->brush = Qt::green;
+
+ EventTester *childYellow = new EventTester(parentGreen);
+ childYellow->setGeometry(QRectF(10, 10, 50, 50));
+ childYellow->brush = Qt::yellow;
+
+ scene.addItem(parentGreen);
+
+ childYellow->setOpacity(0.0);
+ parentGreen->setOpacity(0.0);
+
+ // set any of the flags below to trigger a fullUpdate to reproduce the bug:
+ // ItemIgnoresTransformations, ItemClipsChildrenToShape, ItemIsSelectable
+ parentGreen->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ view.reset();
+
+ parentGreen->setOpacity(1.0);
+
+ QTRY_COMPARE(view.repaints, 1);
+
+ view.reset();
+ childYellow->repaints = 0;
+
+ childYellow->setOpacity(1.0);
+
+ QTRY_COMPARE(view.repaints, 1);
+ QTRY_COMPARE(childYellow->repaints, 1);
+}
+
+void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
+{
+ QGraphicsScene scene(0, 0, 200, 200);
+ MyGraphicsView view(&scene);
+ MyGraphicsView origView(&scene);
+
+ EventTester *parentGreen = new EventTester();
+ parentGreen->setGeometry(QRectF(20, 20, 100, 100));
+ parentGreen->brush = Qt::green;
+
+ EventTester *childYellow = new EventTester(parentGreen);
+ childYellow->setGeometry(QRectF(10, 10, 50, 50));
+ childYellow->brush = Qt::yellow;
+
+ scene.addItem(parentGreen);
+
+ origView.show();
+ QTest::qWaitForWindowShown(&origView);
+
+ parentGreen->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+
+ origView.reset();
+ childYellow->setOpacity(0.0);
+
+ QTRY_COMPARE(origView.repaints, 1);
+
+ view.show();
+
+ QTest::qWaitForWindowShown(&view);
+ view.reset();
+ origView.reset();
+
+ childYellow->setOpacity(1.0);
+
+ QTRY_COMPARE(origView.repaints, 1);
+ QTRY_COMPARE(view.repaints, 1);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index c08a628e..6743fbe 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -270,6 +270,7 @@ private slots:
void initialFocus_data();
void initialFocus();
void polishItems();
+ void polishItems2();
void isActive();
void siblingIndexAlwaysValid();
@@ -3942,14 +3943,23 @@ void tst_QGraphicsScene::initialFocus()
class PolishItem : public QGraphicsTextItem
{
public:
- PolishItem(QGraphicsItem *parent = 0) : QGraphicsTextItem(parent) { }
+ PolishItem(QGraphicsItem *parent = 0)
+ : QGraphicsTextItem(parent), polished(false), deleteChildrenInPolish(true), addChildrenInPolish(false) { }
+ bool polished;
+ bool deleteChildrenInPolish;
+ bool addChildrenInPolish;
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant& value)
{
if (change == ItemVisibleChange) {
- if (value.toBool())
+ polished = true;
+ if (deleteChildrenInPolish)
qDeleteAll(childItems());
+ if (addChildrenInPolish) {
+ for (int i = 0; i < 10; ++i)
+ new PolishItem(this);
+ }
}
return QGraphicsItem::itemChange(change, value);
}
@@ -3966,6 +3976,35 @@ void tst_QGraphicsScene::polishItems()
QMetaObject::invokeMethod(&scene,"_q_polishItems");
}
+void tst_QGraphicsScene::polishItems2()
+{
+ QGraphicsScene scene;
+ PolishItem *item = new PolishItem;
+ item->addChildrenInPolish = true;
+ item->deleteChildrenInPolish = true;
+ // These children should be deleted in the polish.
+ for (int i = 0; i < 20; ++i)
+ new PolishItem(item);
+ scene.addItem(item);
+
+ // Wait for the polish event to be delivered.
+ QVERIFY(!item->polished);
+ QApplication::sendPostedEvents(&scene, QEvent::MetaCall);
+ QVERIFY(item->polished);
+
+ // We deleted the children we added above, but we also
+ // added 10 new children. These should be polished in the next
+ // event loop iteration.
+ QList<QGraphicsItem *> children = item->childItems();
+ QCOMPARE(children.count(), 10);
+ foreach (QGraphicsItem *child, children)
+ QVERIFY(!static_cast<PolishItem *>(child)->polished);
+
+ QApplication::sendPostedEvents(&scene, QEvent::MetaCall);
+ foreach (QGraphicsItem *child, children)
+ QVERIFY(static_cast<PolishItem *>(child)->polished);
+}
+
void tst_QGraphicsScene::isActive()
{
QGraphicsScene scene1;
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 909ea54..d3132fe 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -163,6 +163,7 @@ private slots:
void addChildInpolishEvent();
void polishEvent();
void polishEvent2();
+ void initialShow();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -2856,6 +2857,30 @@ void tst_QGraphicsWidget::polishEvent2()
QVERIFY(widget->events.contains(QEvent::Polish));
}
+void tst_QGraphicsWidget::initialShow()
+{
+ class MyGraphicsWidget : public QGraphicsWidget
+ { public:
+ MyGraphicsWidget() : repaints(0) {}
+ int repaints;
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget*) { ++repaints; }
+ void polishEvent() { update(); }
+ };
+
+ QGraphicsScene scene;
+ MyGraphicsWidget *widget = new MyGraphicsWidget;
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QTest::qWait(100);
+ scene.addItem(widget);
+ QTest::qWait(100);
+
+ QCOMPARE(widget->repaints, 1);
+}
+
void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
{
QGraphicsScene scene;
diff --git a/tests/auto/qimagereader/baseline/35floppy.ico b/tests/auto/qimagereader/baseline/35floppy.ico
deleted file mode 100644
index 59fd37e..0000000
--- a/tests/auto/qimagereader/baseline/35floppy.ico
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/35floppy.png b/tests/auto/qimagereader/baseline/35floppy.png
new file mode 100644
index 0000000..56b9b44
--- /dev/null
+++ b/tests/auto/qimagereader/baseline/35floppy.png
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/connect.png b/tests/auto/qimagereader/baseline/connect.png
new file mode 100644
index 0000000..9544bb9
--- /dev/null
+++ b/tests/auto/qimagereader/baseline/connect.png
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/kde_favicon.ico b/tests/auto/qimagereader/baseline/kde_favicon.ico
deleted file mode 100644
index 15bcdbb..0000000
--- a/tests/auto/qimagereader/baseline/kde_favicon.ico
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/kde_favicon.png b/tests/auto/qimagereader/baseline/kde_favicon.png
new file mode 100644
index 0000000..e19287b
--- /dev/null
+++ b/tests/auto/qimagereader/baseline/kde_favicon.png
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/semitransparent.ico b/tests/auto/qimagereader/baseline/semitransparent.ico
deleted file mode 100644
index dd23de9..0000000
--- a/tests/auto/qimagereader/baseline/semitransparent.ico
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qimagereader/baseline/semitransparent.png b/tests/auto/qimagereader/baseline/semitransparent.png
new file mode 100644
index 0000000..a3ad780
--- /dev/null
+++ b/tests/auto/qimagereader/baseline/semitransparent.png
Binary files differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 72c5c8b..b1a5d26 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1633,24 +1633,44 @@ void tst_QImageReader::pixelCompareWithBaseline_data()
QTest::newRow("floppy (16px,32px - 16 colors)") << "35floppy.ico";
QTest::newRow("semitransparent") << "semitransparent.ico";
- QTest::newRow("slightlybroken") << "kde_favicon.ico";
+ QTest::newRow("slightlybrokenBMPHeader") << "kde_favicon.ico";
+ QTest::newRow("sightlybrokenIconHeader") << "connect.ico";
}
void tst_QImageReader::pixelCompareWithBaseline()
{
QFETCH(QString, fileName);
+ static int enteredCount = 0; // Used for better error diagnostics if something fails. We
+ static int loadFailCount = 0; // don't know if the reason load() fails is that the plugin
+ // does not exist or because of a bug in the plugin. But if at
+ // least one file succeeded we know that the plugin was built.
+ // The other failures are then real failures.
QImage icoImg;
+ const QString inputFileName(QString::fromAscii("images/%1").arg(fileName));
+ QFileInfo fi(inputFileName);
+
+ ++enteredCount;
// might fail if the plugin does not exist, which is ok.
- if (icoImg.load(QString::fromAscii("images/%1").arg(fileName))) {
- QString baselineFileName = QString::fromAscii("baseline/%1").arg(fileName);
+ if (icoImg.load(inputFileName)) {
+ icoImg = icoImg.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ const QString baselineFileName(QString::fromAscii("baseline/%1.png").arg(fi.baseName()));
#if 0
icoImg.save(baselineFileName);
#else
QImage baseImg;
QVERIFY(baseImg.load(baselineFileName));
+ baseImg = baseImg.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(int(baseImg.format()), int(icoImg.format()));
QCOMPARE(baseImg, icoImg);
#endif
+ } else {
+ ++loadFailCount;
+ if (enteredCount != loadFailCount) {
+ QFAIL("Plugin is built, but some did not load properly");
+ } else {
+ qWarning("loading failed, check if ico plugin is built");
+ }
}
}
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 33753f1..eec4797 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -838,13 +838,20 @@ void tst_QNetworkReply::stateChecking()
QVERIFY(reply->isOpen());
QVERIFY(reply->isReadable());
QVERIFY(!reply->isWritable());
- QCOMPARE(reply->errorString(), QString("Unknown error"));
+
+ // both behaviours are OK since we might change underlying behaviour again
+ if (!reply->isFinished())
+ QCOMPARE(reply->errorString(), QString("Unknown error"));
+ else
+ QVERIFY(!reply->errorString().isEmpty());
+
QCOMPARE(reply->manager(), &manager);
QCOMPARE(reply->request(), req);
QCOMPARE(int(reply->operation()), int(QNetworkAccessManager::GetOperation));
- QCOMPARE(reply->error(), QNetworkReply::NoError);
- QCOMPARE(reply->isFinished(), false);
+ // error and not error are OK since we might change underlying behaviour again
+ if (!reply->isFinished())
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->url(), url);
reply->abort();
@@ -1151,7 +1158,8 @@ void tst_QNetworkReply::getErrors()
QNetworkReplyPtr reply = manager.get(request);
reply->setParent(this); // we have expect-fails
- QCOMPARE(reply->error(), QNetworkReply::NoError);
+ if (!reply->isFinished())
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
// now run the request:
connect(reply, SIGNAL(finished()),
@@ -1512,6 +1520,7 @@ void tst_QNetworkReply::ioGetFromFile()
QNetworkRequest request(QUrl::fromLocalFile(file.fileName()));
QNetworkReplyPtr reply = manager.get(request);
+ QVERIFY(reply->isFinished()); // a file should immediatly be done
DataReader reader(reply);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
@@ -3170,12 +3179,13 @@ void tst_QNetworkReply::ioPostToHttpEmptyUploadProgress()
void tst_QNetworkReply::lastModifiedHeaderForFile()
{
- QFileInfo fileInfo(SRCDIR "./bigfile");
+ QFileInfo fileInfo(SRCDIR "/bigfile");
+ QVERIFY(fileInfo.exists());
+
QUrl url = QUrl::fromLocalFile(fileInfo.filePath());
QNetworkRequest request(url);
QNetworkReplyPtr reply = manager.head(request);
- QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
QVERIFY(!QTestEventLoop::instance().timeout());
@@ -3191,7 +3201,6 @@ void tst_QNetworkReply::lastModifiedHeaderForHttp()
QNetworkRequest request(url);
QNetworkReplyPtr reply = manager.head(request);
- QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
QVERIFY(!QTestEventLoop::instance().timeout());
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index d342581..4fa6aaa 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -127,6 +127,7 @@ private slots:
void overloads();
void isSignalConnected();
void qMetaObjectConnect();
+ void qMetaObjectDisconnectOne();
protected:
};
@@ -3269,5 +3270,77 @@ void tst_QObject::qMetaObjectConnect()
}
+void tst_QObject::qMetaObjectDisconnectOne()
+{
+ SenderObject *s = new SenderObject;
+ ReceiverObject *r1 = new ReceiverObject;
+
+ int signal1Index = s->metaObject()->indexOfSignal("signal1()");
+ int signal3Index = s->metaObject()->indexOfSignal("signal3()");
+ int slot1Index = r1->metaObject()->indexOfSlot("slot1()");
+ int slot2Index = r1->metaObject()->indexOfSlot("slot2()");
+
+ QVERIFY(signal1Index > 0);
+ QVERIFY(signal3Index > 0);
+ QVERIFY(slot1Index > 0);
+ QVERIFY(slot2Index > 0);
+
+ QVERIFY( QMetaObject::connect(s, signal1Index, r1, slot1Index) );
+ QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) );
+ QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) );
+ QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) );
+
+ r1->reset();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ s->emitSignal1();
+ QCOMPARE( r1->count_slot1, 1 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ s->emitSignal3();
+ QCOMPARE( r1->count_slot1, 1 );
+ QCOMPARE( r1->count_slot2, 3 );
+
+ r1->reset();
+ QVERIFY( QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) );
+ QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) );
+
+ s->emitSignal1();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ s->emitSignal3();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 2 );
+
+ r1->reset();
+ QVERIFY( false == QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) );
+ QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) );
+
+ s->emitSignal1();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ s->emitSignal3();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 1 );
+
+ r1->reset();
+ QVERIFY( false == QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) );
+ QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) );
+
+ s->emitSignal1();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ s->emitSignal3();
+ QCOMPARE( r1->count_slot1, 0 );
+ QCOMPARE( r1->count_slot2, 0 );
+
+ delete s;
+ delete r1;
+}
+
QTEST_MAIN(tst_QObject)
#include "tst_qobject.moc"
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2340ef5..8bcd5e8 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -171,6 +171,8 @@ private slots:
void preserveDepth();
void splash_crash();
+
+ void loadAsBitmapOrPixmap();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1510,5 +1512,41 @@ void tst_QPixmap::preserveDepth()
QCOMPARE(depth, source.depth());
}
+void tst_QPixmap::loadAsBitmapOrPixmap()
+{
+ QImage tmp(10, 10, QImage::Format_RGB32);
+ tmp.save("tmp.png");
+
+ bool ok;
+
+ // Check that we can load the pixmap as a pixmap and that it then turns into a pixmap
+ QPixmap pixmap("tmp.png");
+ QVERIFY(!pixmap.isNull());
+ QVERIFY(pixmap.depth() > 1);
+ QVERIFY(!pixmap.isQBitmap());
+
+ pixmap = QPixmap();
+ ok = pixmap.load("tmp.png");
+ QVERIFY(ok);
+ QVERIFY(!pixmap.isNull());
+ QVERIFY(pixmap.depth() > 1);
+ QVERIFY(!pixmap.isQBitmap());
+
+ // The do the same check for bitmaps..
+ QBitmap bitmap("tmp.png");
+ QVERIFY(!bitmap.isNull());
+ QVERIFY(bitmap.depth() == 1);
+ QVERIFY(bitmap.isQBitmap());
+
+ bitmap = QBitmap();
+ ok = bitmap.load("tmp.png");
+ QVERIFY(ok);
+ QVERIFY(!bitmap.isNull());
+ QVERIFY(bitmap.depth() == 1);
+ QVERIFY(bitmap.isQBitmap());
+}
+
+
+
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
index 73e4fb6..b4ce561 100644
--- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
+++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
@@ -112,6 +112,7 @@ class MyQObject : public QObject
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType)
Q_PROPERTY(Policy enumProperty READ enumProperty WRITE setEnumProperty)
+ Q_PROPERTY(Ability flagsProperty READ flagsProperty WRITE setFlagsProperty)
Q_ENUMS(Policy Strategy)
Q_FLAGS(Ability)
@@ -150,6 +151,7 @@ public:
m_writeOnlyValue(789),
m_readOnlyValue(987),
m_enumValue(BarPolicy),
+ m_flagsValue(FooAbility),
m_qtFunctionInvoked(-1)
{ }
@@ -216,6 +218,11 @@ public:
void setEnumProperty(Policy policy)
{ m_enumValue = policy; }
+ Ability flagsProperty() const
+ { return m_flagsValue; }
+ void setFlagsProperty(Ability ability)
+ { m_flagsValue = ability; }
+
int qtFunctionInvoked() const
{ return m_qtFunctionInvoked; }
@@ -316,6 +323,10 @@ public:
{ m_qtFunctionInvoked = 56; return arg; }
Q_INVOKABLE QObject* myInvokableReturningMyQObjectAsQObject()
{ m_qtFunctionInvoked = 57; return this; }
+ Q_INVOKABLE Ability myInvokableWithFlagsArg(Ability arg)
+ { m_qtFunctionInvoked = 58; m_actuals << int(arg); return arg; }
+ Q_INVOKABLE MyQObject::Ability myInvokableWithQualifiedFlagsArg(MyQObject::Ability arg)
+ { m_qtFunctionInvoked = 59; m_actuals << int(arg); return arg; }
Q_INVOKABLE QObjectList findObjects() const
{ return findChildren<QObject *>(); }
@@ -433,6 +444,7 @@ protected:
QKeySequence m_shortcut;
CustomType m_customType;
Policy m_enumValue;
+ Ability m_flagsValue;
int m_qtFunctionInvoked;
QVariantList m_actuals;
QByteArray m_connectedSignal;
@@ -520,6 +532,7 @@ private slots:
void prototypes();
void objectDeleted();
void connectToDestroyedSignal();
+ void emitAfterReceiverDeleted();
private:
QScriptEngine *m_engine;
@@ -826,7 +839,7 @@ void tst_QScriptExtQObject::getSetStaticProperty()
{
QScriptValue val = m_engine->evaluate("myObject.enumProperty");
QVERIFY(val.isNumber());
- QCOMPARE(val.toInt32(), (int)MyQObject::BarPolicy);
+ QCOMPARE(val.toInt32(), int(MyQObject::BarPolicy));
}
m_engine->evaluate("myObject.enumProperty = 2");
QCOMPARE(m_myObject->enumProperty(), MyQObject::BazPolicy);
@@ -846,6 +859,25 @@ void tst_QScriptExtQObject::getSetStaticProperty()
m_engine->evaluate("myObject.enumProperty = 'nada'");
QCOMPARE(m_myObject->enumProperty(), (MyQObject::Policy)-1);
+ // flags property
+ QCOMPARE(m_myObject->flagsProperty(), MyQObject::FooAbility);
+ {
+ QScriptValue val = m_engine->evaluate("myObject.flagsProperty");
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), int(MyQObject::FooAbility));
+ }
+ m_engine->evaluate("myObject.flagsProperty = 0x80");
+ QCOMPARE(m_myObject->flagsProperty(), MyQObject::BarAbility);
+ m_engine->evaluate("myObject.flagsProperty = 0x81");
+ QCOMPARE(m_myObject->flagsProperty(), MyQObject::Ability(MyQObject::FooAbility | MyQObject::BarAbility));
+ m_engine->evaluate("myObject.flagsProperty = 123"); // bogus values are accepted
+ QCOMPARE(int(m_myObject->flagsProperty()), 123);
+ m_engine->evaluate("myObject.flagsProperty = 'BazAbility'");
+ QCOMPARE(m_myObject->flagsProperty(), MyQObject::BazAbility);
+ m_engine->evaluate("myObject.flagsProperty = 'ScoobyDoo'");
+ // ### ouch! Shouldn't QMetaProperty::write() rather not change the value...?
+ QCOMPARE(m_myObject->flagsProperty(), (MyQObject::Ability)-1);
+
// auto-dereferencing of pointers
{
QBrush b = QColor(0xCA, 0xFE, 0xBA, 0xBE);
@@ -2017,6 +2049,7 @@ void tst_QScriptExtQObject::classEnums()
QScriptValue myClass = m_engine->newQMetaObject(m_myObject->metaObject(), m_engine->undefinedValue());
m_engine->globalObject().setProperty("MyQObject", myClass);
+ QVERIFY(m_engine->evaluate("MyQObject.FooPolicy").isNumber()); // no strong typing
QCOMPARE(static_cast<MyQObject::Policy>(m_engine->evaluate("MyQObject.FooPolicy").toInt32()),
MyQObject::FooPolicy);
QCOMPARE(static_cast<MyQObject::Policy>(m_engine->evaluate("MyQObject.BarPolicy").toInt32()),
@@ -2031,6 +2064,7 @@ void tst_QScriptExtQObject::classEnums()
QCOMPARE(static_cast<MyQObject::Strategy>(m_engine->evaluate("MyQObject.BazStrategy").toInt32()),
MyQObject::BazStrategy);
+ QVERIFY(m_engine->evaluate("MyQObject.NoAbility").isNumber()); // no strong typing
QCOMPARE(MyQObject::Ability(m_engine->evaluate("MyQObject.NoAbility").toInt32()),
MyQObject::NoAbility);
QCOMPARE(MyQObject::Ability(m_engine->evaluate("MyQObject.FooAbility").toInt32()),
@@ -2042,6 +2076,9 @@ void tst_QScriptExtQObject::classEnums()
QCOMPARE(MyQObject::Ability(m_engine->evaluate("MyQObject.AllAbility").toInt32()),
MyQObject::AllAbility);
+ // Constructors for flags are not provided
+ QVERIFY(m_engine->evaluate("MyQObject.Ability").isUndefined());
+
QScriptValue::PropertyFlags expectedEnumFlags = QScriptValue::ReadOnly | QScriptValue::Undeletable;
QCOMPARE(myClass.propertyFlags("FooPolicy"), expectedEnumFlags);
QCOMPARE(myClass.propertyFlags("BarPolicy"), expectedEnumFlags);
@@ -2094,6 +2131,25 @@ void tst_QScriptExtQObject::classEnums()
QCOMPARE(ret.isNumber(), true);
}
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithFlagsArg(MyQObject.FooAbility)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 58);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::FooAbility));
+ QCOMPARE(ret.isNumber(), true);
+ QCOMPARE(ret.toInt32(), int(MyQObject::FooAbility));
+ }
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithQualifiedFlagsArg(MyQObject.BarAbility)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 59);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::BarAbility));
+ QCOMPARE(ret.isNumber(), true);
+ QCOMPARE(ret.toInt32(), int(MyQObject::BarAbility));
+ }
+
// enum properties are not deletable or writable
QVERIFY(!m_engine->evaluate("delete MyQObject.BazPolicy").toBool());
myClass.setProperty("BazPolicy", QScriptValue());
@@ -2858,7 +2914,8 @@ void tst_QScriptExtQObject::objectDeleted()
v.setProperty("intProperty", QScriptValue(&eng, 123));
QCOMPARE(qobj->intProperty(), 123);
qobj->resetQtFunctionInvoked();
- v.property("myInvokable").call(v);
+ QScriptValue invokable = v.property("myInvokable");
+ invokable.call(v);
QCOMPARE(qobj->qtFunctionInvoked(), 0);
// now delete the object
@@ -2896,6 +2953,14 @@ void tst_QScriptExtQObject::objectDeleted()
QCOMPARE(ret.toString(), QLatin1String("Error: cannot access member `myInvokableWithIntArg' of deleted QObject"));
}
+ // Meta-method wrappers are still valid, but throw error when called
+ QVERIFY(invokable.isFunction());
+ {
+ QScriptValue ret = invokable.call(v);
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("Error: cannot call function of deleted QObject"));
+ }
+
// access from script
eng.globalObject().setProperty("o", v);
{
@@ -2956,5 +3021,27 @@ void tst_QScriptExtQObject::connectToDestroyedSignal()
#endif
}
+void tst_QScriptExtQObject::emitAfterReceiverDeleted()
+{
+ for (int x = 0; x < 2; ++x) {
+ MyQObject *obj = new MyQObject;
+ QScriptValue scriptObj = m_engine->newQObject(obj);
+ if (x == 0) {
+ // Connecting from JS
+ m_engine->globalObject().setProperty("obj", scriptObj);
+ QVERIFY(m_engine->evaluate("myObject.mySignal.connect(obj, 'mySlot()')").isUndefined());
+ } else {
+ // Connecting from C++
+ qScriptConnect(m_myObject, SIGNAL(mySignal()), scriptObj, scriptObj.property("mySlot"));
+ }
+ delete obj;
+ QSignalSpy signalHandlerExceptionSpy(m_engine, SIGNAL(signalHandlerException(QScriptValue)));
+ QVERIFY(!m_engine->hasUncaughtException());
+ m_myObject->emitMySignal();
+ QCOMPARE(signalHandlerExceptionSpy.count(), 0);
+ QVERIFY(!m_engine->hasUncaughtException());
+ }
+}
+
QTEST_MAIN(tst_QScriptExtQObject)
#include "tst_qscriptextqobject.moc"
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index b384a55..ef960d0 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2907,7 +2907,7 @@ void tst_QScriptValue::equals()
QScriptValue qobj1 = eng.newQObject(this);
QScriptValue qobj2 = eng.newQObject(this);
QScriptValue qobj3 = eng.newQObject(0);
- QScriptValue qobj4 = eng.newQObject(new QObject());
+ QScriptValue qobj4 = eng.newQObject(new QObject(), QScriptEngine::ScriptOwnership);
QVERIFY(qobj1.equals(qobj2)); // compares the QObject pointers
QVERIFY(!qobj2.equals(qobj4)); // compares the QObject pointers
QVERIFY(!qobj2.equals(obj2)); // compares the QObject pointers
@@ -3091,6 +3091,20 @@ void tst_QScriptValue::strictlyEquals()
QVERIFY(!falskt.strictlyEquals(null));
QVERIFY(!falskt.strictlyEquals(QScriptValue()));
+ QVERIFY(!QScriptValue(false).strictlyEquals(123));
+ QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals(123));
+ QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals(123));
+ QVERIFY(!QScriptValue(false).strictlyEquals("ciao"));
+ QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals("ciao"));
+ QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals("ciao"));
+ QVERIFY(QScriptValue(&eng, "ciao").strictlyEquals("ciao"));
+ QVERIFY(QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, "ciao")));
+ QVERIFY(!QScriptValue("ciao").strictlyEquals(123));
+ QVERIFY(!QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, 123)));
+ QVERIFY(!QScriptValue(123).strictlyEquals("ciao"));
+ QVERIFY(!QScriptValue(123).strictlyEquals(QScriptValue(&eng, "ciao")));
+ QVERIFY(!QScriptValue(&eng, 123).strictlyEquals("ciao"));
+
QScriptValue obj1 = eng.newObject();
QScriptValue obj2 = eng.newObject();
QCOMPARE(obj1.strictlyEquals(obj2), false);
diff --git a/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem
new file mode 100644
index 0000000..75f3c32
--- /dev/null
+++ b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem
@@ -0,0 +1 @@
+-----BEGIN CERTIFICATE----- \ No newline at end of file
diff --git a/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem
new file mode 100644
index 0000000..a71aecf
--- /dev/null
+++ b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem
@@ -0,0 +1 @@
+-----BEGIN CERTIFICATE-----
diff --git a/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem b/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem
new file mode 100644
index 0000000..f8056c7
--- /dev/null
+++ b/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIIB8zCCAVwCAREwDQYJKoZIhvcNAQEFBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
+BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
+VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDcwNDE3MDc0MDI2WhcNMDcwNTE3
+MDc0MDI2WjApMRowGAYDVQQDExFuYW1lL3dpdGgvc2xhc2hlczELMAkGA1UEBhMC
+Tk8wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOud6QOsME+pWANExxgmL0iT
+1ayg++hTxHsqAYnm/FoMxfUh+NdKkgJn2/GfNppinfPOSI667VqonU+7JBZDTLV5
+CPbZIo9fFQpDJQN6naev4yaxU1VeYFfI7S8c8zYKeGSR+RenNNeLvfH80YxPpZZ1
+snv8IfDH2V8MVxiyr7lLAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAleaU4pgzV6KY
++q9QuXapUYMsC2GiNtDmkG3k+MTHUO8XlE4hqPrIM6rRf7zKQdZ950R2wL9FSnYl
+Qm1Tdv38dCka6ivMBqvRuOt9axH3m0G7nzHL7U3zaCbtEx3yVln+b3yYtiVpTuq0
+3MLrt7tQGAW6ra8ISf6YY1W65/uVXZE=
+-----END CERTIFICATE----- \ No newline at end of file
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
index 892d745..c76c11f 100644
--- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
@@ -105,6 +105,7 @@ private slots:
void fromPath_data();
void fromPath();
void certInfo();
+ void certInfoQByteArray();
void task256066toPem();
void nulInCN();
void nulInSan();
@@ -542,6 +543,9 @@ void tst_QSslCertificate::fromPath_data()
QTest::newRow("\"d.*/c.*.pem\" wildcard der") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << false << 0;
QTest::newRow("trailing-whitespace") << QString("more-certificates/trailing-whitespace.pem") << int(QRegExp::FixedString) << true << 1;
+ QTest::newRow("no-ending-newline") << QString("more-certificates/no-ending-newline.pem") << int(QRegExp::FixedString) << true << 1;
+ QTest::newRow("malformed-just-begin") << QString("more-certificates/malformed-just-begin.pem") << int(QRegExp::FixedString) << true << 0;
+ QTest::newRow("malformed-just-begin-no-newline") << QString("more-certificates/malformed-just-begin-no-newline.pem") << int(QRegExp::FixedString) << true << 0;
}
void tst_QSslCertificate::fromPath()
@@ -697,6 +701,18 @@ void tst_QSslCertificate::certInfo()
QCOMPARE(cert, QSslCertificate(QByteArray::fromHex(der), QSsl::Der));
}
+void tst_QSslCertificate::certInfoQByteArray()
+{
+ QSslCertificate cert = QSslCertificate::fromPath("certificates/cert.pem", QSsl::Pem,
+ QRegExp::FixedString).first();
+ QVERIFY(!cert.isNull());
+
+ // in this test, check the bytearray variants before the enum variants to see if
+ // we fixed a bug we had with lazy initialization of the values.
+ QCOMPARE(cert.issuerInfo("CN"), QString("Test CA (1024 bit)"));
+ QCOMPARE(cert.subjectInfo("CN"), QString("name/with/slashes"));
+}
+
void tst_QSslCertificate::task256066toPem()
{
// a certificate whose PEM encoding's length is a multiple of 64
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 7a5e68f..430712c 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -3024,6 +3024,14 @@ void tst_QTableView::spans_data()
<< QPoint(0, 0)
<< 1
<< 1;
+
+ QTest::newRow("QTBUG-6004 (follow-up): No failing Q_ASSERT, then it passes.")
+ << 10 << 10
+ << (SpanList() << QRect(2, 2, 1, 3) << QRect(2, 2, 1, 1))
+ << false
+ << QPoint(0, 0)
+ << 1
+ << 1;
}
void tst_QTableView::spans()
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index c781108..1304f4e 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -95,6 +95,7 @@ private slots:
void keepOpenMode();
void resetTemplateAfterError();
void setTemplateAfterOpen();
+ void autoRemoveAfterFailedRename();
public:
};
@@ -558,5 +559,40 @@ void tst_QTemporaryFile::setTemplateAfterOpen()
QCOMPARE( temp.fileTemplate(), newTemplate );
}
+void tst_QTemporaryFile::autoRemoveAfterFailedRename()
+{
+ struct CleanOnReturn
+ {
+ ~CleanOnReturn()
+ {
+ if (!tempName.isEmpty())
+ QFile::remove(tempName);
+ }
+
+ void reset()
+ {
+ tempName.clear();
+ }
+
+ QString tempName;
+ };
+
+ CleanOnReturn cleaner;
+
+ {
+ QTemporaryFile file;
+ QVERIFY( file.open() );
+ cleaner.tempName = file.fileName();
+
+ QVERIFY( QFile::exists(cleaner.tempName) );
+ QVERIFY( !QFileInfo("i-do-not-exist").isDir() );
+ QVERIFY( !file.rename("i-do-not-exist/file.txt") );
+ QVERIFY( QFile::exists(cleaner.tempName) );
+ }
+
+ QVERIFY( !QFile::exists(cleaner.tempName) );
+ cleaner.reset();
+}
+
QTEST_MAIN(tst_QTemporaryFile)
#include "tst_qtemporaryfile.moc"
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index ecd6f09..f108f4c 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -90,7 +90,6 @@ public slots:
private slots:
void getSetCheck();
void constructing();
- void isDetached();
void assignment();
void comparison();
void copying();
@@ -166,6 +165,8 @@ private slots:
void ace_testsuite();
void std3violations_data();
void std3violations();
+ void std3deviations_data();
+ void std3deviations();
void tldRestrictions_data();
void tldRestrictions();
void emptyQueryOrFragment();
@@ -319,25 +320,6 @@ void tst_QUrl::constructing()
QVERIFY(!buildUNC.isEmpty());
}
-void tst_QUrl::isDetached()
-{
- QUrl url;
- QVERIFY(!url.isDetached());
-
- url = "http://qt.nokia.com/";
- QVERIFY(url.isDetached());
-
- url.clear();
- QVERIFY(!url.isDetached());
-
- url.setHost("qt.nokia.com");
- QVERIFY(url.isDetached());
-
- QUrl url2 = url;
- QVERIFY(!url.isDetached());
- QVERIFY(!url2.isDetached());
-}
-
void tst_QUrl::assignment()
{
QUrl url("http://qt.nokia.com/");
@@ -3258,6 +3240,8 @@ void tst_QUrl::std3violations_data()
QTest::newRow("bang") << "foo!" << false;
QTest::newRow("plus") << "foo+bar" << false;
QTest::newRow("dot") << "foo.bar";
+ QTest::newRow("startingdot") << ".bar" << false;
+ QTest::newRow("startingdot2") << ".example.com" << false;
QTest::newRow("slash") << "foo/bar" << true;
QTest::newRow("colon") << "foo:80" << true;
QTest::newRow("question") << "foo?bar" << true;
@@ -3302,6 +3286,24 @@ void tst_QUrl::std3violations()
QVERIFY(!url.isValid());
}
+void tst_QUrl::std3deviations_data()
+{
+ QTest::addColumn<QString>("source");
+
+ QTest::newRow("ending-dot") << "example.com.";
+ QTest::newRow("ending-dot3002") << QString("example.com") + QChar(0x3002);
+}
+
+void tst_QUrl::std3deviations()
+{
+ QFETCH(QString, source);
+ QVERIFY(!QUrl::toAce(source).isEmpty());
+
+ QUrl url;
+ url.setHost(source);
+ QVERIFY(!url.host().isEmpty());
+}
+
void tst_QUrl::tldRestrictions_data()
{
QTest::addColumn<QString>("tld");
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index ee4e726..ea90ae3 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -5439,26 +5439,24 @@ public:
QRegion r;
};
-template<typename R, typename C>
-void verifyColor(R const& region, C const& color)
-{
- const QRegion r = QRegion(region);
- for (int i = 0; i < r.rects().size(); ++i) {
- const QRect rect = r.rects().at(i);
- for (int t = 0; t < 5; t++) {
- const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(),
- rect.left(), rect.top(),
- rect.width(), rect.height());
- QCOMPARE(pixmap.size(), rect.size());
- QPixmap expectedPixmap(pixmap); /* ensure equal formats */
- expectedPixmap.fill(color);
- if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 )
- { QTest::qWait(200); continue; }
- QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb());
- QCOMPARE(pixmap, expectedPixmap);
- break;
- }
- }
+#define VERIFY_COLOR(region, color) { \
+ const QRegion r = QRegion(region); \
+ for (int i = 0; i < r.rects().size(); ++i) { \
+ const QRect rect = r.rects().at(i); \
+ for (int t = 0; t < 5; t++) { \
+ const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(), \
+ rect.left(), rect.top(), \
+ rect.width(), rect.height()); \
+ QCOMPARE(pixmap.size(), rect.size()); \
+ QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \
+ expectedPixmap.fill(color); \
+ if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 ) \
+ { QTest::qWait(200); continue; } \
+ QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb()); \
+ QCOMPARE(pixmap, expectedPixmap); \
+ break; \
+ } \
+ } \
}
void tst_QWidget::moveChild_data()
@@ -5499,9 +5497,9 @@ void tst_QWidget::moveChild()
#endif
QTRY_COMPARE(parent.r, QRegion(parent.rect()) - child.geometry());
QTRY_COMPARE(child.r, QRegion(child.rect()));
- verifyColor(child.geometry().translated(tlwOffset),
+ VERIFY_COLOR(child.geometry().translated(tlwOffset),
child.color);
- verifyColor(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset),
+ VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset),
parent.color);
parent.reset();
child.reset();
@@ -5520,9 +5518,9 @@ void tst_QWidget::moveChild()
// should be scrolled in backingstore
QCOMPARE(child.r, QRegion());
#endif
- verifyColor(child.geometry().translated(tlwOffset),
+ VERIFY_COLOR(child.geometry().translated(tlwOffset),
child.color);
- verifyColor(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset),
+ VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset),
parent.color);
}
@@ -5553,8 +5551,8 @@ void tst_QWidget::showAndMoveChild()
child.move(desktopDimensions.width()/2, desktopDimensions.height()/2);
qApp->processEvents();
- verifyColor(child.geometry().translated(tlwOffset), Qt::blue);
- verifyColor(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red);
+ VERIFY_COLOR(child.geometry().translated(tlwOffset), Qt::blue);
+ VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red);
}
void tst_QWidget::subtractOpaqueSiblings()
diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt
index a941f21..1b65adf 100644
--- a/tests/auto/selftests/expected_cmptest.txt
+++ b/tests/auto/selftests/expected_cmptest.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Cmptest *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.6.2, Qt 4.6.2
PASS : tst_Cmptest::initTestCase()
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt
index 692fddb..aabe83d 100644
--- a/tests/auto/selftests/expected_crashes_3.txt
+++ b/tests/auto/selftests/expected_crashes_3.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Crashes *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.6.2, Qt 4.6.2
PASS : tst_Crashes::initTestCase()
QFATAL : tst_Crashes::crash() Received signal 11
FAIL! : tst_Crashes::crash() Received a fatal error.
diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt
index 5755c97..3fe237a 100644
--- a/tests/auto/selftests/expected_longstring.txt
+++ b/tests/auto/selftests/expected_longstring.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_LongString *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.6.2, Qt 4.6.2
PASS : tst_LongString::initTestCase()
FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt
index 032a3e8..8bafeff 100644
--- a/tests/auto/selftests/expected_maxwarnings.txt
+++ b/tests/auto/selftests/expected_maxwarnings.txt
@@ -1,5 +1,5 @@
********* Start testing of MaxWarnings *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.6.2, Qt 4.6.2
PASS : MaxWarnings::initTestCase()
QWARN : MaxWarnings::warn() 0
QWARN : MaxWarnings::warn() 1
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt
index e687759..c4ef92d 100644
--- a/tests/auto/selftests/expected_skip.txt
+++ b/tests/auto/selftests/expected_skip.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Skip *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.6.2, Qt 4.6.2
PASS : tst_Skip::initTestCase()
SKIP : tst_Skip::test() skipping all
Loc: [/home/rmcgover/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)]
diff --git a/tests/auto/selftests/expected_xunit.txt b/tests/auto/selftests/expected_xunit.txt
index d5cd531..3c014e3 100644
--- a/tests/auto/selftests/expected_xunit.txt
+++ b/tests/auto/selftests/expected_xunit.txt
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="5" failures="3" tests="9" name="tst_Xunit">
<properties>
- <property value="4.6.1" name="QTestVersion"/>
- <property value="4.6.1" name="QtVersion"/>
+ <property value="<INSERT_QT_VERSION_HERE>" name="QTestVersion"/>
+ <property value="<INSERT_QT_VERSION_HERE>" name="QtVersion"/>
</properties>
<testcase result="pass" name="initTestCase"/>
<testcase result="pass" name="testFunc1">
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index 89ece0f..0b9cee0 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -248,7 +248,7 @@ void tst_Selftests::doRunSubTest(QString &subdir, QStringList &arguments )
continue;
const QString output(QString::fromLatin1(line));
- const QString expected(QString::fromLatin1(exp.at(i)));
+ const QString expected(QString::fromLatin1(exp.at(i)).replace("<INSERT_QT_VERSION_HERE>", QT_VERSION_STR));
if (line.contains("ASSERT") && output != expected)
QEXPECT_FAIL("assert", "QTestLib prints out the absolute path.", Continue);
diff --git a/tests/auto/tests.xml b/tests/auto/tests.xml
deleted file mode 100644
index f197de0..0000000
--- a/tests/auto/tests.xml
+++ /dev/null
@@ -1,821 +0,0 @@
-<Configuration>
- <Tests>
- <Test name="atwrapper" location="tests/auto/atwrapper/tst_atwrapper" />
- <Test name="bic" location="tests/auto/bic/tst_bic" />
- <Test name="checkxmlfiles" location="tests/auto/checkxmlfiles/tst_checkxmlfiles" />
- <Test name="collections" location="tests/auto/collections/tst_collections" />
- <Test name="compile" location="tests/auto/compile/tst_compile" />
- <Test name="compilerwarnings" location="tests/auto/compilerwarnings/tst_compilerwarnings" />
- <Test name="exceptionsafety" location="tests/auto/exceptionsafety/tst_exceptionsafety" />
- <Test name="headers" location="tests/auto/headers/tst_headers" />
- <Test name="languagechange" location="tests/auto/languagechange/tst_languagechange" />
- <Test name="lrelease" location="tests/auto/linguist/lrelease/tst_lrelease" />
- <Test name="lconvert" location="tests/auto/linguist/lconvert/tst_convert" />
- <Test name="lupdate" location="tests/auto/linguist/lupdate/tst_lupdate" />
- <Test name="macgui" location="tests/auto/macgui/tst_macgui" platforms="macx-g++" />
- <Test name="mediaobject" location="tests/auto/mediaobject/tst_mediaobject" />
- <Test name="moc" location="tests/auto/moc/tst_moc" />
- <Test name="patternistexamplefiletree" location="tests/auto/patternistexamplefiletree/tst_patternistexamplefiletree" />
- <Test name="patternistexamples" location="tests/auto/patternistexamples/tst_patternistexamples" />
- <Test name="patternistheaders" location="tests/auto/patternistheaders/tst_patternistheaders" />
- <Test name="qabstractbutton" location="tests/auto/qabstractbutton/tst_qabstractbutton" />
- <Test name="qabstractitemmodel" location="tests/auto/qabstractitemmodel/tst_qabstractitemmodel" />
- <Test name="qabstractitemview" location="tests/auto/qabstractitemmodel/tst_qabstractitemmodel" />
- <Test name="qabstractmessagehandler" location="tests/auto/qabstractmessagehandler/tst_qabstractmessagehandler" />
- <Test name="qabstractprintdialog" location="tests/auto/qabstractprintdialog/tst_qabstractprintdialog" />
- <Test name="qabstractproxymodel" location="tests/auto/qabstractproxymodel/tst_qabstractproxymodel" />
- <Test name="qabstractscrollarea" location="tests/auto/qabstractscrollarea/tst_qabstractscrollarea" />
- <Test name="qabstractslider" location="tests/auto/qabstractslider/tst_qabstractslider" />
- <Test name="qabstractsocket" location="tests/auto/qabstractsocket/tst_qabstractsocket" />
- <Test name="qabstractspinbox" location="tests/auto/qabstractspinbox/tst_qabstractspinbox" />
- <Test name="qabstracttextdocumentlayout" location="tests/auto/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout" />
- <Test name="qabstracturiresolver" location="tests/auto/qabstracturiresolver/tst_qabstracturiresolver" />
- <Test name="qabstractxmlforwarditerator" location="tests/auto/qabstractxmlforwarditerator/tst_qabstractxmlforwarditerator" />
- <Test name="qabstractxmlnodemodel" location="tests/auto/qabstractxmlnodemodel/tst_qabstractxmlnodemodel" />
- <Test name="qabstractxmlreceiver" location="tests/auto/qabstractxmlreceiver/tst_qabstractxmlreceiver" />
- <Test name="qaccessibility" location="tests/auto/qaccessibility/tst_qaccessibility" />
- <Test name="qaccessibility_mac" location="tests/auto/qaccessibility_mac/tst_qaccessibility_mac" />
- <Test name="qaction" location="tests/auto/qaction/tst_qaction" />
- <Test name="qactiongroup" location="tests/auto/qactiongroup/tst_qactiongroup" />
- <Test name="qalgorithms" location="tests/auto/qalgorithms/tst_qalgorithms" />
- <Test name="qapplication" location="tests/auto/qapplication/tst_qapplication" />
- <Test name="qatomicint" location="tests/auto/qatomicint/tst_qatomicint" />
- <Test name="qatomicpointer" location="tests/auto/qatomicpointer/tst_qatomicpointer" />
- <Test name="qautoptr" location="tests/auto/qautoptr/tst_qautoptr" />
- <Test name="qbitarray" location="tests/auto/qbitarray/tst_qbitarray" />
- <Test name="qboxlayout" location="tests/auto/qboxlayout/tst_qboxlayout" />
- <Test name="qbrush" location="tests/auto/qbrush/tst_qbrush" />
- <Test name="qbuffer" location="tests/auto/qbuffer/tst_qbuffer" />
- <Test name="qbuttongroup" location="tests/auto/qbuttongroup/tst_qbuttongroup" />
- <Test name="qbytearray" location="tests/auto/qbytearray/tst_qbytearray" />
- <Test name="qcache" location="tests/auto/qcache/tst_qcache" />
- <Test name="qcalendarwidget" location="tests/auto/qcalendarwidget/tst_qcalendarwidget" />
- <Test name="qchar" location="tests/auto/qchar/tst_qchar" />
- <Test name="qcheckbox" location="tests/auto/qcheckbox/tst_qcheckbox" />
- <Test name="qclipboard" location="tests/auto/qclipboard/tst_qclipboard" />
- <Test name="qcolor" location="tests/auto/qcolor/tst_qcolor" />
- <Test name="qcolordialog" location="tests/auto/qcolordialog/tst_qcolordialog" />
- <Test name="qcolumnview" location="tests/auto/qcolumnview/tst_qcolumnview" />
- <Test name="qcombobox" location="tests/auto/qcombobox/tst_qcombobox" />
- <Test name="qcommandlinkbutton" location="tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton" />
- <Test name="qcompleter" location="tests/auto/qcompleter/tst_qcompleter" />
- <Test name="qcomplextext" location="tests/auto/qcomplextext/tst_qcomplextext" />
- <Test name="qcopchannel" location="tests/auto/qcopchannel/tst_qcopchannel" />
- <Test name="qcoreapplication" location="tests/auto/qcoreapplication/tst_qcoreapplication" />
- <Test name="qcryptographichash" location="tests/auto/qcryptographichash/tst_qcryptographichash" />
- <Test name="qcssparser" location="tests/auto/qcssparser/tst_qcssparser" />
- <Test name="qdatastream" location="tests/auto/qdatastream/tst_qdatastream" />
- <Test name="qdatawidgetmapper" location="tests/auto/qdatawidgetmapper/tst_qdatawidgetmapper" />
- <Test name="qdate" location="tests/auto/qdate/tst_qdate" />
- <Test name="qdatetime" location="tests/auto/qdatetime/tst_qdatetime" />
- <Test name="qdatetimeedit" location="tests/auto/qdatetimeedit/tst_qdatetimeedit" />
- <Test name="qdbusabstractadaptor" location="tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor" />
- <Test name="qdbusconnection" location="tests/auto/qdbusconnection/tst_qdbusconnection" />
- <Test name="qdbuscontext" location="tests/auto/qdbuscontext/tst_qdbuscontext" />
- <Test name="qdbusinterface" location="tests/auto/qdbusinterface/tst_qdbusinterface" />
- <Test name="qdbuslocalcalls" location="tests/auto/qdbuslocalcalls/tst_qdbuslocalcalls" />
- <Test name="qdbusmarshall" location="tests/auto/qdbusmarshall/tst_qdbusmarshall" />
- <Test name="qdbusmetaobject" location="tests/auto/qdbusmetaobject/tst_qdbusmetaobject" />
- <Test name="qdbusmetatype" location="tests/auto/qdbusmetatype/tst_qdbusmetatype" />
- <Test name="qdbusperformance" location="tests/auto/qdbusperformance/tst_qdbusperformance" />
- <Test name="qdbusreply" location="tests/auto/qdbusreply/tst_qdbusreply" />
- <Test name="qdbusserver" location="tests/auto/qdbusserver/tst_qdbusserver" />
- <Test name="qdbusthreading" location="tests/auto/qdbusthreading/tst_qdbusthreading" />
- <Test name="qdbusxmlparser" location="tests/auto/qdbusxmlparser/tst_qdbusxmlparser" />
- <Test name="qdebug" location="tests/auto/qdebug/tst_qdebug" />
- <Test name="qdesktopservices" location="tests/auto/qdesktopservices/tst_qdesktopservices" />
- <Test name="qdesktopwidget" location="tests/auto/qdesktopwidget/tst_qdesktopwidget" />
- <Test name="qdial" location="tests/auto/qdial/tst_qdial" />
- <Test name="qdialog" location="tests/auto/qdialog/tst_qdialog" />
- <Test name="qdialogbuttonbox" location="tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox" />
- <Test name="qdir" location="tests/auto/qdir/tst_qdir" />
- <Test name="qdirectpainter" location="tests/auto/qdirectpainter/tst_qdirectpainter" />
- <Test name="qdiriterator" location="tests/auto/qdiriterator/tst_qdiriterator" />
- <Test name="qdirmodel" location="tests/auto/qdirmodel/tst_qdirmodel" />
- <Test name="qdockwidget" location="tests/auto/qdockwidget/tst_qdockwidget" />
- <Test name="qdom" location="tests/auto/qdom/tst_qdom" />
- <Test name="qdoublespinbox" location="tests/auto/qdoublespinbox/tst_qdoublespinbox" />
- <Test name="qdoublevalidator" location="tests/auto/qdoublevalidator/tst_qdoublevalidator" />
- <Test name="qdrag" location="tests/auto/qdrag/tst_qdrag" />
- <Test name="qerrormessage" location="tests/auto/qerrormessage/tst_qerrormessage" />
- <Test name="qevent" location="tests/auto/qevent/tst_qevent" />
- <Test name="qeventloop" location="tests/auto/qeventloop/tst_qeventloop" />
- <Test name="qexplicitlyshareddatapointer" location="tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer" />
- <Test name="qfile" location="tests/auto/qfile/tst_qfile" />
- <Test name="qfiledialog" location="tests/auto/qfiledialog/tst_qfiledialog" />
- <Test name="qfileinfo" location="tests/auto/qfileinfo/tst_qfileinfo" />
- <Test name="qfilesystemmodel" location="tests/auto/qfilesystemmodel/tst_qfilesystemmodel" />
- <Test name="qfilesystemwatcher" location="tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher" />
- <Test name="qflags" location="tests/auto/qflags/tst_qflags" />
- <Test name="qfocusevent" location="tests/auto/qfocusevent/tst_qfocusevent" />
- <Test name="qfocusframe" location="tests/auto/qfocusframe/tst_qfocusframe" />
- <Test name="qfont" location="tests/auto/qfont/tst_qfont" />
- <Test name="qfontcombobox" location="tests/auto/qfontcombobox/tst_qfontcombobox" />
- <Test name="qfontdatabase" location="tests/auto/qfontdatabase/tst_qfontdatabase" />
- <Test name="qfontdialog" location="tests/auto/qfontdialog/tst_qfontdialog" />
- <Test name="qfontmetrics" location="tests/auto/qfontmetrics/tst_qfontmetrics" />
- <Test name="qformlayout" location="tests/auto/qformlayout/tst_qformlayout" />
- <Test name="qftp" location="tests/auto/qftp/tst_qftp" />
- <Test name="q_func_info" location="tests/auto/q_func_info/tst_q_func_info" />
- <Test name="qfuture" location="tests/auto/qfuture/tst_qfuture" />
- <Test name="qfuturewatcher" location="tests/auto/qfuturewatcher/tst_qfuturewatcher" />
- <Test name="qgetputenv" location="tests/auto/qgetputenv/tst_qgetputenv" />
- <Test name="qgl" location="tests/auto/qgl/tst_qgl" />
- <Test name="qglobal" location="tests/auto/qglobal/tst_qglobal" />
- <Test name="qgraphicsgridlayout" location="tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout" />
- <Test name="qgraphicsitem" location="tests/auto/qgraphicsitem/tst_qgraphicsitem" />
- <Test name="qgraphicsitemanimation" location="tests/auto/qgraphicsitemanimation/tst_qgraphicsitemanimation" />
- <Test name="qgraphicslayout" location="tests/auto/qgraphicslayout/tst_qgraphicslayout" />
- <Test name="qgraphicslayoutitem" location="tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem" />
- <Test name="qgraphicslinearlayout" location="tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout" />
- <Test name="qgraphicsanchorlayout" location="tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout" />
- <Test name="qgraphicspixmapitem" location="tests/auto/qgraphicspixmapitem/tst_qgraphicspixmapitem" />
- <Test name="qgraphicspolygonitem" location="tests/auto/qgraphicspolygonitem/tst_qgraphicspolygonitem" />
- <Test name="qgraphicsproxywidget" location="tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget" />
- <Test name="qgraphicsscene" location="tests/auto/qgraphicsscene/tst_qgraphicsscene" />
- <Test name="qgraphicsview" location="tests/auto/qgraphicsview/tst_qgraphicsview" />
- <Test name="qgraphicswidget" location="tests/auto/qgraphicswidget/tst_qgraphicswidget" />
- <Test name="qgridlayout" location="tests/auto/qgridlayout/tst_qgridlayout" />
- <Test name="qgroupbox" location="tests/auto/qgroupbox/tst_qgroupbox" />
- <Test name="qguivariant" location="tests/auto/qguivariant/tst_qguivariant" />
- <Test name="qhash" location="tests/auto/qhash/tst_qhash" />
- <Test name="qheaderview" location="tests/auto/qheaderview/tst_qheaderview" />
- <Test name="qhelpcontentmodel" location="tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel" />
- <Test name="qhelpenginecore" location="tests/auto/qhelpenginecore/tst_qhelpenginecore" />
- <Test name="qhelpgenerator" location="tests/auto/qhelpgenerator/tst_qhelpgenerator" />
- <Test name="qhelpindexmodel" location="tests/auto/qhelpindexmodel/tst_qhelpindexmodel" />
- <Test name="qhelpprojectdata" location="tests/auto/qhelpprojectdata/tst_qhelpprojectdata" />
- <Test name="qhostaddress" location="tests/auto/qhostaddress/tst_qhostaddress" />
- <Test name="qhostinfo" location="tests/auto/qhostinfo/tst_qhostinfo" />
- <Test name="qhttp" location="tests/auto/qhttp/tst_qhttp" />
- <Test name="qhttpnetworkconnection" location="tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection" />
- <Test name="qhttpnetworkreply" location="tests/auto/qhttpnetworkreply/tst_qhttpnetworkreply" />
- <Test name="qhttpsocketengine" location="tests/auto/qhttpsocketengine/tst_qhttpsocketengine" />
- <Test name="qicoimageformat" location="tests/auto/qicoimageformat/tst_qicoimageformat" />
- <Test name="qicon" location="tests/auto/qicon/tst_qicon" />
- <Test name="qimage" location="tests/auto/qimage/tst_qimage" />
- <Test name="qimageiohandler" location="tests/auto/qimageiohandler/tst_qimageiohandler" />
- <Test name="qimagereader" location="tests/auto/qimagereader/tst_qimagereader" />
- <Test name="qimagewriter" location="tests/auto/qimagewriter/tst_qimagewriter" />
- <Test name="qinputdialog" location="tests/auto/qinputdialog/tst_qinputdialog" />
- <Test name="qintvalidator" location="tests/auto/qintvalidator/tst_qintvalidator" />
- <Test name="qiodevice" location="tests/auto/qiodevice/tst_qiodevice" />
- <Test name="qitemdelegate" location="tests/auto/qitemdelegate/tst_qitemdelegate" />
- <Test name="qitemeditorfactory" location="tests/auto/qitemeditorfactory/tst_qitemeditorfactory" />
- <Test name="qitemmodel" location="tests/auto/qitemmodel/tst_qitemmodel" />
- <Test name="qitemselectionmodel" location="tests/auto/qitemselectionmodel/tst_qitemselectionmodel" />
- <Test name="qitemview" location="tests/auto/qitemview/tst_qitemview" />
- <Test name="qkeyevent" location="tests/auto/qkeyevent/tst_qkeyevent" />
- <Test name="qkeysequence" location="tests/auto/qkeysequence/tst_qkeysequence" />
- <Test name="qlabel" location="tests/auto/qlabel/tst_qlabel" />
- <Test name="qlayout" location="tests/auto/qlayout/tst_qlayout" />
- <Test name="qlcdnumber" location="tests/auto/qlcdnumber/tst_qlcdnumber" />
- <Test name="qlibrary" location="tests/auto/qlibrary/tst_qlibrary" />
- <Test name="qline" location="tests/auto/qline/tst_qline" />
- <Test name="qlineedit" location="tests/auto/qlineedit/tst_qlineedit" />
- <Test name="qlistbox" location="tests/auto/qlistbox/tst_qlistbox" />
- <Test name="qlistview" location="tests/auto/qlistview/tst_qlistview" />
- <Test name="qlistwidget" location="tests/auto/qlistwidget/tst_qlistwidget" />
- <Test name="qlocale" location="tests/auto/qlocale/tst_qlocale" />
- <Test name="qlocalsocket" location="tests/auto/qlocalsocket/tst_qlocalsocket" />
- <Test name="qmacstyle" location="tests/auto/qmacstyle/tst_qmacstyle" />
- <Test name="qmainwindow" location="tests/auto/qmainwindow/tst_qmainwindow" />
- <Test name="qmake" location="tests/auto/qmake/tst_qmake" />
- <Test name="qmap" location="tests/auto/qmap/tst_qmap" />
- <Test name="qmdiarea" location="tests/auto/qmdiarea/tst_qmdiarea" />
- <Test name="qmdisubwindow" location="tests/auto/qmdisubwindow/tst_qmdisubwindow" />
- <Test name="qmenu" location="tests/auto/qmenu/tst_qmenu" />
- <Test name="qmenubar" location="tests/auto/qmenubar/tst_qmenubar" />
- <Test name="qmessagebox" location="tests/auto/qmessagebox/tst_qmessagebox" />
- <Test name="qmetaobject" location="tests/auto/qmetaobject/tst_qmetaobject" />
- <Test name="qmetatype" location="tests/auto/qmetatype/tst_qmetatype" />
- <Test name="qmouseevent" location="tests/auto/qmouseevent/tst_qmouseevent" />
- <Test name="qmouseevent_modal" location="tests/auto/qmouseevent_modal/tst_qmousevent_modal" />
- <Test name="qmovie" location="tests/auto/qmovie/tst_qmovie" />
- <Test name="qmultiscreen" location="tests/auto/qmultiscreen/tst_qmultiscreen" />
- <Test name="qmutex" location="tests/auto/qmutex/tst_qmutex" />
- <Test name="qmutexlocker" location="tests/auto/qmutexlocker/tst_qmutexlocker" />
- <Test name="qnativesocketengine" location="tests/auto/qnativesocketengine/tst_qnativesocketengine" />
- <Test name="qnetworkcookie" location="tests/auto/qnetworkcookie/tst_qnetworkcookie" />
- <Test name="qnetworkcookiejar" location="tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar" />
- <Test name="qnetworkinterface" location="tests/auto/qnetworkinterface/tst_qnetworkinterface" />
- <Test name="qnetworkproxy" location="tests/auto/qnetworkproxy/tst_qnetworkproxy" />
- <Test name="qnetworkreply" location="tests/auto/qnetworkreply/tst_qnetworkreply" />
- <Test name="qnetworkrequest" location="tests/auto/qnetworkrequest/tst_qnetworkrequest" />
- <Test name="qnumeric" location="tests/auto/qnumeric/tst_qnumeric" />
- <Test name="qobject" location="tests/auto/qobject/tst_qobject" />
- <Test name="qobjectperformance" location="tests/auto/qobjectperformance/tst_qobjectperformance" />
- <Test name="qobjectrace" location="tests/auto/qobjectrace/tst_qobjectrace" />
- <Test name="qpaintengine" location="tests/auto/qpaintengine/tst_qpaintengine" />
- <Test name="qpainter" location="tests/auto/qpainter/tst_qpainter" />
- <Test name="qpainterpath" location="tests/auto/qpainterpath/tst_qpainterpath" />
- <Test name="qpainterpathstroker" location="tests/auto/qpainterpathstroker/tst_qpainterpathstroker" />
- <Test name="qpalette" location="tests/auto/qpalette/tst_qpalette" />
- <Test name="qpathclipper" location="tests/auto/qpathclipper/tst_qpathclipper" />
- <Test name="qpen" location="tests/auto/qpen/tst_qpen" />
- <Test name="qpicture" location="tests/auto/qpicture/tst_qpicture" />
- <Test name="qpixmap" location="tests/auto/qpixmap/tst_qpixmap" />
- <Test name="qpixmapcache" location="tests/auto/qpixmapcache/tst_qpixmapcache" />
- <Test name="qpixmapfilter" location="tests/auto/qpixmapfilter/tst_qpixmapfilter" />
- <Test name="qplaintextedit" location="tests/auto/qplaintextedit/tst_qplaintextedit" />
- <Test name="qplugin" location="tests/auto/qplugin/tst_qplugin" />
- <Test name="qpluginloader" location="tests/auto/qpluginloader/tst_qpluginloader" />
- <Test name="qpoint" location="tests/auto/qpoint/tst_qpoint" />
- <Test name="qpointarray" location="tests/auto/qpointarray/tst_qpointarray" />
- <Test name="qpointer" location="tests/auto/qpointer/tst_qpointer" />
- <Test name="qpopmenu" location="tests/auto/qpopmenu/tst_qpopmenu" />
- <Test name="qprinter" location="tests/auto/qprinter/tst_qprinter" />
- <Test name="qprinterinfo" location="tests/auto/qprinterinfo/tst_qprinterinfo" />
- <Test name="qprocess" location="tests/auto/qprocess/tst_qprocess" />
- <Test name="qprogressbar" location="tests/auto/qprogressbar/tst_qprogressbar" />
- <Test name="qprogressdialog" location="tests/auto/qprogressdialog/tst_qprogressdialog" />
- <Test name="qpushbutton" location="tests/auto/qpushbutton/tst_qpushbutton" />
- <Test name="qqueue" location="tests/auto/qqueue/tst_qqueue" />
- <Test name="qradiobutton" location="tests/auto/qradiobutton/tst_qradiobutton" />
- <Test name="qrand" location="tests/auto/qrand/tst_qrand" />
- <Test name="qreadlocker" location="tests/auto/qreadlocker/tst_qreadlocker" />
- <Test name="qreadwritelock" location="tests/auto/qreadwritelock/tst_qreadwritelock" />
- <Test name="qrect" location="tests/auto/qrect/tst_qrect" />
- <Test name="qregexp" location="tests/auto/qregexp/tst_qregexp" />
- <Test name="qregexpvalidator" location="tests/auto/qregexpvalidator/tst_qregexpvalidator" />
- <Test name="qregion" location="tests/auto/qregion/tst_qregion" />
- <Test name="qresourceengine" location="tests/auto/qresourceengine/tst_qresourceengine" />
- <Test name="qscriptable" location="tests/auto/qscriptable/tst_qscriptable" />
- <Test name="qscriptclass" location="tests/auto/qscriptclass/tst_qscriptclass" />
- <Test name="qscriptcontext" location="tests/auto/qscriptcontext/tst_qscriptcontext" />
- <Test name="qscriptcontextinfo" location="tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo" />
- <Test name="qscriptengine" location="tests/auto/qscriptengine/tst_qscriptengine" />
- <Test name="qscriptengineagent" location="tests/auto/qscriptengineagent/tst_qscriptengineagent" />
- <Test name="qscriptjstestsuite" location="tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite" />
- <Test name="qscriptobject" location="tests/auto/qscriptobject/tst_qscriptobject" />
- <Test name="qscriptstring" location="tests/auto/qscriptstring/tst_qscriptstring" />
- <Test name="qscriptvalue" location="tests/auto/qscriptvalue/tst_qscriptvalue" />
- <Test name="qscriptvalueiterator" location="tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator" />
- <Test name="qscrollarea" location="tests/auto/qscrollarea/tst_qscrollarea" />
- <Test name="qscrollbar" location="tests/auto/qscrollbar/tst_qscrollbar" />
- <Test name="qscrollview" location="tests/auto/qscrollview/tst_qscrollview" />
- <Test name="qsemaphore" location="tests/auto/qsemaphore/tst_qsemaphore" />
- <Test name="qset" location="tests/auto/qset/tst_qset" />
- <Test name="qsettings" location="tests/auto/qsettings/tst_qsettings" />
- <Test name="qsharedmemory" location="tests/auto/qsharedmemory/tst_qsharedmemory" />
- <Test name="qshortcut" location="tests/auto/qshortcut/tst_qshortcut" />
- <Test name="qsidebar" location="tests/auto/qsidebar/tst_qsidebar" />
- <Test name="qsignalmapper" location="tests/auto/qsignalmapper/tst_qsignalmapper" />
- <Test name="qsignalspy" location="tests/auto/qsignalspy/tst_qsignalspy" />
- <Test name="qsimplexmlnodemodel" location="tests/auto/qsimplexmlnodemodel/tst_qsimplexmlnodemodel" />
- <Test name="qsize" location="tests/auto/qsize/tst_qsize" />
- <Test name="qsizef" location="tests/auto/qsizef/tst_qsizef" />
- <Test name="qsizegrip" location="tests/auto/qsizegrip/tst_qsizegrip" />
- <Test name="qslider" location="tests/auto/qslider/tst_qslider" />
- <Test name="qsocket" location="tests/auto/qsocket/tst_qsocket" />
- <Test name="qsocketnotifier" location="tests/auto/qsocketnotifier/tst_qsocketnotifier" />
- <Test name="qsocks5socketengine" location="tests/auto/qsocks5socketengine/tst_qsocks5socketengine" />
- <Test name="qsortfilterproxymodel" location="tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel" />
- <Test name="qsound" location="tests/auto/qsound/tst_qsound" />
- <Test name="qaudiodeviceid" location="tests/auto/qaudiodeviceid/tst_qaudiodeviceid" />
- <Test name="qaudioformat" location="tests/auto/qaudioformat/tst_qaudioformat" />
- <Test name="qaudiooutput" location="tests/auto/qaudiooutput/tst_qaudiooutput" />
- <Test name="qaudioinput" location="tests/auto/qaudioinput/tst_qaudioinput" />
- <Test name="qsourcelocation" location="tests/auto/qsourcelocation/tst_qsourcelocation" />
- <Test name="qspinbox" location="tests/auto/qspinbox/tst_qspinbox" />
- <Test name="qsplitter" location="tests/auto/qsplitter/tst_qsplitter" />
- <Test name="qsql" location="tests/auto/qsql/tst_qsql" />
- <Test name="qsqlbatch" location="tests/auto/qsqlbatch/tst_qsqlbatch" />
- <Test name="qsqlcursor" location="tests/auto/qsqlcursor/tst_qsqlcursor" />
- <Test name="qsqldatabase" location="tests/auto/qsqldatabase/tst_qsqldatabase" />
- <Test name="qsqlerror" location="tests/auto/qsqlerror/tst_qsqlerror" />
- <Test name="qsqlfield" location="tests/auto/qsqlfield/tst_qsqlfield" />
- <Test name="qsqlquery" location="tests/auto/qsqlquery/tst_qsqlquery" />
- <Test name="qsqlquerymodel" location="tests/auto/qsqlquerymodel/tst_qsqlquerymodel" />
- <Test name="qsqlrecord" location="tests/auto/qsqlrecord/tst_qsqlrecord" />
- <Test name="qsqlrelationaltablemodel" location="tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel" />
- <Test name="qsqlselectcursor" location="tests/auto/qsqlselectcursor/tst_qsqlselectcursor" />
- <Test name="qsqltablemodel" location="tests/auto/qsqltablemodel/tst_qsqltablemodel" />
- <Test name="qsqlthread" location="tests/auto/qsqlthread/tst_qsqlthread" />
- <Test name="qsslcertificate" location="tests/auto/qsslcertificate/tst_qsslcertificate" />
- <Test name="qsslcipher" location="tests/auto/qsslcipher/tst_qsslcipher" />
- <Test name="qsslerror" location="tests/auto/qsslerror/tst_qsslerror" />
- <Test name="qsslkey" location="tests/auto/qsslkey/tst_qsslkey" />
- <Test name="qsslsocket" location="tests/auto/qsslsocket/tst_qsslsocket" />
- <Test name="qstackedlayout" location="tests/auto/qstackedlayout/tst_qstackedlayout" />
- <Test name="qstackedwidget" location="tests/auto/qstackedwidget/tst_qstackedwidget" />
- <Test name="qstandarditem" location="tests/auto/qstandarditem/tst_qstandarditem" />
- <Test name="qstandarditemmodel" location="tests/auto/qstandarditemmodel/tst_qstandarditemmodel" />
- <Test name="qstatusbar" location="tests/auto/qstatusbar/tst_qstatusbar" />
- <Test name="qstl" location="tests/auto/qstl/tst_qstl" />
- <Test name="qstring" location="tests/auto/qstring/tst_qstring" />
- <Test name="qstringlist" location="tests/auto/qstringlist/tst_qstringlist" />
- <Test name="qstringlistmodel" location="tests/auto/qstringlistmodel/tst_qstringlistmodel" />
- <Test name="qstyle" location="tests/auto/qstyle/tst_qstyle" />
- <Test name="qstyleoption" location="tests/auto/qstyleoption/tst_qstyleoption" />
- <Test name="qstylesheetstyle" location="tests/auto/qstylesheetstyle/tst_qstylesheetstyle" />
- <Test name="qsvgdevice" location="tests/auto/qsvgdevice/tst_qsvgdevice" />
- <Test name="qsvggenerator" location="tests/auto/qsvggenerator/tst_qsvggenerator" />
- <Test name="qsvgrenderer" location="tests/auto/qsvgrenderer/tst_qsvgrenderer" />
- <Test name="qsyntaxhighlighter" location="tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter" />
- <Test name="qsysinfo" location="tests/auto/qsysinfo/tst_qsysinfo" />
- <Test name="qsystemsemaphore" location="tests/auto/qsystemsemaphore/tst_qsystemsemaphore" />
- <Test name="qsystemtrayicon" location="tests/auto/qsystemtrayicon/tst_qsystemtrayicon" />
- <Test name="qtabbar" location="tests/auto/qtabbar/tst_qtabbar" />
- <Test name="qtableview" location="tests/auto/qtableview/tst_qtableview" />
- <Test name="qtablewidget" location="tests/auto/qtablewidget/tst_qtablewidget" />
- <Test name="qtabwidget" location="tests/auto/qtabwidget/tst_qtabwidget" />
- <Test name="qtconcurrentfilter" location="tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter" />
- <Test name="qtconcurrentiteratekernel" location="tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel" />
- <Test name="qtconcurrentmap" location="tests/auto/qtconcurrentmap/tst_qtconcurrentmap" />
- <Test name="qtconcurrentrun" location="tests/auto/qtconcurrentrun/tst_qtconcurrentrun" />
- <Test name="qtconcurrentthreadengine" location="tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine" />
- <Test name="qtcpserver" location="tests/auto/qtcpserver/tst_qtcpserver" />
- <Test name="qtcpsocket" location="tests/auto/qtcpsocket/tst_qtcpsocket" />
- <Test name="qtemporaryfile" location="tests/auto/qtemporaryfile/tst_qtemporaryfile" />
- <Test name="qtessellator" location="tests/auto/qtessellator/tst_qtessellator" />
- <Test name="qtextblock" location="tests/auto/qtextblock/tst_qtextblock" />
- <Test name="qtextboundaryfinder" location="tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder" />
- <Test name="qtextbrowser" location="tests/auto/qtextbrowser/tst_qtextbrowser" />
- <Test name="qtextcodec" location="tests/auto/qtextcodec/tst_qtextcodec" />
- <Test name="qtextcursor" location="tests/auto/qtextcursor/tst_qtextcursor" />
- <Test name="qtextdocument" location="tests/auto/qtextdocument/tst_qtextdocument" />
- <Test name="qtextdocumentfragment" location="tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment" />
- <Test name="qtextdocumentlayout" location="tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout" />
- <Test name="qtextedit" location="tests/auto/qtextedit/tst_qtextedit" />
- <Test name="qtextformat" location="tests/auto/qtextformat/tst_qtextformat" />
- <Test name="qtextlayout" location="tests/auto/qtextlayout/tst_qtextlayout" />
- <Test name="qtextlist" location="tests/auto/qtextlist/tst_qtextlist" />
- <Test name="qtextobject" location="tests/auto/qtextobject/tst_qtextobject" />
- <Test name="qtextpiecetable" location="tests/auto/qtextpiecetable/tst_qtextpiecetable" />
- <Test name="qtextscriptengine" location="tests/auto/qtextscriptengine/tst_qtextscriptengine" />
- <Test name="qtextstream" location="tests/auto/qtextstream/tst_qtextstream" />
- <Test name="qtexttable" location="tests/auto/qtexttable/tst_qtexttable" />
- <Test name="qthread" location="tests/auto/qthread/tst_qthread" />
- <Test name="qthreadpool" location="tests/auto/qthreadpool/tst_qthreadpool" />
- <Test name="qthreadstorage" location="tests/auto/qthreadstorage/tst_qthreadstorage" />
- <Test name="qtime" location="tests/auto/qtime/tst_qtime" />
- <Test name="qtimeline" location="tests/auto/qtimeline/tst_qtimeline" />
- <Test name="qtimer" location="tests/auto/qtimer/tst_qtimer" />
- <Test name="qtmd5" location="tests/auto/qtmd5/tst_qtmd5" />
- <Test name="qtoolbar" location="tests/auto/qtoolbar/tst_qtoolbar" />
- <Test name="qtoolbox" location="tests/auto/qtoolbox/tst_qtoolbox" />
- <Test name="qtoolbutton" location="tests/auto/qtoolbutton/tst_qtoolbutton" />
- <Test name="qtooltip" location="tests/auto/qtooltip/tst_qtooltip" />
- <Test name="qtransform" location="tests/auto/qtransform/tst_qtransform" />
- <Test name="qtransformedscreen" location="tests/auto/qtransformedscreen/tst_qtransformedscreen" />
- <Test name="qtranslator" location="tests/auto/qtranslator/tst_qtranslator" />
- <Test name="qtreeview" location="tests/auto/qtreeview/tst_qtreeview" />
- <Test name="qtreewidget" location="tests/auto/qtreewidget/tst_qtreewidget" />
- <Test name="qtreewidgetitemiterator" location="tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator" />
- <Test name="qtwidgets" location="tests/auto/qtwidgets/tst_qtwidgets" />
- <Test name="qudpsocket" location="tests/auto/qudpsocket/tst_qudpsocket" />
- <Test name="qundogroup" location="tests/auto/qundogroup/tst_qundogroup" />
- <Test name="qundostack" location="tests/auto/qundostack/tst_qundostack" />
- <Test name="quridrag" location="tests/auto/quridrag/tst_quridrag" />
- <Test name="qurl" location="tests/auto/qurl/tst_qurl" />
- <Test name="quuid" location="tests/auto/quuid/tst_quuid" />
- <Test name="qvariant" location="tests/auto/qvariant/tst_qvariant" />
- <Test name="qvarlengtharray" location="tests/auto/qvarlengtharray/tst_qvarlengtharray" />
- <Test name="qvector" location="tests/auto/qvector/tst_qvector" />
- <Test name="qwaitcondition" location="tests/auto/qwaitcondition/tst_qwaitcondition" />
- <Test name="qwebframe" location="tests/auto/qwebframe/tst_qwebframe" />
- <Test name="qwebpage" location="tests/auto/qwebpage/tst_qwebpage" />
- <Test name="qwidget" location="tests/auto/qwidget/tst_qwidget" />
- <Test name="qwidgetaction" location="tests/auto/qwidgetaction/tst_qwidgetaction" />
- <Test name="qwidgetstack" location="tests/auto/qwidgetstack/tst_qwidgetstack" />
- <Test name="qwidget_window" location="tests/auto/qwidget_window/tst_qwidget_window" />
- <Test name="qwindowsurface" location="tests/auto/qwindowsurface/tst_qwindowsurface" />
- <Test name="qwineventnotifier" location="tests/auto/qwineventnotifier/tst_qwineventnotifier" />
- <Test name="qwizard" location="tests/auto/qwizard/tst_qwizard" />
- <Test name="qwmatrix" location="tests/auto/qwmatrix/tst_qwmatrix" />
- <Test name="qworkspace" location="tests/auto/qworkspace/tst_qworkspace" />
- <Test name="qwritelocker" location="tests/auto/qwritelocker/tst_qwritelocker" />
- <Test name="qwsembedwidget" location="tests/auto/qwsembedwidget/tst_qwsembedwidget" />
- <Test name="qwsinputmethod" location="tests/auto/qwsinputmethod/tst_qwsinputmethod" />
- <Test name="qwswindowsystem" location="tests/auto/qwswindowsystem/tst_qwswindowsystem" />
- <Test name="qx11info" location="tests/auto/qx11info/tst_qx11info" />
- <Test name="qxml" location="tests/auto/qxml/tst_qxml" />
- <Test name="qxmlformatter" location="tests/auto/qxmlformatter/tst_qxmlformatter" />
- <Test name="qxmlinputsource" location="tests/auto/qxmlinputsource/tst_qxmlinputsource" />
- <Test name="qxmlitem" location="tests/auto/qxmlitem/tst_qxmlitem" />
- <Test name="qxmlname" location="tests/auto/qxmlname/tst_qxmlname" />
- <Test name="qxmlnamepool" location="tests/auto/qxmlnamepool/tst_qxmlnamepool" />
- <Test name="qxmlnodemodelindex" location="tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex" />
- <Test name="qxmlquery" location="tests/auto/qxmlquery/tst_qxmlquery" />
- <Test name="qxmlresultitems" location="tests/auto/qxmlresultitems/tst_qxmlresultitems" />
- <Test name="qxmlserializer" location="tests/auto/qxmlserializer/tst_qxmlserializer" />
- <Test name="qxmlsimplereader" location="tests/auto/qxmlsimplereader/tst_qxmlsimplereader" />
- <Test name="qxmlstream" location="tests/auto/qxmlstream/tst_qxmlstream" />
- <Test name="selftests" location="tests/auto/selftests/tst_selftests" />
- <Test name="symbols" location="tests/auto/symbols/tst_symbols" />
- <Test name="tests" location="tests/auto/tests/tst_tests" />
- <Test name="uic" location="tests/auto/uic/tst_uic" />
- <Test name="xmlpatterns" location="tests/auto/xmlpatterns/tst_xmlpatterns" />
- <Test name="xmlpatternsxqts" location="tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts" />
- </Tests>
- <TestSuites>
- <TestSuite name="qt-4.4">
- <Test id="atwrapper" />
- <Test id="bic" />
- <Test id="checkxmlfiles" />
- <Test id="collections" />
- <Test id="compile" />
- <Test id="compilerwarnings" />
- <Test id="exceptionsafety" />
- <Test id="headers" />
- <Test id="languagechange" />
- <Test id="lrelease" />
- <Test id="lconvert" />
- <Test id="lupdate" />
- <Test id="macgui" />
- <Test id="mediaobject" />
- <Test id="moc" />
- <Test id="patternistexamplefiletree" />
- <Test id="patternistexamples" />
- <Test id="patternistheaders" />
- <Test id="qabstractbutton" />
- <Test id="qabstractitemmodel" />
- <Test id="qabstractitemview" />
- <Test id="qabstractmessagehandler" />
- <Test id="qabstractprintdialog" />
- <Test id="qabstractproxymodel" />
- <Test id="qabstractscrollarea" />
- <Test id="qabstractslider" />
- <Test id="qabstractsocket" />
- <Test id="qabstractspinbox" />
- <Test id="qabstracttextdocumentlayout" />
- <Test id="qabstracturiresolver" />
- <Test id="qabstractxmlforwarditerator" />
- <Test id="qabstractxmlnodemodel" />
- <Test id="qabstractxmlreceiver" />
- <Test id="qaccessibility" />
- <Test id="qaccessibility_mac" />
- <Test id="qaction" />
- <Test id="qactiongroup" />
- <Test id="qalgorithms" />
- <Test id="qapplication" />
- <Test id="qatomicint" />
- <Test id="qatomicpointer" />
- <Test id="qautoptr" />
- <Test id="qbitarray" />
- <Test id="qboxlayout" />
- <Test id="qbrush" />
- <Test id="qbuffer" />
- <Test id="qbuttongroup" />
- <Test id="qbytearray" />
- <Test id="qcache" />
- <Test id="qcalendarwidget" />
- <Test id="qchar" />
- <Test id="qcheckbox" />
- <Test id="qclipboard" />
- <Test id="qcolor" />
- <Test id="qcolordialog" />
- <Test id="qcolumnview" />
- <Test id="qcombobox" />
- <Test id="qcommandlinkbutton" />
- <Test id="qcompleter" />
- <Test id="qcomplextext" />
- <Test id="qcopchannel" />
- <Test id="qcoreapplication" />
- <Test id="qcryptographichash" />
- <Test id="qcssparser" />
- <Test id="qdatastream" />
- <Test id="qdatawidgetmapper" />
- <Test id="qdate" />
- <Test id="qdatetime" />
- <Test id="qdatetimeedit" />
- <Test id="qdbusabstractadaptor" />
- <Test id="qdbusconnection" />
- <Test id="qdbuscontext" />
- <Test id="qdbusinterface" />
- <Test id="qdbuslocalcalls" />
- <Test id="qdbusmarshall" />
- <Test id="qdbusmetaobject" />
- <Test id="qdbusmetatype" />
- <Test id="qdbusperformance" />
- <Test id="qdbusreply" />
- <Test id="qdbusserver" />
- <Test id="qdbusthreading" />
- <Test id="qdbusxmlparser" />
- <Test id="qdebug" />
- <Test id="qdesktopservices" />
- <Test id="qdesktopwidget" />
- <Test id="qdial" />
- <Test id="qdialog" />
- <Test id="qdialogbuttonbox" />
- <Test id="qdir" />
- <Test id="qdirectpainter" />
- <Test id="qdiriterator" />
- <Test id="qdirmodel" />
- <Test id="qdockwidget" />
- <Test id="qdom" />
- <Test id="qdoublespinbox" />
- <Test id="qdoublevalidator" />
- <Test id="qdrag" />
- <Test id="qerrormessage" />
- <Test id="qevent" />
- <Test id="qeventloop" />
- <Test id="qexplicitlyshareddatapointer" />
- <Test id="qfile" />
- <Test id="qfiledialog" />
- <Test id="qfileinfo" />
- <Test id="qfilesystemmodel" />
- <Test id="qfilesystemwatcher" />
- <Test id="qflags" />
- <Test id ="qfocusevent" />
- <Test id="qfocusframe" />
- <Test id="qfont" />
- <Test id="qfontcombobox" />
- <Test id="qfontdatabase" />
- <Test id="qfontdialog" />
- <Test id="qfontmetrics" />
- <Test id="qformlayout" />
- <Test id="qftp" />
- <Test id="q_func_info" />
- <Test id="qfuture" />
- <Test id="qfuturewatcher" />
- <Test id="qgetputenv" />
- <Test id="qgl" />
- <Test id="qglobal" />
- <Test id="qgraphicsgridlayout" />
- <Test id="qgraphicsitem" />
- <Test id="qgraphicsitemanimation" />
- <Test id="qgraphicslayout" />
- <Test id="qgraphicslayoutitem" />
- <Test id="qgraphicslinearlayout" />
- <Test id="qgraphicsanchorlayout" />
- <Test id="qgraphicspixmapitem" />
- <Test id="qgraphicspolygonitem" />
- <Test id="qgraphicsproxywidget" />
- <Test id="qgraphicsscene" />
- <Test id="qgraphicsview" />
- <Test id="qgraphicswidget" />
- <Test id="qgridlayout" />
- <Test id="qgroupbox" />
- <Test id="qguivariant" />
- <Test id="qhash" />
- <Test id="qheaderview" />
- <Test id="qhelpcontentmodel" />
- <Test id="qhelpenginecore" />
- <Test id="qhelpgenerator" />
- <Test id="qhelpindexmodel" />
- <Test id="qhelpprojectdata" />
- <Test id="qhostaddress" />
- <Test id="qhostinfo" />
- <Test id="qhttp" />
- <Test id="qhttpnetworkconnection" />
- <Test id="qhttpnetworkreply" />
- <Test id="qhttpsocketengine" />
- <Test id="qicoimageformat" />
- <Test id="qicon" />
- <Test id="qimage" />
- <Test id="qimageiohandler" />
- <Test id="qimagereader" />
- <Test id="qimagewriter" />
- <Test id="qinputdialog" />
- <Test id="qintvalidator" />
- <Test id="qiodevice" />
- <Test id="qitemdelegate" />
- <Test id="qitemeditorfactory" />
- <Test id="qitemmodel" />
- <Test id="qitemselectionmodel" />
- <Test id="qitemview" />
- <Test id="qkeyevent" />
- <Test id="qkeysequence" />
- <Test id="qlabel" />
- <Test id="qlayout" />
- <Test id="qlcdnumber" />
- <Test id="qlibrary" />
- <Test id="qline" />
- <Test id="qlineedit" />
- <Test id="qlistbox" />
- <Test id="qlistview" />
- <Test id="qlistwidget" />
- <Test id="qlocale" />
- <Test id="qlocalsocket" />
- <Test id="qmacstyle" />
- <Test id="qmainwindow" />
- <Test id="qmake" />
- <Test id="qmap" />
- <Test id="qmdiarea" />
- <Test id="qmdisubwindow" />
- <Test id="qmenu" />
- <Test id="qmenubar" />
- <Test id="qmessagebox" />
- <Test id="qmetaobject" />
- <Test id="qmetatype" />
- <Test id="qmouseevent" />
- <Test id="qmouseevent_modal" />
- <Test id="qmovie" />
- <Test id="qmultiscreen" />
- <Test id="qmutex" />
- <Test id="qmutexlocker" />
- <Test id="qnativesocketengine" />
- <Test id="qnetworkcookie" />
- <Test id="qnetworkcookiejar" />
- <Test id="qnetworkinterface" />
- <Test id="qnetworkproxy" />
- <Test id="qnetworkreply" />
- <Test id="qnetworkrequest" />
- <Test id="qnumeric" />
- <Test id="qobject" />
- <Test id="qobjectperformance" />
- <Test id="qobjectrace" />
- <Test id="qpaintengine" />
- <Test id="qpainter" />
- <Test id="qpainterpath" />
- <Test id="qpainterpathstroker" />
- <Test id="qpalette" />
- <Test id="qpathclipper" />
- <Test id="qpen" />
- <Test id="qpicture" />
- <Test id="qpixmap" />
- <Test id="qpixmapcache" />
- <Test id="qplaintextedit" />
- <Test id="qplugin" />
- <Test id="qpluginloader" />
- <Test id="qpoint" />
- <Test id="qpointarray" />
- <Test id="qpointer" />
- <Test id="qpopmenu" />
- <Test id="qprinter" />
- <Test id="qprinterinfo" />
- <Test id="qprocess" />
- <Test id="qprogressbar" />
- <Test id="qprogressdialog" />
- <Test id="qpushbutton" />
- <Test id="qqueue" />
- <Test id="qradiobutton" />
- <Test id="qrand" />
- <Test id="qreadlocker" />
- <Test id="qreadwritelock" />
- <Test id="qrect" />
- <Test id="qregexp" />
- <Test id="qregexpvalidator" />
- <Test id="qregion" />
- <Test id="qresourceengine" />
- <Test id="qscriptable" />
- <Test id="qscriptclass" />
- <Test id="qscriptcontext" />
- <Test id="qscriptcontextinfo" />
- <Test id="qscriptengine" />
- <Test id="qscriptengineagent" />
- <Test id="qscriptjstestsuite" />
- <Test id="qscriptobject" />
- <Test id="qscriptstring" />
- <Test id="qscriptvalue" />
- <Test id="qscriptvalueiterator" />
- <Test id="qscrollarea" />
- <Test id="qscrollbar" />
- <Test id="qscrollview" />
- <Test id="qsemaphore" />
- <Test id="qset" />
- <Test id="qsettings" />
- <Test id="qsharedmemory" />
- <Test id="qshortcut" />
- <Test id="qsidebar" />
- <Test id="qsignalmapper" />
- <Test id="qsignalspy" />
- <Test id="qsimplexmlnodemodel" />
- <Test id="qsize" />
- <Test id="qsizef" />
- <Test id="qsizegrip" />
- <Test id="qslider" />
- <Test id="qsocket" />
- <Test id="qsocketnotifier" />
- <Test id="qsocks5socketengine" />
- <Test id="qsortfilterproxymodel" />
- <Test id="qsound" />
- <Test id="qaudiodeviceid" />
- <Test id="qaudioformat" />
- <Test id="qaudiooutput" />
- <Test id="qaudioinput" />
- <Test id="qsourcelocation" />
- <Test id="qspinbox" />
- <Test id="qsplitter" />
- <Test id="qsql" />
- <Test id="qsqlbatch" />
- <Test id="qsqlcursor" />
- <Test id="qsqldatabase" />
- <Test id="qsqlerror" />
- <Test id="qsqlfield" />
- <Test id="qsqlquery" />
- <Test id="qsqlquerymodel" />
- <Test id="qsqlrecord" />
- <Test id="qsqlrelationaltablemodel" />
- <Test id="qsqlselectcursor" />
- <Test id="qsqltablemodel" />
- <Test id="qsqlthread" />
- <Test id="qsslcertificate" />
- <Test id="qsslcipher" />
- <Test id="qsslerror" />
- <Test id="qsslkey" />
- <Test id="qsslsocket" />
- <Test id="qstackedlayout" />
- <Test id="qstackedwidget" />
- <Test id="qstandarditem" />
- <Test id="qstandarditemmodel" />
- <Test id="qstatusbar" />
- <Test id="qstl" />
- <Test id="qstring" />
- <Test id="qstringlist" />
- <Test id="qstringlistmodel" />
- <Test id="qstyle" />
- <Test id="qstyleoption" />
- <Test id="qstylesheetstyle" />
- <Test id="qsvgdevice" />
- <Test id="qsvggenerator" />
- <Test id="qsvgrenderer" />
- <Test id="qsyntaxhighlighter" />
- <Test id="qsysinfo" />
- <Test id="qsystemsemaphore" />
- <Test id="qsystemtrayicon" />
- <Test id="qtabbar" />
- <Test id="qtableview" />
- <Test id="qtablewidget" />
- <Test id="qtabwidget" />
- <Test id="qtconcurrentfilter" />
- <Test id="qtconcurrentiteratekernel" />
- <Test id="qtconcurrentmap" />
- <Test id="qtconcurrentrun" />
- <Test id="qtconcurrentthreadengine" />
- <Test id="qtcpserver" />
- <Test id="qtcpsocket" />
- <Test id="qtemporaryfile" />
- <Test id="qtessellator" />
- <Test id="qtextblock" />
- <Test id="qtextboundaryfinder" />
- <Test id="qtextbrowser" />
- <Test id="qtextcodec" />
- <Test id="qtextcursor" />
- <Test id="qtextdocument" />
- <Test id="qtextdocumentfragment" />
- <Test id="qtextdocumentlayout" />
- <Test id="qtextedit" />
- <Test id="qtextformat" />
- <Test id="qtextlayout" />
- <Test id="qtextlist" />
- <Test id="qtextobject" />
- <Test id="qtextpiecetable" />
- <Test id="qtextscriptengine" />
- <Test id="qtextstream" />
- <Test id="qtexttable" />
- <Test id="qthread" />
- <Test id="qthreadpool" />
- <Test id="qthreadstorage" />
- <Test id="qtime" />
- <Test id="qtimeline" />
- <Test id="qtimer" />
- <Test id="qtmd5" />
- <Test id="qtoolbar" />
- <Test id="qtoolbox" />
- <Test id="qtoolbutton" />
- <Test id="qtooltip" />
- <Test id="qtransform" />
- <Test id="qtransformedscreen" />
- <Test id="qtranslator" />
- <Test id="qtreeview" />
- <Test id="qtreewidget" />
- <Test id="qtreewidgetitemiterator" />
- <Test id="qtwidgets" />
- <Test id="qudpsocket" />
- <Test id="qundogroup" />
- <Test id="qundostack" />
- <Test id="quridrag" />
- <Test id="qurl" />
- <Test id="quuid" />
- <Test id="qvariant" />
- <Test id="qvarlengtharray" />
- <Test id="qvector" />
- <Test id="qwaitcondition" />
- <Test id="qwebframe" />
- <Test id="qwebpage" />
- <Test id="qwidget" />
- <Test id="qwidgetaction" />
- <Test id="qwidgetstack" />
- <Test id="qwidget_window" />
- <Test id="qwindowsurface" />
- <Test id="qwineventnotifier" />
- <Test id="qwizard" />
- <Test id="qwmatrix" />
- <Test id="qworkspace" />
- <Test id="qwritelocker" />
- <Test id="qwsembedwidget" />
- <Test id="qwsinputmethod" />
- <Test id="qwswindowsystem" />
- <Test id="qx11info" />
- <Test id="qxml" />
- <Test id="qxmlformatter" />
- <Test id="qxmlinputsource" />
- <Test id="qxmlitem" />
- <Test id="qxmlname" />
- <Test id="qxmlnamepool" />
- <Test id="qxmlnodemodelindex" />
- <Test id="qxmlquery" />
- <Test id="qxmlresultitems" />
- <Test id="qxmlserializer" />
- <Test id="qxmlsimplereader" />
- <Test id="qxmlstream" />
- </TestSuite>
- </TestSuites>
- <Testruns>
- <Testrun name="qt-4.4-macx-g++" suite="qt-4.4" results="/Users/pulse/results" qt="4.4" qtest="4.4" hostname="macbuilder" makespec="macx-g++" timeout="300000" os="osx" />
- <Testrun name="qt-4.4-linux-g++" suite="qt-4.4" results="/home/pulse/results" qt="4.4" qtest="4.4" hostname="sv-linux-g++" makespec="linux-g++" timeout="300000" os="unix" />
- </Testruns>
-</Configuration>
diff --git a/tests/auto/uic/baseline/config_fromuic3.ui b/tests/auto/uic/baseline/config_fromuic3.ui
index 0bd6256..2e7addb 100644
--- a/tests/auto/uic/baseline/config_fromuic3.ui
+++ b/tests/auto/uic/baseline/config_fromuic3.ui
@@ -3,7 +3,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/uic/baseline/config_fromuic3.ui.h b/tests/auto/uic/baseline/config_fromuic3.ui.h
index ec20d05..6e22dc7 100644
--- a/tests/auto/uic/baseline/config_fromuic3.ui.h
+++ b/tests/auto/uic/baseline/config_fromuic3.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,7 +45,7 @@
** Form generated from reading UI file 'config_fromuic3.ui'
**
** Created: Thu Dec 17 12:48:42 2009
-** by: Qt User Interface Compiler version 4.6.1
+** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
diff --git a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro
index 39267c8..3f49ccc 100644
--- a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro
+++ b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro
@@ -1,7 +1,6 @@
TEMPLATE = subdirs
contains(QT_CONFIG,xmlpatterns) {
SUBDIRS += lib
- !wince*:lib.file = lib/lib.pro
test.depends = lib
}
SUBDIRS += test
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index 1c78f1f..7a27cc9 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -5,6 +5,7 @@ SUBDIRS = containers-associative \
qbytearray \
qfileinfo \
qfile_vs_qnetworkaccessmanager \
+ qfontmetrics \
qhostinfo \
qpainter \
qtestlib-simple events \
diff --git a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp
index 907ffb7..23e07db 100644
--- a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp
+++ b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp
@@ -55,11 +55,13 @@ class qfile_vs_qnetworkaccessmanager : public QObject
// but.. this is a manual test anyway, so :)
protected:
void qnamFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request);
+ void qnamImmediateFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request);
void qfileFileRead_iteration();
static const int iterations = 10;
private slots:
void qnamFileRead();
+ void qnamImmediateFileRead();
void qfileFileRead();
void initTestCase();
@@ -124,6 +126,39 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead()
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
}
+void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request)
+{
+ QNetworkReply* reply = manager.get(request);
+ QVERIFY(reply->isFinished()); // should be like that!
+ QByteArray qba = reply->readAll();
+ delete reply;
+}
+
+void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead()
+{
+ QNetworkAccessManager manager;
+ QTime t;
+ QNetworkRequest request(QUrl(testFile.fileName()));
+
+ // do 3 dry runs for cache warmup
+ qnamImmediateFileRead_iteration(manager, request);
+ qnamImmediateFileRead_iteration(manager, request);
+ qnamImmediateFileRead_iteration(manager, request);
+
+ t.start();
+ // 10 real runs
+ QBENCHMARK_ONCE {
+ for (int i = 0; i < iterations; i++) {
+ qnamImmediateFileRead_iteration(manager, request);
+ }
+ }
+
+ qint64 elapsed = t.elapsed();
+ qDebug() << endl << "Finished!";
+ qDebug() << "Bytes:" << size;
+ qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
+}
+
void qfile_vs_qnetworkaccessmanager::qfileFileRead_iteration()
{
testFile.reset();
diff --git a/tests/benchmarks/qfontmetrics/main.cpp b/tests/benchmarks/qfontmetrics/main.cpp
new file mode 100644
index 0000000..d3f85ef
--- /dev/null
+++ b/tests/benchmarks/qfontmetrics/main.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QObject>
+#include <QFont>
+#include <QFontMetrics>
+
+#include <qtest.h>
+
+//this test benchmarks the once-off (per font configuration) cost
+//associated with using QFontMetrics
+class tst_QFontMetrics : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QFontMetrics() {}
+private slots:
+ void fontmetrics_create();
+ void fontmetrics_create_once_loaded();
+
+ void fontmetrics_height();
+ void fontmetrics_height_once_loaded();
+
+private:
+ void testQFontMetrics(const QFontMetrics &fm);
+};
+
+void tst_QFontMetrics::testQFontMetrics( const QFontMetrics &fm )
+{
+ int fontHeight = fm.height();
+}
+
+void tst_QFontMetrics::fontmetrics_create()
+{
+ QBENCHMARK {
+ QFont boldfont = QApplication::font();
+ boldfont.setBold( true );
+ boldfont.setPointSize(boldfont.pointSize() * 1.5 );
+ QFontMetrics bfm( boldfont );
+ }
+}
+
+void tst_QFontMetrics::fontmetrics_create_once_loaded()
+{
+ QBENCHMARK {
+ QFont boldfont = QApplication::font();
+ boldfont.setBold( true );
+ boldfont.setPointSize(boldfont.pointSize() * 1.5 );
+ QFontMetrics bfm( boldfont );
+ }
+}
+
+void tst_QFontMetrics::fontmetrics_height()
+{
+ QFont boldfont = QApplication::font();
+ boldfont.setBold( true );
+ boldfont.setPointSize(boldfont.pointSize() * 1.5 );
+ QFontMetrics bfm( boldfont );
+
+ QBENCHMARK { testQFontMetrics(bfm); }
+}
+
+void tst_QFontMetrics::fontmetrics_height_once_loaded()
+{
+ QFont boldfont = QApplication::font();
+ boldfont.setBold( true );
+ boldfont.setPointSize(boldfont.pointSize() * 1.5 );
+ QFontMetrics bfm( boldfont );
+ QBENCHMARK { testQFontMetrics(bfm); }
+}
+
+QTEST_MAIN(tst_QFontMetrics)
+
+#include "main.moc"
diff --git a/tests/benchmarks/qfontmetrics/qfontmetrics.pro b/tests/benchmarks/qfontmetrics/qfontmetrics.pro
new file mode 100644
index 0000000..b6c7b92
--- /dev/null
+++ b/tests/benchmarks/qfontmetrics/qfontmetrics.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_QFontMetrics
+
+SOURCES += main.cpp
diff --git a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
index 6327123..a92359f 100644
--- a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
@@ -262,8 +262,22 @@ protected:
port = server.serverPort();
ready.release();
- server.waitForNewConnection(-1);
+ QVERIFY(server.waitForNewConnection(10*1000));
client = server.nextPendingConnection();
+
+ // read lines until we read the empty line seperating HTTP request from HTTP request body
+ do {
+ if (client->canReadLine()) {
+ QString line = client->readLine();
+ if (line == "\n" || line == "\r\n")
+ break; // empty line
+ }
+ if (!client->waitForReadyRead(10*1000)) {
+ client->close();
+ return;
+ }
+ } while (client->state() == QAbstractSocket::ConnectedState);
+
client->write("HTTP/1.0 200 OK\r\n");
client->write("Content-length: 0\r\n");
client->write("\r\n");
diff --git a/tests/benchmarks/qpainter/tst_qpainter.cpp b/tests/benchmarks/qpainter/tst_qpainter.cpp
index 7c6634e..39b2244 100644
--- a/tests/benchmarks/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/qpainter/tst_qpainter.cpp
@@ -45,6 +45,10 @@
#include <QDialog>
#include <QImage>
#include <QPaintEngine>
+#include <math.h>
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
Q_DECLARE_METATYPE(QLine)
Q_DECLARE_METATYPE(QRect)
@@ -178,6 +182,35 @@ private slots:
void clipAndFill_data();
void clipAndFill();
+ void drawRoundedRect();
+ void drawScaledRoundedRect();
+ void drawTransformedRoundedRect();
+
+ void drawScaledAntialiasedRoundedRect_data();
+ void drawTransformedAntialiasedRoundedRect_data();
+ void drawAntialiasedRoundedRect();
+ void drawScaledAntialiasedRoundedRect();
+ void drawTransformedAntialiasedRoundedRect();
+
+ void drawScaledImageRoundedRect_data();
+ void drawTransformedImageRoundedRect_data();
+ void drawImageRoundedRect();
+ void drawScaledImageRoundedRect();
+ void drawTransformedImageRoundedRect();
+
+ void drawScaledBorderPixmapRoundedRect_data();
+ void drawTransformedBorderPixmapRoundedRect_data();
+ void drawBorderPixmapRoundedRect();
+ void drawScaledBorderPixmapRoundedRect();
+ void drawTransformedBorderPixmapRoundedRect();
+
+ void drawTransformedTransparentImage_data();
+ void drawTransformedSemiTransparentImage_data();
+ void drawTransformedFilledImage_data();
+ void drawTransformedTransparentImage();
+ void drawTransformedSemiTransparentImage();
+ void drawTransformedFilledImage();
+
private:
void setupBrushes();
void createPrimitives();
@@ -185,6 +218,8 @@ private:
void drawPrimitives_data_helper(bool fancypens);
void fillPrimitives_helper(QPainter *painter, PrimitiveType type, PrimitiveSet *s);
+ QTransform transformForAngle(qreal angle);
+
QPaintDevice *surface()
{
return new QPixmap(1024, 1024);
@@ -1123,6 +1158,474 @@ void tst_QPainter::clipAndFill()
}
}
+QTransform tst_QPainter::transformForAngle(qreal angle)
+{
+ const qreal inv_dist_to_plane = 1. / 1024.;
+
+ QTransform transform;
+
+ QTransform rotTrans;
+ rotTrans.translate(-40, 0);
+ QTransform rotTrans2;
+ rotTrans2.translate(40, 0);
+
+ qreal rad = angle * 2. * M_PI / 360.;
+ qreal c = ::cos(rad);
+ qreal s = ::sin(rad);
+
+ qreal x = 0;
+ qreal y = 80;
+ qreal z = 0;
+
+ qreal len = x * x + y * y + z * z;
+ if (len != 1.) {
+ len = ::sqrt(len);
+ x /= len;
+ y /= len;
+ z /= len;
+ }
+
+ QTransform rot(x*x*(1-c)+c, x*y*(1-c)-z*s, x*z*(1-c)+y*s*inv_dist_to_plane,
+ y*x*(1-c)+z*s, y*y*(1-c)+c, y*z*(1-c)-x*s*inv_dist_to_plane,
+ 0, 0, 1);
+
+ transform *= rotTrans;
+ transform *= rot;
+ transform *= rotTrans2;
+
+ return transform;
+}
+
+void tst_QPainter::drawRoundedRect()
+{
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.drawRoundedRect(QRectF(.5, .5, 80, 80), 10, 10);
+ }
+}
+
+void tst_QPainter::drawScaledRoundedRect()
+{
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+ p.scale(3, 3);
+
+ QBENCHMARK {
+ p.drawRoundedRect(10, 10, 80, 80, 10, 10);
+ }
+}
+
+void tst_QPainter::drawTransformedRoundedRect()
+{
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawRoundedRect(100, 100, 80, 80, 10, 10);
+ }
+}
+
+void tst_QPainter::drawAntialiasedRoundedRect()
+{
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.drawRoundedRect(QRectF(.5, .5, 80, 80), 10, 10);
+ }
+}
+
+void tst_QPainter::drawScaledAntialiasedRoundedRect_data()
+{
+ QTest::addColumn<float>("scale");
+
+ for (float i = 0; i < 3; i += .1)
+ QTest::newRow(QString(QLatin1String("scale=%1")).arg(i).toLatin1()) << i;
+}
+
+void tst_QPainter::drawScaledAntialiasedRoundedRect()
+{
+ QFETCH(float, scale);
+
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+ p.scale(scale, scale);
+
+ QBENCHMARK {
+ p.drawRoundedRect(10, 10, 80, 80, 10, 10);
+ }
+}
+
+void tst_QPainter::drawTransformedAntialiasedRoundedRect_data()
+{
+ QTest::addColumn<QTransform>("transform");
+
+ for (float angle = 0; angle < 360; angle += 10)
+ QTest::newRow(QString(QLatin1String("angle=%1")).arg(angle).toLatin1()) << transformForAngle(angle);
+}
+
+void tst_QPainter::drawTransformedAntialiasedRoundedRect()
+{
+ QFETCH(QTransform, transform);
+
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.setWorldTransform(transform);
+ p.drawRoundedRect(100, 100, 80, 80, 10, 10);
+ }
+}
+
+void tst_QPainter::drawImageRoundedRect()
+{
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, QImage::Format_ARGB32_Premultiplied);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.drawImage(0,0, rectImage);
+ }
+}
+
+void tst_QPainter::drawScaledImageRoundedRect_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QPainter::drawScaledImageRoundedRect()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+ p.scale(3, 3);
+
+ QBENCHMARK {
+ p.drawImage(0,0, rectImage);
+ }
+}
+
+void tst_QPainter::drawTransformedImageRoundedRect_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QPainter::drawTransformedImageRoundedRect()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(100,100, rectImage);
+ }
+}
+
+//code from QmlGraphicsRectangle for drawing rounded rects
+void tst_QPainter::drawBorderPixmapRoundedRect()
+{
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+ QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+
+ //setup surface
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ const int pw = 2;
+ int width = 80;
+ int height = 80;
+
+ int xOffset = (rectPixmap.width()-1)/2;
+ int yOffset = (rectPixmap.height()-1)/2;
+ Q_ASSERT(rectPixmap.width() == 2*xOffset + 1);
+ Q_ASSERT(rectPixmap.height() == 2*yOffset + 1);
+
+ QMargins margins(xOffset, yOffset, xOffset, yOffset);
+ QTileRules rules(Qt::StretchTile, Qt::StretchTile);
+ //NOTE: even though our item may have qreal-based width and height, qDrawBorderPixmap only supports QRects
+ qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width+pw, height+pw), margins, rectPixmap, rectPixmap.rect(), margins, rules);
+ }
+}
+
+void tst_QPainter::drawScaledBorderPixmapRoundedRect_data()
+{
+ QTest::addColumn<float>("scale");
+ QTest::addColumn<int>("imageType");
+
+ for (float i = 0; i < 3; i += .1)
+ QTest::newRow(QString(QLatin1String("scale=%1; imagetype=ARGB32_Pre")).arg(i).toLatin1()) << i << (int)QImage::Format_ARGB32_Premultiplied;
+ //for (float i = 0; i < 3; i += .1)
+ // QTest::newRow(QString(QLatin1String("scale=%1; imagetype=ARGB8565_Pre")).arg(i).toLatin1()) << i << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+//code from QmlGraphicsRectangle for drawing rounded rects
+void tst_QPainter::drawScaledBorderPixmapRoundedRect()
+{
+ QFETCH(float, scale);
+ QFETCH(int, imageType);
+
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+
+ QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+ p.scale(scale, scale);
+
+ QBENCHMARK {
+ const int pw = 2;
+ int width = 80;
+ int height = 80;
+
+ int xOffset = (rectPixmap.width()-1)/2;
+ int yOffset = (rectPixmap.height()-1)/2;
+ Q_ASSERT(rectPixmap.width() == 2*xOffset + 1);
+ Q_ASSERT(rectPixmap.height() == 2*yOffset + 1);
+
+ QMargins margins(xOffset, yOffset, xOffset, yOffset);
+ QTileRules rules(Qt::StretchTile, Qt::StretchTile);
+ qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width+pw, height+pw), margins, rectPixmap, rectPixmap.rect(), margins, rules);
+ }
+}
+
+void tst_QPainter::drawTransformedBorderPixmapRoundedRect_data()
+{
+ QTest::addColumn<QTransform>("transform");
+ QTest::addColumn<int>("imageType");
+
+ for (float angle = 0; angle < 360; angle += 10)
+ QTest::newRow(QString(QLatin1String("angle=%1; imagetype=ARGB32_Pre")).arg(angle).toLatin1()) << transformForAngle(angle) << (int)QImage::Format_ARGB32_Premultiplied;
+ //for (float angle = 0; angle < 360; angle += 10)
+ // QTest::newRow(QString(QLatin1String("angle=%1; imagetype=ARGB8565_Pre")).arg(angle).toLatin1()) << transformForAngle(angle) << (int)QImage::Format_ARGB8565_Premultiplied;
+
+}
+
+//code from QmlGraphicsRectangle for drawing rounded rects
+void tst_QPainter::drawTransformedBorderPixmapRoundedRect()
+{
+ QFETCH(QTransform, transform);
+ QFETCH(int, imageType);
+
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+
+ QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(transform);
+ const int pw = 2;
+ int width = 80;
+ int height = 80;
+
+ int xOffset = (rectPixmap.width()-1)/2;
+ int yOffset = (rectPixmap.height()-1)/2;
+ Q_ASSERT(rectPixmap.width() == 2*xOffset + 1);
+ Q_ASSERT(rectPixmap.height() == 2*yOffset + 1);
+
+ QMargins margins(xOffset, yOffset, xOffset, yOffset);
+ QTileRules rules(Qt::StretchTile, Qt::StretchTile);
+ qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width+pw, height+pw), margins, rectPixmap, rectPixmap.rect(), margins, rules);
+ }
+}
+
+void tst_QPainter::drawTransformedTransparentImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QPainter::drawTransformedTransparentImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage transImage(200, 200, (QImage::Format)imageType);
+ transImage.fill(0);
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, transImage);
+ }
+}
+
+void tst_QPainter::drawTransformedSemiTransparentImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QPainter::drawTransformedSemiTransparentImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage transImage(200, 200, (QImage::Format)imageType);
+ transImage.fill(QColor(0,0,0, 128).rgba());
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, transImage);
+ }
+}
+
+void tst_QPainter::drawTransformedFilledImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QPainter::drawTransformedFilledImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage filledImage(200, 200, (QImage::Format)imageType);
+ filledImage.fill(QColor(0,0,0).rgb());
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, filledImage);
+ }
+}
QTEST_MAIN(tst_QPainter)
diff --git a/tests/benchmarks/qtext/main.cpp b/tests/benchmarks/qtext/main.cpp
index 4bd2bee..9854a9f 100644
--- a/tests/benchmarks/qtext/main.cpp
+++ b/tests/benchmarks/qtext/main.cpp
@@ -44,7 +44,10 @@
#include <QTextDocumentWriter>
#include <QTextLayout>
#include <QTextCursor>
+#include <private/qtextcontrol_p.h>
+#include <qmath.h>
#include <QFile>
+#include <QPainter>
#include <QBuffer>
#include <qtest.h>
@@ -56,6 +59,7 @@ class tst_QText: public QObject
public:
tst_QText() {
m_lorem = QString::fromLatin1("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.");
+ m_shortLorem = QString::fromLatin1("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
}
private slots:
@@ -69,8 +73,26 @@ private slots:
void odfWriting_text();
void odfWriting_images();
+ void constructControl();
+ void constructDocument();
+
+ void layout();
+ void paintLayoutToPixmap();
+ void paintLayoutToPixmap_painterFill();
+
+ void document();
+ void paintDocToPixmap();
+ void paintDocToPixmap_painterFill();
+
+ void control();
+ void paintControlToPixmap();
+ void paintControlToPixmap_painterFill();
+
private:
+ QSize setupTextLayout(QTextLayout *layout);
+
QString m_lorem;
+ QString m_shortLorem;
};
void tst_QText::loadHtml_data()
@@ -195,6 +217,189 @@ void tst_QText::odfWriting_images()
delete doc;
}
+QSize tst_QText::setupTextLayout(QTextLayout *layout)
+{
+ bool wrap = true;
+ int wrapWidth = 300;
+ layout->setCacheEnabled(true);
+
+ int height = 0;
+ qreal widthUsed = 0;
+ qreal lineWidth = 0;
+
+ //set manual width
+ if (wrap)
+ lineWidth = wrapWidth;
+
+ layout->beginLayout();
+
+ while (1) {
+ QTextLine line = layout->createLine();
+ if (!line.isValid())
+ break;
+
+ if (wrap)
+ line.setLineWidth(lineWidth);
+ }
+ layout->endLayout();
+
+ for (int i = 0; i < layout->lineCount(); ++i) {
+ QTextLine line = layout->lineAt(i);
+ widthUsed = qMax(widthUsed, line.naturalTextWidth());
+ line.setPosition(QPointF(0, height));
+ height += int(line.height());
+ }
+ return QSize(qCeil(widthUsed), height);
+}
+
+void tst_QText::constructControl()
+{
+ QTextControl *control = new QTextControl;
+ delete control;
+
+ QBENCHMARK {
+ QTextControl *control = new QTextControl;
+ delete control;
+ }
+}
+
+void tst_QText::constructDocument()
+{
+ QTextDocument *doc = new QTextDocument;
+ delete doc;
+
+ QBENCHMARK {
+ QTextDocument *doc = new QTextDocument;
+ delete doc;
+ }
+}
+
+void tst_QText::layout()
+{
+ QTextLayout layout(m_shortLorem);
+ setupTextLayout(&layout);
+
+ QBENCHMARK {
+ QTextLayout layout(m_shortLorem);
+ setupTextLayout(&layout);
+ }
+}
+
+void tst_QText::paintLayoutToPixmap()
+{
+ QTextLayout layout(m_shortLorem);
+ QSize size = setupTextLayout(&layout);
+
+ QBENCHMARK {
+ QPixmap img(size);
+ img.fill(Qt::transparent);
+ QPainter p(&img);
+ layout.draw(&p, QPointF(0, 0));
+ }
+}
+
+void tst_QText::paintLayoutToPixmap_painterFill()
+{
+ QTextLayout layout(m_shortLorem);
+ QSize size = setupTextLayout(&layout);
+
+ QBENCHMARK {
+ QPixmap img(size);
+ QPainter p(&img);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(0, 0, img.width(), img.height(), Qt::transparent);
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ layout.draw(&p, QPointF(0, 0));
+ }
+}
+
+void tst_QText::document()
+{
+ QTextDocument *doc = new QTextDocument;
+
+ QBENCHMARK {
+ QTextDocument *doc = new QTextDocument;
+ doc->setHtml(m_shortLorem);
+ }
+}
+
+void tst_QText::paintDocToPixmap()
+{
+ QTextDocument *doc = new QTextDocument;
+ doc->setHtml(m_shortLorem);
+ doc->setTextWidth(300);
+ QSize size = doc->size().toSize();
+
+ QBENCHMARK {
+ QPixmap img(size);
+ img.fill(Qt::transparent);
+ QPainter p(&img);
+ doc->drawContents(&p);
+ }
+}
+
+void tst_QText::paintDocToPixmap_painterFill()
+{
+ QTextDocument *doc = new QTextDocument;
+ doc->setHtml(m_shortLorem);
+ doc->setTextWidth(300);
+ QSize size = doc->size().toSize();
+
+ QBENCHMARK {
+ QPixmap img(size);
+ QPainter p(&img);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(0, 0, img.width(), img.height(), Qt::transparent);
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ doc->drawContents(&p);
+ }
+}
+
+void tst_QText::control()
+{
+ QTextControl *control = new QTextControl(m_shortLorem);
+
+ QBENCHMARK {
+ QTextControl *control = new QTextControl;
+ QTextDocument *doc = control->document();
+ doc->setHtml(m_shortLorem);
+ }
+}
+
+void tst_QText::paintControlToPixmap()
+{
+ QTextControl *control = new QTextControl;
+ QTextDocument *doc = control->document();
+ doc->setHtml(m_shortLorem);
+ doc->setTextWidth(300);
+ QSize size = doc->size().toSize();
+
+ QBENCHMARK {
+ QPixmap img(size);
+ img.fill(Qt::transparent);
+ QPainter p(&img);
+ control->drawContents(&p, QRectF(QPointF(0, 0), QSizeF(size)));
+ }
+}
+
+void tst_QText::paintControlToPixmap_painterFill()
+{
+ QTextControl *control = new QTextControl;
+ QTextDocument *doc = control->document();
+ doc->setHtml(m_shortLorem);
+ doc->setTextWidth(300);
+ QSize size = doc->size().toSize();
+
+ QBENCHMARK {
+ QPixmap img(size);
+ QPainter p(&img);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(0, 0, img.width(), img.height(), Qt::transparent);
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ control->drawContents(&p, QRectF(QPointF(0, 0), QSizeF(size)));
+ }
+}
+
QTEST_MAIN(tst_QText)
#include "main.moc"
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp
index a2b3ca2..f2bb816 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.cpp
+++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp
@@ -120,6 +120,22 @@ private:
// nothing todo
}
+ void retranslate()
+ {
+ simpleSearchLabel->setText(QHelpSearchQueryWidget::tr("Search for:"));
+ prevQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Previous search"));
+ nextQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Next search"));
+ searchButton->setText(QHelpSearchQueryWidget::tr("Search"));
+#ifdef QT_CLUCENE_SUPPORT
+ advancedSearchLabel->setText(QHelpSearchQueryWidget::tr("Advanced search"));
+ similarLabel->setText(QHelpSearchQueryWidget::tr("words <B>similar</B> to:"));
+ withoutLabel->setText(QHelpSearchQueryWidget::tr("<B>without</B> the words:"));
+ exactLabel->setText(QHelpSearchQueryWidget::tr("with <B>exact phrase</B>:"));
+ allLabel->setText(QHelpSearchQueryWidget::tr("with <B>all</B> of the words:"));
+ atLeastLabel->setText(QHelpSearchQueryWidget::tr("with <B>at least one</B> of the words:"));
+#endif
+ }
+
QString escapeString(const QString &text)
{
QString retValue = text;
@@ -360,6 +376,13 @@ private:
friend class QHelpSearchQueryWidget;
bool simpleSearch;
+ QLabel *simpleSearchLabel;
+ QLabel *advancedSearchLabel;
+ QLabel *similarLabel;
+ QLabel *withoutLabel;
+ QLabel *exactLabel;
+ QLabel *allLabel;
+ QLabel *atLeastLabel;
QPushButton *searchButton;
QWidget* advancedSearchWidget;
QToolButton *showHideAdvancedSearchButton;
@@ -408,19 +431,17 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->setMargin(0);
QHBoxLayout* hBoxLayout = new QHBoxLayout();
- QLabel *label = new QLabel(tr("Search for:"), this);
+ d->simpleSearchLabel = new QLabel(this);
d->defaultQuery = new QLineEdit(this);
d->defaultQuery->setCompleter(&d->searchCompleter);
d->prevQueryButton = new QToolButton(this);
d->prevQueryButton->setArrowType(Qt::LeftArrow);
- d->prevQueryButton->setToolTip(tr("Previous search"));
d->prevQueryButton->setEnabled(false);
d->nextQueryButton = new QToolButton(this);
d->nextQueryButton->setArrowType(Qt::RightArrow);
- d->nextQueryButton->setToolTip(tr("Next search"));
d->nextQueryButton->setEnabled(false);
- d->searchButton = new QPushButton(tr("Search"), this);
- hBoxLayout->addWidget(label);
+ d->searchButton = new QPushButton(this);
+ hBoxLayout->addWidget(d->simpleSearchLabel);
hBoxLayout->addWidget(d->defaultQuery);
hBoxLayout->addWidget(d->prevQueryButton);
hBoxLayout->addWidget(d->nextQueryButton);
@@ -439,15 +460,15 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
d->showHideAdvancedSearchButton->setText(QLatin1String("+"));
d->showHideAdvancedSearchButton->setMinimumSize(25, 20);
- label = new QLabel(tr("Advanced search"), this);
+ d->advancedSearchLabel = new QLabel(this);
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
- sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
- label->setSizePolicy(sizePolicy);
+ sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth());
+ d->advancedSearchLabel->setSizePolicy(sizePolicy);
QFrame* hLine = new QFrame(this);
hLine->setFrameStyle(QFrame::HLine);
hBoxLayout->addWidget(d->showHideAdvancedSearchButton);
- hBoxLayout->addWidget(label);
+ hBoxLayout->addWidget(d->advancedSearchLabel);
hBoxLayout->addWidget(hLine);
vLayout->addLayout(hBoxLayout);
@@ -457,32 +478,32 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget);
gLayout->setMargin(0);
- label = new QLabel(tr("words <B>similar</B> to:"), this);
- gLayout->addWidget(label, 0, 0);
+ d->similarLabel = new QLabel(this);
+ gLayout->addWidget(d->similarLabel, 0, 0);
d->similarQuery = new QLineEdit(this);
d->similarQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->similarQuery, 0, 1);
- label = new QLabel(tr("<B>without</B> the words:"), this);
- gLayout->addWidget(label, 1, 0);
+ d->withoutLabel = new QLabel(this);
+ gLayout->addWidget(d->withoutLabel, 1, 0);
d->withoutQuery = new QLineEdit(this);
d->withoutQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->withoutQuery, 1, 1);
- label = new QLabel(tr("with <B>exact phrase</B>:"), this);
- gLayout->addWidget(label, 2, 0);
+ d->exactLabel = new QLabel(this);
+ gLayout->addWidget(d->exactLabel, 2, 0);
d->exactQuery = new QLineEdit(this);
d->exactQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->exactQuery, 2, 1);
- label = new QLabel(tr("with <B>all</B> of the words:"), this);
- gLayout->addWidget(label, 3, 0);
+ d->allLabel = new QLabel(this);
+ gLayout->addWidget(d->allLabel, 3, 0);
d->allQuery = new QLineEdit(this);
d->allQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->allQuery, 3, 1);
- label = new QLabel(tr("with <B>at least one</B> of the words:"), this);
- gLayout->addWidget(label, 4, 0);
+ d->atLeastLabel = new QLabel(this);
+ gLayout->addWidget(d->atLeastLabel, 4, 0);
d->atLeastQuery = new QLineEdit(this);
d->atLeastQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->atLeastQuery, 4, 1);
@@ -490,6 +511,8 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->addWidget(d->advancedSearchWidget);
d->advancedSearchWidget->hide();
+ d->retranslate();
+
connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
@@ -531,4 +554,14 @@ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent)
}
}
+/*! \reimp
+*/
+void QHelpSearchQueryWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->retranslate();
+ else
+ QWidget::changeEvent(event);
+}
+
QT_END_NAMESPACE
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.h b/tools/assistant/lib/qhelpsearchquerywidget.h
index a99bae0..2afc4b4 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.h
+++ b/tools/assistant/lib/qhelpsearchquerywidget.h
@@ -74,7 +74,8 @@ Q_SIGNALS:
void search();
private:
- void focusInEvent(QFocusEvent *focusEvent);
+ virtual void focusInEvent(QFocusEvent *focusEvent);
+ virtual void changeEvent(QEvent *event);
private:
QHelpSearchQueryWidgetPrivate *d;
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp
index 3cac880..a3f5aed 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.cpp
+++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp
@@ -408,6 +408,14 @@ QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine)
connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int)));
}
+/*! \reimp
+*/
+void QHelpSearchResultWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->setResults(d->searchEngine->hitCount());
+}
+
/*!
Destroys the search result widget.
*/
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.h b/tools/assistant/lib/qhelpsearchresultwidget.h
index d078079..ff29adc 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.h
+++ b/tools/assistant/lib/qhelpsearchresultwidget.h
@@ -75,6 +75,7 @@ private:
QHelpSearchResultWidgetPrivate *d;
QHelpSearchResultWidget(QHelpSearchEngine *engine);
+ virtual void changeEvent(QEvent *event);
};
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index 0b177ae..055fa1c 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -358,7 +358,7 @@ void CentralWidget::zoomOut()
void CentralWidget::findNext()
{
- find(findWidget->editFind->text(), true, false);
+ find(findWidget->editFind->text(), true);
}
void CentralWidget::nextPage()
@@ -389,7 +389,7 @@ void CentralWidget::previousPage()
void CentralWidget::findPrevious()
{
- find(findWidget->editFind->text(), false, true);
+ find(findWidget->editFind->text(), false);
}
void CentralWidget::closeTab()
@@ -697,7 +697,7 @@ HelpViewer *CentralWidget::newEmptyTab()
void CentralWidget::findCurrentText(const QString &text)
{
- find(text, false, false);
+ find(text, true);
}
void CentralWidget::connectSignals()
@@ -896,19 +896,35 @@ void CentralWidget::keyPressEvent(QKeyEvent *e)
QWidget::keyPressEvent(e);
}
-void CentralWidget::find(const QString &ttf, bool forward, bool backward)
+void CentralWidget::find(const QString &ttf, bool forward)
{
QPalette p = findWidget->editFind->palette();
p.setColor(QPalette::Active, QPalette::Base, Qt::white);
- if (!ttf.isEmpty()) {
- HelpViewer *viewer = currentHelpViewer();
+ bool found = false;
- bool found = false;
+#if defined(QT_NO_WEBKIT)
+ found = findInTextBrowser(ttf, forward);
+#else
+ found = findInWebPage(ttf, forward);
+#endif
+
+ if (!found && !ttf.isEmpty())
+ p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
+
+ if (!findWidget->isVisible())
+ findWidget->show();
+ findWidget->editFind->setPalette(p);
+}
+
+bool CentralWidget::findInWebPage(const QString &ttf, bool forward)
+{
#if !defined(QT_NO_WEBKIT)
- if (viewer) {
- QWebPage::FindFlags options;
- if (backward)
+ if (HelpViewer *viewer = currentHelpViewer()) {
+ bool found = false;
+ QWebPage::FindFlags options;
+ if (!ttf.isEmpty()) {
+ if (!forward)
options |= QWebPage::FindBackward;
if (findWidget->checkCase->isChecked())
@@ -923,30 +939,27 @@ void CentralWidget::find(const QString &ttf, bool forward, bool backward)
if (found)
findWidget->labelWrapped->show();
}
- } else if (tabWidget->currentWidget() == m_searchWidget) {
- QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
- found = findInTextBrowser(browser, ttf, forward, backward);
}
-#else
- QTextBrowser *browser = qobject_cast<QTextBrowser*>(viewer);
- if (tabWidget->currentWidget() == m_searchWidget)
- browser = qFindChild<QTextBrowser*>(m_searchWidget);
- found = findInTextBrowser(browser, ttf, forward, backward);
-#endif
-
- if (!found)
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
+ // force highlighting of all other matches, also when empty (clear)
+ options = QWebPage::HighlightAllOccurrences;
+ viewer->findText(QLatin1String(""), options);
+ viewer->findText(ttf, options);
+ return found;
}
- if (!findWidget->isVisible())
- findWidget->show();
- findWidget->editFind->setPalette(p);
+ // this needs to stay, case for active search results page
+ return findInTextBrowser(ttf, forward);
+#endif
+ return false;
}
-bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
- bool forward, bool backward)
+bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward)
{
- if (!browser)
+ QTextBrowser *browser = qobject_cast<QTextBrowser*>(currentHelpViewer());
+ if (tabWidget->currentWidget() == m_searchWidget)
+ browser = qFindChild<QTextBrowser*>(m_searchWidget);
+
+ if (!browser || ttf.isEmpty())
return false;
QTextDocument *doc = browser->document();
@@ -962,7 +975,7 @@ bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
QTextCursor::MoveAnchor);
}
- if (backward)
+ if (!forward)
options |= QTextDocument::FindBackward;
if (findWidget->checkCase->isChecked())
@@ -1074,20 +1087,29 @@ void
CentralWidget::setSourceFromSearch(const QUrl &url)
{
setSource(url);
+#if defined(QT_NO_WEBKIT)
highlightSearchTerms();
+#else
+ connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
+#endif
}
void
CentralWidget::setSourceFromSearchInNewTab(const QUrl &url)
{
setSourceInNewTab(url);
+#if defined(QT_NO_WEBKIT)
highlightSearchTerms();
+#else
+ connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
+#endif
}
void
CentralWidget::highlightSearchTerms()
{
-#if defined(QT_NO_WEBKIT)
HelpViewer *viewer = currentHelpViewer();
if (!viewer)
return;
@@ -1109,6 +1131,7 @@ CentralWidget::highlightSearchTerms()
}
}
+#if defined(QT_NO_WEBKIT)
viewer->viewport()->setUpdatesEnabled(false);
QTextCharFormat marker;
@@ -1140,6 +1163,14 @@ CentralWidget::highlightSearchTerms()
viewer->setTextCursor(firstHit);
viewer->viewport()->setUpdatesEnabled(true);
+#else
+ viewer->findText("", QWebPage::HighlightAllOccurrences);
+ // clears existing selections
+ foreach (const QString& term, terms)
+ viewer->findText(term, QWebPage::HighlightAllOccurrences);
+
+ disconnect(viewer, SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
#endif
}
diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h
index 6c23190..9e32985 100644
--- a/tools/assistant/tools/assistant/centralwidget.h
+++ b/tools/assistant/tools/assistant/centralwidget.h
@@ -182,16 +182,16 @@ private slots:
void printPreview(QPrinter *printer);
void setSourceFromSearch(const QUrl &url);
void setSourceFromSearchInNewTab(const QUrl &url);
+ void highlightSearchTerms();
private:
void connectSignals();
bool eventFilter(QObject *object, QEvent *e);
- void find(const QString &ttf, bool forward, bool backward);
- bool findInTextBrowser(QTextBrowser* browser, const QString &ttf,
- bool forward, bool backward);
+ void find(const QString &ttf, bool forward);
+ bool findInWebPage(const QString &ttf, bool forward);
+ bool findInTextBrowser(const QString &ttf, bool forward);
void initPrinter();
QString quoteTabTitle(const QString &title) const;
- void highlightSearchTerms();
void setLastShownPages();
void getBrowserFontFor(QWidget* viewer, QFont *font);
diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf
index 584c3ce..b8726a4 100644
--- a/tools/assistant/tools/assistant/doc/assistant.qdocconf
+++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf
@@ -12,5 +12,5 @@ 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=\"40%\" align=\"center\">Trademarks</td>\n" \
- "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.1</div></td>\n" \
+ "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.2</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index a9abda5..be6245a 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -141,17 +141,18 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/,
if (mimeType.endsWith(QLatin1String(".svg"))
|| mimeType.endsWith(QLatin1String(".svgz"))) {
mimeType = QLatin1String("image/svg+xml");
- }
- else if (mimeType.endsWith(QLatin1String(".css"))) {
+ } else if (mimeType.endsWith(QLatin1String(".css"))) {
mimeType = QLatin1String("text/css");
- }
- else if (mimeType.endsWith(QLatin1String(".js"))) {
+ } else if (mimeType.endsWith(QLatin1String(".js"))) {
mimeType = QLatin1String("text/javascript");
+ } else if (mimeType.endsWith(QLatin1String(".txt"))) {
+ mimeType = QLatin1String("text/plain");
} else {
mimeType = QLatin1String("text/html");
}
- return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType);
+ const QByteArray &ba = helpEngine->fileData(url);
+ return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType);
}
class HelpPage : public QWebPage
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 919e68f..abf81bd 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -317,6 +317,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "OPENSSL" ] = "auto";
dictionary[ "DBUS" ] = "auto";
dictionary[ "S60" ] = "yes";
+ dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
dictionary[ "STYLE_WINDOWS" ] = "yes";
dictionary[ "STYLE_WINDOWSXP" ] = "auto";
@@ -482,6 +483,7 @@ void Configure::parseCmdLine()
dictionary[ "BUILDNOKIA" ] = "yes";
dictionary[ "BUILDDEV" ] = "yes";
dictionary["LICENSE_CONFIRMED"] = "yes";
+ dictionary[ "SYMBIAN_DEFFILES" ] = "no";
}
else if( configCmdLine.at(i) == "-opensource" ) {
dictionary[ "BUILDTYPE" ] = "opensource";
@@ -803,7 +805,7 @@ void Configure::parseCmdLine()
else if( configCmdLine.at(i) == "-no-native-gestures" )
dictionary[ "NATIVE_GESTURES" ] = "no";
#if !defined(EVAL)
- // Others ---------------------------------------------------
+ // Symbian Support -------------------------------------------
else if (configCmdLine.at(i) == "-fpu" )
{
++i;
@@ -812,12 +814,17 @@ void Configure::parseCmdLine()
dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
}
- // S60 Support -------------------------------------------
else if( configCmdLine.at(i) == "-s60" )
dictionary[ "S60" ] = "yes";
else if( configCmdLine.at(i) == "-no-s60" )
dictionary[ "S60" ] = "no";
+ else if( configCmdLine.at(i) == "-usedeffiles" )
+ dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
+ else if( configCmdLine.at(i) == "-no-usedeffiles" )
+ dictionary[ "SYMBIAN_DEFFILES" ] = "no";
+
+ // Others ---------------------------------------------------
else if (configCmdLine.at(i) == "-fast" )
dictionary[ "FAST" ] = "yes";
else if (configCmdLine.at(i) == "-no-fast" )
@@ -1822,7 +1829,9 @@ bool Configure::displayHelp()
desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.");
desc( "-fpu <flags>", "VFP type on ARM, supported options: softvfp(default) | vfpv2 | softvfp+vfpv2");
desc("S60", "no", "-no-s60", "Do not compile in S60 support.");
- desc("S60", "yes", "-s60", "Compile with support for the S60 UI Framework\n");
+ desc("S60", "yes", "-s60", "Compile with support for the S60 UI Framework");
+ desc("SYMBIAN_DEFFILES", "no", "-no-usedeffiles", "Disable the usage of DEF files.");
+ desc("SYMBIAN_DEFFILES", "yes", "-usedeffiles", "Enable the usage of DEF files.\n");
return true;
}
return false;
@@ -2526,8 +2535,11 @@ void Configure::generateOutputVars()
qtConfig += "phonon-backend";
}
- if (dictionary["MULTIMEDIA"] == "yes")
+ if (dictionary["MULTIMEDIA"] == "yes") {
qtConfig += "multimedia";
+ if (dictionary["AUDIO_BACKEND"] == "yes")
+ qtConfig += "audio-backend";
+ }
if (dictionary["WEBKIT"] == "yes")
qtConfig += "webkit";
@@ -2744,6 +2756,13 @@ void Configure::generateCachefile()
if ( dictionary["PLUGIN_MANIFESTS"] == "no" )
configStream << " no_plugin_manifest";
+ if ( dictionary.contains("SYMBIAN_DEFFILES") ) {
+ if(dictionary["SYMBIAN_DEFFILES"] == "yes" ) {
+ configStream << " def_files";
+ } else if ( dictionary["SYMBIAN_DEFFILES"] == "no" ) {
+ configStream << " def_files_disabled";
+ }
+ }
configStream << endl;
configStream << "QT_ARCH = " << dictionary[ "ARCHITECTURE" ] << endl;
if (dictionary["QT_EDITION"].contains("OPENSOURCE"))
@@ -3268,6 +3287,14 @@ void Configure::displayConfig()
cout << "Support for S60............." << dictionary[ "S60" ] << endl;
}
+ if (dictionary.contains("SYMBIAN_DEFFILES")) {
+ cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
+ if(dictionary["SYMBIAN_DEFFILES"] == "no") {
+ cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
+ cout << " This feature is only intended for use during development, NEVER for release builds." << endl;
+ }
+ }
+
if(dictionary["ASSISTANT_WEBKIT"] == "yes")
cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp
index 2d013c9..9fd084d 100644
--- a/tools/designer/src/components/formeditor/formwindow.cpp
+++ b/tools/designer/src/components/formeditor/formwindow.cpp
@@ -2219,6 +2219,11 @@ QMenu *FormWindow::createPopupMenu(QWidget *w)
QToolBoxHelper::addToolBoxContextMenuActions(toolBox, popup);
}
+ if (manager->actionLower()->isEnabled()) {
+ popup->addAction(manager->actionLower());
+ popup->addAction(manager->actionRaise());
+ popup->addSeparator();
+ }
popup->addAction(manager->actionCut());
popup->addAction(manager->actionCopy());
}
diff --git a/tools/designer/src/components/formeditor/formwindow.h b/tools/designer/src/components/formeditor/formwindow.h
index eed7417..3eee476 100644
--- a/tools/designer/src/components/formeditor/formwindow.h
+++ b/tools/designer/src/components/formeditor/formwindow.h
@@ -278,8 +278,6 @@ private:
void checkPreviewGeometry(QRect &r);
- void finishContextMenu(QWidget *w, QWidget *menuParent, QContextMenuEvent *e);
-
bool handleContextMenu(QWidget *widget, QWidget *managedWidget, QContextMenuEvent *e);
bool handleMouseButtonDblClickEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e);
bool handleMousePressEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e);
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index b005e42..b659179 100644
--- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -1446,7 +1446,7 @@ void QDesignerResource::applyTabStops(QWidget *widget, DomTabStops *tabStops)
return;
QList<QWidget*> tabOrder;
- foreach (QString widgetName, tabStops->elementTabStop()) {
+ foreach (const QString &widgetName, tabStops->elementTabStop()) {
if (QWidget *w = qFindChild<QWidget*>(widget, widgetName)) {
tabOrder.append(w);
}
@@ -2418,7 +2418,7 @@ DomResources *QDesignerResource::saveResources(const QStringList &qrcPaths)
QList<DomResource*> dom_include;
if (resourceSet) {
const QStringList activePaths = resourceSet->activeQrcPaths();
- foreach (QString path, activePaths) {
+ foreach (const QString &path, activePaths) {
if (qrcPaths.contains(path)) {
DomResource *dom_res = new DomResource;
QString conv_path = path;
diff --git a/tools/designer/src/components/propertyeditor/designerpropertymanager.h b/tools/designer/src/components/propertyeditor/designerpropertymanager.h
index 0ec5241..11f900b 100644
--- a/tools/designer/src/components/propertyeditor/designerpropertymanager.h
+++ b/tools/designer/src/components/propertyeditor/designerpropertymanager.h
@@ -102,7 +102,7 @@ class DesignerPropertyManager : public QtVariantPropertyManager
{
Q_OBJECT
public:
- DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0);
+ explicit DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0);
~DesignerPropertyManager();
virtual QStringList attributes(int propertyType) const;
diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp
index fbaf461..887ba98 100644
--- a/tools/designer/src/designer/qdesigner_actions.cpp
+++ b/tools/designer/src/designer/qdesigner_actions.cpp
@@ -580,7 +580,7 @@ bool QDesignerActions::openForm(QWidget *parent)
return false;
bool atLeastOne = false;
- foreach (QString fileName, fileNames) {
+ foreach (const QString &fileName, fileNames) {
if (readInForm(fileName) && !atLeastOne)
atLeastOne = true;
}
@@ -869,7 +869,7 @@ bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QStr
if (f.fileName() != fileName) {
removeBackup(backupFile);
fi.setFile(fileName);
- backupFile = QString();
+ backupFile.clear();
if (fi.exists())
backupFile = createBackup(fileName);
}
diff --git a/tools/designer/src/designer/qdesigner_server.cpp b/tools/designer/src/designer/qdesigner_server.cpp
index 8016dff..de1532c 100644
--- a/tools/designer/src/designer/qdesigner_server.cpp
+++ b/tools/designer/src/designer/qdesigner_server.cpp
@@ -83,7 +83,7 @@ void QDesignerServer::sendOpenRequest(int port, const QStringList &files)
sSocket->connectToHost(QHostAddress::LocalHost, port);
if(sSocket->waitForConnected(3000))
{
- foreach(QString file, files)
+ foreach(const QString &file, files)
{
QFileInfo fi(file);
sSocket->write(fi.absoluteFilePath().toUtf8() + '\n');
@@ -96,9 +96,8 @@ void QDesignerServer::sendOpenRequest(int port, const QStringList &files)
void QDesignerServer::readFromClient()
{
- QString file = QString();
while (m_socket->canReadLine()) {
- file = QString::fromUtf8(m_socket->readLine());
+ QString file = QString::fromUtf8(m_socket->readLine());
if (!file.isNull()) {
file.remove(QLatin1Char('\n'));
file.remove(QLatin1Char('\r'));
@@ -143,7 +142,6 @@ QDesignerClient::~QDesignerClient()
void QDesignerClient::readFromSocket()
{
- QString file = QString();
while (m_socket->canReadLine()) {
QString file = QString::fromUtf8(m_socket->readLine());
if (!file.isNull()) {
diff --git a/tools/designer/src/designer/qdesigner_server.h b/tools/designer/src/designer/qdesigner_server.h
index 08bce68..d522056 100644
--- a/tools/designer/src/designer/qdesigner_server.h
+++ b/tools/designer/src/designer/qdesigner_server.h
@@ -53,7 +53,7 @@ class QDesignerServer: public QObject
{
Q_OBJECT
public:
- QDesignerServer(QObject *parent = 0);
+ explicit QDesignerServer(QObject *parent = 0);
virtual ~QDesignerServer();
quint16 serverPort() const;
diff --git a/tools/designer/src/lib/shared/actioneditor.cpp b/tools/designer/src/lib/shared/actioneditor.cpp
index 624b8bb..26ac8a8 100644
--- a/tools/designer/src/lib/shared/actioneditor.cpp
+++ b/tools/designer/src/lib/shared/actioneditor.cpp
@@ -428,7 +428,7 @@ void ActionEditor::unmanageAction(QAction *action)
m_actionView->model()->remove(row);
}
-// Set an intial property and mark it as changed in the sheet
+// Set an initial property and mark it as changed in the sheet
static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value)
{
const int index = sheet->indexOf(name);
diff --git a/tools/designer/src/lib/shared/actionrepository.cpp b/tools/designer/src/lib/shared/actionrepository.cpp
index 64cf9c4..e3ff2c1 100644
--- a/tools/designer/src/lib/shared/actionrepository.cpp
+++ b/tools/designer/src/lib/shared/actionrepository.cpp
@@ -244,7 +244,7 @@ QMimeData *ActionModel::mimeData(const QModelIndexList &indexes ) const
ActionRepositoryMimeData::ActionList actionList;
QSet<QAction*> actions;
- foreach (const QModelIndex &index, indexes)
+ foreach (const QModelIndex &index, indexes)
if (QStandardItem *item = itemFromIndex(index))
if (QAction *action = actionOfItem(item))
actions.insert(action);
diff --git a/tools/designer/src/lib/shared/connectionedit_p.h b/tools/designer/src/lib/shared/connectionedit_p.h
index 4f0148d..37dfe75 100644
--- a/tools/designer/src/lib/shared/connectionedit_p.h
+++ b/tools/designer/src/lib/shared/connectionedit_p.h
@@ -87,7 +87,7 @@ public:
class EndPoint {
public:
enum Type { Source, Target };
- EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {}
+ explicit EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {}
bool isNull() const { return con == 0; }
bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; }
bool operator != (const EndPoint &other) const { return !operator == (other); }
diff --git a/tools/designer/src/lib/shared/filterwidget_p.h b/tools/designer/src/lib/shared/filterwidget_p.h
index fdb199d..025d708 100644
--- a/tools/designer/src/lib/shared/filterwidget_p.h
+++ b/tools/designer/src/lib/shared/filterwidget_p.h
@@ -66,7 +66,7 @@ class QPushButton;
namespace qdesigner_internal {
/* A line edit that displays a grayed hintText (like "Type Here to Filter")
- * when not focussed and empty. When connecting to the changed signals and
+ * when not focused and empty. When connecting to the changed signals and
* querying text, one has to be aware that the text is set to that hint
* text if isShowingHintText() returns true (that is, does not contain
* valid user input). This widget should never have initial focus
diff --git a/tools/designer/src/lib/shared/iconloader.cpp b/tools/designer/src/lib/shared/iconloader.cpp
index 2c97f62..df0bb7e 100644
--- a/tools/designer/src/lib/shared/iconloader.cpp
+++ b/tools/designer/src/lib/shared/iconloader.cpp
@@ -60,7 +60,7 @@ QDESIGNER_SHARED_EXPORT QIcon createIconSet(const QString &name)
#endif
<< (QString::fromUtf8(":/trolltech/formeditor/images/designer_") + name);
- foreach (QString f, candidates) {
+ foreach (const QString &f, candidates) {
if (QFile::exists(f))
return QIcon(f);
}
diff --git a/tools/designer/src/lib/shared/iconselector_p.h b/tools/designer/src/lib/shared/iconselector_p.h
index 63d4ad7..3373f80 100644
--- a/tools/designer/src/lib/shared/iconselector_p.h
+++ b/tools/designer/src/lib/shared/iconselector_p.h
@@ -76,7 +76,7 @@ class QDESIGNER_SHARED_EXPORT LanguageResourceDialog : public QDialog
{
Q_OBJECT
- LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
+ explicit LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
public:
virtual ~LanguageResourceDialog();
diff --git a/tools/designer/src/lib/shared/plugindialog.cpp b/tools/designer/src/lib/shared/plugindialog.cpp
index c79dcf2..3e88043 100644
--- a/tools/designer/src/lib/shared/plugindialog.cpp
+++ b/tools/designer/src/lib/shared/plugindialog.cpp
@@ -105,7 +105,7 @@ void PluginDialog::populateTreeWidget()
QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Loaded Plugins"));
QFont boldFont = topLevelItem->font(0);
- foreach (QString fileName, fileNames) {
+ foreach (const QString &fileName, fileNames) {
QPluginLoader loader(fileName);
const QFileInfo fileInfo(fileName);
@@ -127,7 +127,7 @@ void PluginDialog::populateTreeWidget()
if (!notLoadedPlugins.isEmpty()) {
QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Failed Plugins"));
const QFont boldFont = topLevelItem->font(0);
- foreach (const QString plugin, notLoadedPlugins) {
+ foreach (const QString &plugin, notLoadedPlugins) {
const QString failureReason = pluginManager->failureReason(plugin);
QTreeWidgetItem *pluginItem = setPluginItem(topLevelItem, plugin, boldFont);
setItem(pluginItem, failureReason, failureReason, QString(), QIcon());
diff --git a/tools/designer/src/lib/shared/qdesigner_introspection.cpp b/tools/designer/src/lib/shared/qdesigner_introspection.cpp
index 170a111..7bc60d4 100644
--- a/tools/designer/src/lib/shared/qdesigner_introspection.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_introspection.cpp
@@ -63,7 +63,7 @@ static QStringList byteArrayListToStringList(const QList<QByteArray> &l)
static inline QString charToQString(const char *c)
{
if (!c)
- return QString::null;
+ return QString();
return QString::fromUtf8(c);
}
diff --git a/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h b/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h
index 354ef2a..f4b6672 100644
--- a/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h
@@ -85,7 +85,7 @@ class QDESIGNER_SHARED_EXPORT QDesignerObjectInspector: public QDesignerObjectIn
{
Q_OBJECT
public:
- QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
// Select a qobject unmanaged by form window
virtual bool selectObject(QObject *o) = 0;
diff --git a/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h b/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h
index d1e407d..1e63d81 100644
--- a/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h
@@ -80,9 +80,9 @@ namespace qdesigner_internal {
class NewPromotedClassPanel : public QGroupBox {
Q_OBJECT
public:
- NewPromotedClassPanel(const QStringList &baseClasses,
- int selectedBaseClass = -1,
- QWidget *parent = 0);
+ explicit NewPromotedClassPanel(const QStringList &baseClasses,
+ int selectedBaseClass = -1,
+ QWidget *parent = 0);
signals:
void newPromotedClass(const PromotionParameters &, bool *ok);
@@ -114,10 +114,10 @@ namespace qdesigner_internal {
public:
enum Mode { ModeEdit, ModeEditChooseClass };
- QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
- QWidget *parent = 0,
- const QString &promotableWidgetClassName = QString(),
- QString *promoteTo = 0);
+ explicit QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
+ QWidget *parent = 0,
+ const QString &promotableWidgetClassName = QString(),
+ QString *promoteTo = 0);
// Return an alphabetically ordered list of base class names for adding new classes.
static const QStringList &baseClassNames(const QDesignerPromotionInterface *promotion);
diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h
index c618bd7..cdd53f0 100644
--- a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h
@@ -69,7 +69,7 @@ class QDESIGNER_SHARED_EXPORT QDesignerPropertyEditor: public QDesignerPropertyE
{
Q_OBJECT
public:
- QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
// A pair <ValidationMode, bool isTranslatable>.
typedef QPair<TextPropertyValidationMode, bool> StringPropertyParameters;
diff --git a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
index 1cee074..02a2f6d 100644
--- a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
@@ -440,7 +440,7 @@ QAction *ToolBarEventFilter::actionAt(const QToolBar *tb, const QPoint &pos)
return tb->actions().at(index);
}
-//that's a trick to get acces to the initStyleOption which is a protected member
+//that's a trick to get access to the initStyleOption which is a protected member
class FriendlyToolBar : public QToolBar {
public:
friend class ToolBarEventFilter;
diff --git a/tools/designer/src/lib/shared/qdesigner_utils_p.h b/tools/designer/src/lib/shared/qdesigner_utils_p.h
index 502703d..fac0697 100644
--- a/tools/designer/src/lib/shared/qdesigner_utils_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_utils_p.h
@@ -298,7 +298,7 @@ class QDESIGNER_SHARED_EXPORT DesignerIconCache : public QObject
{
Q_OBJECT
public:
- DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
+ explicit DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
QIcon icon(const PropertySheetIconValue &value) const;
void clear();
signals:
@@ -313,7 +313,7 @@ private:
class QDESIGNER_SHARED_EXPORT PropertySheetStringValue
{
public:
- PropertySheetStringValue(const QString &value = QString(),
+ explicit PropertySheetStringValue(const QString &value = QString(),
bool translatable = true,
const QString &disambiguation = QString(),
const QString &comment = QString());
@@ -345,11 +345,11 @@ private:
class QDESIGNER_SHARED_EXPORT PropertySheetKeySequenceValue
{
public:
- PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
+ explicit PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
bool translatable = true,
const QString &disambiguation = QString(),
const QString &comment = QString());
- PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
+ explicit PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
bool translatable = true,
const QString &disambiguation = QString(),
const QString &comment = QString());
diff --git a/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h b/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h
index cf944b9..13b7f74 100644
--- a/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h
@@ -70,7 +70,7 @@ class QDESIGNER_SHARED_EXPORT QDesignerWidgetBox : public QDesignerWidgetBoxInte
public:
enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly };
- QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
LoadMode loadMode() const;
void setLoadMode(LoadMode lm);
diff --git a/tools/designer/src/lib/shared/qtresourceview_p.h b/tools/designer/src/lib/shared/qtresourceview_p.h
index 26c4754..8da2975 100644
--- a/tools/designer/src/lib/shared/qtresourceview_p.h
+++ b/tools/designer/src/lib/shared/qtresourceview_p.h
@@ -68,7 +68,7 @@ class QDESIGNER_SHARED_EXPORT QtResourceView : public QWidget
{
Q_OBJECT
public:
- QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
+ explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
~QtResourceView();
void setDragEnabled(bool dragEnabled);
@@ -120,7 +120,7 @@ class QDESIGNER_SHARED_EXPORT QtResourceViewDialog : public QDialog
{
Q_OBJECT
public:
- QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
+ explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
virtual ~QtResourceViewDialog();
QString selectedResource() const;
diff --git a/tools/designer/src/lib/shared/richtexteditor_p.h b/tools/designer/src/lib/shared/richtexteditor_p.h
index 4157d2c..44023ef 100644
--- a/tools/designer/src/lib/shared/richtexteditor_p.h
+++ b/tools/designer/src/lib/shared/richtexteditor_p.h
@@ -72,7 +72,7 @@ class QDESIGNER_SHARED_EXPORT RichTextEditorDialog : public QDialog
{
Q_OBJECT
public:
- RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
+ explicit RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
~RichTextEditorDialog();
int showDialog();
diff --git a/tools/designer/src/lib/shared/shared_settings.cpp b/tools/designer/src/lib/shared/shared_settings.cpp
index d6fd4bc..281b5c6 100644
--- a/tools/designer/src/lib/shared/shared_settings.cpp
+++ b/tools/designer/src/lib/shared/shared_settings.cpp
@@ -161,7 +161,7 @@ QStringList QDesignerSharedSettings::additionalFormTemplatePaths() const
{
// get template paths excluding internal ones
QStringList rc = formTemplatePaths();
- foreach (QString internalTemplatePath, defaultFormTemplatePaths()) {
+ foreach (const QString &internalTemplatePath, defaultFormTemplatePaths()) {
const int index = rc.indexOf(internalTemplatePath);
if (index != -1)
rc.removeAt(index);
diff --git a/tools/designer/src/lib/shared/textpropertyeditor_p.h b/tools/designer/src/lib/shared/textpropertyeditor_p.h
index 5b913ac..48f7898 100644
--- a/tools/designer/src/lib/shared/textpropertyeditor_p.h
+++ b/tools/designer/src/lib/shared/textpropertyeditor_p.h
@@ -90,7 +90,7 @@ namespace qdesigner_internal {
UpdateOnFinished
};
- TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
+ explicit TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
TextPropertyValidationMode textPropertyValidationMode() const { return m_validationMode; }
void setTextPropertyValidationMode(TextPropertyValidationMode vm);
diff --git a/tools/designer/src/lib/shared/widgetdatabase_p.h b/tools/designer/src/lib/shared/widgetdatabase_p.h
index 0e99999..873e79b 100644
--- a/tools/designer/src/lib/shared/widgetdatabase_p.h
+++ b/tools/designer/src/lib/shared/widgetdatabase_p.h
@@ -74,8 +74,8 @@ namespace qdesigner_internal {
class QDESIGNER_SHARED_EXPORT WidgetDataBaseItem: public QDesignerWidgetDataBaseItemInterface
{
public:
- WidgetDataBaseItem(const QString &name = QString(),
- const QString &group = QString());
+ explicit WidgetDataBaseItem(const QString &name = QString(),
+ const QString &group = QString());
QString name() const;
void setName(const QString &name);
@@ -159,7 +159,7 @@ class QDESIGNER_SHARED_EXPORT WidgetDataBase: public QDesignerWidgetDataBaseInte
{
Q_OBJECT
public:
- WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
+ explicit WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
virtual ~WidgetDataBase();
virtual QDesignerFormEditorInterface *core() const;
diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp
index eda551d..c7b13a1 100644
--- a/tools/designer/src/lib/shared/widgetfactory.cpp
+++ b/tools/designer/src/lib/shared/widgetfactory.cpp
@@ -774,6 +774,8 @@ void WidgetFactory::applyStyleTopLevel(const QString &styleName, QWidget *w)
void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget)
{
+ if (!style)
+ return;
const QPalette standardPalette = style->standardPalette();
if (widget->style() == style && widget->palette() == standardPalette)
return;
diff --git a/tools/designer/src/lib/uilib/abstractformbuilder.cpp b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
index 1d2d6f8..a0c9e83 100644
--- a/tools/designer/src/lib/uilib/abstractformbuilder.cpp
+++ b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -364,7 +364,7 @@ QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidge
const QStringList zOrderNames = ui_widget->elementZOrder();
if (!zOrderNames.isEmpty()) {
QList<QWidget *> zOrder = qVariantValue<QWidgetList>(w->property("_q_zOrder"));
- foreach (QString widgetName, zOrderNames) {
+ foreach (const QString &widgetName, zOrderNames) {
if (QWidget *child = qFindChild<QWidget*>(w, widgetName)) {
if (child->parentWidget() == w) {
zOrder.removeAll(child);
diff --git a/tools/designer/src/lib/uilib/formbuilder.cpp b/tools/designer/src/lib/uilib/formbuilder.cpp
index cc8483f..c97daac 100644
--- a/tools/designer/src/lib/uilib/formbuilder.cpp
+++ b/tools/designer/src/lib/uilib/formbuilder.cpp
@@ -494,7 +494,7 @@ void QFormBuilder::updateCustomWidgets()
{
m_customWidgets.clear();
- foreach (QString path, m_pluginPaths) {
+ foreach (const QString &path, m_pluginPaths) {
const QDir dir(path);
const QStringList candidates = dir.entryList(QDir::Files);
diff --git a/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h b/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h
index c48449c..9f3c252 100644
--- a/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h
+++ b/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h
@@ -77,7 +77,7 @@ class QAxWidgetExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h b/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h
index 1308fe2..50132a6 100644
--- a/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h
+++ b/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h
@@ -105,7 +105,7 @@ private:
class QDesignerAxPluginWidget : public QDesignerAxWidget
{
- // No Q_OBJECT here! - meta functionality is overriden
+ // No Q_OBJECT here! - meta functionality is overridden
public:
explicit QDesignerAxPluginWidget(QWidget *parent);
virtual ~QDesignerAxPluginWidget();
diff --git a/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h b/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h
index 49a8a40..4f2b3b2 100644
--- a/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h
@@ -81,7 +81,7 @@ class Q3IconViewExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h b/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h
index 19213d8..e20e344 100644
--- a/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h
@@ -51,7 +51,7 @@ class Q3IconViewPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h b/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h
index 7e291b6..bfb6738 100644
--- a/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h
@@ -79,7 +79,7 @@ class Q3ListBoxExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h b/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h
index 66002f5..68d6913 100644
--- a/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h
@@ -51,7 +51,7 @@ class Q3ListBoxPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h b/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h
index f14f256..e5222ed 100644
--- a/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h
@@ -82,7 +82,7 @@ class Q3ListViewExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h b/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h
index 7127a57..f9c82a2 100644
--- a/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h
@@ -51,7 +51,7 @@ class Q3ListViewPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h b/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h
index de2a75e..4ac7daa 100644
--- a/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h
@@ -51,7 +51,7 @@ class Q3MainWindowPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h b/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h
index 40222bd..4de8b71 100644
--- a/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h
@@ -79,7 +79,7 @@ class Q3TableExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h b/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h
index 94f663a..beeaf3b 100644
--- a/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h
@@ -79,7 +79,7 @@ class Q3TextEditExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h b/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h
index 28e0386..77bfb58 100644
--- a/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h
@@ -51,7 +51,7 @@ class Q3TextEditPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h b/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h
index f3ed995..22562b1 100644
--- a/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h
+++ b/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h
@@ -78,7 +78,7 @@ class Q3ToolBarExtraInfoFactory: public QExtensionFactory
{
Q_OBJECT
public:
- Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
+ explicit Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
protected:
virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
diff --git a/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h b/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h
index c79390c..c750cfe 100644
--- a/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h
+++ b/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h
@@ -51,7 +51,7 @@ class Q3ButtonGroupPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0);
virtual ~Q3ButtonGroupPlugin();
virtual QString name() const;
@@ -80,7 +80,7 @@ class Q3ComboBoxPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0);
virtual ~Q3ComboBoxPlugin();
virtual QString name() const;
@@ -109,7 +109,7 @@ class Q3DateEditPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
@@ -157,7 +157,7 @@ class Q3FramePlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3FramePlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3FramePlugin(const QIcon &icon, QObject *parent = 0);
virtual ~Q3FramePlugin();
virtual QString name() const;
@@ -215,7 +215,7 @@ class Q3ProgressBarPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
@@ -263,7 +263,7 @@ class Q3TimeEditPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h b/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h
index 524f3fd..e8cf4fa 100644
--- a/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h
+++ b/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h
@@ -59,7 +59,7 @@ class Q3WizardHelper : public QObject
{
Q_OBJECT
public:
- Q3WizardHelper(Q3Wizard *wizard);
+ explicit Q3WizardHelper(Q3Wizard *wizard);
private slots:
void slotCurrentChanged();
private:
diff --git a/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h b/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h
index 1837769..c9fff40 100644
--- a/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h
+++ b/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h
@@ -51,7 +51,7 @@ class Q3WizardPlugin: public QObject, public QDesignerCustomWidgetInterface
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- Q3WizardPlugin(const QIcon &icon, QObject *parent = 0);
+ explicit Q3WizardPlugin(const QIcon &icon, QObject *parent = 0);
virtual QString name() const;
virtual QString group() const;
diff --git a/tools/designer/src/src.pro b/tools/designer/src/src.pro
index e1710b8..78665b7 100644
--- a/tools/designer/src/src.pro
+++ b/tools/designer/src/src.pro
@@ -9,6 +9,4 @@ SUBDIRS = \
CONFIG(shared,shared|static):SUBDIRS += plugins
-wince*: SUBDIRS -= designer plugins
-symbian: SUBDIRS = uitools
-contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= lib components \ No newline at end of file
+symbian|wince*: SUBDIRS = uitools
diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp
index 7834b06..266474e 100644
--- a/tools/linguist/lrelease/main.cpp
+++ b/tools/linguist/lrelease/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "translator.h"
-#include "proreader.h"
+#include "profileevaluator.h"
#ifndef QT_BOOTSTRAPPED
#include <QtCore/QCoreApplication>
@@ -246,24 +246,31 @@ int main(int argc, char **argv)
foreach (const QString &inputFile, inputFiles) {
if (inputFile.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive)
|| inputFile.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) {
- QHash<QByteArray, QStringList> varMap;
- bool ok = evaluateProFile(inputFile, cd.isVerbose(), &varMap);
- if (ok) {
- QStringList translations = varMap.value("TRANSLATIONS");
- if (translations.isEmpty()) {
- qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in"
- " project file '%s'\n",
- qPrintable(inputFile));
- } else {
- foreach (const QString &trans, translations)
- if (!releaseTsFile(trans, cd, removeIdentical))
- return 1;
- }
+ QFileInfo fi(inputFile);
+ ProFile pro(fi.absoluteFilePath());
+
+ ProFileEvaluator visitor;
+ visitor.setVerbose(cd.isVerbose());
+
+ if (!visitor.queryProFile(&pro)) {
+ qWarning("lrelease error: cannot read project file '%s'.", qPrintable(inputFile));
+ continue;
+ }
+ if (!visitor.accept(&pro)) {
+ qWarning("lrelease error: cannot process project file '%s'.", qPrintable(inputFile));
+ continue;
+ }
+
+ QStringList translations = visitor.values(QLatin1String("TRANSLATIONS"));
+ if (translations.isEmpty()) {
+ qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in"
+ " project file '%s'\n",
+ qPrintable(inputFile));
} else {
- qWarning("error: lrelease encountered project file functionality that is currently not supported.\n"
- "You might want to consider using TS files as input instead of a project file.\n"
- "Try the following syntax:\n"
- " lrelease [options] ts-files [-qm qm-file]\n");
+ QDir proDir(fi.absolutePath());
+ foreach (const QString &trans, translations)
+ if (!releaseTsFile(QFileInfo(proDir, trans).filePath(), cd, removeIdentical))
+ return 1;
}
} else {
if (outputFile.isEmpty()) {
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index 2129265..b2bfd7c 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -43,7 +43,6 @@
#include <translator.h>
#include <profileevaluator.h>
-#include <proreader.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
@@ -118,21 +117,26 @@ static void printUsage()
" -disable-heuristic {sametext|similartext|number}\n"
" Disable the named merge heuristic. Can be specified multiple times.\n"
" -pro <filename>\n"
- " Name of a .pro file. Useful for files with .pro\n"
- " file syntax but different file suffix\n"
+ " Name of a .pro file. Useful for files with .pro file syntax but\n"
+ " different file suffix. Projects are recursed into and merged.\n"
" -source-language <language>[_<region>]\n"
" Specify the language of the source strings for new files.\n"
" Defaults to POSIX if not specified.\n"
" -target-language <language>[_<region>]\n"
" Specify the language of the translations for new files.\n"
" Guessed from the file name if not specified.\n"
+ " -ts <ts-file>...\n"
+ " Specify the output file(s). This will override the TRANSLATIONS\n"
+ " and nullify the CODECFORTR from possibly specified project files.\n"
+ " -codecfortr <codec>\n"
+ " Specify the codec assumed for tr() calls. Effective only with -ts.\n"
" -version\n"
" Display the version of lupdate and exit.\n"
).arg(m_defaultExtensions));
}
static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFileNames,
- const QByteArray &codecForTr, const QString &sourceLanguage, const QString &targetLanguage,
+ bool setCodec, const QString &sourceLanguage, const QString &targetLanguage,
UpdateOptions options, bool *fail)
{
QDir dir;
@@ -150,10 +154,10 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
}
tor.resolveDuplicates();
cd.clearErrors();
- if (!codecForTr.isEmpty() && codecForTr != tor.codecName())
+ if (setCodec && fetchedTor.codec() != tor.codec())
qWarning("lupdate warning: Codec for tr() '%s' disagrees with "
"existing file's codec '%s'. Expect trouble.",
- codecForTr.constData(), tor.codecName().constData());
+ fetchedTor.codecName().constData(), tor.codecName().constData());
if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode())
qWarning("lupdate warning: Specified target language '%s' disagrees with "
"existing file's language '%s'. Ignoring.",
@@ -163,8 +167,8 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
"existing file's language '%s'. Ignoring.",
qPrintable(sourceLanguage), qPrintable(tor.sourceLanguageCode()));
} else {
- if (!codecForTr.isEmpty())
- tor.setCodecName(codecForTr);
+ if (setCodec)
+ tor.setCodec(fetchedTor.codec());
if (!targetLanguage.isEmpty())
tor.setLanguageCode(targetLanguage);
else
@@ -186,8 +190,8 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
if (tor.locationsType() == Translator::NoLocations) // Could be set from file
theseOptions |= NoLocations;
Translator out = merge(tor, fetchedTor, theseOptions, err);
- if (!codecForTr.isEmpty())
- out.setCodecName(codecForTr);
+ if (setCodec)
+ out.setCodec(fetchedTor.codec());
if ((options & Verbose) && !err.isEmpty()) {
printOut(err);
@@ -214,16 +218,196 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
}
}
+static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths,
+ const QString &projectDir, const ProFileEvaluator &visitor)
+{
+ QStringList vPaths = visitor.absolutePathValues(QLatin1String(vvar), projectDir);
+ vPaths += baseVPaths;
+ vPaths.removeDuplicates();
+ return visitor.absoluteFileValues(QLatin1String(var), projectDir, vPaths, 0);
+}
+
+static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir)
+{
+ QStringList baseVPaths;
+ baseVPaths += visitor.absolutePathValues(QLatin1String("VPATH"), projectDir);
+ baseVPaths << projectDir; // QMAKE_ABSOLUTE_SOURCE_PATH
+ baseVPaths += visitor.absolutePathValues(QLatin1String("DEPENDPATH"), projectDir);
+ baseVPaths.removeDuplicates();
+
+ QStringList sourceFiles;
+
+ // app/lib template
+ sourceFiles += getSources("SOURCES", "VPATH_SOURCES", baseVPaths, projectDir, visitor);
+
+ sourceFiles += getSources("FORMS", "VPATH_FORMS", baseVPaths, projectDir, visitor);
+ sourceFiles += getSources("FORMS3", "VPATH_FORMS3", baseVPaths, projectDir, visitor);
+
+ QStringList vPathsInc = baseVPaths;
+ vPathsInc += visitor.absolutePathValues(QLatin1String("INCLUDEPATH"), projectDir);
+ vPathsInc.removeDuplicates();
+ sourceFiles += visitor.absoluteFileValues(QLatin1String("HEADERS"), projectDir, vPathsInc, 0);
+
+ sourceFiles.removeDuplicates();
+ sourceFiles.sort();
+
+ return sourceFiles;
+}
+
+static void processSources(Translator &fetchedTor,
+ const QStringList &sourceFiles, ConversionData &cd)
+{
+ QStringList sourceFilesCpp;
+ for (QStringList::const_iterator it = sourceFiles.begin(); it != sourceFiles.end(); ++it) {
+ if (it->endsWith(QLatin1String(".java"), Qt::CaseInsensitive))
+ loadJava(fetchedTor, *it, cd);
+ else if (it->endsWith(QLatin1String(".ui"), Qt::CaseInsensitive)
+ || it->endsWith(QLatin1String(".jui"), Qt::CaseInsensitive))
+ loadUI(fetchedTor, *it, cd);
+ else if (it->endsWith(QLatin1String(".js"), Qt::CaseInsensitive)
+ || it->endsWith(QLatin1String(".qs"), Qt::CaseInsensitive))
+ loadQScript(fetchedTor, *it, cd);
+ else
+ sourceFilesCpp << *it;
+ }
+ loadCPP(fetchedTor, sourceFilesCpp, cd);
+ if (!cd.error().isEmpty())
+ printOut(cd.error());
+}
+
+static void processProjects(
+ bool topLevel, bool nestComplain, const QStringList &proFiles,
+ UpdateOptions options, const QByteArray &codecForSource,
+ const QString &targetLanguage, const QString &sourceLanguage,
+ Translator *parentTor, bool *fail);
+
+static void processProject(
+ bool nestComplain, const QFileInfo &pfi, ProFileEvaluator &visitor,
+ UpdateOptions options, const QByteArray &_codecForSource,
+ const QString &targetLanguage, const QString &sourceLanguage,
+ Translator *fetchedTor, bool *fail)
+{
+ QByteArray codecForSource = _codecForSource;
+ QStringList tmp = visitor.values(QLatin1String("CODECFORSRC"));
+ if (!tmp.isEmpty()) {
+ codecForSource = tmp.last().toLatin1();
+ if (!QTextCodec::codecForName(codecForSource)) {
+ qWarning("lupdate warning: Codec for source '%s' is invalid. "
+ "Falling back to codec for tr().", codecForSource.constData());
+ codecForSource.clear();
+ }
+ }
+ if (visitor.templateType() == ProFileEvaluator::TT_Subdirs) {
+ QStringList subProFiles;
+ QDir proDir(pfi.absoluteDir());
+ foreach (const QString &subdir, visitor.values(QLatin1String("SUBDIRS"))) {
+ QString subPro = QDir::cleanPath(proDir.absoluteFilePath(subdir));
+ QFileInfo subInfo(subPro);
+ if (subInfo.isDir())
+ subProFiles << (subPro + QLatin1Char('/')
+ + subInfo.fileName() + QLatin1String(".pro"));
+ else
+ subProFiles << subPro;
+ }
+ processProjects(false, nestComplain, subProFiles, options, codecForSource,
+ targetLanguage, sourceLanguage, fetchedTor, fail);
+ } else {
+ ConversionData cd;
+ cd.m_noUiLines = options & NoUiLines;
+ cd.m_codecForSource = codecForSource;
+ cd.m_includePath = visitor.values(QLatin1String("INCLUDEPATH"));
+ QStringList sourceFiles = getSources(visitor, pfi.absolutePath());
+ QSet<QString> sourceDirs;
+ sourceDirs.insert(QDir::cleanPath(pfi.absolutePath()) + QLatin1Char('/'));
+ foreach (const QString &sf, sourceFiles)
+ sourceDirs.insert(sf.left(sf.lastIndexOf(QLatin1Char('/')) + 1));
+ QStringList rootList = sourceDirs.toList();
+ rootList.sort();
+ for (int prev = 0, curr = 1; curr < rootList.length(); )
+ if (rootList.at(curr).startsWith(rootList.at(prev)))
+ rootList.removeAt(curr);
+ else
+ prev = curr++;
+ cd.m_projectRoots = QSet<QString>::fromList(rootList);
+ processSources(*fetchedTor, sourceFiles, cd);
+ }
+}
+
+static void processProjects(
+ bool topLevel, bool nestComplain, const QStringList &proFiles,
+ UpdateOptions options, const QByteArray &codecForSource,
+ const QString &targetLanguage, const QString &sourceLanguage,
+ Translator *parentTor, bool *fail)
+{
+ foreach (const QString &proFile, proFiles) {
+ ProFileEvaluator visitor;
+ visitor.setVerbose(options & Verbose);
+
+ QFileInfo pfi(proFile);
+ ProFile pro(pfi.absoluteFilePath());
+ if (!visitor.queryProFile(&pro) || !visitor.accept(&pro)) {
+ if (topLevel)
+ *fail = true;
+ continue;
+ }
+
+ if (visitor.contains(QLatin1String("TRANSLATIONS"))) {
+ if (parentTor) {
+ if (topLevel) {
+ std::cerr << "lupdate warning: TS files from command line "
+ "will override TRANSLATIONS in " << qPrintable(proFile) << ".\n";
+ goto noTrans;
+ } else if (nestComplain) {
+ std::cerr << "lupdate warning: TS files from command line "
+ "prevent recursing into " << qPrintable(proFile) << ".\n";
+ continue;
+ }
+ }
+ QStringList tsFiles;
+ QDir proDir(pfi.absolutePath());
+ foreach (const QString &tsFile, visitor.values(QLatin1String("TRANSLATIONS")))
+ tsFiles << QFileInfo(proDir, tsFile).filePath();
+ if (tsFiles.isEmpty()) {
+ // This might mean either a buggy PRO file or an intentional detach -
+ // we can't know without seeing the actual RHS of the assignment ...
+ // Just assume correctness and be silent.
+ continue;
+ }
+ Translator tor;
+ bool setCodec = false;
+ QStringList tmp = visitor.values(QLatin1String("CODEC"))
+ + visitor.values(QLatin1String("DEFAULTCODEC"))
+ + visitor.values(QLatin1String("CODECFORTR"));
+ if (!tmp.isEmpty()) {
+ tor.setCodecName(tmp.last().toLatin1());
+ setCodec = true;
+ }
+ processProject(false, pfi, visitor, options, codecForSource,
+ targetLanguage, sourceLanguage, &tor, fail);
+ updateTsFiles(tor, tsFiles, setCodec, sourceLanguage, targetLanguage, options, fail);
+ continue;
+ }
+ noTrans:
+ if (!parentTor) {
+ if (topLevel)
+ std::cerr << "lupdate warning: no TS files specified. Only diagnostics "
+ "will be produced for '" << qPrintable(proFile) << "'.\n";
+ Translator tor;
+ processProject(nestComplain, pfi, visitor, options, codecForSource,
+ targetLanguage, sourceLanguage, &tor, fail);
+ } else {
+ processProject(nestComplain, pfi, visitor, options, codecForSource,
+ targetLanguage, sourceLanguage, parentTor, fail);
+ }
+ }
+}
+
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
m_defaultExtensions = QLatin1String("ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx");
QStringList args = app.arguments();
- QString defaultContext; // This was QLatin1String("@default") before.
- Translator fetchedTor;
- QByteArray codecForTr;
- QByteArray codecForSource;
QStringList tsFileNames;
QStringList proFiles;
QMultiHash<QString, QString> allCSources;
@@ -232,6 +416,7 @@ int main(int argc, char **argv)
QStringList includePath;
QString targetLanguage;
QString sourceLanguage;
+ QByteArray codecForTr;
UpdateOptions options =
Verbose | // verbose is on by default starting with Qt 4.2
@@ -330,6 +515,14 @@ int main(int argc, char **argv)
} else if (arg == QLatin1String("-version")) {
printOut(QObject::tr("lupdate version %1\n").arg(QLatin1String(QT_VERSION_STR)));
return 0;
+ } else if (arg == QLatin1String("-codecfortr")) {
+ ++i;
+ if (i == argc) {
+ qWarning("The -codecfortr option should be followed by a codec name.");
+ return 1;
+ }
+ codecForTr = args[i].toLatin1();
+ continue;
} else if (arg == QLatin1String("-ts")) {
metTsFlag = true;
continue;
@@ -367,11 +560,6 @@ int main(int argc, char **argv)
return 1;
}
- numFiles++;
-
- codecForTr.clear();
- codecForSource.clear();
-
if (metTsFlag) {
bool found = false;
foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) {
@@ -395,6 +583,7 @@ int main(int argc, char **argv)
} else if (arg.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive)
|| arg.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) {
proFiles << arg;
+ numFiles++;
} else {
QFileInfo fi(arg);
if (!fi.exists()) {
@@ -439,105 +628,53 @@ int main(int argc, char **argv)
} else {
sourceFiles << QDir::cleanPath(fi.absoluteFilePath());;
}
+ numFiles++;
}
} // for args
- foreach (const QString &proFile, proFiles)
- projectRoots.insert(QDir::cleanPath(QFileInfo(proFile).absolutePath()) + QLatin1Char('/'));
+ if (numFiles == 0) {
+ printUsage();
+ return 1;
+ }
+
+ if (!targetLanguage.isEmpty() && tsFileNames.count() != 1)
+ std::cerr << "lupdate warning: -target-language usually only "
+ "makes sense with exactly one TS file.\n";
+ if (!codecForTr.isEmpty() && tsFileNames.isEmpty())
+ std::cerr << "lupdate warning: -codecfortr has no effect without -ts.\n";
- bool firstPass = true;
bool fail = false;
- while (firstPass || !proFiles.isEmpty()) {
+ if (proFiles.isEmpty()) {
+ if (tsFileNames.isEmpty())
+ std::cerr << "lupdate warning: no TS files specified. "
+ "Only diagnostics will be produced.\n";
+
+ Translator fetchedTor;
ConversionData cd;
- cd.m_defaultContext = defaultContext;
cd.m_noUiLines = options & NoUiLines;
cd.m_projectRoots = projectRoots;
cd.m_includePath = includePath;
cd.m_allCSources = allCSources;
-
- QStringList tsFiles = tsFileNames;
- if (proFiles.count() > 0) {
- QFileInfo pfi(proFiles.takeFirst());
- QHash<QByteArray, QStringList> variables;
-
- ProFileEvaluator visitor;
- visitor.setVerbose(options & Verbose);
-
- ProFile pro(pfi.absoluteFilePath());
- if (!visitor.queryProFile(&pro))
- return 2;
- if (!visitor.accept(&pro))
- return 2;
-
- if (visitor.templateType() == ProFileEvaluator::TT_Subdirs) {
- QDir proDir(pfi.absoluteDir());
- foreach (const QString &subdir, visitor.values(QLatin1String("SUBDIRS"))) {
- QString subPro = QDir::cleanPath(proDir.absoluteFilePath(subdir));
- QFileInfo subInfo(subPro);
- if (subInfo.isDir())
- proFiles << (subPro + QLatin1Char('/')
- + subInfo.fileName() + QLatin1String(".pro"));
- else
- proFiles << subPro;
- }
- continue;
- }
-
- cd.m_includePath += visitor.values(QLatin1String("INCLUDEPATH"));
-
- evaluateProFile(visitor, &variables, pfi.absolutePath());
-
- sourceFiles = variables.value("SOURCES");
-
- QStringList tmp = variables.value("CODECFORTR");
- if (!tmp.isEmpty() && !tmp.first().isEmpty()) {
- codecForTr = tmp.first().toLatin1();
- fetchedTor.setCodecName(codecForTr);
- cd.m_outputCodec = codecForTr;
- }
- tmp = variables.value("CODECFORSRC");
- if (!tmp.isEmpty() && !tmp.first().isEmpty()) {
- codecForSource = tmp.first().toLatin1();
- if (!QTextCodec::codecForName(codecForSource))
- qWarning("lupdate warning: Codec for source '%s' is invalid. Falling back to codec for tr().",
- codecForSource.constData());
- else
- cd.m_codecForSource = codecForSource;
- }
-
- tsFiles += variables.value("TRANSLATIONS");
+ fetchedTor.setCodecName(codecForTr);
+ processSources(fetchedTor, sourceFiles, cd);
+ updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(),
+ sourceLanguage, targetLanguage, options, &fail);
+ } else {
+ if (!sourceFiles.isEmpty() || !includePath.isEmpty()) {
+ qWarning("lupdate error: Both project and source files / include paths specified.\n");
+ return 1;
}
-
- QStringList sourceFilesCpp;
- for (QStringList::iterator it = sourceFiles.begin(); it != sourceFiles.end(); ++it) {
- if (it->endsWith(QLatin1String(".java"), Qt::CaseInsensitive))
- loadJava(fetchedTor, *it, cd);
- else if (it->endsWith(QLatin1String(".ui"), Qt::CaseInsensitive)
- || it->endsWith(QLatin1String(".jui"), Qt::CaseInsensitive))
- loadUI(fetchedTor, *it, cd);
- else if (it->endsWith(QLatin1String(".js"), Qt::CaseInsensitive)
- || it->endsWith(QLatin1String(".qs"), Qt::CaseInsensitive))
- loadQScript(fetchedTor, *it, cd);
- else
- sourceFilesCpp << *it;
+ if (!tsFileNames.isEmpty()) {
+ Translator fetchedTor;
+ fetchedTor.setCodecName(codecForTr);
+ processProjects(true, true, proFiles, options, QByteArray(),
+ targetLanguage, sourceLanguage, &fetchedTor, &fail);
+ updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(),
+ sourceLanguage, targetLanguage, options, &fail);
+ } else {
+ processProjects(true, false, proFiles, options, QByteArray(),
+ targetLanguage, sourceLanguage, 0, &fail);
}
- loadCPP(fetchedTor, sourceFilesCpp, cd);
- if (!cd.error().isEmpty())
- printOut(cd.error());
-
- tsFiles.sort();
- tsFiles.removeDuplicates();
-
- if (!tsFiles.isEmpty())
- updateTsFiles(fetchedTor, tsFiles, codecForTr, sourceLanguage, targetLanguage, options, &fail);
-
- firstPass = false;
- }
-
- if (numFiles == 0) {
- printUsage();
- return 1;
}
-
return fail ? 1 : 0;
}
diff --git a/tools/linguist/shared/proparser.pri b/tools/linguist/shared/proparser.pri
index 99d32e7..372247e 100644
--- a/tools/linguist/shared/proparser.pri
+++ b/tools/linguist/shared/proparser.pri
@@ -2,13 +2,11 @@
INCLUDEPATH *= $$PWD
HEADERS += \
- $$PWD/proreader.h \
$$PWD/abstractproitemvisitor.h \
$$PWD/proitems.h \
$$PWD/profileevaluator.h \
$$PWD/proparserutils.h
SOURCES += \
- $$PWD/proreader.cpp \
$$PWD/proitems.cpp \
$$PWD/profileevaluator.cpp
diff --git a/tools/linguist/shared/proreader.cpp b/tools/linguist/shared/proreader.cpp
deleted file mode 100644
index 4a621a8..0000000
--- a/tools/linguist/shared/proreader.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Linguist 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 "profileevaluator.h"
-
-#include <QtCore/QDir>
-#include <QtCore/QFileInfo>
-
-QT_BEGIN_NAMESPACE
-
-static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths,
- const QString &projectDir, const ProFileEvaluator &visitor)
-{
- QStringList vPaths =
- visitor.absolutePathValues(QLatin1String(vvar), projectDir);
- vPaths += baseVPaths;
- vPaths.removeDuplicates();
- return visitor.absoluteFileValues(QLatin1String(var), projectDir, vPaths, 0);
-}
-
-void evaluateProFile(const ProFileEvaluator &visitor, QHash<QByteArray, QStringList> *varMap,
- const QString &projectDir)
-{
- QStringList baseVPaths;
- baseVPaths += visitor.absolutePathValues(QLatin1String("VPATH"), projectDir);
- baseVPaths << projectDir; // QMAKE_ABSOLUTE_SOURCE_PATH
- baseVPaths += visitor.absolutePathValues(QLatin1String("DEPENDPATH"), projectDir);
- baseVPaths.removeDuplicates();
-
- QStringList sourceFiles;
- QString codecForTr;
- QString codecForSource;
- QStringList tsFileNames;
-
- // app/lib template
- sourceFiles += getSources("SOURCES", "VPATH_SOURCES", baseVPaths, projectDir, visitor);
-
- sourceFiles += getSources("FORMS", "VPATH_FORMS", baseVPaths, projectDir, visitor);
- sourceFiles += getSources("FORMS3", "VPATH_FORMS3", baseVPaths, projectDir, visitor);
-
- QStringList vPathsInc = baseVPaths;
- vPathsInc += visitor.absolutePathValues(QLatin1String("INCLUDEPATH"), projectDir);
- vPathsInc.removeDuplicates();
- sourceFiles += visitor.absoluteFileValues(QLatin1String("HEADERS"), projectDir, vPathsInc, 0);
-
- QDir proDir(projectDir);
- foreach (const QString &tsFile, visitor.values(QLatin1String("TRANSLATIONS")))
- tsFileNames << QFileInfo(proDir, tsFile).filePath();
-
- QStringList trcodec = visitor.values(QLatin1String("CODEC"))
- + visitor.values(QLatin1String("DEFAULTCODEC"))
- + visitor.values(QLatin1String("CODECFORTR"));
- if (!trcodec.isEmpty())
- codecForTr = trcodec.last();
-
- QStringList srccodec = visitor.values(QLatin1String("CODECFORSRC"));
- if (!srccodec.isEmpty())
- codecForSource = srccodec.last();
-
- sourceFiles.sort();
- sourceFiles.removeDuplicates();
- tsFileNames.sort();
- tsFileNames.removeDuplicates();
-
- varMap->insert("SOURCES", sourceFiles);
- varMap->insert("CODECFORTR", QStringList() << codecForTr);
- varMap->insert("CODECFORSRC", QStringList() << codecForSource);
- varMap->insert("TRANSLATIONS", tsFileNames);
-}
-
-bool evaluateProFile(const QString &fileName, bool verbose, QHash<QByteArray, QStringList> *varMap)
-{
- QFileInfo fi(fileName);
- if (!fi.exists())
- return false;
-
- ProFile pro(fi.absoluteFilePath());
-
- ProFileEvaluator visitor;
- visitor.setVerbose(verbose);
-
- if (!visitor.queryProFile(&pro))
- return false;
-
- if (!visitor.accept(&pro))
- return false;
-
- evaluateProFile(visitor, varMap, fi.absolutePath());
-
- return true;
-}
-
-QT_END_NAMESPACE
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index 0fcd598..0b88c07 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -153,6 +153,7 @@ public:
void reportDuplicates(const Duplicates &dupes, const QString &fileName, bool verbose);
void setCodecName(const QByteArray &name);
+ void setCodec(QTextCodec *codec) { m_codec = codec; }
QByteArray codecName() const;
QTextCodec *codec() const { return m_codec; }
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index adca7b4..38da552 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -17,7 +17,7 @@ qhp.Assistant.namespace = com.trolltech.assistant.460
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Assistant.filterAttributes = qt 4.6.1 tools assistant
+qhp.Assistant.filterAttributes = qt 4.6.2 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
qhp.Assistant.subprojects = manual examples
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index d30ade9..57d21a9 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -17,7 +17,7 @@ qhp.Designer.namespace = com.trolltech.designer.460
qhp.Designer.virtualFolder = qdoc
qhp.Designer.indexTitle = Qt Designer Manual
qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Designer.filterAttributes = qt 4.6.1 tools designer
+qhp.Designer.filterAttributes = qt 4.6.2 tools designer
qhp.Designer.customFilters.Designer.name = Qt Designer Manual
qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
qhp.Designer.subprojects = manual examples
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index f06671b..5860b33 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -17,7 +17,7 @@ qhp.Linguist.namespace = com.trolltech.linguist.460
qhp.Linguist.virtualFolder = qdoc
qhp.Linguist.indexTitle = Qt Linguist Manual
qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Linguist.filterAttributes = qt 4.6.1 tools linguist
+qhp.Linguist.filterAttributes = qt 4.6.2 tools linguist
qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
qhp.Linguist.subprojects = manual examples
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index dbb8ab8..22db23e 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -32,4 +32,4 @@ macro.mdash.HTML = "&mdash;"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
-macro.clearfloat.HTML = "<div style=\"clear: both\">"
+macro.clearfloat.HTML = "<br style=\"clear: both\" />"
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index ad27d75..0e7d960 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -17,7 +17,7 @@ qhp.qmake.namespace = com.trolltech.qmake.460
qhp.qmake.virtualFolder = qdoc
qhp.qmake.indexTitle = QMake Manual
qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.qmake.filterAttributes = qt 4.6.1 tools qmake
+qhp.qmake.filterAttributes = qt 4.6.2 tools qmake
qhp.qmake.customFilters.qmake.name = qmake Manual
qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
qhp.qmake.subprojects = manual
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index e9b9eb8..def4e67 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -32,9 +32,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.6.1
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1
+qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.6.2
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
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/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index a99f73e..1aefa98 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -34,9 +34,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.6.1
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1
+qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.6.2
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp
index 85e9b12..a932d72 100644
--- a/tools/qttracereplay/main.cpp
+++ b/tools/qttracereplay/main.cpp
@@ -52,6 +52,7 @@ public:
ReplayWidget(const QString &filename);
void paintEvent(QPaintEvent *event);
+ void resizeEvent(QResizeEvent *event);
public slots:
void updateRect();
@@ -64,14 +65,15 @@ public:
int currentIteration;
QTime timer;
+ QList<uint> visibleUpdates;
QList<uint> iterationTimes;
QString filename;
};
void ReplayWidget::updateRect()
{
- if (!updates.isEmpty())
- update(updates.at(currentFrame));
+ if (!visibleUpdates.isEmpty())
+ update(updates.at(visibleUpdates.at(currentFrame)));
}
void ReplayWidget::paintEvent(QPaintEvent *)
@@ -80,10 +82,10 @@ void ReplayWidget::paintEvent(QPaintEvent *)
// p.setClipRegion(frames.at(currentFrame).updateRegion);
- buffer.draw(&p, currentFrame);
+ buffer.draw(&p, visibleUpdates.at(currentFrame));
++currentFrame;
- if (currentFrame >= buffer.numFrames()) {
+ if (currentFrame >= visibleUpdates.size()) {
currentFrame = 0;
++currentIteration;
@@ -119,7 +121,7 @@ void ReplayWidget::paintEvent(QPaintEvent *)
if (iterationTimes.size() >= 10 || stddev < 4) {
printf("%s, iterations: %d, frames: %d, min(ms): %d, median(ms): %d, stddev: %f %%, max(fps): %f\n", qPrintable(filename),
- iterationTimes.size(), updates.size(), min, median, stddev, 1000. * updates.size() / min);
+ iterationTimes.size(), visibleUpdates.size(), min, median, stddev, 1000. * visibleUpdates.size() / min);
deleteLater();
return;
}
@@ -130,6 +132,21 @@ void ReplayWidget::paintEvent(QPaintEvent *)
QTimer::singleShot(0, this, SLOT(updateRect()));
}
+void ReplayWidget::resizeEvent(QResizeEvent *event)
+{
+ visibleUpdates.clear();
+
+ QRect bounds = rect();
+ for (int i = 0; i < updates.size(); ++i) {
+ if (updates.at(i).intersects(bounds))
+ visibleUpdates << i;
+ }
+
+ if (visibleUpdates.size() != updates.size())
+ printf("Warning: skipped %d frames due to limited resolution\n", updates.size() - visibleUpdates.size());
+
+}
+
ReplayWidget::ReplayWidget(const QString &filename_)
: currentFrame(0)
, currentIteration(0)
@@ -138,7 +155,6 @@ ReplayWidget::ReplayWidget(const QString &filename_)
setWindowTitle(filename);
QFile file(filename);
- QRect bounds;
if (!file.open(QIODevice::ReadOnly)) {
printf("Failed to load input file '%s'\n", qPrintable(filename_));
return;
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index d8c306f..a77e713 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
QString serialPortFriendlyName;
QString sisFile;
QString exeFile;
- QString cmdLine;
+ QStringList cmdLine;
QStringList args = QCoreApplication::arguments();
QTextStream outstream(stdout);
QTextStream errstream(stderr);
@@ -124,7 +124,6 @@ int main(int argc, char *argv[])
i++;
for(;i<args.size();i++) {
cmdLine.append(args.at(i));
- if(i + 1 < args.size()) cmdLine.append(' ');
}
}
}
@@ -175,7 +174,11 @@ int main(int argc, char *argv[])
}
if(loglevel > 0)
outstream << "Connecting to target via " << serialPortName << endl;
+#ifdef Q_OS_WIN
launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
+#else
+ launcher->setTrkServerName(serialPortName);
+#endif
launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
launcher->setCommandLineArgs(cmdLine);
@@ -200,8 +203,8 @@ int main(int argc, char *argv[])
QObject::connect(launcher.data(), SIGNAL(applicationOutputReceived(const QString &)), &handler, SLOT(applicationOutputReceived(const QString &)));
QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int)));
QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int)));
- QObject::connect(launcher.data(), SIGNAL(stopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
- QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resume(uint,uint)));
+ QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
+ QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resumeProcess(uint,uint)));
QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate()));
QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished()));
diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro
index cf0c055..2c1be98 100644
--- a/tools/runonphone/runonphone.pro
+++ b/tools/runonphone/runonphone.pro
@@ -18,3 +18,9 @@ windows {
-luuid \
-ladvapi32
}
+else:unix:!symbian {
+ SOURCES += serenum_unix.cpp
+}
+else {
+ SOURCES += serenum_stub.cpp
+}
diff --git a/tools/runonphone/serenum_stub.cpp b/tools/runonphone/serenum_stub.cpp
new file mode 100644
index 0000000..f39765e
--- /dev/null
+++ b/tools/runonphone/serenum_stub.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications 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 "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ qWarning() << "enumerateSerialPorts not implemented" << endl;
+ return list;
+}
+
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp
new file mode 100644
index 0000000..ca6c437
--- /dev/null
+++ b/tools/runonphone/serenum_unix.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications 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 "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+#include <QFileInfo>
+#include <QDir>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ QDir dir("/dev/serial/by-id/");
+ QFileInfoList ports(dir.entryInfoList());
+ foreach(QFileInfo info, ports) {
+ if (!info.isDir()) {
+ SerialPortId id;
+ id.friendlyName = info.fileName();
+ id.portName = info.canonicalFilePath();
+ list << id;
+ }
+ }
+ return list;
+}
+
diff --git a/tools/runonphone/trk/launcher.cpp b/tools/runonphone/trk/launcher.cpp
index 8f150c6..1796fc5 100644
--- a/tools/runonphone/trk/launcher.cpp
+++ b/tools/runonphone/trk/launcher.cpp
@@ -76,7 +76,7 @@ struct LauncherPrivate {
CopyState m_copyState;
QString m_fileName;
- QString m_commandLineArgs;
+ QStringList m_commandLineArgs;
QString m_installFileName;
int m_verbose;
Launcher::Actions m_startupActions;
@@ -159,7 +159,7 @@ void Launcher::setInstallFileName(const QString &name)
d->m_installFileName = name;
}
-void Launcher::setCommandLineArgs(const QString &args)
+void Launcher::setCommandLineArgs(const QStringList &args)
{
d->m_commandLineArgs = args;
}
@@ -189,8 +189,10 @@ bool Launcher::startServer(QString *errorMessage)
{
errorMessage->clear();
if (d->m_verbose) {
- const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Package=%3 Remote Package=%4 Install file=%5")
- .arg(d->m_trkServerName, d->m_fileName, d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName);
+ const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Arguments=%3 Package=%4 Remote Package=%5 Install file=%6")
+ .arg(d->m_trkServerName, d->m_fileName,
+ d->m_commandLineArgs.join(QString(QLatin1Char(' '))),
+ d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName);
logMessage(msg);
}
if (d->m_startupActions & ActionCopy) {
@@ -296,6 +298,34 @@ void Launcher::handleRemoteProcessKilled(const TrkResult &result)
disconnectTrk();
}
+QString Launcher::msgStopped(uint pid, uint tid, uint address, const QString &why)
+{
+ return QString::fromLatin1("Process %1, thread %2 stopped at 0x%3: %4").
+ arg(pid).arg(tid).arg(address, 0, 16).
+ arg(why.isEmpty() ? QString::fromLatin1("<Unknown reason>") : why);
+}
+
+bool Launcher::parseNotifyStopped(const QByteArray &dataBA,
+ uint *pid, uint *tid, uint *address,
+ QString *why /* = 0 */)
+{
+ if (why)
+ why->clear();
+ *address = *pid = *tid = 0;
+ if (dataBA.size() < 12)
+ return false;
+ const char *data = dataBA.data();
+ *address = extractInt(data);
+ *pid = extractInt(data + 4);
+ *tid = extractInt(data + 8);
+ if (why && dataBA.size() >= 14) {
+ const unsigned short len = extractShort(data + 12);
+ if (len > 0)
+ *why = QString::fromLatin1(data + 14, len);
+ }
+ return true;
+}
+
void Launcher::handleResult(const TrkResult &result)
{
QByteArray prefix = "READ BUF: ";
@@ -315,25 +345,13 @@ void Launcher::handleResult(const TrkResult &result)
break;
}
case TrkNotifyStopped: { // Notified Stopped
- logMessage(prefix + "NOTE: STOPPED " + str);
- // 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00
QString reason;
- if (result.data.size() >= 14) {
- uint pc = extractInt(result.data.mid(0,4).constData());
- uint pid = extractInt(result.data.mid(4,4).constData());
- uint tid = extractInt(result.data.mid(8,4).constData());
- ushort len = extractShort(result.data.mid(12,2).constData());
- if(len > 0)
- reason = result.data.mid(14, len);
- emit(stopped(pc, pid, tid, reason));
- } else {
- emit(stopped(0, 0, 0, reason));
- }
- //const char *data = result.data.data();
-// uint addr = extractInt(data); //code address: 4 bytes; code base address for the library
-// uint pid = extractInt(data + 4); // ProcessID: 4 bytes;
-// uint tid = extractInt(data + 8); // ThreadID: 4 bytes
- //logMessage(prefix << " ADDR: " << addr << " PID: " << pid << " TID: " << tid);
+ uint pc;
+ uint pid;
+ uint tid;
+ parseNotifyStopped(result.data, &pid, &tid, &pc, &reason);
+ logMessage(prefix + msgStopped(pid, tid, pc, reason));
+ emit(processStopped(pc, pid, tid, reason));
d->m_device->sendTrkAck(result.token);
break;
}
@@ -681,31 +699,38 @@ void Launcher::handleInstallPackageFinished(const TrkResult &result)
}
}
-void Launcher::startInferiorIfNeeded()
+QByteArray Launcher::startProcessMessage(const QString &executable,
+ const QStringList &arguments)
{
- emit startingApplication();
- if (d->m_session.pid != 0) {
- logMessage("Process already 'started'");
- return;
- }
// It's not started yet
QByteArray ba;
appendShort(&ba, 0, TargetByteOrder); // create new process
appendByte(&ba, 0); // options - currently unused
+ if(arguments.isEmpty()) {
+ appendString(&ba, executable.toLocal8Bit(), TargetByteOrder);
+ return ba;
+ }
+ // Append full command line as one string (leading length information).
+ QByteArray commandLineBa;
+ commandLineBa.append(executable.toLocal8Bit());
+ commandLineBa.append('\0');
+ commandLineBa.append(arguments.join(QString(QLatin1Char(' '))).toLocal8Bit());
+ appendString(&ba, commandLineBa, TargetByteOrder);
+ return ba;
+}
- if(d->m_commandLineArgs.isEmpty()) {
- appendString(&ba, d->m_fileName.toLocal8Bit(), TargetByteOrder);
- } else {
- QByteArray ba2;
- ba2.append(d->m_fileName.toLocal8Bit());
- ba2.append('\0');
- ba2.append(d->m_commandLineArgs.toLocal8Bit());
- appendString(&ba, ba2, TargetByteOrder);
+void Launcher::startInferiorIfNeeded()
+{
+ emit startingApplication();
+ if (d->m_session.pid != 0) {
+ logMessage("Process already 'started'");
+ return;
}
- d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item
+ d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess),
+ startProcessMessage(d->m_fileName, d->m_commandLineArgs)); // Create Item
}
-void Launcher::resume(uint pid, uint tid)
+void Launcher::resumeProcess(uint pid, uint tid)
{
QByteArray ba;
appendInt(&ba, pid, BigEndian);
diff --git a/tools/runonphone/trk/launcher.h b/tools/runonphone/trk/launcher.h
index 5dded53..8dc6ebe 100644
--- a/tools/runonphone/trk/launcher.h
+++ b/tools/runonphone/trk/launcher.h
@@ -95,7 +95,7 @@ public:
void setFileName(const QString &name);
void setCopyFileName(const QString &srcName, const QString &dstName);
void setInstallFileName(const QString &name);
- void setCommandLineArgs(const QString &args);
+ void setCommandLineArgs(const QStringList &args);
bool startServer(QString *errorMessage);
void setVerbose(int v);
void setSerialFrame(bool b);
@@ -109,6 +109,15 @@ public:
// becomes valid after successful execution of ActionPingOnly
QString deviceDescription(unsigned verbose = 0u) const;
+ static QByteArray startProcessMessage(const QString &executable,
+ const QStringList &arguments);
+ // Parse a TrkNotifyStopped message
+ static bool parseNotifyStopped(const QByteArray &a,
+ uint *pid, uint *tid, uint *address,
+ QString *why = 0);
+ // Helper message
+ static QString msgStopped(uint pid, uint tid, uint address, const QString &why);
+
signals:
void copyingStarted();
void canNotConnect(const QString &errorMessage);
@@ -125,11 +134,11 @@ signals:
void applicationOutputReceived(const QString &output);
void copyProgress(int percent);
void stateChanged(int);
- void stopped(uint pc, uint pid, uint tid, const QString& reason);
+ void processStopped(uint pc, uint pid, uint tid, const QString& reason);
public slots:
void terminate();
- void resume(uint pid, uint tid);
+ void resumeProcess(uint pid, uint tid);
private slots:
void handleResult(const trk::TrkResult &data);
diff --git a/tools/runonphone/trk/trkdevice.cpp b/tools/runonphone/trk/trkdevice.cpp
index 53f4490..fe3261b 100644
--- a/tools/runonphone/trk/trkdevice.cpp
+++ b/tools/runonphone/trk/trkdevice.cpp
@@ -99,6 +99,8 @@ QString winErrorMessage(unsigned long error)
#endif
+enum { verboseTrk = 0 };
+
namespace trk {
///////////////////////////////////////////////////////////////////////
@@ -128,6 +130,12 @@ TrkMessage::TrkMessage(byte c, byte t, TrkCallback cb) :
{
}
+QDebug operator<<(QDebug d, const TrkMessage &msg)
+{
+ return d << "Message: Code: " << msg.code
+ << " Token: " << msg.token << " " << msg.data.toHex();
+}
+
} // namespace trk
Q_DECLARE_METATYPE(trk::TrkMessage)
@@ -204,6 +212,8 @@ byte TrkWriteQueue::nextTrkWriteToken()
++m_trkWriteToken;
if (m_trkWriteToken == 0)
++m_trkWriteToken;
+ if (verboseTrk)
+ qDebug() << "Write token: " << m_trkWriteToken;
return m_trkWriteToken;
}
@@ -334,7 +344,8 @@ DeviceContext::DeviceContext() :
///////////////////////////////////////////////////////////////////////
-class WriterThread : public QThread {
+class WriterThread : public QThread
+{
Q_OBJECT
Q_DISABLE_COPY(WriterThread)
public:
@@ -400,15 +411,18 @@ int WriterThread::writePendingMessage()
m_waitMutex.unlock();
if (m_terminate)
return 1;
+
// Send off message
m_dataMutex.lock();
TrkMessage message;
const TrkWriteQueue::PendingMessageResult pr = m_queue.pendingMessage(&message);
m_dataMutex.unlock();
+
switch (pr) {
case TrkWriteQueue::NoMessage:
break;
case TrkWriteQueue::PendingMessage: {
+ //qDebug() << "Write pending message " << message;
// Untested: try to re-send a few times
bool success = false;
for (int r = 0; !success && (r < MaxAttempts); r++) {
@@ -428,6 +442,8 @@ int WriterThread::writePendingMessage()
break;
case TrkWriteQueue::NoopMessageDequeued:
// Sync with thread that owns us via a blocking signal
+ if (verboseTrk)
+ qDebug() << "Noop message dequeued" << message;
emit internalNoopMessageDequeued(message);
break;
} // switch
@@ -499,6 +515,8 @@ static inline bool overlappedSyncWrite(HANDLE file,
bool WriterThread::write(const QByteArray &data, QString *errorMessage)
{
+ if (verboseTrk)
+ qDebug() << "Write raw data: " << data.toHex();
QMutexLocker locker(&m_context->mutex);
#ifdef Q_OS_WIN
DWORD charsWritten;
@@ -557,6 +575,7 @@ void WriterThread::slotHandleResult(const TrkResult &result)
tryWrite(); // Have messages been enqueued in-between?
}
+
///////////////////////////////////////////////////////////////////////
//
// ReaderThreadBase: Base class for a thread that reads data from
@@ -566,7 +585,8 @@ void WriterThread::slotHandleResult(const TrkResult &result)
//
///////////////////////////////////////////////////////////////////////
-class ReaderThreadBase : public QThread {
+class ReaderThreadBase : public QThread
+{
Q_OBJECT
Q_DISABLE_COPY(ReaderThreadBase)
public:
@@ -625,7 +645,8 @@ void ReaderThreadBase::readMessages()
//
///////////////////////////////////////////////////////////////////////
-class WinReaderThread : public ReaderThreadBase {
+class WinReaderThread : public ReaderThreadBase
+{
Q_OBJECT
Q_DISABLE_COPY(WinReaderThread)
public:
@@ -835,7 +856,8 @@ void UnixReaderThread::terminate()
{
// Trigger select() by writing to the pipe
char c = 0;
- write(m_terminatePipeFileDescriptors[1], &c, 1);
+ int written = write(m_terminatePipeFileDescriptors[1], &c, 1);
+ // FIXME: Use result.
wait();
}
@@ -1021,6 +1043,8 @@ void TrkDevice::setVerbose(int b)
void TrkDevice::slotMessageReceived(const trk::TrkResult &result, const QByteArray &rawData)
{
d->writerThread->slotHandleResult(result);
+ if (d->verbose > 1)
+ qDebug() << "Received: " << result.toString();
emit messageReceived(result);
if (!rawData.isEmpty())
emit rawDataReceived(rawData);
@@ -1057,6 +1081,8 @@ bool TrkDevice::sendTrkAck(byte token)
TrkMessage msg(0x80, token);
msg.token = token;
msg.data.append('\0');
+ if (verboseTrk)
+ qDebug() << "Write synchroneous message: " << msg;
return d->writerThread->trkWriteRawMessage(msg);
// 01 90 00 07 7e 80 01 00 7d 5e 7e
}
diff --git a/tools/runonphone/trk/trkutils.h b/tools/runonphone/trk/trkutils.h
index c636ac0..328dd2b 100644
--- a/tools/runonphone/trk/trkutils.h
+++ b/tools/runonphone/trk/trkutils.h
@@ -119,7 +119,8 @@ struct Library
uint dataseg;
};
-struct TrkAppVersion {
+struct TrkAppVersion
+{
TrkAppVersion();
void reset();
@@ -153,6 +154,10 @@ struct Session
typedef QList<Library> Libraries;
Libraries libraries;
+ typedef uint Thread;
+ typedef QList<Thread> Threads;
+ Threads threads;
+
// Gdb request
uint currentThread;
QStringList modules;
diff --git a/tools/shared/findwidget/texteditfindwidget.h b/tools/shared/findwidget/texteditfindwidget.h
index 3034a42..a051f0e 100644
--- a/tools/shared/findwidget/texteditfindwidget.h
+++ b/tools/shared/findwidget/texteditfindwidget.h
@@ -53,7 +53,7 @@ class TextEditFindWidget : public AbstractFindWidget
Q_OBJECT
public:
- TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
+ explicit TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
QTextEdit *textEdit() const
{ return m_textEdit; }
diff --git a/tools/shared/fontpanel/fontpanel.cpp b/tools/shared/fontpanel/fontpanel.cpp
index 0b6f394..ad297df 100644
--- a/tools/shared/fontpanel/fontpanel.cpp
+++ b/tools/shared/fontpanel/fontpanel.cpp
@@ -217,7 +217,7 @@ void FontPanel::updateFamily(const QString &family)
const QString normalStyle = QLatin1String("Normal");
if (hasStyles) {
- foreach (QString style, styles) {
+ foreach (const QString &style, styles) {
// try to maintain selection or select 'normal' preferably
const int newIndex = m_styleComboBox->count();
m_styleComboBox->addItem(style);
diff --git a/tools/shared/qtgradienteditor/qtgradientutils.cpp b/tools/shared/qtgradienteditor/qtgradientutils.cpp
index 9fa0324..083ba89 100644
--- a/tools/shared/qtgradienteditor/qtgradientutils.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientutils.cpp
@@ -395,7 +395,7 @@ static QStringList styleSheetParameters(const QGradient &gradient)
static QStringList styleSheetStops(const QGradient &gradient)
{
QStringList result;
- foreach (QGradientStop stop, gradient.stops()) {
+ foreach (const QGradientStop &stop, gradient.stops()) {
const QColor color = stop.second;
const QString stopDescription = QLatin1String("stop:") + QString::number(stop.first) + QLatin1String(" rgba(")
diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.h b/tools/shared/qttoolbardialog/qttoolbardialog.h
index a1c099a..e182368 100644
--- a/tools/shared/qttoolbardialog/qttoolbardialog.h
+++ b/tools/shared/qttoolbardialog/qttoolbardialog.h
@@ -68,7 +68,7 @@ class QtToolBarManager : public QObject
Q_OBJECT
public:
- QtToolBarManager(QObject *parent = 0);
+ explicit QtToolBarManager(QObject *parent = 0);
~QtToolBarManager();
void setMainWindow(QMainWindow *mainWindow);
@@ -100,7 +100,7 @@ class QtToolBarDialog : public QDialog
Q_OBJECT
public:
- QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~QtToolBarDialog();
void setToolBarManager(QtToolBarManager *toolBarManager);
diff --git a/translations/translations.pri b/translations/translations.pri
index 7a24a4f..8896654 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -8,8 +8,12 @@ defineReplace(prependAll) {
return ($$result)
}
-LUPDATE = $$QT_BUILD_TREE/bin/lupdate -locations relative -no-ui-lines
-LUPDATE ~= s,/,$$QMAKE_DIR_SEP,
+LUPDATE = $$QT_BUILD_TREE/bin/lupdate
+win32 {
+ LUPDATE ~= s,/,$$QMAKE_DIR_SEP,
+ LUPDATE = $${LUPDATE}.exe
+}
+LUPDATE += -locations relative -no-ui-lines
###### Qt Libraries
diff --git a/translations/translations.pro b/translations/translations.pro
index ef09dc3..f1b9c99 100644
--- a/translations/translations.pro
+++ b/translations/translations.pro
@@ -1,7 +1,10 @@
TRANSLATIONS = $$files(*.ts)
LRELEASE = $$QT_BUILD_TREE/bin/lrelease
-LRELEASE ~= s,/,$$QMAKE_DIR_SEP,
+win32 {
+ LRELEASE ~= s,/,$$QMAKE_DIR_SEP,
+ LRELEASE = $${LRELEASE}.exe
+}
contains(TEMPLATE_PREFIX, vc):vcproj = 1
@@ -14,7 +17,8 @@ LIBS =
updateqm.input = TRANSLATIONS
updateqm.output = ${QMAKE_FILE_BASE}.qm
isEmpty(vcproj):updateqm.variable_out = PRE_TARGETDEPS
-updateqm.commands = @echo lrelease ${QMAKE_FILE_IN}; $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
+updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
+silent:updateqm.commands = @echo lrelease ${QMAKE_FILE_IN} && $$updateqm.commands
updateqm.name = LRELEASE ${QMAKE_FILE_IN}
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm
diff --git a/util/qlalr/doc/qlalr.qdocconf b/util/qlalr/doc/qlalr.qdocconf
index 391844b..ea9eaa6 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; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 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>"