summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore28
-rw-r--r--bin/build_release_package.pl205
-rw-r--r--bin/createpackage.bat81
-rw-r--r--bin/patch_capabilities.pl95
-rw-r--r--config.tests/unix/openssl/openssl.pri8
-rwxr-xr-x[-rw-r--r--]configure.exebin856064 -> 535040 bytes
-rw-r--r--confqt.bat1
-rw-r--r--confsbsv2.bat1
-rw-r--r--demos/affine/affine.pro2
-rw-r--r--demos/arthurplugin/arthurplugin.pro2
-rw-r--r--demos/books/books.pro2
-rw-r--r--demos/browser/browser.pro2
-rw-r--r--demos/chip/chip.pro2
-rw-r--r--demos/composition/composition.pro2
-rw-r--r--demos/deform/deform.pro4
-rw-r--r--demos/deform/pathdeform.cpp12
-rw-r--r--demos/demobase.pri1
-rw-r--r--demos/demos.pro37
-rw-r--r--demos/embedded/desktopservices/contenttab.cpp110
-rw-r--r--demos/embedded/desktopservices/contenttab.h70
-rw-r--r--demos/embedded/desktopservices/data/Explosion.wavbin0 -> 18427 bytes
-rw-r--r--demos/embedded/desktopservices/data/designer.pngbin0 -> 4205 bytes
-rw-r--r--demos/embedded/desktopservices/data/monkey_on_64x64.pngbin0 -> 3479 bytes
-rw-r--r--demos/embedded/desktopservices/data/sax.mp3bin0 -> 417844 bytes
-rw-r--r--demos/embedded/desktopservices/desktopservices.pro23
-rw-r--r--demos/embedded/desktopservices/desktopservices.qrc8
-rw-r--r--demos/embedded/desktopservices/desktopwidget.cpp56
-rw-r--r--demos/embedded/desktopservices/desktopwidget.h43
-rw-r--r--demos/embedded/desktopservices/linktab.cpp49
-rw-r--r--demos/embedded/desktopservices/linktab.h55
-rw-r--r--demos/embedded/desktopservices/main.cpp26
-rw-r--r--demos/embedded/desktopservices/resources/browser.pngbin0 -> 2739 bytes
-rw-r--r--demos/embedded/desktopservices/resources/heart.svg55
-rw-r--r--demos/embedded/desktopservices/resources/message.pngbin0 -> 2234 bytes
-rw-r--r--demos/embedded/desktopservices/resources/music.pngbin0 -> 2322 bytes
-rw-r--r--demos/embedded/desktopservices/resources/photo.pngbin0 -> 2430 bytes
-rw-r--r--demos/embedded/embedded.pro5
-rw-r--r--demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro7
-rw-r--r--demos/embedded/fluidlauncher/config_s60/config.xml19
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.cpp126
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.h4
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro86
-rw-r--r--demos/embedded/fluidlauncher/pictureflow.cpp24
-rw-r--r--demos/embedded/fluidlauncher/screenshots/context2d.pngbin0 -> 23995 bytes
-rw-r--r--demos/embedded/fluidlauncher/screenshots/desktopservices.pngbin0 -> 43341 bytes
-rw-r--r--demos/embedded/fluidlauncher/screenshots/fridgemagnets.pngbin0 -> 50464 bytes
-rw-r--r--demos/embedded/fluidlauncher/screenshots/ftp.pngbin0 -> 29831 bytes
-rw-r--r--demos/embedded/fluidlauncher/screenshots/saxbookmarks.pngbin0 -> 27098 bytes
-rw-r--r--demos/embedded/styledemo/files/application.qss2
-rw-r--r--demos/embedded/styledemo/files/blue.qss3
-rw-r--r--demos/embedded/styledemo/files/khaki.qss3
-rw-r--r--demos/embedded/styledemo/files/transparent.qss1
-rw-r--r--demos/embedded/styledemo/styledemo.pro4
-rw-r--r--demos/embedded/styledemo/stylewidget.ui64
-rw-r--r--demos/embeddeddialogs/embeddeddialogs.pro2
-rw-r--r--demos/gradients/gradients.pro2
-rw-r--r--demos/interview/interview.pro2
-rw-r--r--demos/macmainwindow/macmainwindow.pro2
-rw-r--r--demos/mainwindow/mainwindow.pro2
-rw-r--r--demos/mediaplayer/mediaplayer.pro2
-rw-r--r--demos/pathstroke/pathstroke.pro3
-rw-r--r--demos/qtdemo/qtdemo.pro2
-rw-r--r--demos/shared/shared.pri3
-rw-r--r--demos/shared/shared.pro3
-rw-r--r--demos/spreadsheet/spreadsheet.pro2
-rw-r--r--demos/sqlbrowser/sqlbrowser.pro2
-rw-r--r--demos/textedit/textedit.cpp6
-rw-r--r--demos/textedit/textedit.pro2
-rw-r--r--demos/undo/undo.pro2
-rw-r--r--dist/changes-4.4.4-temple65
-rw-r--r--dist/changes-4.5.0-garden241
-rw-r--r--doc/src/appicon.qdoc15
-rw-r--r--doc/src/examples.qdoc1
-rw-r--r--doc/src/examples/htmlinfo.qdoc59
-rw-r--r--doc/src/installation.qdoc110
-rw-r--r--doc/src/plugins-howto.qdoc14
-rw-r--r--doc/src/qmake-manual.qdoc427
-rw-r--r--doc/src/qnamespace.qdoc31
-rw-r--r--doc/src/s60-introduction.qdoc84
-rw-r--r--doc/src/snippets/code/doc_src_appicon.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc31
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc119
-rw-r--r--doc/src/snippets/code/doc_src_s60-introduction.qdoc16
-rw-r--r--examples/activeqt/activeqt.pro2
-rw-r--r--examples/activeqt/comapp/comapp.pro2
-rw-r--r--examples/activeqt/hierarchy/hierarchy.pro2
-rw-r--r--examples/activeqt/menus/menus.pro2
-rw-r--r--examples/activeqt/multiple/multiple.pro2
-rw-r--r--examples/activeqt/opengl/opengl.pro2
-rw-r--r--examples/activeqt/qutlook/qutlook.pro2
-rw-r--r--examples/activeqt/simple/simple.pro2
-rw-r--r--examples/activeqt/webbrowser/webbrowser.pro2
-rw-r--r--examples/activeqt/wrapper/wrapper.pro2
-rw-r--r--examples/assistant/assistant.pro2
-rw-r--r--examples/assistant/simpletextviewer/simpletextviewer.pro2
-rw-r--r--examples/dbus/complexpingpong/complexping.pro2
-rw-r--r--examples/dbus/complexpingpong/complexpong.pro2
-rw-r--r--examples/dbus/dbus-chat/dbus-chat.pro2
-rw-r--r--examples/dbus/dbus.pro2
-rw-r--r--examples/dbus/listnames/listnames.pro2
-rw-r--r--examples/dbus/pingpong/ping.pro2
-rw-r--r--examples/dbus/pingpong/pong.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/remotecontrolledcar.pro2
-rw-r--r--examples/designer/calculatorbuilder/calculatorbuilder.pro2
-rw-r--r--examples/designer/calculatorform/calculatorform.pro2
-rw-r--r--examples/designer/containerextension/containerextension.pro2
-rw-r--r--examples/designer/customwidgetplugin/customwidgetplugin.pro2
-rw-r--r--examples/designer/designer.pro2
-rw-r--r--examples/designer/taskmenuextension/taskmenuextension.pro2
-rw-r--r--examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro2
-rw-r--r--examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro2
-rw-r--r--examples/desktop/desktop.pro4
-rw-r--r--examples/desktop/screenshot/screenshot.pro2
-rw-r--r--examples/desktop/systray/systray.pro2
-rw-r--r--examples/dialogs/classwizard/classwizard.pro2
-rw-r--r--examples/dialogs/configdialog/configdialog.pro2
-rw-r--r--examples/dialogs/dialogs.pro4
-rw-r--r--examples/dialogs/extension/extension.pro2
-rw-r--r--examples/dialogs/findfiles/findfiles.pro2
-rw-r--r--examples/dialogs/licensewizard/licensewizard.pro2
-rw-r--r--examples/dialogs/sipdialog/sipdialog.pro2
-rw-r--r--examples/dialogs/standarddialogs/standarddialogs.pro2
-rw-r--r--examples/dialogs/tabdialog/tabdialog.pro2
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.pro2
-rw-r--r--examples/draganddrop/draganddrop.pro2
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro2
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro2
-rw-r--r--examples/draganddrop/dropsite/dropsite.pro2
-rw-r--r--examples/draganddrop/fridgemagnets/dragwidget.cpp3
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.pro3
-rw-r--r--examples/draganddrop/fridgemagnets/main.cpp9
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro7
-rw-r--r--examples/examplebase.pri1
-rw-r--r--examples/examples.pro16
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro4
-rw-r--r--examples/graphicsview/collidingmice/collidingmice.pro4
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.pro2
-rw-r--r--examples/graphicsview/dragdroprobot/dragdroprobot.pro2
-rw-r--r--examples/graphicsview/elasticnodes/elasticnodes.pro6
-rw-r--r--examples/graphicsview/graphicsview.pro12
-rw-r--r--examples/graphicsview/padnavigator/main.cpp2
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.pro5
-rw-r--r--examples/graphicsview/portedasteroids/portedasteroids.pro2
-rw-r--r--examples/graphicsview/portedcanvas/portedcanvas.pro2
-rw-r--r--examples/help/contextsensitivehelp/contextsensitivehelp.pro2
-rw-r--r--examples/help/help.pro2
-rw-r--r--examples/help/remotecontrol/remotecontrol.pro2
-rw-r--r--examples/help/simpletextviewer/simpletextviewer.pro2
-rw-r--r--examples/ipc/ipc.pro2
-rw-r--r--examples/ipc/localfortuneclient/localfortuneclient.pro2
-rw-r--r--examples/ipc/localfortuneserver/localfortuneserver.pro2
-rw-r--r--examples/ipc/sharedmemory/sharedmemory.pro2
-rw-r--r--examples/itemviews/addressbook/addressbook.pro4
-rw-r--r--examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro2
-rw-r--r--examples/itemviews/chart/chart.pro8
-rw-r--r--examples/itemviews/coloreditorfactory/coloreditorfactory.pro2
-rw-r--r--examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro2
-rw-r--r--examples/itemviews/dirview/dirview.pro2
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.pro2
-rw-r--r--examples/itemviews/itemviews.pro6
-rw-r--r--examples/itemviews/pixelator/pixelator.pro2
-rw-r--r--examples/itemviews/puzzle/puzzle.pro2
-rw-r--r--examples/itemviews/simpledommodel/simpledommodel.pro2
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.pro2
-rw-r--r--examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro2
-rw-r--r--examples/itemviews/spinboxdelegate/spinboxdelegate.pro2
-rw-r--r--examples/itemviews/stardelegate/stardelegate.pro2
-rw-r--r--examples/layouts/basiclayouts/basiclayouts.pro2
-rw-r--r--examples/layouts/borderlayout/borderlayout.pro2
-rw-r--r--examples/layouts/dynamiclayouts/dynamiclayouts.pro2
-rw-r--r--examples/layouts/flowlayout/flowlayout.pro2
-rw-r--r--examples/layouts/layouts.pro2
-rw-r--r--examples/linguist/arrowpad/arrowpad.pro2
-rw-r--r--examples/linguist/hellotr/hellotr.pro2
-rw-r--r--examples/linguist/linguist.pro2
-rw-r--r--examples/linguist/trollprint/trollprint.pro2
-rw-r--r--examples/mainwindows/application/application.pro2
-rw-r--r--examples/mainwindows/application/mainwindow.cpp8
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.pro2
-rw-r--r--examples/mainwindows/mainwindows.pro6
-rw-r--r--examples/mainwindows/mdi/mdi.pro2
-rw-r--r--examples/mainwindows/menus/menus.pro2
-rw-r--r--examples/mainwindows/recentfiles/recentfiles.pro2
-rw-r--r--examples/mainwindows/sdi/sdi.pro2
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.pro2
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.pro2
-rw-r--r--examples/network/broadcastsender/broadcastsender.pro2
-rw-r--r--examples/network/download/download.pro2
-rw-r--r--examples/network/downloadmanager/downloadmanager.pro2
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro2
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro2
-rw-r--r--examples/network/ftp/ftp.pro10
-rw-r--r--examples/network/ftp/ftpwindow.cpp15
-rw-r--r--examples/network/ftp/main.cpp58
-rw-r--r--examples/network/http/http.pro2
-rw-r--r--examples/network/loopback/loopback.pro2
-rw-r--r--examples/network/network-chat/network-chat.pro2
-rw-r--r--examples/network/network.pro12
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro2
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.pro2
-rw-r--r--examples/network/torrent/torrent.pro2
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro2
-rw-r--r--examples/opengl/framebufferobject/bubbles.svg13
-rw-r--r--examples/opengl/framebufferobject/framebufferobject.pro2
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.pro2
-rw-r--r--examples/opengl/grabber/grabber.pro2
-rw-r--r--examples/opengl/hellogl/glwidget.cpp52
-rw-r--r--examples/opengl/hellogl/hellogl.pro2
-rw-r--r--examples/opengl/opengl.pro2
-rw-r--r--examples/opengl/overpainting/overpainting.pro2
-rw-r--r--examples/opengl/pbuffers/pbuffers.pro2
-rw-r--r--examples/opengl/pbuffers2/bubbles.svg13
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.pro2
-rw-r--r--examples/opengl/samplebuffers/glwidget.cpp36
-rw-r--r--examples/opengl/samplebuffers/samplebuffers.pro2
-rw-r--r--examples/opengl/textures/textures.pro2
-rw-r--r--examples/painting/basicdrawing/basicdrawing.pro4
-rw-r--r--examples/painting/concentriccircles/concentriccircles.pro4
-rw-r--r--examples/painting/fontsampler/fontsampler.pro2
-rw-r--r--examples/painting/imagecomposition/imagecomposition.pro3
-rw-r--r--examples/painting/painterpaths/painterpaths.pro6
-rw-r--r--examples/painting/painting.pro4
-rw-r--r--examples/painting/svgviewer/files/bubbles.svg13
-rw-r--r--examples/painting/svgviewer/svgviewer.pro9
-rw-r--r--examples/painting/transformations/transformations.pro4
-rw-r--r--examples/phonon/capabilities/capabilities.pro5
-rw-r--r--examples/phonon/phonon.pro2
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro2
-rw-r--r--examples/qtconcurrent/map/map.pro2
-rw-r--r--examples/qtconcurrent/progressdialog/progressdialog.pro2
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro2
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.pro2
-rw-r--r--examples/qtconcurrent/wordcount/wordcount.pro2
-rw-r--r--examples/qtestlib/qtestlib.pro2
-rw-r--r--examples/qtestlib/tutorial1/tutorial1.pro4
-rw-r--r--examples/qtestlib/tutorial2/tutorial2.pro4
-rw-r--r--examples/qtestlib/tutorial3/tutorial3.pro4
-rw-r--r--examples/qtestlib/tutorial4/tutorial4.pro4
-rw-r--r--examples/qtestlib/tutorial5/tutorial5.pro4
-rw-r--r--examples/qws/ahigl/ahigl.pro2
-rw-r--r--examples/qws/dbscreen/dbscreen.pro2
-rw-r--r--examples/qws/framebuffer/framebuffer.pro2
-rw-r--r--examples/qws/mousecalibration/mousecalibration.pro2
-rw-r--r--examples/qws/qws.pro2
-rw-r--r--examples/qws/svgalib/svgalib.pro2
-rw-r--r--examples/richtext/calendar/calendar.pro2
-rw-r--r--examples/richtext/orderform/orderform.pro2
-rw-r--r--examples/richtext/richtext.pro2
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/script/calculator/calculator.pro2
-rw-r--r--examples/script/context2d/context2d.pro9
-rw-r--r--examples/script/context2d/main.cpp3
-rw-r--r--examples/script/customclass/customclass.pro2
-rw-r--r--examples/script/defaultprototypes/defaultprototypes.pro2
-rw-r--r--examples/script/helloscript/helloscript.pro2
-rw-r--r--examples/script/marshal/marshal.pro2
-rw-r--r--examples/script/qscript/qscript.pro2
-rw-r--r--examples/script/qsdbg/qsdbg.pro2
-rw-r--r--examples/script/script.pro4
-rw-r--r--examples/sql/cachedtable/cachedtable.pro2
-rw-r--r--examples/sql/drilldown/drilldown.pro4
-rw-r--r--examples/sql/drilldown/informationwindow.cpp2
-rw-r--r--examples/sql/drilldown/main.cpp4
-rw-r--r--examples/sql/drilldown/view.cpp19
-rw-r--r--examples/sql/masterdetail/masterdetail.pro2
-rw-r--r--examples/sql/querymodel/querymodel.pro2
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.pro2
-rw-r--r--examples/sql/sql.pro16
-rw-r--r--examples/sql/tablemodel/tablemodel.pro2
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro4
-rw-r--r--examples/threads/semaphores/semaphores.pro2
-rw-r--r--examples/threads/threads.pro2
-rw-r--r--examples/threads/waitconditions/waitconditions.pro6
-rw-r--r--examples/tools/codecs/codecs.pro2
-rw-r--r--examples/tools/completer/completer.pro2
-rw-r--r--examples/tools/customcompleter/customcompleter.pro2
-rw-r--r--examples/tools/echoplugin/echoplugin.pro2
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.pro2
-rw-r--r--examples/tools/echoplugin/plugin/plugin.pro4
-rw-r--r--examples/tools/i18n/i18n.pro2
-rw-r--r--examples/tools/plugandpaint/plugandpaint.pro8
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.pro2
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro4
-rw-r--r--examples/tools/plugandpaintplugins/plugandpaintplugins.pro2
-rw-r--r--examples/tools/regexp/regexp.pro2
-rw-r--r--examples/tools/settingseditor/settingseditor.pro2
-rw-r--r--examples/tools/styleplugin/plugin/plugin.pro4
-rw-r--r--examples/tools/styleplugin/styleplugin.pro2
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.pro2
-rw-r--r--examples/tools/tools.pro2
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.pro2
-rw-r--r--examples/tools/undoframework/undoframework.pro2
-rw-r--r--examples/tutorials/addressbook/addressbook.pro2
-rw-r--r--examples/tutorials/addressbook/part1/part1.pro2
-rw-r--r--examples/tutorials/addressbook/part2/part2.pro2
-rw-r--r--examples/tutorials/addressbook/part3/part3.pro2
-rw-r--r--examples/tutorials/addressbook/part4/part4.pro2
-rw-r--r--examples/tutorials/addressbook/part5/part5.pro2
-rw-r--r--examples/tutorials/addressbook/part6/part6.pro2
-rw-r--r--examples/tutorials/addressbook/part7/part7.pro2
-rw-r--r--examples/tutorials/tutorials.pro2
-rw-r--r--examples/uitools/multipleinheritance/multipleinheritance.pro2
-rw-r--r--examples/uitools/textfinder/textfinder.pro2
-rw-r--r--examples/uitools/uitools.pro4
-rw-r--r--examples/webkit/formextractor/formextractor.pro2
-rw-r--r--examples/webkit/previewer/previewer.pro2
-rw-r--r--examples/webkit/webkit.pro2
-rw-r--r--examples/widgets/analogclock/analogclock.pro4
-rw-r--r--examples/widgets/calculator/calculator.pro4
-rw-r--r--examples/widgets/calendarwidget/calendarwidget.pro4
-rw-r--r--examples/widgets/charactermap/charactermap.pro2
-rw-r--r--examples/widgets/digitalclock/digitalclock.pro2
-rw-r--r--examples/widgets/groupbox/groupbox.pro2
-rw-r--r--examples/widgets/icons/icons.pro2
-rw-r--r--examples/widgets/imageviewer/imageviewer.pro2
-rw-r--r--examples/widgets/lineedits/lineedits.pro4
-rw-r--r--examples/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/scribble/scribble.pro2
-rw-r--r--examples/widgets/shapedclock/shapedclock.pro4
-rw-r--r--examples/widgets/sliders/sliders.pro2
-rw-r--r--examples/widgets/spinboxes/spinboxes.pro2
-rw-r--r--examples/widgets/styles/styles.pro2
-rw-r--r--examples/widgets/stylesheet/stylesheet.pro2
-rw-r--r--examples/widgets/tablet/tablet.pro2
-rw-r--r--examples/widgets/tetrix/tetrix.pro4
-rw-r--r--examples/widgets/tooltips/tooltips.pro2
-rw-r--r--examples/widgets/validators/validators.pro2
-rw-r--r--examples/widgets/widgets.pro11
-rw-r--r--examples/widgets/wiggly/dialog.cpp11
-rw-r--r--examples/widgets/wiggly/dialog.h2
-rw-r--r--examples/widgets/wiggly/main.cpp14
-rw-r--r--examples/widgets/wiggly/wiggly.pro4
-rw-r--r--examples/widgets/windowflags/windowflags.pro2
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/apache_org.html281
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro18
-rw-r--r--examples/xml/htmlinfo/main.cpp89
-rw-r--r--examples/xml/htmlinfo/nokia_com.html215
-rw-r--r--examples/xml/htmlinfo/simpleexample.html11
-rw-r--r--examples/xml/htmlinfo/trolltech_com.html955
-rw-r--r--examples/xml/htmlinfo/w3c_org.html507
-rw-r--r--examples/xml/htmlinfo/youtube_com.html1585
-rw-r--r--examples/xml/rsslisting/rsslisting.pro2
-rw-r--r--examples/xml/saxbookmarks/frankf.xbel230
-rw-r--r--examples/xml/saxbookmarks/jenniferf.xbel93
-rw-r--r--examples/xml/saxbookmarks/main.cpp4
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp3
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro9
-rw-r--r--examples/xml/streambookmarks/streambookmarks.pro2
-rw-r--r--examples/xml/xml.pro5
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.pro2
-rw-r--r--examples/xmlpatterns/filetree/filetree.pro2
-rw-r--r--examples/xmlpatterns/recipes/recipes.pro2
-rw-r--r--examples/xmlpatterns/xmlpatterns.pro2
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globalVariables.pro2
-rw-r--r--examples/xmlpatterns/xquery/xquery.pro2
-rw-r--r--mkspecs/common/symbian/fixed_stdlib.h34
-rw-r--r--mkspecs/common/symbian/qplatformdefs.h136
-rw-r--r--mkspecs/common/symbian/stl-off/new5
-rw-r--r--mkspecs/common/symbian/symbian.conf141
-rw-r--r--mkspecs/features/debug_and_release.prf2
-rw-r--r--mkspecs/features/qt.prf8
-rw-r--r--mkspecs/features/qttest_p4.prf23
-rw-r--r--mkspecs/features/symbian/application_icon.prf39
-rw-r--r--mkspecs/features/symbian/data_caging_paths.prf80
-rw-r--r--mkspecs/features/symbian/default_post.prf31
-rw-r--r--mkspecs/features/symbian/default_pre.prf2
-rw-r--r--mkspecs/features/symbian/epocallowdlldata.prf1
-rw-r--r--mkspecs/features/symbian/moc.prf16
-rw-r--r--mkspecs/features/symbian/platform_paths.prf456
-rw-r--r--mkspecs/features/symbian/qt.prf15
-rw-r--r--mkspecs/features/symbian/stl.prf19
-rw-r--r--mkspecs/features/symbian/stl_off.prf2
-rw-r--r--mkspecs/symbian-abld/qmake.conf9
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm39
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm35
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm34
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qt.xml37
-rw-r--r--mkspecs/symbian-sbsv2/qmake.conf9
-rw-r--r--mkspecs/win32-mwc/qmake.conf110
-rw-r--r--mkspecs/win32-mwc/qplatformdefs.h134
-rw-r--r--projects.pro21
-rw-r--r--qmake/Makefile.unix33
-rw-r--r--qmake/Makefile.win3237
-rw-r--r--qmake/Makefile.win32-g++30
-rw-r--r--qmake/Makefile.win32-g++-sh30
-rw-r--r--qmake/Makefile.win32-mwc469
-rw-r--r--qmake/generators/makefile.cpp78
-rw-r--r--qmake/generators/makefile.h5
-rw-r--r--qmake/generators/metamakefile.cpp315
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp210
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h39
-rw-r--r--qmake/generators/symbian/symmake.cpp1620
-rw-r--r--qmake/generators/symbian/symmake.h125
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp436
-rw-r--r--qmake/generators/symbian/symmake_abld.h39
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp409
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.h42
-rw-r--r--qmake/generators/win32/msvc_dsp.cpp15
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp21
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp15
-rw-r--r--qmake/project.cpp326
-rw-r--r--qmake/project.h7
-rw-r--r--qmake/qmake.pri23
-rw-r--r--qmake/qmake.pro3
-rw-r--r--qmake/qpopen.cpp113
-rw-r--r--qmake/qpopen.h43
-rw-r--r--selfsigned.cer19
-rw-r--r--selfsigned.key12
-rw-r--r--src/3rdparty/freetype/src/gzip/zconf.h7
-rw-r--r--src/3rdparty/freetype/src/gzip/zlib.h7
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h6
-rw-r--r--src/3rdparty/libjpeg/jinclude.h5
-rw-r--r--src/3rdparty/libmng/libmng_types.h7
-rw-r--r--src/3rdparty/libpng/pngconf.h9
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_config.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_unix.c7
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffio.h5
-rw-r--r--src/3rdparty/phonon/phonon/phonon_export.h6
-rw-r--r--src/3rdparty/zlib/zutil.h7
-rw-r--r--src/corelib/arch/arch.pri5
-rw-r--r--src/corelib/arch/generic/qatomic_generic_unix.cpp5
-rw-r--r--src/corelib/arch/qatomic_arch.h2
-rw-r--r--src/corelib/arch/qatomic_arm.h32
-rw-r--r--src/corelib/arch/qatomic_symbian.h26
-rw-r--r--src/corelib/arch/qatomic_windows.h9
-rw-r--r--src/corelib/arch/symbian/arch.pri5
-rw-r--r--src/corelib/arch/symbian/qatomic_symbian.cpp49
-rw-r--r--src/corelib/concurrent/qtconcurrentiteratekernel.cpp6
-rw-r--r--src/corelib/concurrent/qtconcurrentiteratekernel.h23
-rw-r--r--src/corelib/concurrent/qtconcurrentthreadengine.h1
-rw-r--r--src/corelib/corelib.pro8
-rw-r--r--src/corelib/global/qglobal.cpp156
-rw-r--r--src/corelib/global/qglobal.h90
-rw-r--r--src/corelib/global/qnamespace.h28
-rw-r--r--src/corelib/io/io.pri8
-rw-r--r--src/corelib/io/qdir.cpp25
-rw-r--r--src/corelib/io/qfile.cpp12
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp252
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian_p.h101
-rw-r--r--src/corelib/io/qfsfileengine.h3
-rw-r--r--src/corelib/io/qfsfileengine_iterator_unix.cpp12
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp292
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp4
-rw-r--r--src/corelib/io/qiodevice.cpp15
-rw-r--r--src/corelib/io/qprocess.cpp38
-rw-r--r--src/corelib/io/qprocess.h7
-rw-r--r--src/corelib/io/qprocess_p.h7
-rw-r--r--src/corelib/io/qprocess_symbian.cpp1003
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/kernel/kernel.pri20
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp145
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h113
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp121
-rw-r--r--src/corelib/kernel/qcoreapplication.h2
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.h3
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp930
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h272
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp24
-rw-r--r--src/corelib/kernel/qobject.cpp4
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp17
-rw-r--r--src/corelib/kernel/qsharedmemory_p.h9
-rw-r--r--src/corelib/kernel/qsharedmemory_symbian.cpp154
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp9
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp13
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h13
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp97
-rw-r--r--src/corelib/kernel/qvariant.cpp27
-rw-r--r--src/corelib/plugin/qlibrary.cpp92
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp27
-rw-r--r--src/corelib/plugin/qpluginloader.cpp37
-rw-r--r--src/corelib/plugin/quuid.cpp2
-rw-r--r--src/corelib/thread/qthread.cpp100
-rw-r--r--src/corelib/thread/qthread.h9
-rw-r--r--src/corelib/thread/qthread_p.h52
-rw-r--r--src/corelib/thread/qthread_unix.cpp97
-rw-r--r--src/corelib/tools/qalgorithms.h2
-rw-r--r--src/corelib/tools/qbytearray.h20
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qhash.h8
-rw-r--r--src/corelib/tools/qlocale.cpp798
-rw-r--r--src/corelib/tools/qmap.h8
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h22
-rw-r--r--src/corelib/tools/qtextboundaryfinder.cpp2
-rw-r--r--src/corelib/tools/tools.pri5
-rw-r--r--src/gui/dialogs/dialogs.pri6
-rw-r--r--src/gui/dialogs/qdialog.cpp28
-rw-r--r--src/gui/dialogs/qfiledialog.cpp22
-rw-r--r--src/gui/dialogs/qfiledialog_embedded.ui (renamed from src/gui/dialogs/qfiledialog_wince.ui)0
-rw-r--r--src/gui/dialogs/qfiledialog_p.h6
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp37
-rw-r--r--src/gui/dialogs/qmessagebox.cpp2
-rw-r--r--src/gui/gui.pro3
-rw-r--r--src/gui/image/image.pri3
-rw-r--r--src/gui/image/qpixmap.cpp7
-rw-r--r--src/gui/image/qpixmap_s60.cpp74
-rw-r--r--src/gui/image/qpixmapcache.cpp4
-rw-r--r--src/gui/image/qpixmapdatafactory.cpp4
-rw-r--r--src/gui/inputmethod/inputmethod.pri5
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h118
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp734
-rw-r--r--src/gui/inputmethod/qinputcontext.cpp50
-rw-r--r--src/gui/inputmethod/qinputcontext.h8
-rw-r--r--src/gui/inputmethod/qinputcontextfactory.cpp23
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp1
-rw-r--r--src/gui/itemviews/qcolumnview_p.h2
-rw-r--r--src/gui/itemviews/qdirmodel.cpp17
-rw-r--r--src/gui/itemviews/qheaderview.cpp2
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp4
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp2
-rw-r--r--src/gui/kernel/kernel.pri21
-rw-r--r--src/gui/kernel/qapplication.cpp103
-rw-r--r--src/gui/kernel/qapplication.h19
-rw-r--r--src/gui/kernel/qapplication_p.h11
-rw-r--r--src/gui/kernel/qapplication_s60.cpp1096
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp247
-rw-r--r--src/gui/kernel/qcursor.cpp3
-rw-r--r--src/gui/kernel/qcursor_s60.cpp30
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp125
-rw-r--r--src/gui/kernel/qdnd_s60.cpp365
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp94
-rw-r--r--src/gui/kernel/qeventdispatcher_s60_p.h66
-rw-r--r--src/gui/kernel/qkeymapper_p.h8
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp217
-rw-r--r--src/gui/kernel/qsound.cpp3
-rw-r--r--src/gui/kernel/qsound_s60.cpp175
-rw-r--r--src/gui/kernel/qt_s60_p.h251
-rw-r--r--src/gui/kernel/qwidget.cpp74
-rw-r--r--src/gui/kernel/qwidget.h9
-rw-r--r--src/gui/kernel/qwidget_p.h24
-rw-r--r--src/gui/kernel/qwidget_s60.cpp977
-rw-r--r--src/gui/kernel/qwindowdefs.h5
-rw-r--r--src/gui/painting/painting.pri26
-rw-r--r--src/gui/painting/qblendfunctions_armv6_rvct.s223
-rw-r--r--src/gui/painting/qdrawhelper.cpp288
-rw-r--r--src/gui/painting/qdrawhelper_armv6_p.h81
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.inc496
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.s178
-rw-r--r--src/gui/painting/qdrawhelper_p.h95
-rw-r--r--src/gui/painting/qgraphicssystem.cpp4
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-rw-r--r--src/gui/painting/qgrayraster.c5
-rw-r--r--src/gui/painting/qpaintdevice_s60.cpp42
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp16
-rw-r--r--src/gui/painting/qpathclipper_p.h7
-rw-r--r--src/gui/painting/qregion.h4
-rw-r--r--src/gui/painting/qregion_s60.cpp22
-rw-r--r--src/gui/painting/qtessellator.cpp3
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp204
-rw-r--r--src/gui/painting/qwindowsurface_s60_p.h65
-rw-r--r--src/gui/styles/qs60style.cpp2786
-rw-r--r--src/gui/styles/qs60style.h83
-rw-r--r--src/gui/styles/qs60style_p.h433
-rw-r--r--src/gui/styles/qs60style_simulated.cpp294
-rw-r--r--src/gui/styles/qs60style_symbian.cpp1355
-rw-r--r--src/gui/styles/qstyle_s60_simulated.qrc6
-rw-r--r--src/gui/styles/qstylefactory.cpp12
-rw-r--r--src/gui/styles/qstylesheetstyle_default.cpp7
-rw-r--r--src/gui/styles/styles.pri17
-rw-r--r--src/gui/text/qabstractfontengine_p.h2
-rw-r--r--src/gui/text/qcssparser.cpp5
-rw-r--r--src/gui/text/qfont.cpp14
-rw-r--r--src/gui/text/qfont_s60.cpp64
-rw-r--r--src/gui/text/qfontdatabase.cpp181
-rw-r--r--src/gui/text/qfontdatabase.h3
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp109
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp348
-rw-r--r--src/gui/text/qfontengine.cpp14
-rw-r--r--src/gui/text/qfontengine_ft_p.h2
-rw-r--r--src/gui/text/qfontengine_p.h17
-rw-r--r--src/gui/text/qfontengine_s60.cpp309
-rw-r--r--src/gui/text/qfontengine_s60_p.h116
-rw-r--r--src/gui/text/qtextcontrol.cpp2
-rw-r--r--src/gui/text/text.pri33
-rw-r--r--src/gui/util/qcompleter.cpp15
-rw-r--r--src/gui/util/qdesktopservices.cpp7
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp359
-rw-r--r--src/gui/util/util.pri5
-rw-r--r--src/gui/widgets/qabstractslider.cpp3
-rw-r--r--src/gui/widgets/qcombobox.cpp5
-rw-r--r--src/gui/widgets/qlineedit.cpp23
-rw-r--r--src/gui/widgets/qlineedit_p.h4
-rw-r--r--src/gui/widgets/qmenu.cpp27
-rw-r--r--src/gui/widgets/qmenu.h12
-rw-r--r--src/gui/widgets/qmenu_p.h43
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp392
-rw-r--r--src/gui/widgets/qmenubar.cpp38
-rw-r--r--src/gui/widgets/qmenubar.h4
-rw-r--r--src/gui/widgets/qmenubar_p.h44
-rw-r--r--src/gui/widgets/widgets.pri4
-rw-r--r--src/network/access/qnetworkcookie.cpp37
-rw-r--r--src/network/access/qnetworkcookie.h4
-rw-r--r--src/network/access/qnetworkrequest.cpp12
-rw-r--r--src/network/access/qnetworkrequest.h4
-rw-r--r--src/network/kernel/kernel.pri3
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp2
-rw-r--r--src/network/kernel/qnetworkinterface.cpp5
-rw-r--r--src/network/kernel/qnetworkinterface_symbian.cpp173
-rw-r--r--src/network/network.pro14
-rw-r--r--src/network/socket/qabstractsocket.cpp3
-rw-r--r--src/network/socket/qlocalserver_unix.cpp18
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp18
-rw-r--r--src/network/socket/qnativesocketengine.cpp11
-rw-r--r--src/network/socket/qnativesocketengine_p.h149
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp163
-rw-r--r--src/network/socket/qsocks5socketengine.cpp4
-rw-r--r--src/network/socket/qudpsocket.cpp20
-rw-r--r--src/network/socket/socket.pri2
-rw-r--r--src/network/ssl/qsslerror.cpp17
-rw-r--r--src/network/ssl/qsslerror.h8
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h4
-rw-r--r--src/network/ssl/ssl.pri12
-rw-r--r--src/phonon/phonon.pro13
-rw-r--r--src/plugins/codecs/cn/cn.pro2
-rw-r--r--src/plugins/codecs/jp/jp.pro2
-rw-r--r--src/plugins/codecs/kr/kr.pro2
-rw-r--r--src/plugins/codecs/tw/tw.pro2
-rw-r--r--src/plugins/iconengines/svgiconengine/svgiconengine.pro2
-rw-r--r--src/plugins/imageformats/gif/gif.pro2
-rw-r--r--src/plugins/imageformats/ico/ico.pro2
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro2
-rw-r--r--src/plugins/imageformats/mng/mng.pro2
-rw-r--r--src/plugins/imageformats/svg/svg.pro2
-rw-r--r--src/plugins/imageformats/tiff/tiff.pro5
-rw-r--r--src/plugins/plugins.pro1
-rw-r--r--src/plugins/qpluginbase.pri5
-rw-r--r--src/plugins/s60/3_1/3_1.pro8
-rw-r--r--src/plugins/s60/3_2/3_2.pro15
-rw-r--r--src/plugins/s60/5_0/5_0.pro15
-rw-r--r--src/plugins/s60/bwins/qts60pluginu.def7
-rw-r--r--src/plugins/s60/eabi/qts60pluginu.def7
-rw-r--r--src/plugins/s60/s60.pro3
-rw-r--r--src/plugins/s60/s60pluginbase.pri15
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_1.cpp20
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp37
-rw-r--r--src/plugins/s60/src/qlocale_3_1.cpp32
-rw-r--r--src/plugins/s60/src/qlocale_3_2.cpp32
-rw-r--r--src/plugins/sqldrivers/sqldrivers.pro4
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zipbin0 -> 3155605 bytes
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro8
-rw-r--r--src/qbase.pri8
-rw-r--r--src/s60installs/qt.iby94
-rw-r--r--src/s60installs/qt_libs.pro75
-rw-r--r--src/s60installs/qtdemoapps.iby15
-rw-r--r--src/s60installs/qtvggraphicssystem.iby9
-rw-r--r--src/s60main/qts60main.cpp32
-rw-r--r--src/s60main/qts60main_mcrt0.cpp77
-rw-r--r--src/s60main/qts60mainapplication.cpp61
-rw-r--r--src/s60main/qts60mainapplication.h64
-rw-r--r--src/s60main/qts60mainappui.cpp158
-rw-r--r--src/s60main/qts60mainappui.h99
-rw-r--r--src/s60main/qts60maindocument.cpp87
-rw-r--r--src/s60main/qts60maindocument.h93
-rw-r--r--src/s60main/s60main.pro55
-rw-r--r--src/s60main/s60main.rss56
-rw-r--r--src/script/qscriptengine_p.cpp2
-rw-r--r--src/script/qscriptvalueimplfwd_p.h23
-rw-r--r--src/script/script.pro2
-rw-r--r--src/sql/kernel/qsqlfield.cpp11
-rw-r--r--src/sql/kernel/qsqlfield.h6
-rw-r--r--src/sql/kernel/qsqlresult.cpp4
-rw-r--r--src/sql/sql.pro8
-rw-r--r--src/src.pro16
-rw-r--r--src/svg/svg.pro2
-rw-r--r--src/testlib/3rdparty/cycle_p.h17
-rw-r--r--src/testlib/qbenchmark.cpp1
-rw-r--r--src/testlib/qplaintestlogger.cpp10
-rw-r--r--src/testlib/qtest_global.h5
-rw-r--r--src/testlib/qtestcase.cpp7
-rw-r--r--src/testlib/qtestcase.h65
-rw-r--r--src/testlib/testlib.pro2
-rw-r--r--src/tools/bootstrap/bootstrap.pri2
-rw-r--r--src/tools/moc/preprocessor.cpp7
-rw-r--r--src/xml/sax/qxml.cpp4
-rw-r--r--src/xml/xml.pro2
-rw-r--r--src/xmlpatterns/data/qabstractfloatcasters.cpp10
-rw-r--r--src/xmlpatterns/data/qschemanumeric.cpp3
-rw-r--r--src/xmlpatterns/functions/qcomparingaggregator.cpp7
-rw-r--r--src/xmlpatterns/functions/qsequencefns_p.h15
-rw-r--r--tests/arthur/common/paintcommands.cpp7
-rw-r--r--tests/arthur/common/paintcommands.h2
-rw-r--r--tests/arthur/common/qengines.cpp8
-rw-r--r--tests/arthur/common/qengines.h3
-rw-r--r--tests/arthur/lance/lance.pro8
-rw-r--r--tests/arthur/lance/main.cpp7
-rw-r--r--tests/auto/JoinResults.py66
-rw-r--r--tests/auto/_Categories/Qt3Support.txt51
-rw-r--r--tests/auto/_Categories/QtCore.txt105
-rw-r--r--tests/auto/_Categories/QtDBus.txt15
-rw-r--r--tests/auto/_Categories/QtGui.txt191
-rw-r--r--tests/auto/_Categories/QtHelp.txt5
-rw-r--r--tests/auto/_Categories/QtNetwork.txt29
-rw-r--r--tests/auto/_Categories/QtOpenGl.txt1
-rw-r--r--tests/auto/_Categories/QtScript.txt13
-rw-r--r--tests/auto/_Categories/QtSql.txt11
-rw-r--r--tests/auto/_Categories/QtSvg.txt3
-rw-r--r--tests/auto/_Categories/QtTest.txt1
-rw-r--r--tests/auto/_Categories/QtWebkit.txt2
-rw-r--r--tests/auto/_Categories/QtXml.txt5
-rw-r--r--tests/auto/_Categories/QtXmlPatterns.txt27
-rw-r--r--tests/auto/_Categories/all_categories.txt16
-rw-r--r--tests/auto/_Categories/phonon.txt2
-rw-r--r--tests/auto/_Categories/qmake.txt0
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/autobuildruncategory.bat11
-rw-r--r--tests/auto/autobuildrunsingle.bat71
-rw-r--r--tests/auto/autobuildtests.bat19
-rw-r--r--tests/auto/autobuildtestsmain.bat38
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/collections/collections.pro4
-rw-r--r--tests/auto/compilecategory.bat4
-rw-r--r--tests/auto/compilerwarnings/compilerwarnings.pro1
-rw-r--r--tests/auto/compilesingle.bat28
-rw-r--r--tests/auto/exceptionsafety/exceptionsafety.pro2
-rw-r--r--tests/auto/headers/headers.pro2
-rw-r--r--tests/auto/languagechange/tst_languagechange.cpp20
-rw-r--r--tests/auto/network-settings.h264
-rw-r--r--tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro1
-rw-r--r--tests/auto/patternistexamples/patternistexamples.pro2
-rw-r--r--tests/auto/patternistheaders/patternistheaders.pro1
-rw-r--r--tests/auto/q3urloperator/copy.res/.gitattributes1
-rw-r--r--tests/auto/q_func_info/q_func_info.pro2
-rw-r--r--tests/auto/q_func_info/tst_q_func_info.cpp2
-rw-r--r--tests/auto/qabstractitemmodel/qabstractitemmodel.pro5
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp13
-rw-r--r--tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro1
-rw-r--r--tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro2
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp12
-rw-r--r--tests/auto/qabstracturiresolver/qabstracturiresolver.pro1
-rw-r--r--tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro1
-rw-r--r--tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro1
-rw-r--r--tests/auto/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro9
-rw-r--r--tests/auto/qapplication/test/test.pro8
-rw-r--r--tests/auto/qapplication/tst_qapplication.cpp56
-rw-r--r--tests/auto/qatomicint/qatomicint.pro3
-rw-r--r--tests/auto/qatomicpointer/qatomicpointer.pro2
-rw-r--r--tests/auto/qautoptr/qautoptr.pro2
-rw-r--r--tests/auto/qbitarray/qbitarray.pro4
-rw-r--r--tests/auto/qbitarray/tst_qbitarray.cpp1
-rw-r--r--tests/auto/qbuffer/qbuffer.pro4
-rw-r--r--tests/auto/qbytearray/.gitattributes1
-rw-r--r--tests/auto/qbytearray/qbytearray.pro7
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp20
-rw-r--r--tests/auto/qcache/qcache.pro4
-rw-r--r--tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp2
-rw-r--r--tests/auto/qchar/qchar.pro2
-rw-r--r--tests/auto/qclipboard/test/test.pro2
-rw-r--r--tests/auto/qclipboard/tst_qclipboard.cpp6
-rw-r--r--tests/auto/qcolumnview/tst_qcolumnview.cpp2
-rw-r--r--tests/auto/qcombobox/qcombobox.pro2
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp13
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp39
-rw-r--r--tests/auto/qcoreapplication/qcoreapplication.pro3
-rw-r--r--tests/auto/qcryptographichash/qcryptographichash.pro6
-rw-r--r--tests/auto/qcssparser/qcssparser.pro7
-rw-r--r--tests/auto/qcssparser/tst_cssparser.cpp4
-rw-r--r--tests/auto/qdatastream/qdatastream.pro11
-rw-r--r--tests/auto/qdatastream/tst_qdatastream.cpp39
-rw-r--r--tests/auto/qdate/qdate.pro4
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp14
-rw-r--r--tests/auto/qdebug/qdebug.pro4
-rw-r--r--tests/auto/qdesktopservices/qdesktopservices.pro25
-rw-r--r--tests/auto/qdesktopservices/tst_qdesktopservices.cpp203
-rw-r--r--tests/auto/qdir/qdir.pro9
-rw-r--r--tests/auto/qdir/tst_qdir.cpp116
-rw-r--r--tests/auto/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp7
-rw-r--r--tests/auto/qdirmodel/qdirmodel.pro11
-rw-r--r--tests/auto/qdirmodel/tst_qdirmodel.cpp28
-rw-r--r--tests/auto/qdom/qdom.pro4
-rw-r--r--tests/auto/qevent/qevent.pro3
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp371
-rw-r--r--tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro2
-rw-r--r--tests/auto/qfile/test/test.pro42
-rw-r--r--tests/auto/qfile/tst_qfile.cpp66
-rw-r--r--tests/auto/qfiledialog/qfiledialog.pro7
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp18
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro3
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp50
-rw-r--r--tests/auto/qfilesystemmodel/qfilesystemmodel.pro9
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp47
-rw-r--r--tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro2
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp5
-rw-r--r--tests/auto/qflags/qflags.pro3
-rw-r--r--tests/auto/qfontdatabase/qfontdatabase.pro4
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp12
-rw-r--r--tests/auto/qftp/.gitattributes2
-rw-r--r--tests/auto/qftp/qftp.pro5
-rw-r--r--tests/auto/qftp/tst_qftp.cpp34
-rw-r--r--tests/auto/qgetputenv/qgetputenv.pro4
-rw-r--r--tests/auto/qglobal/qglobal.pro3
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro9
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp10
-rw-r--r--tests/auto/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp4
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp84
-rw-r--r--tests/auto/qhash/qhash.pro7
-rw-r--r--tests/auto/qhash/tst_qhash.cpp8
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp20
-rw-r--r--tests/auto/qhttp/qhttp.pro8
-rw-r--r--tests/auto/qhttp/tst_qhttp.cpp279
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp28
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp35
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro7
-rw-r--r--tests/auto/qicoimageformat/tst_qticoimageformat.cpp6
-rw-r--r--tests/auto/qicon/qicon.pro7
-rw-r--r--tests/auto/qicon/tst_qicon.cpp7
-rw-r--r--tests/auto/qimage/qimage.pro7
-rw-r--r--tests/auto/qimage/tst_qimage.cpp20
-rw-r--r--tests/auto/qimagereader/qimagereader.pro10
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp4
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro8
-rw-r--r--tests/auto/qimagewriter/tst_qimagewriter.cpp13
-rw-r--r--tests/auto/qinputcontext/qinputcontext.pro2
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp195
-rw-r--r--tests/auto/qiodevice/qiodevice.pro5
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp9
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro2
-rw-r--r--tests/auto/qitemview/tst_qitemview.cpp9
-rw-r--r--tests/auto/qkeyevent/tst_qkeyevent.cpp59
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp2
-rw-r--r--tests/auto/qlabel/qlabel.pro7
-rw-r--r--tests/auto/qlabel/tst_qlabel.cpp3
-rw-r--r--tests/auto/qlayout/qlayout.pro2
-rw-r--r--tests/auto/qlibrary/lib/lib.pro3
-rw-r--r--tests/auto/qlibrary/lib/mylib.c4
-rw-r--r--tests/auto/qlibrary/lib2/lib2.pro19
-rw-r--r--tests/auto/qlibrary/lib2/mylib.c4
-rw-r--r--tests/auto/qlibrary/qlibrary.pro1
-rw-r--r--tests/auto/qlibrary/tst/tst.pro12
-rw-r--r--tests/auto/qlibrary/tst_qlibrary.cpp69
-rw-r--r--tests/auto/qline/qline.pro6
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp6
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/qlocale/test/test.pro1
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp87
-rw-r--r--tests/auto/qlocalsocket/lackey/main.cpp2
-rw-r--r--tests/auto/qlocalsocket/qlocalsocket.pro2
-rw-r--r--tests/auto/qlocalsocket/test/test.pro11
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp90
-rw-r--r--tests/auto/qmainwindow/qmainwindow.pro3
-rw-r--r--tests/auto/qmap/qmap.pro4
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp9
-rw-r--r--tests/auto/qmenubar/qmenubar.pro2
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp4
-rw-r--r--tests/auto/qmetatype/qmetatype.pro3
-rw-r--r--tests/auto/qmouseevent/tst_qmouseevent.cpp6
-rw-r--r--tests/auto/qmovie/qmovie.pro10
-rw-r--r--tests/auto/qmultiscreen/qmultiscreen.pro4
-rw-r--r--tests/auto/qmutex/qmutex.pro2
-rw-r--r--tests/auto/qmutexlocker/qmutexlocker.pro2
-rw-r--r--tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp29
-rw-r--r--tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp7
-rw-r--r--tests/auto/qnetworkreply/.gitattributes5
-rw-r--r--tests/auto/qnetworkreply/echo/echo.pro2
-rw-r--r--tests/auto/qnetworkreply/test/test.pro16
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp84
-rw-r--r--tests/auto/qnumeric/qnumeric.pro3
-rw-r--r--tests/auto/qobject/tst_qobject.cpp15
-rw-r--r--tests/auto/qobject/tst_qobject.pro6
-rw-r--r--tests/auto/qobjectrace/qobjectrace.pro3
-rw-r--r--tests/auto/qpainter/qpainter.pro9
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp13
-rw-r--r--tests/auto/qpathclipper/qpathclipper.pro2
-rw-r--r--tests/auto/qpixmap/qpixmap.pro11
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp17
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp27
-rw-r--r--tests/auto/qplugin/debugplugin/debugplugin.pro4
-rw-r--r--tests/auto/qplugin/qplugin.pro1
-rw-r--r--tests/auto/qplugin/releaseplugin/releaseplugin.pro4
-rw-r--r--tests/auto/qplugin/tst_qplugin.pro8
-rw-r--r--tests/auto/qpluginloader/lib/lib.pro3
-rw-r--r--tests/auto/qpluginloader/qpluginloader.pro3
-rw-r--r--tests/auto/qpluginloader/theplugin/theplugin.pro4
-rw-r--r--tests/auto/qpluginloader/tst/tst.pro10
-rw-r--r--tests/auto/qpluginloader/tst_qpluginloader.cpp13
-rw-r--r--tests/auto/qpoint/qpoint.pro5
-rw-r--r--tests/auto/qpointarray/qpointarray.pro2
-rw-r--r--tests/auto/qprocess/qprocess.pro9
-rw-r--r--tests/auto/qprocess/test/test.pro21
-rw-r--r--tests/auto/qprocess/testDetached/testDetached.pro3
-rw-r--r--tests/auto/qprocess/testProcessOutput/main.cpp18
-rw-r--r--tests/auto/qprocess/testProcessSpacesArgs/main.cpp12
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp277
-rw-r--r--tests/auto/qqueue/qqueue.pro3
-rw-r--r--tests/auto/qrand/qrand.pro2
-rw-r--r--tests/auto/qreadlocker/qreadlocker.pro2
-rw-r--r--tests/auto/qreadwritelock/qreadwritelock.pro2
-rw-r--r--tests/auto/qrect/qrect.pro2
-rw-r--r--tests/auto/qrect/tst_qrect.cpp320
-rw-r--r--tests/auto/qregexp/qregexp.pro3
-rw-r--r--tests/auto/qregexp/tst_qregexp.cpp4
-rw-r--r--tests/auto/qregion/tst_qregion.cpp4
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro8
-rw-r--r--tests/auto/qresourceengine/tst_resourceengine.cpp4
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro5
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp6
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro4
-rw-r--r--tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp2
-rw-r--r--tests/auto/qscriptqobject/qscriptqobject.pro4
-rw-r--r--tests/auto/qscriptqobject/tst_qscriptqobject.cpp6
-rw-r--r--tests/auto/qset/qset.pro7
-rw-r--r--tests/auto/qsettings/.gitattributes5
-rw-r--r--tests/auto/qsettings/tst_qsettings.cpp24
-rw-r--r--tests/auto/qsharedmemory/lackey/scripts/producer.js8
-rw-r--r--tests/auto/qsharedmemory/src/qsystemlock_p.h1
-rw-r--r--tests/auto/qsharedmemory/src/qsystemlock_unix.cpp24
-rw-r--r--tests/auto/qsharedmemory/test/test.pro10
-rw-r--r--tests/auto/qsharedmemory/tst_qsharedmemory.cpp32
-rw-r--r--tests/auto/qsharedpointer/externaltests.cpp4
-rw-r--r--tests/auto/qsharedpointer/externaltests.pri3
-rw-r--r--tests/auto/qsharedpointer/qsharedpointer.pro2
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp4
-rw-r--r--tests/auto/qsidebar/qsidebar.pro2
-rw-r--r--tests/auto/qsignalspy/qsignalspy.pro3
-rw-r--r--tests/auto/qsize/qsize.pro4
-rw-r--r--tests/auto/qsizef/qsizef.pro3
-rw-r--r--tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp92
-rw-r--r--tests/auto/qsocks5socketengine/qsocks5socketengine.pro2
-rw-r--r--tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp54
-rw-r--r--tests/auto/qsound/qsound.pro2
-rw-r--r--tests/auto/qsplitter/qsplitter.pro2
-rw-r--r--tests/auto/qsql/qsql.pro8
-rw-r--r--tests/auto/qsqldatabase/qsqldatabase.pro11
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp1
-rw-r--r--tests/auto/qsqlerror/qsqlerror.pro8
-rw-r--r--tests/auto/qsqlfield/qsqlfield.pro8
-rw-r--r--tests/auto/qsqlquery/qsqlquery.pro8
-rw-r--r--tests/auto/qsqlquerymodel/qsqlquerymodel.pro8
-rw-r--r--tests/auto/qsqlrecord/qsqlrecord.pro10
-rw-r--r--tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro8
-rw-r--r--tests/auto/qsqltablemodel/qsqltablemodel.pro8
-rw-r--r--tests/auto/qsqlthread/qsqlthread.pro8
-rw-r--r--tests/auto/qsslcertificate/qsslcertificate.pro11
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp6
-rw-r--r--tests/auto/qsslcipher/qsslcipher.pro2
-rw-r--r--tests/auto/qsslerror/qsslerror.pro2
-rw-r--r--tests/auto/qsslkey/qsslkey.pro9
-rw-r--r--tests/auto/qsslkey/tst_qsslkey.cpp8
-rw-r--r--tests/auto/qsslsocket/certs/aspiriniks.ca.crt22
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro8
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp117
-rw-r--r--tests/auto/qstandarditem/tst_qstandarditem.cpp4
-rw-r--r--tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp4
-rw-r--r--tests/auto/qstl/qstl.pro4
-rw-r--r--tests/auto/qstring/qstring.pro5
-rw-r--r--tests/auto/qstring/tst_qstring.cpp312
-rw-r--r--tests/auto/qstringlist/qstringlist.pro4
-rw-r--r--tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp1
-rw-r--r--tests/auto/qstyle/qstyle.pro7
-rw-r--r--tests/auto/qstyle/tst_qstyle.cpp114
-rw-r--r--tests/auto/qsvggenerator/qsvggenerator.pro7
-rw-r--r--tests/auto/qsvggenerator/tst_qsvggenerator.cpp4
-rw-r--r--tests/auto/qsvgrenderer/qsvgrenderer.pro2
-rw-r--r--tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp2
-rw-r--r--tests/auto/qsysinfo/qsysinfo.pro1
-rw-r--r--tests/auto/qsystemsemaphore/test/test.pro11
-rw-r--r--tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp14
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/qtableview/qtableview.pro2
-rw-r--r--tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp2
-rw-r--r--tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp2
-rw-r--r--tests/auto/qtcpserver/crashingServer/main.cpp8
-rw-r--r--tests/auto/qtcpserver/test/test.pro6
-rw-r--r--tests/auto/qtcpserver/tst_qtcpserver.cpp40
-rw-r--r--tests/auto/qtcpsocket/qtcpsocket.pro2
-rw-r--r--tests/auto/qtcpsocket/test/test.pro4
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp79
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp4
-rw-r--r--tests/auto/qtextblock/tst_qtextblock.cpp2
-rw-r--r--tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro5
-rw-r--r--tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp3
-rw-r--r--tests/auto/qtextbrowser/qtextbrowser.pro4
-rw-r--r--tests/auto/qtextbrowser/tst_qtextbrowser.cpp13
-rw-r--r--tests/auto/qtextcodec/test/test.pro2
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp5
-rw-r--r--tests/auto/qtextedit/qtextedit.pro9
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp33
-rw-r--r--tests/auto/qtextlayout/qtextlayout.pro3
-rw-r--r--tests/auto/qtextodfwriter/qtextodfwriter.pro4
-rw-r--r--tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp4
-rw-r--r--tests/auto/qtextstream/test/test.pro11
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp26
-rw-r--r--tests/auto/qthread/qthread.pro3
-rw-r--r--tests/auto/qthread/tst_qthread.cpp2
-rw-r--r--tests/auto/qthreadstorage/qthreadstorage.pro3
-rw-r--r--tests/auto/qtime/qtime.pro3
-rw-r--r--tests/auto/qtimeline/qtimeline.pro3
-rw-r--r--tests/auto/qtimer/qtimer.pro3
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp53
-rw-r--r--tests/auto/qtransform/qtransform.pro2
-rw-r--r--tests/auto/qtransformedscreen/qtransformedscreen.pro1
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp12
-rw-r--r--tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp10
-rw-r--r--tests/auto/qtwidgets/qtwidgets.pro1
-rw-r--r--tests/auto/qudpsocket/test/test.pro2
-rw-r--r--tests/auto/qudpsocket/tst_qudpsocket.cpp105
-rw-r--r--tests/auto/qudpsocket/udpServer/udpServer.pro1
-rw-r--r--tests/auto/qurl/qurl.pro5
-rw-r--r--tests/auto/quuid/quuid.pro3
-rw-r--r--tests/auto/qvariant/qvariant.pro1
-rw-r--r--tests/auto/qvarlengtharray/qvarlengtharray.pro3
-rw-r--r--tests/auto/qvector/qvector.pro4
-rw-r--r--tests/auto/qwaitcondition/tst_qwaitcondition.cpp133
-rw-r--r--tests/auto/qwidget/qwidget.pro6
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp92
-rw-r--r--tests/auto/qwindowsurface/tst_qwindowsurface.cpp2
-rw-r--r--tests/auto/qwineventnotifier/qwineventnotifier.pro3
-rw-r--r--tests/auto/qwizard/qwizard.pro1
-rw-r--r--tests/auto/qwmatrix/qwmatrix.pro2
-rw-r--r--tests/auto/qwritelocker/qwritelocker.pro2
-rw-r--r--tests/auto/qwsembedwidget/qwsembedwidget.pro4
-rw-r--r--tests/auto/qwsinputmethod/qwsinputmethod.pro4
-rw-r--r--tests/auto/qwswindowsystem/qwswindowsystem.pro4
-rw-r--r--tests/auto/qxml/qxml.pro2
-rw-r--r--tests/auto/qxmlformatter/qxmlformatter.pro2
-rw-r--r--tests/auto/qxmlquery/qxmlquery.pro2
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp1
-rw-r--r--tests/auto/qxmlsimplereader/qxmlsimplereader.pro4
-rw-r--r--tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp8
-rw-r--r--tests/auto/qxmlstream/qxmlstream.pro2
-rw-r--r--tests/auto/qzip/qzip.pro4
-rw-r--r--tests/auto/qzip/tst_qzip.cpp4
-rw-r--r--tests/auto/symbian/qmainexceptions/qmainexceptions.pro5
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp108
-rw-r--r--tests/auto/symbian/qsymbiantests.pro2
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp2
-rw-r--r--tests/benchmarks/qfile/main.cpp5
-rw-r--r--tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp2
-rwxr-xr-xtests/benchmarks/qiodevice/main.cpp2
-rwxr-xr-xtests/benchmarks/qiodevice/qiodevice.pro1
-rw-r--r--tools/configure/configure.pro5
-rw-r--r--tools/configure/configureapp.cpp204
-rw-r--r--tools/designer/src/lib/uilib/abstractformbuilder.cpp189
-rw-r--r--translations/qt_ja_JP.qmbin64337 -> 0 bytes
-rw-r--r--util/s60pixelmetrics/bld.inf45
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp1223
-rw-r--r--util/s60pixelmetrics/pixel_metrics.h216
-rw-r--r--util/s60pixelmetrics/pm_mapper.hrh73
-rw-r--r--util/s60pixelmetrics/pm_mapper.mmp91
-rw-r--r--util/s60pixelmetrics/pm_mapper.pkg32
-rw-r--r--util/s60pixelmetrics/pm_mapper.rss162
-rw-r--r--util/s60pixelmetrics/pm_mapper_reg.rss57
-rw-r--r--util/s60pixelmetrics/pm_mapperapp.cpp1044
-rw-r--r--util/s60pixelmetrics/pm_mapperapp.h198
-rw-r--r--util/s60pixelmetrics/pm_mapperview.cpp375
-rw-r--r--util/s60pixelmetrics/pm_mapperview.h228
1056 files changed, 43529 insertions, 2551 deletions
diff --git a/.gitignore b/.gitignore
index 0de9563f2b..4c2ba32e8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,8 @@ tags
.DS_Store
*.debug
Makefile*
+!qmake/Makefile.win32*
+!qmake/Makefile.unix
*.prl
*.app
*.pro.user
@@ -64,6 +66,7 @@ bin/qhelpconverter*
bin/qhelpgenerator*
bin/qtconfig*
bin/xmlpatterns*
+bin/cetest*
bin/collectiongenerator
bin/helpconverter
bin/helpgenerator
@@ -169,6 +172,31 @@ doc/qch
doc-build
.rcc
.pch
+
+# Symbian build system generated files
+# ---------------------
+
+ABLD.BAT
+bld.inf
+*.mmp
+*.mk
+*.rss
+*.loc
+!s60main.rss
+*.pkg
+plugin_commonU.def
+*.qtplugin
+*.sis
+*.sisx
+
+# Generated by abldfast.bat from devtools.
+.abldsteps.*
+
+# Carbide project files
+# ---------------------
+.project
+.cproject
+
src/corelib/lib
src/network/lib
src/xml/lib/
diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl
new file mode 100644
index 0000000000..0a350623da
--- /dev/null
+++ b/bin/build_release_package.pl
@@ -0,0 +1,205 @@
+#######################################################################
+#
+# A script for creating binary release package
+#
+# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+# Contact: Qt Software Information (qt-info@nokia.com)
+#
+#######################################################################
+
+use Cwd;
+
+if (@ARGV)
+{
+ my $platform = shift(@ARGV);
+ my $build = shift(@ARGV);
+ my $cert = shift(@ARGV);
+ my $certKey = shift(@ARGV);
+ my $releaseDir = shift(@ARGV);
+ my $epocroot = shift(@ARGV);
+
+ if ($build eq "")
+ {
+ print("HW build parameter required!\n");
+ exit;
+ }
+
+ if ($cert eq "")
+ {
+ print("Signing certificate parameter required!\n");
+ exit;
+ }
+
+ if ($certKey eq "")
+ {
+ print("Signing certificate key parameter required!\n");
+ exit;
+ }
+
+ if ($releaseDir eq "")
+ {
+ print("Release directory parameter required!\n");
+ exit;
+ }
+
+ if ($epocroot eq "")
+ {
+ $epocroot = "\\";
+ }
+
+ if ($epocroot =~ m/.*[^\\]$/)
+ {
+ $epocroot = "${epocroot}\\";
+ }
+
+ $epocroot =~ s/.://;
+
+ my $releaseDirQt = "${releaseDir}\\qt";
+ my $releaseDirEpocroot = "${releaseDir}\\epocroot";
+ my $releaseDirSis = "${releaseDir}\\sis";
+
+ my $qtRootDir = cwd();
+ $qtRootDir =~ s/\//\\/g; # Fix dir separators
+
+ my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching
+ $qtRootDirForMatch =~ s/\\/\\\\/;
+
+ my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg";
+
+ my $hwBuildDir = "${epocroot}epoc32\\release\\$platform\\$build";
+ my $armDbgDir = "epoc32\\release\\armv5\\udeb";
+ my $armRelDir = "epoc32\\release\\armv5\\urel";
+ my $gcceDbgDir = "epoc32\\release\\gcce\\udeb";
+ my $gcceRelDir = "epoc32\\release\\gcce\\urel";
+ my $armLibDir = "epoc32\\release\\armv5\\lib";
+ my $winscwDbgDir = "epoc32\\release\\winscw\\udeb";
+
+ # clean up old stuff
+ system("rd /S /Q ${releaseDir} 2> NUL");
+ system("rd /S /Q ${epocroot}epoc32\\build 2> NUL"); # Just in case env is not clean
+
+ # Copy the whole thing over to the release dir before it gets polluted
+ print("Copying clean tree...\n");
+ my $tempExcludeFile = "${releaseDir}\\__temp_exclude.txt";
+ system("mkdir ${releaseDir} 2>NUL");
+ runSystemCmd("echo \\.git\\ > ${tempExcludeFile}");
+ runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q /EXCLUDE:${tempExcludeFile}");
+ system("del /F /Q ${tempExcludeFile} 2> NUL");
+
+ # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib
+ # as those will have the binaries used for all platforms and builds.
+ runSystemCmd("attrib -A ${hwBuildDir}\\*");
+ runSystemCmd("attrib -A ${epocroot}${armLibDir}\\*");
+ runSystemCmd("attrib -A ${epocroot}${winscwDbgDir}\\*");
+
+ # Build Qt
+ runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer");
+ chdir("src");
+ runSystemCmd("qmake");
+ runSystemCmd("bldmake bldfiles");
+ runSystemCmd("abld build ${platform} ${build}");
+ runSystemCmd("abld build winscw udeb");
+ chdir($qtRootDir);
+
+ # Copy misc stuff
+ runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D");
+ runSystemCmd("xcopy ${qtRootDir}\\lib\\*.prl ${releaseDirQt}\\lib /F /R /Y /I /D /E");
+ runSystemCmd("xcopy ${qtRootDir}\\mkspecs\\* ${releaseDirQt}\\mkspecs /F /R /Y /I /D /E");
+ print("Copying includes...\n");
+ runSystemCmd("xcopy ${qtRootDir}\\include\\* ${releaseDirQt}\\include /F /R /Y /I /D /E /Q");
+ runSystemCmd("copy src\\corelib\\global\\qconfig.h ${releaseDirQt}\\src\\corelib\\global\\qconfig.h");
+ runSystemCmd("copy .qmake.cache ${releaseDirQt}\\.qmake.cache");
+
+ # Copy stuff indicated by pkg file for emulator
+ open (PKG, "<".$pkgFileName);
+ while (<PKG>)
+ {
+ my $line = $_;
+ chomp ($line);
+
+ # If the line specifies a file, parse the source and destination locations.
+ if ($line =~ m/\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"/)
+ {
+ my $sourcePath = $1;
+ my $pkgDestinationPath = $2;
+ $sourcePath =~ s/\//\\/g;
+
+ # Copy stuff required for creating deployment package
+ my $destinationPath = $sourcePath;
+
+ if($destinationPath =~ m/($qtRootDirForMatch)/i)
+ {
+ $destinationPath =~ s/($qtRootDirForMatch)//i;
+ $destinationPath = $releaseDirQt.$destinationPath;
+ }
+ else
+ {
+ $destinationPath =~ s/.://;
+ if ($epocroot !~ m/\\/)
+ {
+ $destinationPath =~ s/($epocroot)//i;
+ }
+ $destinationPath = $releaseDirEpocroot.$destinationPath;
+ }
+
+ runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D");
+
+ if ($sourcePath !~ m/\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe))/i)
+ {
+ # Copy non-binaries also over for emulator to use
+ $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g;
+ runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D");
+ }
+ else
+ {
+ # For binaries, copy also winscw versions (needed for deployed binaries that are not actually built)
+ $sourcePath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/;
+ $destinationPath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/;
+ runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D");
+ }
+
+ }
+ }
+ close (PKG);
+
+ # Copy any other binaries and related files built not included in pkg
+ runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D ");
+ runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D");
+ system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL");
+ runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /R /Y /I /D");
+ runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /R /Y /I /D");
+ runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D");
+ runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D");
+
+ # Create unsigned sis and Rnd signed sisx
+ my @pkgPathElements = split(/\\/, $pkgFileName);
+ my $pathlessPkgFile = pop(@pkgPathElements);
+ my @pkgSuffixElements = split(/\./, $pathlessPkgFile);
+ pop(@pkgSuffixElements);
+ my $sisFileName = join("", @pkgSuffixElements).".sis";
+ system("mkdir ${releaseDirSis}");
+ runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}");
+ runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${sisFileName}x ${cert} ${certKey}");
+}
+else
+{
+ print("Usage:\n");
+ print("build_release_package.pl <hw platform> <hw build> <signing cert> <signing cert key> <release directory> [EPOCROOT]\n");
+ print("EPOCROOT is optional, defaults to '\\'\n");
+ print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n");
+ print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\epoc\\root\\]>\"\n");
+ print(" to build Qt and create the release package structure and sis file.\n");
+ print(" Note: Run in the Qt root directory.\n");
+ print("3) Optional: Get the sis signed with commercial certificate\n");
+ print("4) Zip up the release directory contents\n");
+}
+
+sub runSystemCmd
+{
+ my $error_code = system($_[0]);
+ if ($error_code != 0)
+ {
+ print("'$_[0]' call failed: error code == $error_code\n");
+ exit;
+ }
+}
diff --git a/bin/createpackage.bat b/bin/createpackage.bat
new file mode 100644
index 0000000000..1c6e94dc86
--- /dev/null
+++ b/bin/createpackage.bat
@@ -0,0 +1,81 @@
+@echo off
+
+rem Help text
+if "%1"=="" (
+ echo Convenience script for creating signed packages you can install on your phone.
+ echo Usage: createpackage.bat [-i] myexample_armv5_udeb.pkg [certificate key [passphrase]]
+ echo.
+ echo If no certificate and key files are provided, either a RnD certificate or
+ echo a self-signed certificate from Qt installation root directory is used.
+ echo.
+ echo To install the package right away using PC suite, use -i argument.
+ goto done
+)
+
+if "%1"=="-i" (
+ set installsisx=true
+ set pkgfile=%2
+ set basename=%~n2
+ set signsis1=%3
+ set signsis2=%4
+ set signsis3=%5
+) else (
+ set installsisx=false
+ set pkgfile=%1
+ set basename=%~n1
+ set signsis1=%2
+ set signsis2=%3
+ set signsis3=%4
+)
+
+rem Check the .pkg actually exists.
+if not exist %pkgfile% (
+ echo Error: Package description file '%pkgfile%' does not exist.
+ goto done
+)
+
+rem Get absolute path to this script
+set scriptpath=%~dp0
+
+rem Remove any existing .sis or .sisx packages
+if exist %basename%.sis del %basename%.sis
+if exist %basename%.sisx del %basename%.sisx
+
+rem Create .sis package
+makesis %pkgfile%
+
+rem If no certificate is given, check default options
+if x%signsis1% == x (
+ rem If RnD certificate is not found, sign with self signed certificate
+ if not exist %scriptpath%..\rd.cer (
+ set certificate=Self signed
+ signsis %basename%.sis %basename%.sisx %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key
+ goto install
+ )
+
+ rem Sign with RnD certificate
+ set certificate=RnD
+ signsis %basename%.sis %basename%.sisx %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem
+) else (
+ if x%signsis2% == x (
+ echo Custom certificate key file parameter missing.
+ goto cleanup
+ )
+
+ set certificate=%signsis1%
+ signsis %basename%.sis %basename%.sisx %signsis1% %signsis2% %signsis3%
+)
+
+:install
+if exist %basename%.sisx (
+ echo Successfully created %basename%.sisx using certificate %certificate%
+ if "%installsisx%" == "true" (
+ echo Installing %basename%.sisx...
+ call %basename%.sisx
+ )
+)
+
+:cleanup
+if exist %basename%.sis del %basename%.sis
+
+:done \ No newline at end of file
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
new file mode 100644
index 0000000000..d75605b19a
--- /dev/null
+++ b/bin/patch_capabilities.pl
@@ -0,0 +1,95 @@
+#######################################################################
+#
+# A script for setting binary capabilities based on .pkg file contents.
+#
+# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+# Contact: Qt Software Information (qt-info@nokia.com)
+#
+#######################################################################
+
+my @capabilitiesToSet = ("LocalServices", "NetworkServices", "ReadUserData", "UserEnvironment", "WriteUserData");
+
+# If arguments were given to the script,
+if (@ARGV)
+{
+ # Parse the first given script argument as a ".pkg" file name.
+ my $pkgFileName = shift(@ARGV);
+
+ # If the specified ".pkg" file exists (and can be read),
+ if (($pkgFileName =~ m|\.pkg$|i) && -r($pkgFileName))
+ {
+ # If there are more arguments given, parse them as capabilities.
+ if (@ARGV)
+ {
+ @capabilitiesToSet = ();
+ while (@ARGV)
+ {
+ push (@capabilitiesToSet, pop(@ARGV));
+ }
+ }
+
+ # Start with no binaries listed.
+ my @binaries = ();
+
+ # Open the ".pkg" file.
+ open (PKG, "<".$pkgFileName);
+
+ # Parse each line.
+ while (<PKG>)
+ {
+ my $line = $_;
+ chomp ($line);
+
+ # If the line specifies a file, parse the source and destination locations.
+ if ($line =~ m|\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|)
+ {
+ my $sourcePath = $1;
+ my $destinationPath = $2;
+
+ # If the given file is a binary, check the target and binary type (+ the actual filename) from its path.
+ if ($sourcePath =~ m:/epoc32/release/([^/]+)/(udeb|urel)/(\w+(\.dll|\.exe)):i)
+ {
+ push (@binaries, $sourcePath);
+ }
+ }
+ }
+
+ # Close the ".pkg" file.
+ close (PKG);
+
+ print ("\n");
+
+ my $baseCommandToExecute = "elftran -capability \"";
+ if (@capabilitiesToSet)
+ {
+ $baseCommandToExecute .= join(" ", @capabilitiesToSet);
+ }
+ $baseCommandToExecute .= "\" ";
+
+ # Actually set the capabilities of the listed binaries.
+ foreach my $binaryPath(@binaries)
+ {
+ # Create the command line for setting the capabilities.
+ my $commandToExecute = $baseCommandToExecute;
+ $commandToExecute .= $binaryPath;
+
+ # Actually execute the elftran command to set the capabilities.
+ system ($commandToExecute." > NUL");
+ print ("Executed ".$commandToExecute."\n");
+
+ ## Create another command line to check that the set capabilities are correct.
+ #$commandToExecute = "elftran -dump s ".$binaryPath;
+ }
+
+ print ("\n");
+ }
+}
+else
+{
+ print("This script can be used to set capabilities of all binaries\n");
+ print("specified for deployment in a .pkg file.\n");
+ print("If no capabilities are given, the binaries will be given the\n");
+ print("capabilities supported by self-signed certificates.\n");
+ print("\nUsage: patch_capabilities.pl pkg_filename [capability list]\n");
+ print("\nE.g. patch_capabilities.pl myapp_armv5_urel.pkg \"All -TCB\"\n");
+} \ No newline at end of file
diff --git a/config.tests/unix/openssl/openssl.pri b/config.tests/unix/openssl/openssl.pri
index bc954794ee..c8703c23a1 100644
--- a/config.tests/unix/openssl/openssl.pri
+++ b/config.tests/unix/openssl/openssl.pri
@@ -7,3 +7,11 @@
exists($$pp):INCLUDEPATH *= $$p
}
}
+
+symbian{
+ TRY_INCLUDEPATHS = $${EPOCROOT}epoc32 $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE $$QMAKE_INCDIR $$INCLUDEPATH
+ for(p, TRY_INCLUDEPATHS) {
+ pp = $$join(p, "", "", "/openssl")
+ exists($$pp):INCLUDEPATH *= $$pp
+ }
+}
diff --git a/configure.exe b/configure.exe
index 40843b48e3..30383d8c10 100644..100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/confqt.bat b/confqt.bat
new file mode 100644
index 0000000000..5da959275c
--- /dev/null
+++ b/confqt.bat
@@ -0,0 +1 @@
+configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %*
diff --git a/confsbsv2.bat b/confsbsv2.bat
new file mode 100644
index 0000000000..6c9bc1ac87
--- /dev/null
+++ b/confsbsv2.bat
@@ -0,0 +1 @@
+configure -platform win32-mwc -xplatform symbian-sbsv2 -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %*
diff --git a/demos/affine/affine.pro b/demos/affine/affine.pro
index b92875313a..4973496915 100644
--- a/demos/affine/affine.pro
+++ b/demos/affine/affine.pro
@@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.jpg
sources.path = $$[QT_INSTALL_DEMOS]/affine
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qjpeg
}
diff --git a/demos/arthurplugin/arthurplugin.pro b/demos/arthurplugin/arthurplugin.pro
index e9eb1f3672..d4827a150a 100644
--- a/demos/arthurplugin/arthurplugin.pro
+++ b/demos/arthurplugin/arthurplugin.pro
@@ -44,6 +44,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg *.png
sources.path = $$[QT_INSTALL_DEMOS]/arthurplugin
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
win32-msvc* {
QMAKE_CFLAGS += /Zm500
QMAKE_CXXFLAGS += /Zm500
diff --git a/demos/books/books.pro b/demos/books/books.pro
index a2cd33f86e..94b049a9f6 100644
--- a/demos/books/books.pro
+++ b/demos/books/books.pro
@@ -13,6 +13,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images
sources.path = $$[QT_INSTALL_DEMOS]/books
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
CONFIG(debug, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro
index d970f9970e..c500788b62 100644
--- a/demos/browser/browser.pro
+++ b/demos/browser/browser.pro
@@ -89,3 +89,5 @@ target.path = $$[QT_INSTALL_DEMOS]/browser
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.plist *.icns *.ico *.rc *.pro *.html *.doc images htmls
sources.path = $$[QT_INSTALL_DEMOS]/browser
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/chip/chip.pro b/demos/chip/chip.pro
index 53fa23b981..2c44e56f08 100644
--- a/demos/chip/chip.pro
+++ b/demos/chip/chip.pro
@@ -17,3 +17,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/chip
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/composition/composition.pro b/demos/composition/composition.pro
index d5c4a601b8..90562eb3b9 100644
--- a/demos/composition/composition.pro
+++ b/demos/composition/composition.pro
@@ -17,6 +17,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.jpg *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/composition
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
win32-msvc* {
QMAKE_CXXFLAGS += /Zm500
QMAKE_CFLAGS += /Zm500
diff --git a/demos/deform/deform.pro b/demos/deform/deform.pro
index db8484d4f0..31ba2e9bb7 100644
--- a/demos/deform/deform.pro
+++ b/demos/deform/deform.pro
@@ -17,3 +17,7 @@ target.path = $$[QT_INSTALL_DEMOS]/deform
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/deform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63D
diff --git a/demos/deform/pathdeform.cpp b/demos/deform/pathdeform.cpp
index 2e1d89a689..4026241dc3 100644
--- a/demos/deform/pathdeform.cpp
+++ b/demos/deform/pathdeform.cpp
@@ -53,6 +53,10 @@
#include <QDesktopWidget>
#include <qmath.h>
+#if defined(Q_OS_SYMBIAN)
+// TODO: Remove all FONT_OUTLINE_TWEAK related code as soon as the S60FontEngine can deliver outlines
+#define FONT_OUTLINE_TWEAK
+#endif
PathDeformControls::PathDeformControls(QWidget *parent, PathDeformRenderer* renderer, bool smallScreen)
: QWidget(parent)
@@ -241,6 +245,14 @@ void PathDeformControls::layoutForSmallScreen()
QRect screen_size = QApplication::desktop()->screenGeometry();
radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/5);
+
+#ifdef FONT_OUTLINE_TWEAK
+ radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/7);
+ fontSizeLabel->setText("Qt Logo Size:");
+ m_renderer->setText("A"); // Any Letter would be fine
+ fontSizeSlider->setValue(100);
+#endif
+
m_renderer->setText(tr("Qt"));
}
diff --git a/demos/demobase.pri b/demos/demobase.pri
new file mode 100644
index 0000000000..c0bba64162
--- /dev/null
+++ b/demos/demobase.pri
@@ -0,0 +1 @@
+symbian:RSS_RULES = "group_name=\"QtDemos\";" \ No newline at end of file
diff --git a/demos/demos.pro b/demos/demos.pro
index 60845500f2..3856591618 100644
--- a/demos/demos.pro
+++ b/demos/demos.pro
@@ -1,26 +1,31 @@
TEMPLATE = subdirs
SUBDIRS = \
- demos_shared \
- demos_deform \
- demos_gradients \
- demos_pathstroke \
- demos_affine \
- demos_composition \
- demos_books \
- demos_interview \
- demos_mainwindow \
- demos_spreadsheet \
- demos_textedit \
- demos_chip \
- demos_embeddeddialogs \
- demos_undo
+ demos_shared \
+ demos_deform \
+ demos_gradients \
+ demos_pathstroke \
+ demos_affine \
+ demos_composition \
+ demos_books \
+ demos_interview \
+ demos_mainwindow \
+ demos_spreadsheet \
+ demos_textedit \
+ demos_chip \
+ demos_embeddeddialogs \
+ demos_undo
+
+symbian: SUBDIRS = \
+ demos_shared \
+ demos_deform \
+ demos_pathstroke
contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{
SUBDIRS += demos_boxes
}
mac*: SUBDIRS += demos_macmainwindow
-wince*|embedded: SUBDIRS += embedded
+wince*|symbian|embedded: SUBDIRS += embedded
!contains(QT_EDITION, Console):!cross_compile:!embedded:!wince*:SUBDIRS += demos_arthurplugin
@@ -38,6 +43,8 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_DEMOS]
INSTALLS += sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
demos_chip.subdir = chip
demos_embeddeddialogs.subdir = embeddeddialogs
demos_shared.subdir = shared
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp
new file mode 100644
index 0000000000..1abb0510dd
--- /dev/null
+++ b/demos/embedded/desktopservices/contenttab.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QKeyEvent>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QFileInfoList>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "contenttab.h"
+
+
+// CONSTRUCTORS & DESTRUCTORS
+ContentTab::ContentTab(QWidget *parent) :
+ QListWidget(parent)
+{
+ setDragEnabled(false);
+ setIconSize(QSize(45, 45));
+}
+
+ContentTab::~ContentTab()
+{
+}
+
+// NEW PUBLIC METHODS
+void ContentTab::init(const QDesktopServices::StandardLocation &location,
+ const QString &icon)
+{
+ setContentDir(location);
+ setIcon(icon);
+
+ connect(this, SIGNAL(itemClicked(QListWidgetItem *)),
+ this, SLOT(openItem(QListWidgetItem *)));
+
+ populateListWidget();
+}
+
+// NEW PROTECTED METHODS
+void ContentTab::setContentDir(const QDesktopServices::StandardLocation &location)
+{
+ m_ContentDir.setPath(QDesktopServices::storageLocation(location));
+}
+
+void ContentTab::setIcon(const QString &icon)
+{
+ m_Icon = QIcon(icon);
+}
+
+void ContentTab::populateListWidget()
+{
+ QFileInfoList fileList = m_ContentDir.entryInfoList(QStringList(), QDir::Files, QDir::Time);
+ foreach(QFileInfo item, fileList) {
+ new QListWidgetItem(m_Icon, itemName(item), this);
+ }
+}
+
+QString ContentTab::itemName(const QFileInfo &item)
+{
+ return QString(item.baseName() + "." + item.completeSuffix());
+}
+
+QUrl ContentTab::itemUrl(QListWidgetItem *item)
+{
+ return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text());
+}
+
+void ContentTab::keyPressEvent(QKeyEvent *event)
+{
+ switch(event->key()) {
+ case Qt::Key_Up:
+ if(currentRow() == 0) {
+ setCurrentRow(count()-1);
+ } else {
+ setCurrentRow(currentRow()-1);
+ }
+ break;
+ case Qt::Key_Down:
+ if(currentRow() == (count()-1)) {
+ setCurrentRow(0);
+ } else {
+ setCurrentRow(currentRow()+1);
+ }
+ break;
+ case Qt::Key_Select:
+ openItem(currentItem());
+ default:
+ QListWidget::keyPressEvent(event);
+ break;
+ }
+}
+
+// NEW SLOTS
+void ContentTab::openItem(QListWidgetItem *item)
+{
+ QDesktopServices::openUrl(itemUrl(item));
+}
+
+// End of File
diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h
new file mode 100644
index 0000000000..60fabc84bd
--- /dev/null
+++ b/demos/embedded/desktopservices/contenttab.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTENTTAB_H_
+#define CONTENTTAB_H_
+
+// EXTERNAL INCLUDES
+#include <QDir>
+#include <QUrl>
+#include <QIcon>
+#include <QFileInfo>
+#include <QListWidget>
+#include <QDesktopServices>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* ContentTab class.
+*
+* This class implements general purpose tab for media files.
+*/
+class ContentTab : public QListWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ ContentTab(QWidget *parent);
+ virtual ~ContentTab();
+
+public: // New Methods
+ virtual void init(const QDesktopServices::StandardLocation &location,
+ const QString &icon);
+
+protected: // New Methods
+ virtual void setContentDir(const QDesktopServices::StandardLocation &location);
+ virtual void setIcon(const QString &icon);
+ virtual void populateListWidget();
+ virtual QString itemName(const QFileInfo &item);
+ virtual QUrl itemUrl(QListWidgetItem *item);
+
+protected:
+ void keyPressEvent(QKeyEvent *event);
+
+public slots: // New Slots
+ virtual void openItem(QListWidgetItem *item);
+
+protected: // Owned variables
+ QDir m_ContentDir;
+ QIcon m_Icon;
+};
+
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/demos/embedded/desktopservices/data/Explosion.wav b/demos/embedded/desktopservices/data/Explosion.wav
new file mode 100644
index 0000000000..7b140b1c69
--- /dev/null
+++ b/demos/embedded/desktopservices/data/Explosion.wav
Binary files differ
diff --git a/demos/embedded/desktopservices/data/designer.png b/demos/embedded/desktopservices/data/designer.png
new file mode 100644
index 0000000000..0988fcee3f
--- /dev/null
+++ b/demos/embedded/desktopservices/data/designer.png
Binary files differ
diff --git a/demos/embedded/desktopservices/data/monkey_on_64x64.png b/demos/embedded/desktopservices/data/monkey_on_64x64.png
new file mode 100644
index 0000000000..990f604d98
--- /dev/null
+++ b/demos/embedded/desktopservices/data/monkey_on_64x64.png
Binary files differ
diff --git a/demos/embedded/desktopservices/data/sax.mp3 b/demos/embedded/desktopservices/data/sax.mp3
new file mode 100644
index 0000000000..0a078b10ca
--- /dev/null
+++ b/demos/embedded/desktopservices/data/sax.mp3
Binary files differ
diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro
new file mode 100644
index 0000000000..32cb6d9b09
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopservices.pro
@@ -0,0 +1,23 @@
+TEMPLATE = app
+TARGET =
+INCLUDEPATH += .
+
+HEADERS += desktopwidget.h contenttab.h linktab.h
+SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp
+
+RESOURCES += desktopservices.qrc
+
+music.sources = data/*.mp3 data/*.wav
+music.path = /data/sounds/
+
+image.sources = data/*.png
+image.path = /data/images/
+
+DEPLOYMENT += music image
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian {
+ TARGET.UID3 = 0xA000C611
+ ICON = ./resources/heart.svg
+}
diff --git a/demos/embedded/desktopservices/desktopservices.qrc b/demos/embedded/desktopservices/desktopservices.qrc
new file mode 100644
index 0000000000..d36205dec4
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopservices.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resources/music.png</file>
+ <file>resources/photo.png</file>
+ <file>resources/browser.png</file>
+ <file>resources/message.png</file>
+</qresource>
+</RCC>
diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp
new file mode 100644
index 0000000000..17243cf7b4
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopwidget.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QTabWidget>
+#include <QVBoxLayout>
+#include <QDesktopServices>
+
+// INTERNAL INCLUDES
+#include "linktab.h"
+#include "contenttab.h"
+
+// CLASS HEADER
+#include "desktopwidget.h"
+
+// CONSTRUCTORS & DESTRUCTORS
+DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent)
+
+{
+ QTabWidget *tabWidget = new QTabWidget(this);
+
+ // Images
+ ContentTab* imageTab = new ContentTab(tabWidget);
+ imageTab->init(QDesktopServices::PicturesLocation, ":/resources/photo.png");
+ tabWidget->addTab(imageTab, tr("Images"));
+
+ // Music
+ ContentTab* musicTab = new ContentTab(tabWidget);
+ musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png");
+ tabWidget->addTab(musicTab, tr("Music"));
+
+ // Links
+ LinkTab* othersTab = new LinkTab(tabWidget);;
+ // Given icon file will be overriden by LinkTab
+ othersTab->init(QDesktopServices::PicturesLocation, "");
+ tabWidget->addTab(othersTab, tr("Links"));
+
+ // Layout
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(tabWidget);
+ setLayout(layout);
+}
+
+DesktopWidget::~DesktopWidget()
+{
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h
new file mode 100644
index 0000000000..a947e80e78
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopwidget.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DESKTOPWIDGET_H_
+#define DESKTOPWIDGET_H_
+
+// EXTERNAL INCLUDES
+#include <QWidget>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+/**
+* DesktopWidget class.
+*
+* Implements the main top level widget for QDesktopServices demo app.
+*/
+class DesktopWidget : public QWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ DesktopWidget(QWidget *parent);
+ ~DesktopWidget();
+
+};
+
+#endif // DESKTOPWIDGET_H_
+
+// End of file
diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp
new file mode 100644
index 0000000000..0d5bea725c
--- /dev/null
+++ b/demos/embedded/desktopservices/linktab.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QUrl>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "linktab.h"
+
+LinkTab::LinkTab(QWidget *parent) :
+ ContentTab(parent)
+{
+}
+
+LinkTab::~LinkTab()
+{
+}
+
+void LinkTab::populateListWidget()
+{
+ m_WebItem = new QListWidgetItem(QIcon(":/resources/browser.png"), tr("Launch Browser"), this);
+ m_MailToItem = new QListWidgetItem(QIcon(":/resources/message.png"), tr("New e-mail"), this);
+}
+
+QUrl LinkTab::itemUrl(QListWidgetItem *item)
+{
+ if(m_WebItem == item) {
+ return QUrl(tr("http://www.qtsoftware.com"));
+ } else if(m_MailToItem == item) {
+ return QUrl(tr("mailto:qts60-feedback@trolltech.com?subject=QtS60 feedback&body=Hello"));
+ } else {
+ // We should never endup here
+ Q_ASSERT(false);
+ return QUrl();
+ }
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h
new file mode 100644
index 0000000000..f88c334964
--- /dev/null
+++ b/demos/embedded/desktopservices/linktab.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LINKTAB_H_
+#define LINKTAB_H_
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include "contenttab.h"
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QWidget;
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* LinkTab class.
+*
+* This class implements tab for opening http and mailto links.
+*/
+class LinkTab : public ContentTab
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ LinkTab(QWidget *parent);
+ ~LinkTab();
+
+protected: // Derived Methods
+ virtual void populateListWidget();
+ virtual QUrl itemUrl(QListWidgetItem *item);
+
+private: // Used variables
+ QListWidgetItem *m_WebItem;
+ QListWidgetItem *m_MailToItem;
+
+private: // Owned variables
+
+};
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp
new file mode 100644
index 0000000000..32e22ae697
--- /dev/null
+++ b/demos/embedded/desktopservices/main.cpp
@@ -0,0 +1,26 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "desktopwidget.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(desktopservices);
+
+ QApplication app(argc, argv);
+ DesktopWidget* myWidget = new DesktopWidget(0);
+ myWidget->showMaximized();
+
+ return app.exec();
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/resources/browser.png b/demos/embedded/desktopservices/resources/browser.png
new file mode 100644
index 0000000000..28561e13f1
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/browser.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/heart.svg b/demos/embedded/desktopservices/resources/heart.svg
new file mode 100644
index 0000000000..ba5f050b00
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/heart.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="595.27559pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+<metadata>
+<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<cc:Work rdf:about="">
+<dc:title>Heart Left-Highlight</dc:title>
+<dc:description>This is a normal valentines day heart.</dc:description>
+<dc:subject>
+<rdf:Bag>
+<rdf:li>holiday</rdf:li>
+<rdf:li>valentines</rdf:li>
+<rdf:li></rdf:li>
+<rdf:li>valentine</rdf:li>
+<rdf:li>hash(0x8a091c0)</rdf:li>
+<rdf:li>hash(0x8a0916c)</rdf:li>
+<rdf:li>signs_and_symbols</rdf:li>
+<rdf:li>hash(0x8a091f0)</rdf:li>
+<rdf:li>day</rdf:li>
+</rdf:Bag>
+</dc:subject>
+<dc:publisher>
+<cc:Agent rdf:about="http://www.openclipart.org">
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:publisher>
+<dc:creator>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:creator>
+<dc:rights>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:rights>
+<dc:date></dc:date>
+<dc:format>image/svg+xml</dc:format>
+<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
+<dc:language>en</dc:language>
+</cc:Work>
+<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
+<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+</cc:License>
+</rdf:RDF>
+</metadata>
+<defs id="defs3"/>
+<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/>
+<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+</g>
+</svg>
diff --git a/demos/embedded/desktopservices/resources/message.png b/demos/embedded/desktopservices/resources/message.png
new file mode 100644
index 0000000000..e30052bfce
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/message.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/music.png b/demos/embedded/desktopservices/resources/music.png
new file mode 100644
index 0000000000..11a57bbcd7
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/music.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/photo.png b/demos/embedded/desktopservices/resources/photo.png
new file mode 100644
index 0000000000..5ba15c18cd
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/photo.png
Binary files differ
diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro
index 7428b9f680..8214dd3e94 100644
--- a/demos/embedded/embedded.pro
+++ b/demos/embedded/embedded.pro
@@ -3,7 +3,8 @@ SUBDIRS = styledemo
contains(QT_CONFIG, svg) {
SUBDIRS += embeddedsvgviewer \
- fluidlauncher
+ fluidlauncher \
+ desktopservices
}
# install
@@ -11,3 +12,5 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_DEMOS]/embedded
INSTALLS += sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
index 505e6078ca..51a04e7c5d 100644
--- a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
+++ b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
@@ -11,6 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.svg files
sources.path = $$[QT_INSTALL_DEMOS]/embedded/embeddedsvgviewer
INSTALLS += target sources
-wince*: {
+wince* {
DEPLOYMENT_PLUGIN += qsvg
}
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A640
+
diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml
new file mode 100644
index 0000000000..41b3b6d7ae
--- /dev/null
+++ b/demos/embedded/fluidlauncher/config_s60/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<demolauncher>
+ <demos>
+ <example filename="embeddedsvgviewer" name="SVG Viewer" image="screenshots/embeddedsvgviewer.png" args="/data/images/qt/demos/embeddedsvgviewer/shapes.svg"/>
+ <example filename="styledemo" name="Stylesheets" image="screenshots/styledemo.png"/>
+ <example filename="deform" name="Vector Deformation" image="screenshots/deform.png" args="-small-screen"/>
+ <example filename="pathstroke" name="Path Stroking" image="screenshots/pathstroke.png" args="-small-screen"/>
+ <example filename="wiggly" name="Wiggly Text" image="screenshots/wiggly.png" args="-small-screen"/>
+ <example filename="ftp" name="Ftp Client" image="screenshots/ftp.png"/>
+ <example filename="context2d" name="Context2d" image="screenshots/context2d.png"/>
+ <example filename="saxbookmarks" name="SaxBookmarks" image="screenshots/saxbookmarks.png"/>
+ <example filename="desktopservices" name="Desktop Services" image="screenshots/desktopservices.png"/>
+ <example filename="fridgemagnets" name="Fridge Magnets" image="screenshots/fridgemagnets.png" args="-small-screen"/>
+ <example filename="drilldown" name="Drilldown" image="screenshots/drilldown.png"/>
+ </demos>
+ <slideshow timeout="60000" interval="10000">
+ <imagedir dir="slides"/>
+ </slideshow>
+</demolauncher>
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp
index f80e6ca133..9a4f2cad33 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.cpp
+++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp
@@ -39,12 +39,14 @@
**
****************************************************************************/
-#include <QtXml>
+#include <QXmlStreamReader>
#include "fluidlauncher.h"
#define DEFAULT_INPUT_TIMEOUT 10000
+#define SIZING_FACTOR_HEIGHT 6/10
+#define SIZING_FACTOR_WIDTH 6/10
FluidLauncher::FluidLauncher(QStringList* args)
{
@@ -62,7 +64,11 @@ FluidLauncher::FluidLauncher(QStringList* args)
inputTimer->setSingleShot(true);
inputTimer->setInterval(DEFAULT_INPUT_TIMEOUT);
- pictureFlowWidget->setSlideSize(QSize( (screen_size.width()*2)/5, (screen_size.height()*2)/5 ));
+ const int h = screen_size.height() * SIZING_FACTOR_HEIGHT;
+ const int w = screen_size.width() * SIZING_FACTOR_WIDTH;
+ const int hh = qMin(h, w);
+ const int ww = hh / 3 * 2;
+ pictureFlowWidget->setSlideSize(QSize(ww, hh));
bool success;
int configIndex = args->indexOf("-config");
@@ -100,61 +106,97 @@ bool FluidLauncher::loadConfig(QString configPath)
slideShowWidget->clearImages();
- QDomDocument xmlDoc;
- xmlDoc.setContent(&xmlFile, true);
+ xmlFile.open(QIODevice::ReadOnly);
+ QXmlStreamReader reader(&xmlFile);
+ while (!reader.atEnd()) {
+ reader.readNext();
- QDomElement rootElement = xmlDoc.documentElement();
-
- // Process the demos node:
- QDomNodeList demoNodes = rootElement.firstChildElement("demos").elementsByTagName("example");
- for (int i=0; i<demoNodes.size(); i++) {
- QDomElement element = demoNodes.item(i).toElement();
-
- if (element.hasAttribute("filename")) {
- DemoApplication* newDemo = new DemoApplication(
- element.attribute("filename"),
- element.attribute("name", "Unamed Demo"),
- element.attribute("image"),
- element.attribute("args").split(" "));
- demoList.append(newDemo);
+ if (reader.isStartElement()) {
+ if (reader.name() == "demos")
+ parseDemos(reader);
+ else if(reader.name() == "slideshow")
+ parseSlideshow(reader);
}
}
+ if (reader.hasError()) {
+ qDebug() << QString("Error parsing %1 on line %2 column %3: \n%4")
+ .arg(configPath)
+ .arg(reader.lineNumber())
+ .arg(reader.columnNumber())
+ .arg(reader.errorString());
+ }
- // Process the slideshow node:
- QDomElement slideshowElement = rootElement.firstChildElement("slideshow");
+ // Append an exit Item
+ DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList());
+ demoList.append(exitItem);
- if (slideshowElement.hasAttribute("timeout")) {
- bool valid;
- int timeout = slideshowElement.attribute("timeout").toInt(&valid);
- if (valid)
- inputTimer->setInterval(timeout);
- }
+ return true;
+}
- if (slideshowElement.hasAttribute("interval")) {
- bool valid;
- int interval = slideshowElement.attribute("interval").toInt(&valid);
- if (valid)
- slideShowWidget->setSlideInterval(interval);
+
+void FluidLauncher::parseDemos(QXmlStreamReader& reader)
+{
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == "example") {
+ QXmlStreamAttributes attrs = reader.attributes();
+ QStringRef filename = attrs.value("filename");
+ if (!filename.isEmpty()) {
+ QStringRef name = attrs.value("name");
+ QStringRef image = attrs.value("image");
+ QStringRef args = attrs.value("args");
+
+ DemoApplication* newDemo = new DemoApplication(
+ filename.toString(),
+ name.isEmpty() ? "Unamed Demo" : name.toString(),
+ image.toString(),
+ args.toString().split(" "));
+ demoList.append(newDemo);
+ }
+ } else if(reader.isEndElement() && reader.name() == "demos") {
+ return;
+ }
}
+}
- for (QDomNode node=slideshowElement.firstChild(); !node.isNull(); node=node.nextSibling()) {
- QDomElement element = node.toElement();
+void FluidLauncher::parseSlideshow(QXmlStreamReader& reader)
+{
+ QXmlStreamAttributes attrs = reader.attributes();
+
+ QStringRef timeout = attrs.value("timeout");
+ bool valid;
+ if (!timeout.isEmpty()) {
+ int t = timeout.toString().toInt(&valid);
+ if (valid)
+ inputTimer->setInterval(t);
+ }
- if (element.tagName() == "imagedir")
- slideShowWidget->addImageDir(element.attribute("dir"));
- else if (element.tagName() == "image")
- slideShowWidget->addImage(element.attribute("image"));
+ QStringRef interval = attrs.value("interval");
+ if (!interval.isEmpty()) {
+ int i = interval.toString().toInt(&valid);
+ if (valid)
+ slideShowWidget->setSlideInterval(i);
}
- // Append an exit Item
- DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList());
- demoList.append(exitItem);
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement()) {
+ QXmlStreamAttributes attrs = reader.attributes();
+ if (reader.name() == "imagedir") {
+ QStringRef dir = attrs.value("dir");
+ slideShowWidget->addImageDir(dir.toString());
+ } else if(reader.name() == "image") {
+ QStringRef image = attrs.value("image");
+ slideShowWidget->addImage(image.toString());
+ }
+ } else if(reader.isEndElement() && reader.name() == "slideshow") {
+ return;
+ }
+ }
- return true;
}
-
void FluidLauncher::populatePictureFlow()
{
pictureFlowWidget->setSlideCount(demoList.count());
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.h b/demos/embedded/fluidlauncher/fluidlauncher.h
index 3f4c1fe332..d064edd275 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.h
+++ b/demos/embedded/fluidlauncher/fluidlauncher.h
@@ -44,6 +44,7 @@
#include <QtGui>
#include <QTimer>
+#include <QStringRef>
#include "pictureflow.h"
#include "slideshow.h"
@@ -73,7 +74,8 @@ private:
bool loadConfig(QString configPath);
void populatePictureFlow();
void switchToSlideshow();
-
+ void parseDemos(QXmlStreamReader& reader);
+ void parseSlideshow(QXmlStreamReader& reader);
};
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 76d12adf84..ed2530cd37 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -2,7 +2,6 @@ TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
-QT += xml
# Input
HEADERS += \
@@ -40,7 +39,8 @@ wince*{
$$QT_BUILD_TREE/demos/pathstroke/$${BUILD_DIR}/pathstroke.exe \
$$QT_BUILD_TREE/examples/graphicsview/elasticnodes/$${BUILD_DIR}/elasticnodes.exe \
$$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/wiggly.exe \
- $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe
+ $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe \
+ $$QT_BUILD_TREE/examples/draganddrop/$${BUILD_DIR}/fridgemagnets.exe
executables.path = .
@@ -54,3 +54,85 @@ wince*{
DEPLOYMENT_PLUGIN += qgif qjpeg qmng qsvg
}
+
+symbian {
+ load(data_caging_paths)
+
+ TARGET.UID3 = 0xA000A641
+
+ executables.sources = \
+ embeddedsvgviewer.exe \
+ styledemo.exe \
+ deform.exe \
+ pathstroke.exe \
+ wiggly.exe \
+ ftp.exe \
+ context2d.exe \
+ saxbookmarks.exe \
+ desktopservices.exe \
+ fridgemagnets.exe \
+ drilldown.exe
+
+ executables.path = /sys/bin
+
+ reg_resource.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc
+
+ reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
+
+
+ resource.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/ftp.rsc\
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc
+
+ resource.path = $$APP_RESOURCE_DIR
+
+ mifs.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif
+ mifs.path = $$APP_RESOURCE_DIR
+
+ files.sources = $$PWD/screenshots $$PWD/slides
+ files.path = .
+
+ config.sources = $$PWD/config_s60/config.xml
+ config.path = .
+
+ viewerimages.sources = $$PWD/../embeddedsvgviewer/shapes.svg
+ viewerimages.path = /data/images/qt/demos/embeddedsvgviewer
+
+ desktopservices_music.sources = \
+ $$PWD/../desktopservices/data/*.mp3 \
+ $$PWD/../desktopservices/data/*.wav
+ desktopservices_music.path = /data/sounds
+
+ desktopservices_images.sources = $$PWD/../desktopservices/data/*.png
+ desktopservices_images.path = /data/images
+
+ saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frankf.xbel
+ saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jenniferf.xbel
+ saxbookmarks.path = /data/qt/saxbookmarks
+
+ DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \
+ mifs desktopservices_music desktopservices_images
+
+ TARGET.EPOCHEAPSIZE = 100000 20000000
+}
diff --git a/demos/embedded/fluidlauncher/pictureflow.cpp b/demos/embedded/fluidlauncher/pictureflow.cpp
index 04bbf050a5..e2f8284391 100644
--- a/demos/embedded/fluidlauncher/pictureflow.cpp
+++ b/demos/embedded/fluidlauncher/pictureflow.cpp
@@ -105,6 +105,14 @@
#include <QDebug>
+static const int captionFontSize =
+#ifdef Q_WS_S60
+ 8;
+#else
+ 14;
+#endif
+
+
// uncomment this to enable bilinear filtering for texture mapping
// gives much better rendering, at the cost of memory space
// #define PICTUREFLOW_BILINEAR_FILTER
@@ -739,14 +747,14 @@ void PictureFlowPrivate::render()
QPainter painter;
painter.begin(&buffer);
- QFont font("Arial", 14);
+ QFont font("Arial", captionFontSize);
font.setBold(true);
painter.setFont(font);
painter.setPen(Qt::white);
//painter.setPen(QColor(255,255,255,127));
if (!captions.isEmpty())
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[centerIndex]);
painter.end();
@@ -789,18 +797,18 @@ void PictureFlowPrivate::render()
QPainter painter;
painter.begin(&buffer);
- QFont font("Arial", 14);
+ QFont font("Arial", captionFontSize);
font.setBold(true);
painter.setFont(font);
int leftTextIndex = (step>0) ? centerIndex : centerIndex-1;
painter.setPen(QColor(255,255,255, (255-fade) ));
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[leftTextIndex]);
painter.setPen(QColor(255,255,255, fade));
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[leftTextIndex+1]);
@@ -1265,6 +1273,12 @@ void PictureFlow::keyPressEvent(QKeyEvent* event)
return;
}
+ if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Select) {
+ emit itemActivated(d->getTarget());
+ event->accept();
+ return;
+ }
+
event->ignore();
}
diff --git a/demos/embedded/fluidlauncher/screenshots/context2d.png b/demos/embedded/fluidlauncher/screenshots/context2d.png
new file mode 100644
index 0000000000..d571546c25
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/context2d.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/desktopservices.png b/demos/embedded/fluidlauncher/screenshots/desktopservices.png
new file mode 100644
index 0000000000..a8d82ce5d4
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/desktopservices.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png b/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png
new file mode 100644
index 0000000000..87b9099e3b
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/ftp.png b/demos/embedded/fluidlauncher/screenshots/ftp.png
new file mode 100644
index 0000000000..fae7ffc43c
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/ftp.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png b/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png
new file mode 100644
index 0000000000..6a2b07fc5a
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png
Binary files differ
diff --git a/demos/embedded/styledemo/files/application.qss b/demos/embedded/styledemo/files/application.qss
index a632ad1c86..432fe6bc76 100644
--- a/demos/embedded/styledemo/files/application.qss
+++ b/demos/embedded/styledemo/files/application.qss
@@ -6,7 +6,7 @@ QWidget#StyleWidget
QLabel, QAbstractButton
{
- font: 18px bold;
+ font: bold;
color: beige;
}
diff --git a/demos/embedded/styledemo/files/blue.qss b/demos/embedded/styledemo/files/blue.qss
index aa87277f8d..ac8671b5e4 100644
--- a/demos/embedded/styledemo/files/blue.qss
+++ b/demos/embedded/styledemo/files/blue.qss
@@ -5,7 +5,7 @@
QLabel, QAbstractButton
{
- font: 10pt bold;
+ font: bold;
color: yellow;
}
@@ -28,7 +28,6 @@ QAbstractButton
border-style: solid;
border-radius: 5;
padding: 3px;
- qproperty-focusPolicy: NoFocus;
}
QAbstractButton:pressed
diff --git a/demos/embedded/styledemo/files/khaki.qss b/demos/embedded/styledemo/files/khaki.qss
index 9c0f77caa5..b0d4a0fa6f 100644
--- a/demos/embedded/styledemo/files/khaki.qss
+++ b/demos/embedded/styledemo/files/khaki.qss
@@ -16,7 +16,6 @@ QPushButton, QToolButton {
padding: 3px;
/* min-width: 96px; */
/* min-height: 48px; */
- qproperty-focusPolicy: NoFocus
}
QPushButton:hover, QToolButton:hover {
@@ -30,7 +29,7 @@ QPushButton:pressed, QToolButton:pressed {
}
QLabel, QAbstractButton {
- font: italic 11pt "Times New Roman";
+ font: italic "Times New Roman";
}
QFrame, QLabel#title {
diff --git a/demos/embedded/styledemo/files/transparent.qss b/demos/embedded/styledemo/files/transparent.qss
index e3a991265c..b38eb366f4 100644
--- a/demos/embedded/styledemo/files/transparent.qss
+++ b/demos/embedded/styledemo/files/transparent.qss
@@ -6,7 +6,6 @@ QWidget#StyleWidget
QLabel, QAbstractButton
{
- font: 13pt;
color: beige;
}
diff --git a/demos/embedded/styledemo/styledemo.pro b/demos/embedded/styledemo/styledemo.pro
index ee5e4d6cc2..e0ef202526 100644
--- a/demos/embedded/styledemo/styledemo.pro
+++ b/demos/embedded/styledemo/styledemo.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63F
diff --git a/demos/embedded/styledemo/stylewidget.ui b/demos/embedded/styledemo/stylewidget.ui
index 586faeac42..9c5f253dfc 100644
--- a/demos/embedded/styledemo/stylewidget.ui
+++ b/demos/embedded/styledemo/stylewidget.ui
@@ -5,16 +5,19 @@
<rect>
<x>0</x>
<y>0</y>
- <width>339</width>
- <height>230</height>
+ <width>172</width>
+ <height>220</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
<property name="margin" >
- <number>3</number>
+ <number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox" >
@@ -27,15 +30,15 @@
<property name="title" >
<string>Styles</string>
</property>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>3</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
<property name="margin" >
- <number>3</number>
+ <number>4</number>
</property>
- <item>
- <widget class="QPushButton" name="noStyle" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="transparentStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
@@ -43,23 +46,23 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>No-Style</string>
+ <string>Transp.</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
</property>
</widget>
</item>
- <item>
+ <item row="2" column="0" >
<widget class="QPushButton" name="blueStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
@@ -68,7 +71,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Blue</string>
@@ -84,7 +87,7 @@
</property>
</widget>
</item>
- <item>
+ <item row="0" column="1" >
<widget class="QPushButton" name="khakiStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
@@ -93,7 +96,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Khaki</string>
@@ -109,8 +112,8 @@
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="transparentStyle" >
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="noStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
@@ -118,16 +121,16 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Transparent</string>
+ <string>None</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
@@ -166,7 +169,7 @@
</property>
<layout class="QVBoxLayout" name="frameLayout" >
<property name="margin" >
- <number>3</number>
+ <number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
@@ -195,7 +198,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::WheelFocus</enum>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -209,6 +212,9 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
<item row="0" column="0" >
<widget class="QScrollBar" name="horizontalScrollBar" >
<property name="sizePolicy" >
@@ -237,10 +243,10 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Show Scroller</string>
+ <string>Show</string>
</property>
<property name="checkable" >
<bool>true</bool>
@@ -275,10 +281,10 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Enable Scroller</string>
+ <string>Enable</string>
</property>
<property name="checkable" >
<bool>true</bool>
@@ -330,7 +336,7 @@
<item>
<widget class="QPushButton" name="close" >
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Close</string>
diff --git a/demos/embeddeddialogs/embeddeddialogs.pro b/demos/embeddeddialogs/embeddeddialogs.pro
index a38e3e8f9f..d9948a939b 100644
--- a/demos/embeddeddialogs/embeddeddialogs.pro
+++ b/demos/embeddeddialogs/embeddeddialogs.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.png *.jpg *.plist *.icns *.ico *.rc *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/gradients/gradients.pro b/demos/gradients/gradients.pro
index 167572bd4c..77898961ae 100644
--- a/demos/gradients/gradients.pro
+++ b/demos/gradients/gradients.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_DEMOS]/gradients
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/gradients
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/interview/interview.pro b/demos/interview/interview.pro
index c013755205..19b2ca81dc 100644
--- a/demos/interview/interview.pro
+++ b/demos/interview/interview.pro
@@ -16,3 +16,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES README *.pro images
sources.path = $$[QT_INSTALL_DEMOS]/interview
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/macmainwindow/macmainwindow.pro b/demos/macmainwindow/macmainwindow.pro
index f5165a79c4..cab38455c7 100644
--- a/demos/macmainwindow/macmainwindow.pro
+++ b/demos/macmainwindow/macmainwindow.pro
@@ -20,4 +20,6 @@ target.path = $$[QT_INSTALL_DEMOS]/macmainwindow
sources.files = $$SOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/macmainwindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
}
diff --git a/demos/mainwindow/mainwindow.pro b/demos/mainwindow/mainwindow.pro
index 9853a55a47..6e7d784e3b 100644
--- a/demos/mainwindow/mainwindow.pro
+++ b/demos/mainwindow/mainwindow.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.png *.jpg *.pro
sources.path = $$[QT_INSTALL_DEMOS]/mainwindow
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro
index c64abd9b0d..001989de68 100644
--- a/demos/mediaplayer/mediaplayer.pro
+++ b/demos/mediaplayer/mediaplayer.pro
@@ -25,4 +25,4 @@ wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
-
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/pathstroke/pathstroke.pro b/demos/pathstroke/pathstroke.pro
index 50b4de2496..ce6ab3d8b8 100644
--- a/demos/pathstroke/pathstroke.pro
+++ b/demos/pathstroke/pathstroke.pro
@@ -18,3 +18,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/pathstroke
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63E \ No newline at end of file
diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro
index 2534b752c9..18eac80156 100644
--- a/demos/qtdemo/qtdemo.pro
+++ b/demos/qtdemo/qtdemo.pro
@@ -4,6 +4,8 @@ DESTDIR = $$QT_BUILD_TREE/bin
OBJECTS_DIR = .obj
MOC_DIR = .moc
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
QT += xml network
contains(QT_CONFIG, opengl) {
diff --git a/demos/shared/shared.pri b/demos/shared/shared.pri
index b5515950a0..1541fa7248 100644
--- a/demos/shared/shared.pri
+++ b/demos/shared/shared.pri
@@ -16,5 +16,6 @@ contains(CONFIG, debug_and_release_target) {
hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a
hpuxi-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a
-!hpuxi-acc*:!hpux-acc*:LIBS += -ldemo_shared
+symbian:LIBS += -ldemo_shared.lib
+!hpuxi-acc*:!hpux-acc*:!symbian:LIBS += -ldemo_shared
diff --git a/demos/shared/shared.pro b/demos/shared/shared.pro
index cabce25d1a..a5e0e700c9 100644
--- a/demos/shared/shared.pro
+++ b/demos/shared/shared.pro
@@ -29,5 +29,8 @@ target.path = $$[QT_INSTALL_DEMOS]/shared
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.pri images
sources.path = $$[QT_INSTALL_DEMOS]/shared
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
!cross_compile:INSTALLS += target
+symbian:TARGET.UID3 = 0xA000A63C
diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro
index b62f244591..39c76dafec 100644
--- a/demos/spreadsheet/spreadsheet.pro
+++ b/demos/spreadsheet/spreadsheet.pro
@@ -31,3 +31,5 @@ sources.files = $$SOURCES $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/sqlbrowser/sqlbrowser.pro b/demos/sqlbrowser/sqlbrowser.pro
index 920e8a0011..1334bc1370 100644
--- a/demos/sqlbrowser/sqlbrowser.pro
+++ b/demos/sqlbrowser/sqlbrowser.pro
@@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$FORMS *.pro
sources.path = $$[QT_INSTALL_DEMOS]/sqlbrowser
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
}
diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp
index 128cd6a101..7350a4209a 100644
--- a/demos/textedit/textedit.cpp
+++ b/demos/textedit/textedit.cpp
@@ -127,7 +127,9 @@ TextEdit::TextEdit(QWidget *parent)
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
+#ifndef QT_NO_CLIPBOARD
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
+#endif
QString initialFile = ":/example.html";
const QStringList args = QCoreApplication::arguments();
@@ -240,7 +242,9 @@ void TextEdit::setupEditActions()
a->setShortcut(QKeySequence::Paste);
tb->addAction(a);
menu->addAction(a);
+#ifndef QT_NO_CLIPBOARD
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+#endif
}
void TextEdit::setupTextActions()
@@ -638,7 +642,9 @@ void TextEdit::cursorPositionChanged()
void TextEdit::clipboardDataChanged()
{
+#ifndef QT_NO_CLIPBOARD
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+#endif
}
void TextEdit::about()
diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro
index 1ef4256a73..6f15e70e2a 100644
--- a/demos/textedit/textedit.pro
+++ b/demos/textedit/textedit.pro
@@ -19,3 +19,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/textedit
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/undo/undo.pro b/demos/undo/undo.pro
index e26d07c4be..bf7017bf9f 100644
--- a/demos/undo/undo.pro
+++ b/demos/undo/undo.pro
@@ -15,3 +15,5 @@ sources.files = $$SOURCES $$HEADERS *.pro icons $$RESOURCES $$FORMS
sources.path = $$[QT_INSTALL_DEMOS]/undo
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/dist/changes-4.4.4-temple b/dist/changes-4.4.4-temple
new file mode 100644
index 0000000000..25f1f0bcb6
--- /dev/null
+++ b/dist/changes-4.4.4-temple
@@ -0,0 +1,65 @@
+Qt for S60 4.4.4 Temple introduces new ported modules and few other improvements.
+It guarantees no source or binary compatibility between any other versions.
+
+Some of the changes listed in this file include internal issue tracking
+numbers.
+
+This file only lists changes specific to Qt for S60.
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for S60
+----------
+ * Changes to qmake:
+ * [228860] Fixed bld.inf and .mmp generation when not under Qt src tree,
+ i.e. when the makespec is default.
+ * [231121] Added no_icon CONFIG keyword to suppress showing application
+ icon in the application menu.
+ * [233497] EPOCROOT is no longer required as environment variable as long
+ as a Symbian device can be determined.
+ * [234551] Generated .pkg files no longer include Qt libraries directly,
+ instead they have a dependency to a separate QtLibs package.
+ * [234555] Added support for generic mmp file content in form of
+ MMP_RULES variable. Also, EXPORTUNFROZEN is now defined using this
+ variable instead of being hardcoded.
+ * [234557] Improved user ability to control include order via INCLUDEPATH
+ variable.
+ * [234557] Support for STDDLL, STDEXE and STDLIB Open C target types via
+ stdbinary CONFIG keyword.
+ * [235975] The -r switch is no longer required with qmake to recurse
+ subdirs template.
+ * Fixed: Resources with similar basenames corrupted makefile.
+
+ * [230751] Improved Elastic Nodes application stability.
+ * [230752] Mouse drag events work now.
+ * [234558] Ported QSharedMemory.
+ * [234559] Ported QSystemSemaphore.
+ * [234560] Ported all of QtXml.
+ * [234561] Ported all of QtScript.
+ * [234562] Ported all of QtSvg.
+ * [234869] QFileDialog no longer uses desktop layout in Qt for S60.
+ * QtNetwork now supports SSL.
+ * If current path returned by Open C doesn't exist when queried, it is
+ created.
+ * All supported libs and plugins built under src dir now have proper UIDs.
+ * Fixed GCCE build breaking on atomics.
+ * Improved fonts support:
+ * Anti aliasing
+ * Italic/bold
+ * Higher text layout precision
+ * QPixmapCache size limited to 2MB.
+ * Createpackage script looks for RnD certs in Qt installation root instead
+ of EPOCROOT.
+ * Iconengines plugins included in the default build.
+ * More examples and demos added in the default build to showcase newly
+ ported modules.
+ * QFileSystemWatcher thread stack size increased to avoid crashing when
+ entering directories that need AllFiles capability.
+ * Createpackage will now support signing with custom certificates in
+ addition to default ones.
+ * A perl script patch_capabilities.pl is provided for changing capabilities
+ of all binaries specified in a single .pkg file.
+ \ No newline at end of file
diff --git a/dist/changes-4.5.0-garden b/dist/changes-4.5.0-garden
new file mode 100644
index 0000000000..1fae42ef1d
--- /dev/null
+++ b/dist/changes-4.5.0-garden
@@ -0,0 +1,241 @@
+Qt 4.5.0-garden
+---------------
+
+The Qt for S60 "Garden" release is the fourth pre-release from the
+Qt for S60 porting project. "Garden" is based on the Qt 4.5 codebase
+and release focus has been on proper GUI integration.
+
+Up to and including change: b7621555cb1d1c97967dd40d63dd7e85a418407c
+
+Lists just S60 fixes, for general 4.5.0 changes go to:
+
+ http://www.qtsoftware.com/developer/changes/changes-4.5.0
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Task Tracker:
+
+ http://qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain
+more information about a particular change. Sometimes the task is internal
+and cannot be viewed by the public, a lot of them are non-public for Qt for
+S60 at the moment.
+
+****************************************************************************
+* New features *
+****************************************************************************
+
+New modules
+-----------
+
+- qtmain
+ * Added a small static library called qtmain which is linked in
+ automatically for Qt applications on S60. qtmain includes an
+ implementation of E32Main() that sets up Qt correctly for S60. This
+ means that Qt no longer links to libcrt0.lib but uses qtmain instead.
+ However, if you are not linking against QtGui, you'll still have to
+ link to libcrt0.
+
+New classes
+------------
+
+- QS60Style
+ * Native look for Qt applications on S60 3.1 and later versions. The
+ style picks up the current theme parts, palettes and font settings
+ through the skinserver and uses these when painting in Qt.
+ The layout data for different resolutions is considered.
+
+Ported classes
+--------------
+
+- QDesktopServices
+ * Provides methods for accessing common desktop services: Opening the
+ browser with an url, launching documents with the standard application
+ and getting default system directories.
+
+- QClipboard
+ * Provides access to the window system clipboard.
+
+- QSysInfo
+ * QSysInfo class provides information about the system.
+
+Features
+--------
+
+- Input methods
+ * QInputMethodEvent will now be generated by Qt.
+ To use it, widgets must set the attribute WA_InputMethodEnabled and
+ implement QWidget::inputMethodQuery(...).
+ * Qt will use the underlaying FEP framework from S60.
+ * Multitap and T9 supported.
+ * Virtual keyboard for touch phones is supported.
+ * Most of the Qt widgets already have support for input methods.
+
+- Drag-n-Drop
+ * At the moment works only within same Qt process.
+
+- STL support for QtS60
+ * use -stl switch when configuring Qt.
+
+Optimizations
+-------------
+
+
+****************************************************************************
+* Build issues *
+****************************************************************************
+
+- Fixed compilation on private S60 platforms by adding neccessary include paths.
+- Fix compiler error if --gnu flag is given to RVCT.
+
+
+****************************************************************************
+* Changes to existing classes *
+****************************************************************************
+
+- qapplication_s60.cpp (non-public)
+ * Simplified by introduction of qtmain.
+ * added CCoeControl to be the native representation of QWidget.
+ * Use window group from CEikonEnv instead of creating our own.
+ * No need to create/destroy RWsSession, this is now done by the Avkon
+ application.
+ * Handle pointer events from QSymbianControl.
+ * Stopped using QETWidget for translation, now handled by
+ QSymbianControl.
+ * MouseButtonDblClick mapped to EModifierDoubleClick (after dblclick
+ Symbian will send mouseButtonRelease.
+
+- QApplication
+ * Implemented setDoubleClickInterval(...).
+ * Improved widgetAt().
+ * Added support for resizing widget's when the screen orientation
+ changes from portrait to landscape. For fullscreen and maximized
+ widgets this will ensure that they look correct in the new screen
+ layout.
+
+- qwindowsurface_s60.cpp (non-public)
+ * Stopped creating our own CWindowGc based on the RWindow and get
+ SystemGc from the CCoeControl we are currently painting on instead.
+
+- qeventdispatcher_s60.cpp
+ * Stopped using Active Objects to recieve events, we get them from
+ C*AppUi and CCoeControl instead.
+
+- QWidget
+ * Proper implementation for QDesktopWidget::availableGeometry.
+ * Improved raising and lowering widgets.
+ * Implemented setWindowTitle(...).
+ * Implemented QWidget::setWindowIcon(...) and made it to react to
+ different statuspane layouts.
+ * Improved focus handling (improved setFocus_sys).
+ * Fixed native window scrolling. Only use accelerated scroll if we are
+ scrolling a window owning widget.
+ * Improved setWindowState(...).
+ * Added implementation for createDefaultWindowSurface_sys().
+ * Added implementation for setMask_sys().
+ * Not creating a backing store for the top level widget (saves memory).
+ * winId() now returns a CCoeControl instead of RWindow.
+
+- QMenuBar
+ * Added support for using native S60 menues.
+ * Supported infinite level of menues inside menues.
+ * Supported checkboxes next to menu items).
+
+- QtCore and QtGui
+ * link to CONE and Uikon libraries and stop linking to glib and gthread.
+ * Renamed qt_deployment.pro to qt_libs.pro as it is more consistent.
+
+- Event loop / Event dispatcher
+ * We now integrate with the native loop, allowing CActiveScheduler and
+ QEventLoop to be used interchangably.
+ * Enabled posted events to work from the Symbian active scheduler too.
+ * Enable use of QEventLoop::ExcludeSocketEvents on Symbian.
+ * Improved handling of zero timers.
+
+- QColumnView
+ * Fixed a typo in one instance of QT_NO_QCOLUMNVIEW.
+
+- font rendering
+ * Speed increase
+ * Correctly render RTL text
+ * Proper shaping of complex writing systems
+ * Automatic font linking (aka merging) of different writing systems
+ * Rudimentary fallback glyph outline support
+ * Defaults to Symbians native (usually iType based) font rendering.
+ Alternatively, supports FreeType. Configure with -qt-freetype.
+
+- qcore_symbian_p.h (non-public)
+ * Added helper functions to convert QRect <-> TRect.
+ * Renamed qstringToTPtrC to qt_QString2TPtrC.
+ * Added helper function qt_TDisplayMode2Format.
+ * Added helper function to convert QSize <-> TSize.
+ * Added helper function to convert QString ->HBufC.
+ * Added helper function to convert TDesC -> QString.
+
+- QGraphicsSystem
+ * QRasterPixmapData(...) is specified as default pixmap data for S60.
+
+- QPixmap
+ * Improved grabWindow(...) when it comes to selecting client rect.
+
+- QDirModel
+ * Returns root dir name similary as done in Windows
+
+- QFSFileEngine
+ * copy(...) now uses Symbian native copy implementation which is more efficient
+ and doesn't leave temp files behind
+
+- QLocale
+ * Now has Symbian system locale support.
+
+****************************************************************************
+* Examples and demos *
+****************************************************************************
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- qmake
+ * Support for QMAKE_EXTRA_TARGETS and QMAKE_EXTRA_COMPILERS variables.
+ * Support BLD_INF_RULES variable. Adds entries to generated bld.inf file
+ * Added 'make' targets '<build>-<platform>' 'distclean' and 'run'
+ * New platform_paths.prf and data_caging_paths.prf contain several
+ variables and replacement functions for including known paths.
+ * The .pro file qt_libs.pro was moved to src/s60installs.
+ * Support for ICON variable for setting application icon.
+ * Support for RSS_RULES variable, which enables entries to be added to
+ generated application registration files.
+ * When bulding qmake and other bootstrapped tools we now use
+ "-warnings on" instead of "-warnings all".
+ * Improved error message if calls to $$system() fails.
+ * Fixed several issues when qmake is built for platform win32-mwc.
+ * Moved mocing step to the build step so it is not longer required to
+ do "abld build" or "abld makefile" to remoc.
+ * Improved "make clean".
+ * Increased max heap to 8Mb.
+ * Enabled __CC_ARM flag used by some versions of RVCT.
+ * Removed hard coded INCLUDEPATH from qmake - developer can control
+ the whole include path hierachy.
+ * Symbian export mechanism is no longer used for emulator deployment,
+ instead copy commands are generated to wrapper makefile and
+ executed during final phase of building, after post link.
+ * Removed -O1 flag from WINSCW builds.
+ * Added qmake function (size) to ask number of items in QStringList.
+ * Qt demos are now installed to QtDemos folder in S60 emulator.
+ * Qt examples are now installed to QtExamples folder in S60 emulator/HW.
+ * Plugin stubs suffix changed to ".qtplugin".
+ * Paths containing $${EPOCROOT}/epoc32 will now properly generate
+ absolute paths in mmps.
+
+
+-configure
+ * Defaults for FREETYPE and SCRIPTTOOLS set to "no".
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
diff --git a/doc/src/appicon.qdoc b/doc/src/appicon.qdoc
index 4d293374c7..a0fdbab409 100644
--- a/doc/src/appicon.qdoc
+++ b/doc/src/appicon.qdoc
@@ -223,4 +223,19 @@
installed in the appropriate locations for GNOME.
The GNOME developer website is at \l{http://developer.gnome.org/}.
+
+ \section1 Setting the Application Icon on S60 platforms
+
+ In order to set application icon for S60 application you need SVG-T icon.
+ How to create such SVG-T, please refer to
+ \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/}
+
+ Once you have icon in correct format and assuming you are using
+ \c qmake to generate your makefiles, you only need to add a single
+ line to your \c .pro project file. For example, if the name of your
+ icon file is \c{myapp.svg}, and your project file is \c{myapp.pro},
+ add this line to \c{myapp.pro}:
+
+ \snippet doc/src/snippets/code/doc_src_appicon.qdoc 5
+
*/
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index 29c6c0b844..2d57389dac 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -384,6 +384,7 @@
\list
\o \l{xml/dombookmarks}{DOM Bookmarks}
+ \o \l{xml/htmlinfo}{HTML Info}
\o \l{xml/saxbookmarks}{SAX Bookmarks}
\o \l{xml/streambookmarks}{QXmlStream Bookmarks}\raisedaster
\o \l{xml/rsslisting}{RSS-Listing}
diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc
new file mode 100644
index 0000000000..bf95486d67
--- /dev/null
+++ b/doc/src/examples/htmlinfo.qdoc
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example xml/htmlinfo
+ \title XML HTML Info Example
+
+ The XML HTML Info example provides a simple command line utility that
+ scans the current directory for HTML files and prints statistics about
+ them to standard out.
+
+ \note Standard out is redirected on some platforms. On Symbian using Open
+ C \c stdout is by default directed to the console window, but this window
+ may not always be visible. To redirect to a file instead, locate the \c
+ c:\\system\\data\\config.ini file (on either the emulator or the device)
+ and change \c STDOUT to point to \c MEDIA4. This will redirect the console
+ to \c c:\\system\\data\\out.txt.
+
+ The files are parsed using a QXmlStreamReader object. If the file does
+ not contain a well-formed XML document, a description of the error is
+ printed to the standard error console.
+
+ \section1 Basic Operation
+
+ The main function of the example uses QDir to access files in the current
+ directory that match either "*.htm" or "*.html". For each file found,
+ the \c parseHtmlFile() function is called.
+
+ Reading XML is handled by an instance of the QXmlStreamReader class, which
+ operates on the input file object:
+
+ \snippet examples/xml/htmlinfo/main.cpp 0
+
+ The work of parsing and the XML and extracting statistics is done in a
+ while loop, and is driven by input from the reader:
+
+ \snippet examples/xml/htmlinfo/main.cpp 1
+
+ If more input is available, the next token from the input file is read
+ and parsed. The program then looks for the specific element types,
+ "title", "a", and "p", and stores information about them.
+
+ When there is no more input, the loop terminates. If an error occurred,
+ information is written to the standard out file via a stream, and the
+ example exits:
+
+ \snippet examples/xml/htmlinfo/main.cpp 2
+
+ If no error occurred, the example prints some statistics from the data
+ gathered in the loop, and then exits.
+*/
diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc
index 925a195d40..85ea20c0ab 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -499,6 +499,116 @@ in the \l{Qt for Windows CE Requirements} document.
We hope you will enjoy using Qt. Good luck!
*/
+/*! \page install-S60.html
+
+\title Installing Qt on S60
+\ingroup installation
+\ingroup qts60
+\brief How to install Qt on S60.
+
+\list 1
+ \o Install needed IDE and SDKs
+
+ Make sure you have the following installed:
+ \list
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher}
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher}
+ \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ for S60 3rd Edition} (automatically included in 3.2 and higher)
+ \endlist
+
+ These instructions assume the above tools are installed and
+ that the enviroment variables for your compiler are set correctly.
+
+ \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found
+ \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+
+ \note The wsini.ini provided with the \bold{S60 Platform SDK 5th Edition v0.9}
+ needs to be updated for correct font rendering in the emulator. The update can be found
+ \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+
+ \o Install Qt
+
+ Uncompress the package into the directory you want Qt installed,
+ e.g. \c{C:\Qt\%VERSION%}.
+
+ \note Qt must be installed on the same drive as the S60 SDK you are
+ using, and the install path must not contain any spaces.
+
+ \o Environment variables
+
+ In order to build and use Qt, the \c PATH environment variable needs
+ to be extended:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 18
+
+ This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
+
+ On Windows the PATH can be extended by navigating to
+ "Control Panel->System->Advanced->Environment variables".
+
+ In addition, you must configure the environment for use with the S60
+ emulator. This is done by locating the Carbide.c++ submenu on the Start
+ menu, and choosing "Configure environment for WINSCW command line".
+
+ \o Configure Qt
+
+ To configure Qt for S60, do:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 23
+
+ For other options, type \c{configure -help} to get a list of all available
+ options.
+
+ \o Build Qt
+
+ The Qt libraries comes pre-built for real devices.
+ If you are using a 3.x S60 SDK, install \c{qts60binaries\3.x\qtlibs-%VERSION%.exe}
+ into the S60 SDK root directory. For example: \c{C:\Symbian\9.2\S60_3rd_FP1_2\}
+ If you are using a 5.0 S60 SDK, install \c{qts60binaries\5.0\qtlibs-%VERSION%.exe}
+ into the S60 SDK root directory. For example: \c{C:\S60\devices\S60_5th_Edition_SDK_v0.9\}
+
+ To build Qt for the emulator, type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 24
+
+ Congratulations, Qt is now ready to use.
+
+ \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. To run the demo on a real device, you first have to install
+ the Qt libraries on the device.
+ For 3.x devices install \c{qts60binaries\3.x\qt_libs_armv5_udeb.sisx}
+ For 5.0 devices install \c{qts60binaries\5.0\qt_libs_armv5_udeb.sisx}
+ included in this package to the device. Then type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 25
+
+ This will create a self-signed \c fluidlauncher_gcce_udeb.sisx and
+ install it to your device.
+
+ \note You can specify your own certificate and key files as additional parameters to
+ \c createpackage if default ones are not suitable.
+
+ To run the demos on the emulator simply run:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+
+ Or, if you need to supply arguments to the program, navigate to
+ \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the
+ Qt demos located there, for example:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 26
+
+ For more information about building and running Qt programs on S60,
+ see \l{S60 - Introduction to using Qt}.
+
+ We hope you will enjoy using Qt.
+
+\endlist
+
+*/
/*!
\page requirements.html
\title General Qt Requirements
diff --git a/doc/src/plugins-howto.qdoc b/doc/src/plugins-howto.qdoc
index 2c2b03192f..95710f603e 100644
--- a/doc/src/plugins-howto.qdoc
+++ b/doc/src/plugins-howto.qdoc
@@ -187,6 +187,20 @@
The \l{Style Plugin Example} shows how to implement a plugin
that extends the QStylePlugin base class.
+ \note In Symbian all binaries must be located in the directory \\sys\\bin,
+ so each Qt plugin has a stub with the same basename as the plugin dll
+ and suffix ".qtplugin" to make Qt extension plugins work similarly to
+ other platforms.
+ When trying to locate the plugin, Qt actually looks for the stub
+ instead of the plugin binary. While plugin stub files have the
+ suffix ".qtplugin", they can still be loaded also by specifying a filename
+ with the normal library suffix ".dll" for QPluginLoader, so normally application
+ developer doesn't need to care about the different suffix of the stub.
+ In Symbian the default plugin stubs path is \\resource\\qt\\plugins.
+ Because of the way applications can be installed
+ on ROM or various other drives in Symbian, all available drives are
+ searched for that path when looking for plugins.
+
\section1 The Lower-Level API: Extending Qt Applications
Not only Qt itself but also Qt application can be extended
diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc
index 172bc60e0b..ff56dadaee 100644
--- a/doc/src/qmake-manual.qdoc
+++ b/doc/src/qmake-manual.qdoc
@@ -883,6 +883,89 @@
This is discussed in more detail in the
\l{Deploying an Application on Windows#Visual Studio 2005 Onwards}
{deployment guide for Windows}.
+
+
+ \section1 S60
+
+ Features specific to this platform include handling of static data,
+ capabilities, stack and heap size, compiler specific options, and unique
+ identifiers for the application or library.
+
+ \section2 Handling of static data
+
+ If the application uses any static data, the build system needs to be
+ informed about it. This is because Symbian tries to save memory if no
+ static data is in use.
+
+ To specify that static data support is desired, add this to the project file:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 129
+
+ The default value is zero.
+
+ \section2 Stack and heap size
+
+ Symbian uses predefined sizes for stacks and heaps. If an
+ application exceeds either limit, it may crash or fail to complete its
+ task. Crashes that seem to have no reason can often be traced back to
+ insufficient stack and/or heap sizes.
+
+ The stack size has a maximum value, whereas the heap size has a
+ minimum and a maximum value, all specified in bytes. The minimum value
+ prevents the application from starting if that amount of memory is not available. The
+ minimum and maximum values are separated by a space. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 130
+
+ The default values depend on the version of the S60 SDK you're using.
+
+ \section2 Compiler specific options
+
+ General compiler options can as usual be set using \c QMAKE_CFLAGS and \c QMAKE_CXXFLAGS.
+ In order to set specific compiler options, \c QMAKE_CFLAGS.<compiler> and
+ \c QMAKE_CXXFLAGS.<compiler> can be used. \c <compiler> can be either \c CW for the WINSCW
+ architecture (emulator), or \c ARMCC for the ARMv5 architecture (hardware).
+
+ Here is an example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131
+
+ \section2 Unique identifiers
+
+ Symbian applications may have unique identifiers attached to them.
+ Here is how to define them in a project file:
+
+ There are four types of IDs supported: \c UID2, \c UID3, \c SID, and \c VID. They
+ are specified like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 132
+
+ If \c UID2 is not specified, it defaults to the same value as \c UID3.
+ If \c UID3 is not specified, qmake will automatically generate a \c UID3
+ suitable for development and debugging. This value should be manually
+ specified for applications that are to be released. In order to optain
+ an official UID, please contact Nokia. Both \c SID and \c VID default to empty values.
+
+ For more information about unique identifiers and their meaning for
+ Symbian applications, please refer to the
+ \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/ToolsAndUtilities/BuildTools/UsingUids.guide.html}{respective S60 SDK documentation}.
+
+ \section2 Capabilities
+
+ Capabilities define extra priviledges for the application, such as the
+ ability to list all files on the file system. Capabilities are defined
+ in the project file like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 133
+
+ It is also possible to specify which capabilities \e not to have,
+ by first specifying \c ALL and then list the unwanted capabilities
+ with a minus in front of them, like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 134
+
+ For more information about capabilities, please refer to the
+ \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/guide/platsecsdk/index.html}{respective S60 SDK documentation}.
*/
/*!
@@ -973,6 +1056,32 @@
\tableofcontents{3}
+ \target BLD_INF_RULES
+ \section1 BLD_INF_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables.
+ The section of \c bld.inf file where each rule goes is appended to
+ \c BLD_INF_RULES with a dot.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 146
+
+ This will add the specified statements to the \c prj_exports section of the
+ generated \c bld.inf file.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the generated \c bld.inf file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 143
+
+ Any rules you define will be added after automatically generated
+ rules in each section.
+
\target CONFIG
\section1 CONFIG
@@ -1123,6 +1232,20 @@
The build process for bundles is also influenced by
the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable.
+ These options only have an effect on Symbian:
+
+ \table 95%
+ \header \o Option \o Description
+ \row \o stdbinary \o Builds an Open C binary (i.e. STDDLL, STDEXE, or STDLIB,
+ depending on the target binary type.)
+ \row \o no_icon \o Doesn't generate resources needed for displaying an icon
+ for executable in application menu (app only).
+ \row \o symbian_test \o Places mmp files and extension makefiles under
+ test sections in generated bld.inf instead of their regular sections.
+ Note that this only affects automatically generated bld.inf content;
+ the content added via \c BLD_INF_RULES variable is not affected.
+ \endtable
+
These options have an effect on Linux/Unix platforms:
\table 95%
@@ -1166,7 +1289,7 @@
\target DEPLOYMENT
\section1 DEPLOYMENT
- \e {This is only used on Windows CE.}
+ \e {This is only used on Windows CE and Symbian.}
Specifies which additional files will be deployed. Deployment means the
transfer of files from the development system to the target device or
@@ -1184,7 +1307,8 @@
The default deployment target path for Windows CE is
\c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
- \c{\Program Files\target}.
+ \c{\Program Files\target}. For Symbian, the default target is the application
+ private directory on the drive it is installed to.
It is also possible to specify multiple \c sources to be deployed on
target \c paths. In addition, different variables can be used for
@@ -1194,24 +1318,63 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 29
- \note All linked Qt libraries will be deployed to the path specified
- by \c{myFiles.path}.
+ \note In Windows CE all linked Qt libraries will be deployed to the path
+ specified by \c{myFiles.path}. In Symbian all libraries and executables
+ will always be deployed to the \\sys\\bin of the installation drive.
+
+ Since the Symbian build system automatically moves binaries to certain
+ directories under the epoc32 directory, custom plugins, executables or
+ dynamically loadable libraries need special handling. When deploying
+ extra executables or dynamically loadable libraries, the target path
+ must specify \\sys\\bin. For plugins, the target path must specify the
+ location where the plugin stub will be deployed to (see the
+ \l{How to Create Qt Plugins} document for more information about plugins).
+ If the binary cannot be found from the indicated source path,
+ the directory Symbian build process moves the executables to is
+ searched, e.g. \\epoc32\\release\\armv5\\urel.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128
+ In Symbian, dependencies to other packages can also be created using
+ this variable. The strings defined as dependencies are not parsed by
+ qmake, so they should be in a format understood by Symbian package
+ generation tools. Please consult Symbian documentation for correct syntax.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
+
+ In Symbian, the \c default_deployment item specifies
+ default platform dependencies. It can be overwritten if a more
+ restrictive set is needed - e.g. if a specific
+ device is required to run the application.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141
+
\target DEPLOYMENT_PLUGIN
\section1 DEPLOYMENT_PLUGIN
- \e {This is only used on Windows CE.}
+ \e {This is only used on Windows CE and Symbian.}
This variable specifies the Qt plugins that will be deployed. All plugins
available in Qt can be explicitly deployed to the device. See
\l{Static Plugins}{Static Plugins} for a complete list.
- \note No plugins will be deployed automatically. If the application
- depends on plugins, these plugins have to be specified manually.
+ \note In Windows CE, No plugins will be deployed automatically.
+ If the application depends on plugins, these plugins have to be specified
+ manually.
+
+ \note In Symbian, all plugins supported by this variable will be deployed
+ by default with Qt libraries, so generally using this variable is not
+ needed.
For example:
- \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 142
This will upload the jpeg imageformat plugin to the plugins directory
on the Windows CE device.
@@ -1367,9 +1530,9 @@
This variable contains a list of libraries to be linked into the project.
You can use the Unix \c -l (library) and -L (library path) flags and qmake
- will do the correct thing with these libraries on Windows (namely this
- means passing the full path of the library to the linker). The only
- limitation to this is the library must exist, for qmake to find which
+ will do the correct thing with these libraries on Windows and Symbian
+ (namely this means passing the full path of the library to the linker). The
+ only limitation to this is the library must exist, for qmake to find which
directory a \c -l lib lives in.
For example:
@@ -1383,6 +1546,14 @@
explicitly specify the library to be used by including the \c{.lib}
file name suffix.
+ \bold{Note:} On S60, the build system makes a distinction between shared and
+ static libraries. In most cases, qmake will figure out which library you
+ are refering to, but in some cases you may have to specify it explicitly to
+ get the expected behavior. This typically happens if you are building a
+ library and using it in the same project. To specify that the library is
+ either shared or static, add a ".dll" or ".lib" suffix, respectively, to the
+ library name.
+
By default, the list of libraries stored in \c LIBS is reduced to a list of
unique names before it is used. To change this behavior, add the
\c no_lflags_merge option to the \c CONFIG variable:
@@ -1418,6 +1589,37 @@
when generating a Makefile. The value of this variable is typically
handled internally by \c qmake and rarely needs to be modified.
+ \target MMP_RULES
+ \section1 MMP_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic MMP file content can be specified with this variable.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 137
+
+ This will add the specified statement to the end of the generated MMP file.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the generated MMP file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 138
+
+ If you need to include a hash (\c{#}) character inside the
+ \c MMP_RULES statement, it can be done with the variable
+ \c LITERAL_HASH as follows:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 139
+
+ \note You should not use this variable to add MMP statements that are
+ explicitly supported by their own variables, such as
+ \c TARGET.EPOCSTACKSIZE.
+ Doing so could result in duplicate statements in the MMP file.
+
\target MOC_DIR
\section1 MOC_DIR
@@ -1710,6 +1912,14 @@
the \c QMAKE_CXXFLAGS_DEBUG and \c QMAKE_CXXFLAGS_RELEASE variables,
respectively.
+ \bold{Note:} On S60, this variable can be used to pass architecture specific
+ options to each compiler in the Symbian build system. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131
+
+ For more information, see
+ \l{qmake Platform Notes#Compiler specific options}{qmake Platform Notes}.
+
\target QMAKE_CXXFLAGS_DEBUG
\section1 QMAKE_CXXFLAGS_DEBUG
@@ -2432,6 +2642,49 @@
This variable contains the name of the resource file for the application.
The value of this variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ \target RSS_RULES
+ \section1 RSS_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic RSS file content can be specified with this variable. The syntax is
+ similar to \c MMP_RULES and \c BLD_INF_RULES.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 144
+
+ This will add the specified statement to the end of the generated
+ registration resource file. As an impact of this statement, the application
+ will not be visible in application shell.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the registration resource file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145
+
+ This example will install the application to MyFolder in S60 application
+ shell. In addition it will make the application to be launched in background.
+
+ For detailed list of possible RSS statements, please refer to Symbian OS help.
+
+ \note You should not use \c RSS_RULES variable to set the following RSS statements:
+
+ app_file
+ localisable_resource_file
+ localisable_resource_id
+
+ These statements are internally handled by qmake.
+
+ \target S60_VERSION
+ \section1 S60_VERSION
+
+ \e {This is only used on Symbian.}
+
+ Contains the version number of the underlying S60 SDK; e.g. "5.0".
\target SIGNATURE_FILE
\section1 SIGNATURE_FILE
@@ -2496,6 +2749,78 @@
The project file above would produce an executable named \c myapp on
unix and 'myapp.exe' on windows.
+ \target TARGET.CAPABILITY
+ \section1 TARGET.CAPABILITY
+
+ \e {This is only used on Symbian.}
+
+ Specifies which platform capabilities the application should have. For more
+ information, please refer to the S60 SDK documentation.
+
+ \target TARGET.EPOCALLOWDLLDATA
+ \section1 TARGET.EPOCALLOWDLLDATA
+
+ \e {This is only used on Symbian.}
+
+ Specifies whether static data should be allowed in the application. Symbian
+ disallows this by default in order to save memory. To use it, set this to 1.
+
+ \target TARGET.EPOCHEAPSIZE
+ \section1 TARGET.EPOCHEAPSIZE
+
+ \e {This is only used on Symbian.}
+
+ Specifies the minimum and maximum heap size of the application. The program
+ will refuse to run if the minimum size is not available when it starts. For
+ example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 135
+
+ \target TARGET.EPOCSTACKSIZE
+ \section1 TARGET.EPOCSTACKSIZE
+
+ \e {This is only used on Symbian.}
+
+ Specifies the maximum stack size of the application. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 136
+
+ \target TARGET.SID
+ \section1 TARGET.SID
+
+ \e {This is only used on Symbian.}
+
+ Specifies which secure identifier to use for the target application or
+ library. For more information, see the S60 SDK documentation.
+
+ \target TARGET.UID2
+ \section1 TARGET.UID2
+
+ \e {This is only used on Symbian.}
+
+ Specifies which unique identifier 2 to use for the target application or
+ library. If this variable is not specified, it defaults to the same value
+ as TARGET.UID3. For more information, see the S60 SDK documentation.
+
+ \target TARGET.UID3
+ \section1 TARGET.UID3
+
+ \e {This is only used on Symbian.}
+
+ Specifies which unique identifier 3 to use for the target application or
+ library. If this variable is not specified, a UID3 suitable for development
+ and debugging will be generated automatically. However, applications being
+ released should always define this variable. For more information, see the
+ S60 SDK documentation.
+
+ \target TARGET.VID
+ \section1 TARGET.VID
+
+ \e {This is only used on Symbian.}
+
+ Specifies which vendor identifier to use for the target application or
+ library. For more information, see the S60 SDK documentation.
+
\section1 TARGET_EXT
This variable specifies the target's extension. The value of this variable
@@ -3315,22 +3640,70 @@
\table
\header
- \o Member
- \o Description
- \row
- \o combine
- \o Indicates that all of the input files are combined into a single output file.
- \row
- \o target_predeps
- \o Indicates that the output should be added to the list of PRE_TARGETDEPS.
- \row
- \o explicit_dependencies
- \o The dependencies for the output only get generated from the depends member and from
- nowhere else.
- \row
- \o no_link
- \o Indicates that the output should not be added to the list of objects to be linked in
- \endtable
+ \o Member
+ \o Description
+ \row
+ \o commands
+ \o The commands used for for generating the output from the input.
+ \row
+ \o CONFIG
+ \o Specific configuration options for the custom compiler. See the CONFIG table for details.
+ \row
+ \o depend_command
+ \o Specifies a command used to generate the list of dependencies for the output.
+ \row
+ \o dependency_type
+ \o Specifies the type of file the output is, if it is a known type (such as TYPE_C,
+ TYPE_UI, TYPE_QRC) then it is handled as one of those type of files.
+ \row
+ \o depends
+ \o Specifies the dependencies of the output file.
+ \row
+ \o input
+ \o The variable that contains the files that should be processed with the custom compiler.
+ \row
+ \o name
+ \o A description of what the custom compiler is doing. This is only used in some backends.
+ \row
+ \o output
+ \o The filename that is created from the custom compiler.
+ \row
+ \o output_function
+ \o Specifies a custom qmake function that is used to specify the filename to be created.
+ \row
+ \o variables
+ \o Indicates that the variables specified here are replaced with $(QMAKE_COMP_VARNAME) when refered to
+ in the pro file as $(VARNAME).
+ \row
+ \o variable_out
+ \o The variable that the files created from the output should be added to.
+ \endtable
+
+ List of members specific to the CONFIG option:
+
+ \table
+ \header
+ \o Member
+ \o Description
+ \row
+ \o combine
+ \o Indicates that all of the input files are combined into a single output file.
+ \row
+ \o target_predeps
+ \o Indicates that the output should be added to the list of PRE_TARGETDEPS.
+ \row
+ \o explicit_dependencies
+ \o The dependencies for the output only get generated from the depends member and from
+ nowhere else.
+ \row
+ \o no_link
+ \o Indicates that the output should not be added to the list of objects to be linked in.
+ \endtable
+
+ \note Symbian specific: Generating objects to be linked in is not supported in Symbian,
+ so either the \c CONFIG option \c no_link or variable \c variable_out
+ should always be defined for extra compilers.
+
*/
/*!
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index d9f001e599..84b3a01672 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -2392,6 +2392,36 @@
*/
/*!
+ \enum Qt::InputMethodHint
+
+ \value ImhNone No hints.
+ \value ImhHiddenText Characters should be hidden, as is typically used when entering passwords.
+ This is automatically set when setting QLineEdit::echoMode to \c Password.
+ \value ImhDigitsOnly Only digit input is allowed.
+ \value ImhFormattedNumbersOnly Only number input (including integers and real numbers) is allowed.
+ \value ImhUppercaseOnly Only upper case letter input is allowed.
+ \value ImhLowercaseOnly Only lower case letter input is allowed.
+ \value ImhNoAutoUppercase The input method should not try to automatically switch to upper case
+ at the beginning of a sentence.
+ \value ImhPreferNumbers Numbers are preferred (but not required). This can include only digits,
+ phone numbers, or all numbers, depending on which one of the
+ \c ImhDigitsOnly, \c ImhDialableCharactersOnly and
+ \c ImhFormattedNumbersOnly flags is given.
+ \value ImhPreferUppercase Upper case letters are preferred (but not required).
+ \value ImhPreferLowercase Lower case letters are preferred (but not required).
+ \value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing.
+ \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed.
+
+ \note If several flags ending with \c Only are ORed together, the resulting character set will
+ consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
+ \c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
+
+ \note If several flags of the \c Prefer type are ORed together, the result is undefined.
+
+ \sa QWidget::inputMethodHints
+*/
+
+/*!
\enum Qt::InputMethodQuery
\value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates.
@@ -2401,6 +2431,7 @@
selection, even if the real cursor is located at the logical start.
\value ImSurroundingText The plain text around the input area, for example the current paragraph.
\value ImCurrentSelection The currently selected text.
+ \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned.
*/
/*!
diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc
new file mode 100644
index 0000000000..a574355802
--- /dev/null
+++ b/doc/src/s60-introduction.qdoc
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page s60-with-qt-introduction.html
+
+ \title S60 - Introduction to using Qt
+ \brief An introduction to Qt for S60 developers.
+ \ingroup howto
+ \ingroup qts60
+
+ \tableofcontents
+
+ \section1 Required tools
+
+ In order to use Qt for S60 you need to have a typical S60 development
+ setup. See \l{Qt for S60 Requirements} for the details.
+
+ \section1 Installing Qt
+
+ Follow the instructions found in \l{Installing Qt on S60}.
+
+ \section1 Building your own applications
+
+ If you are new to Qt development, have a look at \l{How to Learn Qt}
+ and \l{Qt Tutorial}. In general, the difference between developing a
+ Qt application on S60 compared to any of the other platforms supported
+ by Qt is not that big.
+
+ Once you have crated a \c .pro file for your project, generate the
+ Carbide specific \c Bld.inf and \c .mmp files this way:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 0
+
+ For more information on how to use qmake have a look at the \l
+ {qmake Tutorial}.
+
+ Now you can build the Qt on S60 application with standard build
+ tools. By default, running \c make will produce binaries for the
+ emulator. However, S60 comes with several alternative build targets,
+ as shown in the table below:
+
+ \table
+ \row \o \c debug-winscw \o Build debug binaries for the emulator (default).
+ It is currently not possible to build release
+ binaries for the emulator.
+ \row \o \c debug-gcce \o Build debug binaries for hardware using GCCE.
+ \row \o \c release-gcce \o Build release binaries for hardware using GCCE.
+ \row \o \c debug-armv5 \o Build debug binaries for hardware using RVCT.
+ \row \o \c release-armv5 \o Build release binaries for hardware using RVCT.
+ \row \o \c run \o Run the emulator binaries from the build directory.
+ \endtable
+
+ The following lines perform a debug build for the emulator
+ and deploy all the needed files:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 1
+
+ To work on your project in Carbide, simply import the \c .pro file
+ by right clicking on the project explorer and executing "Import...".
+
+ \section1 Installing your own applications
+
+ To install your own applications on hardware, Qt comes with a tool called
+ \c createpackage. When used on the \c .pkg files created by qmake, it
+ will produce a \c .sisx file that can be installed to the device. For
+ example:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2
+
+ If you want to install the program immediately, make sure that the device
+ is connected to the computer in "PC Suite" mode, and run \c createpackage
+ with the \c -i switch, like this:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 3
+*/
diff --git a/doc/src/snippets/code/doc_src_appicon.qdoc b/doc/src/snippets/code/doc_src_appicon.qdoc
index c8883fe388..c763a685e1 100644
--- a/doc/src/snippets/code/doc_src_appicon.qdoc
+++ b/doc/src/snippets/code/doc_src_appicon.qdoc
@@ -21,3 +21,7 @@ kde-config --path icon
//! [4]
gnome-config --datadir
//! [4]
+
+//! [5]
+ICON = myapp.svg
+//! [5]
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index e35dad9f0b..2930317206 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -125,3 +125,34 @@ setcepaths wincewm50pocket-msvc2005
//! [22]
nmake
//! [22]
+
+
+//! [23]
+cd \Qt\%VERSION%
+configure -platform win32-mwc -xplatform symbian-abld
+//! [23]
+
+
+//! [24]
+make debug-winscw
+//! [24]
+
+
+//! [25]
+cd examples
+make debug-gcce
+cd ..\demos
+
+make debug-gcce
+cd embedded\fluidlauncher
+createpackage -i fluidlauncher_gcce_udeb.pkg
+//! [25]
+
+
+//! [26]
+wiggly.exe -small-screen
+//! [26]
+
+//! [27]
+make run
+//! [27]
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index edb66bcdea..b93e1518c4 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -809,5 +809,122 @@ CONFIG(debug, debug|release) {
//! [127]
//! [128]
-DEPLOYMENT_PLUGIN += qjpeg
+customplugin.sources = customimageplugin.dll
+customplugin.sources += c:\myplugins\othercustomimageplugin.dll
+customplugin.path = imageformats
+dynamiclibrary.sources = mylib.dll helper.exe
+dynamiclibrary.path = \sys\bin
+globalplugin.sources = someglobalimageplugin.dll
+globalplugin.path = \resource\qt\plugins\imageformats
+DEPLOYMENT += customplugin dynamiclibrary globalplugin
//! [128]
+
+//! [129]
+TARGET.EPOCALLOWDLLDATA = 1
+//! [129]
+
+//! [130]
+TARGET.EPOCHEAPSIZE = 10000 10000000
+TARGET.EPOCSTACKSIZE = 0x8000
+//! [130]
+
+//! [131]
+QMAKE_CXXFLAGS.CW += -O2
+QMAKE_CXXFLAGS.ARMCC += -O0
+//! [131]
+
+//! [132]
+TARGET.UID2 = 0x00000001
+TARGET.UID3 = 0x00000002
+TARGET.SID = 0x00000003
+TARGET.VID = 0x00000004
+//! [132]
+
+//! [133]
+TARGET.CAPABILITY += AllFiles
+//! [133]
+
+//! [134]
+TARGET.CAPABILITY = ALL -TCB
+//! [134]
+
+//! [135]
+TARGET.EPOCHEAPSIZE = 10000 10000000
+//! [135]
+
+//! [136]
+TARGET.EPOCSTACKSIZE = 0x8000
+//! [136]
+
+//! [137]
+MMP_RULES += "DEFFILE hello.def"
+//! [137]
+
+//! [138]
+myBlock = \
+"START RESOURCE foo.rss" \
+"TARGET bar" \
+"TARGETPATH private\10001234" \
+"HEADER" \
+"LANG 01" \
+"UID 0x10002345 0x10003456" \
+"END"
+
+MMP_RULES += myBlock
+//! [138]
+
+//! [139]
+myIfdefBlock = \
+"$${LITERAL_HASH}ifdef WINSCW" \
+"DEFFILE hello_winscw.def" \
+"$${LITERAL_HASH}endif"
+
+MMP_RULES += myIfdefBlock
+//! [139]
+
+//! [140]
+somelib.sources = somelib.dll
+somelib.path = \sys\bin
+somelib.depends = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \
+ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}"
+justdep.depends = "(0xAAAABBBB), 0, 2, 0, {\"My Framework\"}"
+DEPLOYMENT += somelib justdep
+//! [140]
+
+//! [141]
+default_deployment.depends = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}"
+//! [141]
+
+//! [142]
+DEPLOYMENT_PLUGIN += qjpeg
+//! [142]
+
+//! [143]
+myextension = \
+ "start extension myextension" \
+ "$${LITERAL_HASH}if defined(WINSCW)" \
+ "option MYOPTION foo" \
+ "$${LITERAL_HASH}endif" \
+ "option MYOPTION bar" \
+ "end"
+BLD_INF_RULES.prj_extensions += myextension
+//! [143]
+
+//! [144]
+RSS_RULES += "hidden = KAppIsHidden;"
+//! [144]
+
+//! [145]
+myrssrules = \
+ "hidden = KAppIsHidden;" \
+ "launch = KAppLaunchInBackground;" \
+RSS_RULES += myrssrules
+//! [145]
+
+//! [146]
+BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "rom/my.iby APP_LAYER_PUBLIC_EXPORT_PATH(my.iby)" \
+ "inc/myheader.h mycomp/myheader.h" \
+ ":zip my_api.zip my_api"
+//! [146]
diff --git a/doc/src/snippets/code/doc_src_s60-introduction.qdoc b/doc/src/snippets/code/doc_src_s60-introduction.qdoc
new file mode 100644
index 0000000000..ff1d159c21
--- /dev/null
+++ b/doc/src/snippets/code/doc_src_s60-introduction.qdoc
@@ -0,0 +1,16 @@
+//! [0]
+ qmake
+//! [0]
+
+
+//! [1]
+ make debug-winscw
+//! [1]
+
+//! [2]
+ createpackage wiggly_gcce_udeb.pkg
+//! [2]
+
+//! [3]
+ createpackage -i wiggly_gcce_udeb.pkg
+//! [3]
diff --git a/examples/activeqt/activeqt.pro b/examples/activeqt/activeqt.pro
index 262e1a1506..1cd05f61d6 100644
--- a/examples/activeqt/activeqt.pro
+++ b/examples/activeqt/activeqt.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS activeqt.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/comapp/comapp.pro b/examples/activeqt/comapp/comapp.pro
index 84ce072b10..29aebae58e 100644
--- a/examples/activeqt/comapp/comapp.pro
+++ b/examples/activeqt/comapp/comapp.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS comapp.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro
index abe5f1bb2b..d0ebbcd206 100644
--- a/examples/activeqt/hierarchy/hierarchy.pro
+++ b/examples/activeqt/hierarchy/hierarchy.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hierarchy.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro
index c962b6b718..8963bad405 100644
--- a/examples/activeqt/menus/menus.pro
+++ b/examples/activeqt/menus/menus.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro
index 7b86950a30..97acc9a4aa 100644
--- a/examples/activeqt/multiple/multiple.pro
+++ b/examples/activeqt/multiple/multiple.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS multiple.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro
index 8eb81beaf5..4979dc09cb 100644
--- a/examples/activeqt/opengl/opengl.pro
+++ b/examples/activeqt/opengl/opengl.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/qutlook/qutlook.pro b/examples/activeqt/qutlook/qutlook.pro
index c1154e0ddd..0387735e8c 100644
--- a/examples/activeqt/qutlook/qutlook.pro
+++ b/examples/activeqt/qutlook/qutlook.pro
@@ -21,3 +21,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qutlook.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/simple/simple.pro b/examples/activeqt/simple/simple.pro
index d0f201947a..4d8480eebc 100644
--- a/examples/activeqt/simple/simple.pro
+++ b/examples/activeqt/simple/simple.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS simple.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/webbrowser/webbrowser.pro b/examples/activeqt/webbrowser/webbrowser.pro
index 992d871a2e..d6566cb64c 100644
--- a/examples/activeqt/webbrowser/webbrowser.pro
+++ b/examples/activeqt/webbrowser/webbrowser.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webbrowser.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/wrapper/wrapper.pro b/examples/activeqt/wrapper/wrapper.pro
index 4eb6baf6cb..e109dba93c 100644
--- a/examples/activeqt/wrapper/wrapper.pro
+++ b/examples/activeqt/wrapper/wrapper.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wrapper.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/assistant/assistant.pro b/examples/assistant/assistant.pro
index 14771788e0..b724bcb6f5 100644
--- a/examples/assistant/assistant.pro
+++ b/examples/assistant/assistant.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/assistant
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS assistant.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/assistant
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/assistant/simpletextviewer/simpletextviewer.pro b/examples/assistant/simpletextviewer/simpletextviewer.pro
index 4b66edb3cc..4bbdaf1a9d 100644
--- a/examples/assistant/simpletextviewer/simpletextviewer.pro
+++ b/examples/assistant/simpletextviewer/simpletextviewer.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro
index 4b37b038a8..7c46533f9a 100644
--- a/examples/dbus/complexpingpong/complexping.pro
+++ b/examples/dbus/complexpingpong/complexping.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro
index e62fb8569a..b4d4d1aa9e 100644
--- a/examples/dbus/complexpingpong/complexpong.pro
+++ b/examples/dbus/complexpingpong/complexpong.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/dbus-chat/dbus-chat.pro b/examples/dbus/dbus-chat/dbus-chat.pro
index a094048850..e04c641c5a 100644
--- a/examples/dbus/dbus-chat/dbus-chat.pro
+++ b/examples/dbus/dbus-chat/dbus-chat.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index 36bdc1a552..e4a4f70f88 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus
sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/listnames/listnames.pro b/examples/dbus/listnames/listnames.pro
index e2096a7c06..b8a648ee3d 100644
--- a/examples/dbus/listnames/listnames.pro
+++ b/examples/dbus/listnames/listnames.pro
@@ -15,3 +15,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/listnames
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/dbus/pingpong/ping.pro b/examples/dbus/pingpong/ping.pro
index 5e5f07afef..e28060f6f2 100644
--- a/examples/dbus/pingpong/ping.pro
+++ b/examples/dbus/pingpong/ping.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/pingpong/pong.pro b/examples/dbus/pingpong/pong.pro
index f377a71f28..ed06d222e2 100644
--- a/examples/dbus/pingpong/pong.pro
+++ b/examples/dbus/pingpong/pong.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro
index d4a97fa65a..600c3f2e8b 100644
--- a/examples/dbus/remotecontrolledcar/car/car.pro
+++ b/examples/dbus/remotecontrolledcar/car/car.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro
index 3015127cb9..b31d418421 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.pro
+++ b/examples/dbus/remotecontrolledcar/controller/controller.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
index 73bfa37d00..0df8e1ff2d 100644
--- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
+++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
@@ -6,3 +6,5 @@ SUBDIRS = car \
sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/calculatorbuilder/calculatorbuilder.pro b/examples/designer/calculatorbuilder/calculatorbuilder.pro
index 1d69cc856f..e08220a0a3 100644
--- a/examples/designer/calculatorbuilder/calculatorbuilder.pro
+++ b/examples/designer/calculatorbuilder/calculatorbuilder.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorbuilder
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.ui *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorbuilder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/calculatorform/calculatorform.pro b/examples/designer/calculatorform/calculatorform.pro
index 73f4351325..5a133a9cce 100644
--- a/examples/designer/calculatorform/calculatorform.pro
+++ b/examples/designer/calculatorform/calculatorform.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/containerextension/containerextension.pro b/examples/designer/containerextension/containerextension.pro
index 6a2cb58d12..9b2b8bc959 100644
--- a/examples/designer/containerextension/containerextension.pro
+++ b/examples/designer/containerextension/containerextension.pro
@@ -24,3 +24,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/containerextension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/customwidgetplugin/customwidgetplugin.pro b/examples/designer/customwidgetplugin/customwidgetplugin.pro
index 4feee59f6a..6cc376f0c7 100644
--- a/examples/designer/customwidgetplugin/customwidgetplugin.pro
+++ b/examples/designer/customwidgetplugin/customwidgetplugin.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/customwidgetplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/designer.pro b/examples/designer/designer.pro
index 0f30421aca..b7eacc086a 100644
--- a/examples/designer/designer.pro
+++ b/examples/designer/designer.pro
@@ -17,3 +17,5 @@ solaris-cc*:SUBDIRS -= calculatorbuilder \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/taskmenuextension/taskmenuextension.pro b/examples/designer/taskmenuextension/taskmenuextension.pro
index 83dd8788c3..89c0c44f2c 100644
--- a/examples/designer/taskmenuextension/taskmenuextension.pro
+++ b/examples/designer/taskmenuextension/taskmenuextension.pro
@@ -23,3 +23,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/taskmenuextension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
index 2690921673..0123fd13b3 100644
--- a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
+++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.ui *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
index cd117dc05d..5eb133f1fa 100644
--- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
+++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/desktop.pro b/examples/desktop/desktop.pro
index b65f4f2d8b..61108e509c 100644
--- a/examples/desktop/desktop.pro
+++ b/examples/desktop/desktop.pro
@@ -2,10 +2,12 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = screenshot
-contains(QT_CONFIG, svg): SUBDIRS += systray
+!symbian:contains(QT_CONFIG, svg): SUBDIRS += systray
# install
target.path = $$[QT_INSTALL_EXAMPLES]/desktop
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS desktop.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/screenshot/screenshot.pro b/examples/desktop/screenshot/screenshot.pro
index 3ecbf8f50a..b610812c82 100644
--- a/examples/desktop/screenshot/screenshot.pro
+++ b/examples/desktop/screenshot/screenshot.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/desktop/screenshot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS screenshot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop/screenshot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro
index c73a48e9b9..3c0862636a 100644
--- a/examples/desktop/systray/systray.pro
+++ b/examples/desktop/systray/systray.pro
@@ -10,6 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS systray.pro resources im
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop/systray
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince* {
CONFIG(debug, release|debug) {
addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll
diff --git a/examples/dialogs/classwizard/classwizard.pro b/examples/dialogs/classwizard/classwizard.pro
index 15b602988f..0515a8a9f1 100644
--- a/examples/dialogs/classwizard/classwizard.pro
+++ b/examples/dialogs/classwizard/classwizard.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/classwizard
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/classwizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro
index 344a394e6c..5ef381049c 100644
--- a/examples/dialogs/configdialog/configdialog.pro
+++ b/examples/dialogs/configdialog/configdialog.pro
@@ -10,5 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/configdialog
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/configdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/dialogs.pro b/examples/dialogs/dialogs.pro
index b9f029a0e1..6d0ed8dc6e 100644
--- a/examples/dialogs/dialogs.pro
+++ b/examples/dialogs/dialogs.pro
@@ -5,7 +5,7 @@ SUBDIRS = classwizard \
tabdialog \
trivialwizard
-!wince*: SUBDIRS += licensewizard \
+!symbian:!wince*: SUBDIRS += licensewizard \
extension \
findfiles
@@ -15,3 +15,5 @@ wince*: SUBDIRS += sipdialog
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/extension/extension.pro b/examples/dialogs/extension/extension.pro
index 3e56cb9984..7f80f9c0a9 100644
--- a/examples/dialogs/extension/extension.pro
+++ b/examples/dialogs/extension/extension.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/extension
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/extension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/findfiles/findfiles.pro b/examples/dialogs/findfiles/findfiles.pro
index 99be394186..6820c173ea 100644
--- a/examples/dialogs/findfiles/findfiles.pro
+++ b/examples/dialogs/findfiles/findfiles.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/findfiles
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/findfiles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/licensewizard/licensewizard.pro b/examples/dialogs/licensewizard/licensewizard.pro
index fd5e37ccff..789dae0462 100644
--- a/examples/dialogs/licensewizard/licensewizard.pro
+++ b/examples/dialogs/licensewizard/licensewizard.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/licensewizard
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/licensewizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro
index 69667eba01..3d5503f616 100644
--- a/examples/dialogs/sipdialog/sipdialog.pro
+++ b/examples/dialogs/sipdialog/sipdialog.pro
@@ -7,6 +7,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro
index 6bfa6bfc38..9b06e5cf3e 100644
--- a/examples/dialogs/standarddialogs/standarddialogs.pro
+++ b/examples/dialogs/standarddialogs/standarddialogs.pro
@@ -7,5 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/standarddialogs
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/standarddialogs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro
index 3239a72a58..f3fa95df4b 100644
--- a/examples/dialogs/tabdialog/tabdialog.pro
+++ b/examples/dialogs/tabdialog/tabdialog.pro
@@ -7,4 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/tabdialog
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/tabdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/trivialwizard/trivialwizard.pro b/examples/dialogs/trivialwizard/trivialwizard.pro
index 970e12f250..27bb8d9a7a 100644
--- a/examples/dialogs/trivialwizard/trivialwizard.pro
+++ b/examples/dialogs/trivialwizard/trivialwizard.pro
@@ -5,3 +5,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/trivialwizard
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/trivialwizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/draganddrop.pro b/examples/draganddrop/draganddrop.pro
index 0cd881ac2d..fa857db14c 100644
--- a/examples/draganddrop/draganddrop.pro
+++ b/examples/draganddrop/draganddrop.pro
@@ -8,7 +8,7 @@ SUBDIRS = draggableicons \
contains(QT_CONFIG, svg): SUBDIRS += delayedencoding
wince*: SUBDIRS -= dropsite
-
+symbian: SUBDIRS -= dropsite
# install
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop
diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro
index 74cfda9e36..5212abc800 100644
--- a/examples/draganddrop/draggableicons/draggableicons.pro
+++ b/examples/draganddrop/draggableicons/draggableicons.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro
index 07c7c24b46..109be5dd00 100644
--- a/examples/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/draganddrop/draggabletext/draggabletext.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.txt *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro
index 29dd0fdb4d..268e2478b0 100644
--- a/examples/draganddrop/dropsite/dropsite.pro
+++ b/examples/draganddrop/dropsite/dropsite.pro
@@ -10,3 +10,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/dropsite
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp
index 43a9588c5a..2f96a58670 100644
--- a/examples/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp
@@ -75,9 +75,12 @@ DragWidget::DragWidget(QWidget *parent)
//! [1]
//! [2]
+ #ifndef Q_WS_S60
+ //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
+ #endif
setMinimumSize(400, qMax(200, y));
setWindowTitle(tr("Fridge Magnets"));
diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
index f1baaefdac..b452746dfd 100644
--- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro
+++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
@@ -10,3 +10,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/fridgemagnets
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/fridgemagnets
INSTALLS += target sources
+TARGET.UID3 = 0xA000C610
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp
index c24cdb2198..23dfe79a0f 100644
--- a/examples/draganddrop/fridgemagnets/main.cpp
+++ b/examples/draganddrop/fridgemagnets/main.cpp
@@ -45,9 +45,16 @@
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(fridgemagnets);
+ bool smallScreen = false;
+ for (int i=0; i<argc; i++)
+ if (QString(argv[i]) == "-small-screen")
+ smallScreen = true;
QApplication app(argc, argv);
DragWidget window;
- window.show();
+ if (smallScreen)
+ window.showFullScreen();
+ else
+ window.show();
return app.exec();
}
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index 26d2350e3d..e51eb78bdf 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -13,6 +13,13 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/puzzle
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:{
+ addFile.sources = example.jpg
+ addFile.path = .
+ DEPLOYMENT += addFile
+}
wince*: {
addFile.sources = example.jpg
addFile.path = .
diff --git a/examples/examplebase.pri b/examples/examplebase.pri
new file mode 100644
index 0000000000..eff6588df6
--- /dev/null
+++ b/examples/examplebase.pri
@@ -0,0 +1 @@
+symbian:RSS_RULES ="group_name=\"QtExamples\";" \ No newline at end of file
diff --git a/examples/examples.pro b/examples/examples.pro
index 41501a0205..da87e2267e 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -22,10 +22,22 @@ SUBDIRS = \
xml \
script
+symbian: SUBDIRS = \
+ graphicsview \
+ itemviews \
+ network \
+ painting \
+ widgets \
+ draganddrop \
+ mainwindows \
+ script \
+ sql \
+ xml
+
contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon
contains(QT_CONFIG, webkit): SUBDIRS += webkit
embedded:SUBDIRS += qws
-!wince*: {
+!wince*:!symbian: {
!contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer
contains(QT_BUILD_PARTS, tools):SUBDIRS += assistant qtestlib help
} else {
@@ -41,3 +53,5 @@ contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
index a166882adb..956f5c27ac 100644
--- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
+++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/basicgraphicslayouts
sources.files = $$SOURCES $$HEADERS $$RESOURCES basicgraphicslayouts.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/basicgraphicslayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A645 \ No newline at end of file
diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro
index 77543b5c85..a434efcf34 100644
--- a/examples/graphicsview/collidingmice/collidingmice.pro
+++ b/examples/graphicsview/collidingmice/collidingmice.pro
@@ -12,3 +12,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS collidingmice.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A643 \ No newline at end of file
diff --git a/examples/graphicsview/diagramscene/diagramscene.pro b/examples/graphicsview/diagramscene/diagramscene.pro
index fe261bd80f..9e90e0d534 100644
--- a/examples/graphicsview/diagramscene/diagramscene.pro
+++ b/examples/graphicsview/diagramscene/diagramscene.pro
@@ -18,3 +18,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS diagramscene.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/diagramscene
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
index 769e54ad04..756a9c8d42 100644
--- a/examples/graphicsview/dragdroprobot/dragdroprobot.pro
+++ b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/dragdroprobot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dragdroprobot.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/dragdroprobot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro
index 77ca706ba5..800eaae7b7 100644
--- a/examples/graphicsview/elasticnodes/elasticnodes.pro
+++ b/examples/graphicsview/elasticnodes/elasticnodes.pro
@@ -9,8 +9,14 @@ SOURCES += \
node.cpp \
graphwidget.cpp
+TARGET.EPOCHEAPSIZE = 0x200000 0xA00000
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/elasticnodes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS elasticnodes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/elasticnodes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A642 \ No newline at end of file
diff --git a/examples/graphicsview/graphicsview.pro b/examples/graphicsview/graphicsview.pro
index 66eb0b41f5..e955725b15 100644
--- a/examples/graphicsview/graphicsview.pro
+++ b/examples/graphicsview/graphicsview.pro
@@ -1,18 +1,22 @@
-TEMPLATE = \
- subdirs
+TEMPLATE = subdirs
SUBDIRS = \
elasticnodes \
collidingmice \
+ padnavigator \
+ basicgraphicslayouts
+
+!symbian: SUBDIRS += \
diagramscene \
dragdroprobot \
- padnavigator \
basicgraphicslayouts
contains(QT_CONFIG, qt3support):SUBDIRS += portedcanvas portedasteroids
-contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= dragdroprobot
+contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS graphicsview.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp
index dc5ff0cac1..a7d00c8448 100644
--- a/examples/graphicsview/padnavigator/main.cpp
+++ b/examples/graphicsview/padnavigator/main.cpp
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
Panel panel(3, 3);
panel.setFocus();
- panel.show();
+ panel.showFullScreen();
return app.exec();
}
diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro
index 0d094c620a..7fa85072c3 100644
--- a/examples/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/graphicsview/padnavigator/padnavigator.pro
@@ -22,3 +22,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS padnavigator.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+CONFIG += console
+
+symbian:TARGET.UID3 = 0xA000A644 \ No newline at end of file
diff --git a/examples/graphicsview/portedasteroids/portedasteroids.pro b/examples/graphicsview/portedasteroids/portedasteroids.pro
index 1452e91d7d..99dc042657 100644
--- a/examples/graphicsview/portedasteroids/portedasteroids.pro
+++ b/examples/graphicsview/portedasteroids/portedasteroids.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS portedasteroids.pro bg.png sounds sprites
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/portedcanvas/portedcanvas.pro b/examples/graphicsview/portedcanvas/portedcanvas.pro
index 71e3d8481f..7c3946bc0d 100644
--- a/examples/graphicsview/portedcanvas/portedcanvas.pro
+++ b/examples/graphicsview/portedcanvas/portedcanvas.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedcanvas
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS portedcanvas.pro *.png *.xpm *.doc
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedcanvas
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/contextsensitivehelp/contextsensitivehelp.pro b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
index 5a8c0b105a..03a26fa157 100644
--- a/examples/help/contextsensitivehelp/contextsensitivehelp.pro
+++ b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/help/contextsensitivehelp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.doc doc
sources.path = $$[QT_INSTALL_EXAMPLES]/help/contextsensitivehelp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/help.pro b/examples/help/help.pro
index 1ce6322d84..293e511ae8 100644
--- a/examples/help/help.pro
+++ b/examples/help/help.pro
@@ -9,3 +9,5 @@ SUBDIRS += contextsensitivehelp \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/help
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/remotecontrol/remotecontrol.pro b/examples/help/remotecontrol/remotecontrol.pro
index 05fc14c24e..e97af6d5e8 100644
--- a/examples/help/remotecontrol/remotecontrol.pro
+++ b/examples/help/remotecontrol/remotecontrol.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/help/remotecontrol
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.doc doc
sources.path = $$[QT_INSTALL_EXAMPLES]/help/remotecontrol
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/simpletextviewer/simpletextviewer.pro b/examples/help/simpletextviewer/simpletextviewer.pro
index e9e7ea2700..a8504e13a6 100644
--- a/examples/help/simpletextviewer/simpletextviewer.pro
+++ b/examples/help/simpletextviewer/simpletextviewer.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/help/simpletextviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/ipc.pro b/examples/ipc/ipc.pro
index 0698f89eb0..b758fc48dd 100644
--- a/examples/ipc/ipc.pro
+++ b/examples/ipc/ipc.pro
@@ -6,3 +6,5 @@ SUBDIRS = sharedmemory
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ipc.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro
index 906cc8a91d..a394169822 100644
--- a/examples/ipc/localfortuneclient/localfortuneclient.pro
+++ b/examples/ipc/localfortuneclient/localfortuneclient.pro
@@ -9,4 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS localfortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneclient
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/localfortuneserver/localfortuneserver.pro b/examples/ipc/localfortuneserver/localfortuneserver.pro
index fca9a0ad93..db20791dc8 100644
--- a/examples/ipc/localfortuneserver/localfortuneserver.pro
+++ b/examples/ipc/localfortuneserver/localfortuneserver.pro
@@ -9,4 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS localfortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneserver
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/sharedmemory/sharedmemory.pro b/examples/ipc/sharedmemory/sharedmemory.pro
index 48330905e4..4dad1d1073 100644
--- a/examples/ipc/sharedmemory/sharedmemory.pro
+++ b/examples/ipc/sharedmemory/sharedmemory.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro
index 6f6a72d9f7..a03e3b6564 100644
--- a/examples/itemviews/addressbook/addressbook.pro
+++ b/examples/itemviews/addressbook/addressbook.pro
@@ -15,3 +15,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/addressbook
sources.files = $$SOURCES $$HEADERS $$RESOURCES addressbook.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/addressbook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A646 \ No newline at end of file
diff --git a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
index 7870b39679..a2c8751e08 100644
--- a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
+++ b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/basicsortfiltermodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/basicsortfiltermodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro
index d2024511c0..3556de03af 100644
--- a/examples/itemviews/chart/chart.pro
+++ b/examples/itemviews/chart/chart.pro
@@ -4,10 +4,16 @@ RESOURCES = chart.qrc
SOURCES = main.cpp \
mainwindow.cpp \
pieview.cpp
-unix:!mac:LIBS+= -lm
+unix:!mac:!symbian:LIBS+= -lm
+
+TARGET.EPOCHEAPSIZE = 0x200000 0x800000
# install
target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/chart
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.cht
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/chart
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A647
diff --git a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
index ebb3b8e507..f668e6a7e8 100644
--- a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
+++ b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/coloreditorfactory
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/coloreditorfactory
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
index 5a9b9f9a19..091cd9db21 100644
--- a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
+++ b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/customsortfiltermodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/customsortfiltermodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/dirview/dirview.pro b/examples/itemviews/dirview/dirview.pro
index 5865d3ca85..77290a8ad0 100644
--- a/examples/itemviews/dirview/dirview.pro
+++ b/examples/itemviews/dirview/dirview.pro
@@ -5,3 +5,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/dirview
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/dirview
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/editabletreemodel/editabletreemodel.pro b/examples/itemviews/editabletreemodel/editabletreemodel.pro
index 2b7b7def8c..4213cd7a9f 100644
--- a/examples/itemviews/editabletreemodel/editabletreemodel.pro
+++ b/examples/itemviews/editabletreemodel/editabletreemodel.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/editabletreemodel
sources.files = $$FORMS $$HEADERS $$RESOURCES $$SOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/editabletreemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/itemviews.pro b/examples/itemviews/itemviews.pro
index 6202bbc1a3..adbb9004c7 100644
--- a/examples/itemviews/itemviews.pro
+++ b/examples/itemviews/itemviews.pro
@@ -16,7 +16,13 @@ SUBDIRS = addressbook \
spinboxdelegate \
stardelegate
+symbian: SUBDIRS = \
+ addressbook \
+ chart
+
# install
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/pixelator/pixelator.pro b/examples/itemviews/pixelator/pixelator.pro
index dc052966a7..8a139d414a 100644
--- a/examples/itemviews/pixelator/pixelator.pro
+++ b/examples/itemviews/pixelator/pixelator.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/pixelator
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/pixelator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro
index deed112f7d..e5ee3dd84f 100644
--- a/examples/itemviews/puzzle/puzzle.pro
+++ b/examples/itemviews/puzzle/puzzle.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/simpledommodel/simpledommodel.pro b/examples/itemviews/simpledommodel/simpledommodel.pro
index bc9b1cafa3..cc7b4de94c 100644
--- a/examples/itemviews/simpledommodel/simpledommodel.pro
+++ b/examples/itemviews/simpledommodel/simpledommodel.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpledommodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpledommodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/simpletreemodel/simpletreemodel.pro b/examples/itemviews/simpletreemodel/simpletreemodel.pro
index 9db74d4483..b1dd37a264 100644
--- a/examples/itemviews/simpletreemodel/simpletreemodel.pro
+++ b/examples/itemviews/simpletreemodel/simpletreemodel.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpletreemodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpletreemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
index b2940d7780..8bbfef9e61 100644
--- a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
+++ b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simplewidgetmapper
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simplewidgetmapper
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
index a202748d37..31b55d4f32 100644
--- a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
+++ b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/spinboxdelegate
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/spinboxdelegate
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/stardelegate/stardelegate.pro b/examples/itemviews/stardelegate/stardelegate.pro
index 4e1ef45497..a55b55d368 100644
--- a/examples/itemviews/stardelegate/stardelegate.pro
+++ b/examples/itemviews/stardelegate/stardelegate.pro
@@ -12,3 +12,5 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/stardelegate
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/layouts/basiclayouts/basiclayouts.pro b/examples/layouts/basiclayouts/basiclayouts.pro
index 8fa73ffc5a..4ffc8c0aad 100644
--- a/examples/layouts/basiclayouts/basiclayouts.pro
+++ b/examples/layouts/basiclayouts/basiclayouts.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/basiclayouts
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/basiclayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/borderlayout/borderlayout.pro b/examples/layouts/borderlayout/borderlayout.pro
index e327574ebc..18b5e6cff4 100644
--- a/examples/layouts/borderlayout/borderlayout.pro
+++ b/examples/layouts/borderlayout/borderlayout.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/borderlayout
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/borderlayout
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/dynamiclayouts/dynamiclayouts.pro b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
index c169dd0fd6..dce1e29d84 100644
--- a/examples/layouts/dynamiclayouts/dynamiclayouts.pro
+++ b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/dynamiclayouts
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/dynamiclayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/flowlayout/flowlayout.pro b/examples/layouts/flowlayout/flowlayout.pro
index 0e9782459c..ece314f9ce 100644
--- a/examples/layouts/flowlayout/flowlayout.pro
+++ b/examples/layouts/flowlayout/flowlayout.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/flowlayout
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/flowlayout
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/layouts.pro b/examples/layouts/layouts.pro
index 9676f4b690..81c15f24f1 100644
--- a/examples/layouts/layouts.pro
+++ b/examples/layouts/layouts.pro
@@ -8,3 +8,5 @@ SUBDIRS = basiclayouts \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro
index c8a6fb2fee..7e409a6f2a 100644
--- a/examples/linguist/arrowpad/arrowpad.pro
+++ b/examples/linguist/arrowpad/arrowpad.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro
index c0065a4e37..ecd480bf93 100644
--- a/examples/linguist/hellotr/hellotr.pro
+++ b/examples/linguist/hellotr/hellotr.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro
index 921667df47..ad3f772a23 100644
--- a/examples/linguist/linguist.pro
+++ b/examples/linguist/linguist.pro
@@ -7,3 +7,5 @@ SUBDIRS = arrowpad \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro
index 9f3aaeb002..27cb38ed4a 100644
--- a/examples/linguist/trollprint/trollprint.pro
+++ b/examples/linguist/trollprint/trollprint.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
sources.files = $$SOURCES $$HEADERS $$TRANSLATIONS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/application/application.pro b/examples/mainwindows/application/application.pro
index ad1168a2e4..fc022fc53f 100644
--- a/examples/mainwindows/application/application.pro
+++ b/examples/mainwindows/application/application.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/application
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS application.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/application
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/application/mainwindow.cpp b/examples/mainwindows/application/mainwindow.cpp
index 9a22254ccc..c9ff842a6c 100644
--- a/examples/mainwindows/application/mainwindow.cpp
+++ b/examples/mainwindows/application/mainwindow.cpp
@@ -328,9 +328,13 @@ void MainWindow::loadFile(const QString &fileName)
}
QTextStream in(&file);
+#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
+#endif
textEdit->setPlainText(in.readAll());
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
setCurrentFile(fileName);
statusBar()->showMessage(tr("File loaded"), 2000);
@@ -351,9 +355,13 @@ bool MainWindow::saveFile(const QString &fileName)
}
QTextStream out(&file);
+#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
+#endif
out << textEdit->toPlainText();
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
diff --git a/examples/mainwindows/dockwidgets/dockwidgets.pro b/examples/mainwindows/dockwidgets/dockwidgets.pro
index afc8aaa243..ea8594d703 100644
--- a/examples/mainwindows/dockwidgets/dockwidgets.pro
+++ b/examples/mainwindows/dockwidgets/dockwidgets.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
sources.files = $$SOURCES $$HEADERS $$RESOURCES dockwidgets.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/mainwindows.pro b/examples/mainwindows/mainwindows.pro
index 90ff3a5260..e310e3db84 100644
--- a/examples/mainwindows/mainwindows.pro
+++ b/examples/mainwindows/mainwindows.pro
@@ -6,8 +6,14 @@ SUBDIRS = application \
recentfiles \
sdi
+symbian: SUBDIRS = \
+ menus
+
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/mdi/mdi.pro b/examples/mainwindows/mdi/mdi.pro
index 4601f1c9f0..b0db42cd8c 100644
--- a/examples/mainwindows/mdi/mdi.pro
+++ b/examples/mainwindows/mdi/mdi.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mdi.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro
index 7b0a2ecc88..448e779971 100644
--- a/examples/mainwindows/menus/menus.pro
+++ b/examples/mainwindows/menus/menus.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/recentfiles/recentfiles.pro b/examples/mainwindows/recentfiles/recentfiles.pro
index 7c62cdfe7d..8f7ddafd3a 100644
--- a/examples/mainwindows/recentfiles/recentfiles.pro
+++ b/examples/mainwindows/recentfiles/recentfiles.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/recentfiles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS recentfiles.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/recentfiles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/sdi/sdi.pro b/examples/mainwindows/sdi/sdi.pro
index 3283334c00..c033e195b4 100644
--- a/examples/mainwindows/sdi/sdi.pro
+++ b/examples/mainwindows/sdi/sdi.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/sdi
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sdi.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/sdi
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
index fa146fa0e8..96fbc1f173 100644
--- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro
index ad04e2c01f..36ad0960bb 100644
--- a/examples/network/broadcastreceiver/broadcastreceiver.pro
+++ b/examples/network/broadcastreceiver/broadcastreceiver.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro
index b300a505f7..84e65936a2 100644
--- a/examples/network/broadcastsender/broadcastsender.pro
+++ b/examples/network/broadcastsender/broadcastsender.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro
index 254c356cf5..f0db3402c0 100644
--- a/examples/network/download/download.pro
+++ b/examples/network/download/download.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/download
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/network/download
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro
index 1b979cafcb..ef7052c2de 100644
--- a/examples/network/downloadmanager/downloadmanager.pro
+++ b/examples/network/downloadmanager/downloadmanager.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index 1c7b0a81ab..bb125e8816 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index e98385aa22..8cf52ee957 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro
index cabc00332b..90594f5d54 100644
--- a/examples/network/ftp/ftp.pro
+++ b/examples/network/ftp/ftp.pro
@@ -9,3 +9,13 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/ftp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ftp.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/network/ftp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian {
+ #Enable this macro if you have latest Open C and you want to get rid of IAP queries
+ #DEFINES += SETDEFAULTIF_AVAILABLE
+ TARGET.CAPABILITY="NetworkServices"
+ TARGET.UID3 = 0xA000A648
+ contains( DEFINES, SETDEFAULTIF_AVAILABLE ):LIBS+=-lesock
+} \ No newline at end of file
diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp
index a05a5dd3d9..52c31e0bc0 100644
--- a/examples/network/ftp/ftpwindow.cpp
+++ b/examples/network/ftp/ftpwindow.cpp
@@ -52,6 +52,10 @@ FtpWindow::FtpWindow(QWidget *parent)
ftpServerLabel->setBuddy(ftpServerLineEdit);
statusLabel = new QLabel(tr("Please enter the name of an FTP server."));
+#ifdef Q_OS_SYMBIAN
+ // Use word wrapping to fit the text on screen
+ statusLabel->setWordWrap( true );
+#endif
fileList = new QTreeWidget;
fileList->setEnabled(false);
@@ -90,11 +94,22 @@ FtpWindow::FtpWindow(QWidget *parent)
QHBoxLayout *topLayout = new QHBoxLayout;
topLayout->addWidget(ftpServerLabel);
topLayout->addWidget(ftpServerLineEdit);
+#ifndef Q_OS_SYMBIAN
topLayout->addWidget(cdToParentButton);
topLayout->addWidget(connectButton);
+#else
+ // Make app better lookin on small screen
+ QHBoxLayout *topLayout2 = new QHBoxLayout;
+ topLayout2->addWidget(cdToParentButton);
+ topLayout2->addWidget(connectButton);
+#endif
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(topLayout);
+#ifdef Q_OS_SYMBIAN
+ // Make app better lookin on small screen
+ mainLayout->addLayout(topLayout2);
+#endif
mainLayout->addWidget(fileList);
mainLayout->addWidget(statusLabel);
mainLayout->addWidget(buttonBox);
diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp
index b9ffd33a14..a472fd76e3 100644
--- a/examples/network/ftp/main.cpp
+++ b/examples/network/ftp/main.cpp
@@ -40,15 +40,67 @@
****************************************************************************/
#include <QApplication>
-
+#ifdef Q_OS_SYMBIAN
+#include <QDir>
+#include <QDesktopWidget>
+#endif
#include "ftpwindow.h"
+#if defined Q_OS_SYMBIAN && defined SETDEFAULTIF_AVAILABLE
+#include <es_sock.h>
+#include <sys/socket.h>
+#include <net/if.h>
+
+static void setDefaultIapL()
+{
+ TInt err = KErrNone;
+ RSocketServ serv;
+ CleanupClosePushL(serv);
+ User::LeaveIfError(serv.Connect());
+
+ RConnection conn;
+ CleanupClosePushL(conn);
+ User::LeaveIfError(conn.Open(serv));
+ User::LeaveIfError(conn.Start());
+
+ _LIT(KIapNameSetting, "IAP\\Name");
+ TBuf8<50> iapName;
+ User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName));
+
+ struct ifreq ifReq;
+ strcpy( ifReq.ifr_name, (char*)iapName.Ptr());
+ User::LeaveIfError(setdefaultif( &ifReq ));
+
+ CleanupStack::PopAndDestroy(&conn);
+ CleanupStack::PopAndDestroy(&serv);
+}
+
+static int setDefaultIap()
+{
+ TRAPD(err, setDefaultIapL());
+ return err;
+}
+
+#endif
+
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(ftp);
-
- QApplication app(argc, argv);
+
+#ifdef Q_OS_SYMBIAN
+#ifdef SETDEFAULTIF_AVAILABLE
+ setDefaultIap();
+#endif
+ // Change current directory from default private to c:\data
+ // in order that user can access the downloaded content
+ QDir::setCurrent( "c:\\data" );
+#endif
+ QApplication app(argc, argv);
FtpWindow ftpWin;
+#ifdef Q_OS_SYMBIAN
+ // Make application better looking and more usable on small screen
+ ftpWin.showMaximized();
+#endif
ftpWin.show();
return ftpWin.exec();
}
diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro
index 7f58d9fffb..99aa717e71 100644
--- a/examples/network/http/http.pro
+++ b/examples/network/http/http.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/http
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/http
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro
index 88b7a8bf05..0a09e34048 100644
--- a/examples/network/loopback/loopback.pro
+++ b/examples/network/loopback/loopback.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/loopback
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/loopback
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 5d5efea537..6967228440 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network-chat.pro *.chat
sources.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 8c45745b2d..9e48e9a77c 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -1,10 +1,10 @@
TEMPLATE = subdirs
SUBDIRS = blockingfortuneclient \
- broadcastreceiver \
+ broadcastreceiver \
broadcastsender \
network-chat \
- download \
- downloadmanager \
+ download \
+ downloadmanager \
fortuneclient \
fortuneserver \
ftp \
@@ -12,7 +12,9 @@ SUBDIRS = blockingfortuneclient \
loopback \
threadedfortuneserver \
googlesuggest \
- torrent
+ torrent
+
+symbian: SUBDIRS = ftp
contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
@@ -20,3 +22,5 @@ contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/network
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index 4d70a718ac..166d7ad248 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.jpg images
sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
index 0867dac72b..94543bfb30 100644
--- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro
index 10b267242f..bfd576776e 100644
--- a/examples/network/torrent/torrent.pro
+++ b/examples/network/torrent/torrent.pro
@@ -35,3 +35,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES torrent.pro *.torrent
sources.files += icons forms 3rdparty
sources.path = $$[QT_INSTALL_EXAMPLES]/network/torrent
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro
index c45b764e12..01df1da6bd 100644
--- a/examples/opengl/2dpainting/2dpainting.pro
+++ b/examples/opengl/2dpainting/2dpainting.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/2dpainting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS 2dpainting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/2dpainting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/framebufferobject/bubbles.svg b/examples/opengl/framebufferobject/bubbles.svg
index 65867da2d8..3d7971d547 100644
--- a/examples/opengl/framebufferobject/bubbles.svg
+++ b/examples/opengl/framebufferobject/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/opengl/framebufferobject/framebufferobject.pro b/examples/opengl/framebufferobject/framebufferobject.pro
index 4bc667c6d0..a5927ec120 100644
--- a/examples/opengl/framebufferobject/framebufferobject.pro
+++ b/examples/opengl/framebufferobject/framebufferobject.pro
@@ -20,3 +20,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro
index 9f1644c7a1..076f98c9b9 100644
--- a/examples/opengl/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/framebufferobject2/framebufferobject2.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
sources.files = $$SOURCES $$HEADERS $$RESOURCES framebufferobject2.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro
index 15eaf0250a..23a0c4a4b6 100644
--- a/examples/opengl/grabber/grabber.pro
+++ b/examples/opengl/grabber/grabber.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS grabber.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/hellogl/glwidget.cpp b/examples/opengl/hellogl/glwidget.cpp
index d81e7e6008..fbca8292d9 100644
--- a/examples/opengl/hellogl/glwidget.cpp
+++ b/examples/opengl/hellogl/glwidget.cpp
@@ -183,46 +183,30 @@ GLuint GLWidget::makeObject()
glBegin(GL_QUADS);
- GLdouble x1 = +0.06;
- GLdouble y1 = -0.14;
- GLdouble x2 = +0.14;
- GLdouble y2 = -0.06;
- GLdouble x3 = +0.08;
- GLdouble y3 = +0.00;
- GLdouble x4 = +0.30;
- GLdouble y4 = +0.22;
-
- quad(x1, y1, x2, y2, y2, x2, y1, x1);
- quad(x3, y3, x4, y4, y4, x4, y3, x3);
-
- extrude(x1, y1, x2, y2);
- extrude(x2, y2, y2, x2);
- extrude(y2, x2, y1, x1);
- extrude(y1, x1, x1, y1);
- extrude(x3, y3, x4, y4);
- extrude(x4, y4, y4, x4);
- extrude(y4, x4, y3, x3);
-
const double Pi = 3.14159265358979323846;
const int NumSectors = 200;
- for (int i = 0; i < NumSectors; ++i) {
- double angle1 = (i * 2 * Pi) / NumSectors;
- GLdouble x5 = 0.30 * sin(angle1);
- GLdouble y5 = 0.30 * cos(angle1);
- GLdouble x6 = 0.20 * sin(angle1);
- GLdouble y6 = 0.20 * cos(angle1);
+ for (int j = 0; j < 2; ++j) {
+ double r = 0.1 + (j * 0.2);
+
+ for (int i = 0; i < NumSectors; ++i) {
+ double angle1 = (i * 2 * Pi) / NumSectors;
+ GLdouble x5 = (r + 0.1) * sin(angle1);
+ GLdouble y5 = (r + 0.1) * cos(angle1);
+ GLdouble x6 = r * sin(angle1);
+ GLdouble y6 = r * cos(angle1);
- double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
- GLdouble x7 = 0.20 * sin(angle2);
- GLdouble y7 = 0.20 * cos(angle2);
- GLdouble x8 = 0.30 * sin(angle2);
- GLdouble y8 = 0.30 * cos(angle2);
+ double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
+ GLdouble x7 = r * sin(angle2);
+ GLdouble y7 = r * cos(angle2);
+ GLdouble x8 = (r + 0.1) * sin(angle2);
+ GLdouble y8 = (r + 0.1) * cos(angle2);
- quad(x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(x5, y5, x6, y6, x7, y7, x8, y8);
- extrude(x6, y6, x7, y7);
- extrude(x8, y8, x5, y5);
+ extrude(x6, y6, x7, y7);
+ extrude(x8, y8, x5, y5);
+ }
}
glEnd();
diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro
index ce9c8e8e34..77034cc1f0 100644
--- a/examples/opengl/hellogl/hellogl.pro
+++ b/examples/opengl/hellogl/hellogl.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index a4c2a22365..7b76d86c36 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -27,3 +27,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro
index b8e79eb651..3603260258 100644
--- a/examples/opengl/overpainting/overpainting.pro
+++ b/examples/opengl/overpainting/overpainting.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS overpainting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro
index c1060e2361..72f20f8690 100644
--- a/examples/opengl/pbuffers/pbuffers.pro
+++ b/examples/opengl/pbuffers/pbuffers.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/pbuffers2/bubbles.svg b/examples/opengl/pbuffers2/bubbles.svg
index 65867da2d8..3d7971d547 100644
--- a/examples/opengl/pbuffers2/bubbles.svg
+++ b/examples/opengl/pbuffers2/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro
index cbd0cb514e..7f12483157 100644
--- a/examples/opengl/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/pbuffers2/pbuffers2.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers2.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/samplebuffers/glwidget.cpp b/examples/opengl/samplebuffers/glwidget.cpp
index 381ff9573b..0bc17aa94f 100644
--- a/examples/opengl/samplebuffers/glwidget.cpp
+++ b/examples/opengl/samplebuffers/glwidget.cpp
@@ -109,44 +109,28 @@ void GLWidget::makeObject()
QColor trolltechGreen(QColor::fromCmykF(0.40, 0.0, 1.0, 0.0));
const double Pi = 3.14159265358979323846;
const int NumSectors = 15;
- GLdouble x1 = +0.06;
- GLdouble y1 = -0.14;
- GLdouble x2 = +0.14;
- GLdouble y2 = -0.06;
- GLdouble x3 = +0.08;
- GLdouble y3 = +0.00;
- GLdouble x4 = +0.30;
- GLdouble y4 = +0.22;
list = glGenLists(1);
glNewList(list, GL_COMPILE);
{
for (int i = 0; i < NumSectors; ++i) {
double angle1 = (i * 2 * Pi) / NumSectors;
- GLdouble x5 = 0.30 * sin(angle1);
- GLdouble y5 = 0.30 * cos(angle1);
- GLdouble x6 = 0.20 * sin(angle1);
- GLdouble y6 = 0.20 * cos(angle1);
+ GLdouble x1 = 0.30 * sin(angle1);
+ GLdouble y1 = 0.30 * cos(angle1);
+ GLdouble x2 = 0.20 * sin(angle1);
+ GLdouble y2 = 0.20 * cos(angle1);
double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
- GLdouble x7 = 0.20 * sin(angle2);
- GLdouble y7 = 0.20 * cos(angle2);
- GLdouble x8 = 0.30 * sin(angle2);
- GLdouble y8 = 0.30 * cos(angle2);
+ GLdouble x3 = 0.20 * sin(angle2);
+ GLdouble y3 = 0.20 * cos(angle2);
+ GLdouble x4 = 0.30 * sin(angle2);
+ GLdouble y4 = 0.30 * cos(angle2);
qglColor(trolltechGreen);
- quad(GL_QUADS, x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(GL_QUADS, x1, y1, x2, y2, x3, y3, x4, y4);
qglColor(Qt::black);
- quad(GL_LINE_LOOP, x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(GL_LINE_LOOP, x1, y1, x2, y2, x3, y3, x4, y4);
}
-
- qglColor(trolltechGreen);
- quad(GL_QUADS, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_QUADS, x3, y3, x4, y4, y4, x4, y3, x3);
-
- qglColor(Qt::black);
- quad(GL_LINE_LOOP, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_LINE_LOOP, x3, y3, x4, y4, y4, x4, y3, x3);
}
glEndList();
}
diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro
index 9eb5f58b15..de09a71e61 100644
--- a/examples/opengl/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/samplebuffers/samplebuffers.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
sources.files = $$SOURCES $$HEADERS samplebuffers.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro
index cd98a6880a..086c9ac413 100644
--- a/examples/opengl/textures/textures.pro
+++ b/examples/opengl/textures/textures.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS textures.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro
index 401126055e..df845d9395 100644
--- a/examples/painting/basicdrawing/basicdrawing.pro
+++ b/examples/painting/basicdrawing/basicdrawing.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/basicdrawing
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS basicdrawing.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/basicdrawing
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A649 \ No newline at end of file
diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro
index 093ea1c9d2..bf8398feab 100644
--- a/examples/painting/concentriccircles/concentriccircles.pro
+++ b/examples/painting/concentriccircles/concentriccircles.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/concentriccircles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS concentriccircles.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/concentriccircles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64A \ No newline at end of file
diff --git a/examples/painting/fontsampler/fontsampler.pro b/examples/painting/fontsampler/fontsampler.pro
index 8b63752feb..bc7e0a2dba 100644
--- a/examples/painting/fontsampler/fontsampler.pro
+++ b/examples/painting/fontsampler/fontsampler.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/fontsampler
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fontsampler.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/fontsampler
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro
index 935a1d47c1..66fcf6ad20 100644
--- a/examples/painting/imagecomposition/imagecomposition.pro
+++ b/examples/painting/imagecomposition/imagecomposition.pro
@@ -9,3 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES images *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/imagecomposition
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64B \ No newline at end of file
diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro
index 76c9e82aeb..6c9ba95d61 100644
--- a/examples/painting/painterpaths/painterpaths.pro
+++ b/examples/painting/painterpaths/painterpaths.pro
@@ -3,10 +3,14 @@ HEADERS = renderarea.h \
SOURCES = main.cpp \
renderarea.cpp \
window.cpp
-unix:!mac:LIBS += -lm
+unix:!mac:!symbian:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/painting/painterpaths
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS painterpaths.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/painterpaths
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64C \ No newline at end of file
diff --git a/examples/painting/painting.pro b/examples/painting/painting.pro
index 6d00720534..59ca54e3a8 100644
--- a/examples/painting/painting.pro
+++ b/examples/painting/painting.pro
@@ -5,7 +5,7 @@ SUBDIRS = basicdrawing \
painterpaths \
transformations
-!wince*: SUBDIRS += fontsampler
+!wince*:!symbian: SUBDIRS += fontsampler
contains(QT_CONFIG, svg): SUBDIRS += svggenerator svgviewer
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS painting.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/painting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/svgviewer/files/bubbles.svg b/examples/painting/svgviewer/files/bubbles.svg
index 65867da2d8..3d7971d547 100644
--- a/examples/painting/svgviewer/files/bubbles.svg
+++ b/examples/painting/svgviewer/files/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro
index b29e2184a4..523dcf68a7 100644
--- a/examples/painting/svgviewer/svgviewer.pro
+++ b/examples/painting/svgviewer/svgviewer.pro
@@ -16,8 +16,17 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES svgviewer.pro files
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svgviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = files\*.svg
addFiles.path = \My Documents
DEPLOYMENT += addFiles
}
+
+symbian: {
+ TARGET.UID3 = 0xA000A64E
+ addFiles.sources = files\*.svg
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+}
diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro
index a8ff61099d..6e4fe4f0b3 100644
--- a/examples/painting/transformations/transformations.pro
+++ b/examples/painting/transformations/transformations.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/transformations
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS transformations.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/transformations
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64D \ No newline at end of file
diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro
index 52b6b1bd0d..29d75012b9 100644
--- a/examples/phonon/capabilities/capabilities.pro
+++ b/examples/phonon/capabilities/capabilities.pro
@@ -9,8 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
sources.files = $$SOURCES $$HEADERS capabilities.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
INSTALLS += target sources
-
-wince*{
-DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
-}
-
diff --git a/examples/phonon/phonon.pro b/examples/phonon/phonon.pro
index 0dea7669aa..7bb58227ff 100644
--- a/examples/phonon/phonon.pro
+++ b/examples/phonon/phonon.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS phonon.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro
index fbf864ab7b..2040e7c5cf 100644
--- a/examples/qtconcurrent/imagescaling/imagescaling.pro
+++ b/examples/qtconcurrent/imagescaling/imagescaling.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro
index f20267bc3b..cc80704399 100644
--- a/examples/qtconcurrent/map/map.pro
+++ b/examples/qtconcurrent/map/map.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/map
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/map
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/progressdialog/progressdialog.pro b/examples/qtconcurrent/progressdialog/progressdialog.pro
index 12ba0bf386..aa6a118aba 100644
--- a/examples/qtconcurrent/progressdialog/progressdialog.pro
+++ b/examples/qtconcurrent/progressdialog/progressdialog.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/progressdialog
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/progressdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index 53008f0595..b21cb17c45 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtconcurrent.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro
index 90344766c7..58a1375cfe 100644
--- a/examples/qtconcurrent/runfunction/runfunction.pro
+++ b/examples/qtconcurrent/runfunction/runfunction.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro
index fba95ee260..581e6c7309 100644
--- a/examples/qtconcurrent/wordcount/wordcount.pro
+++ b/examples/qtconcurrent/wordcount/wordcount.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/wordcount
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/wordcount
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtestlib/qtestlib.pro b/examples/qtestlib/qtestlib.pro
index 8addbcba63..70115e27aa 100644
--- a/examples/qtestlib/qtestlib.pro
+++ b/examples/qtestlib/qtestlib.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtestlib.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro
index baa15b29f6..5191a3d59b 100644
--- a/examples/qtestlib/tutorial1/tutorial1.pro
+++ b/examples/qtestlib/tutorial1/tutorial1.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60B \ No newline at end of file
diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro
index 44211d8fc4..ae66cace1d 100644
--- a/examples/qtestlib/tutorial2/tutorial2.pro
+++ b/examples/qtestlib/tutorial2/tutorial2.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial2
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60C \ No newline at end of file
diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro
index b494ba8c6a..9fdda2aca1 100644
--- a/examples/qtestlib/tutorial3/tutorial3.pro
+++ b/examples/qtestlib/tutorial3/tutorial3.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial3
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial3
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60D \ No newline at end of file
diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro
index 0777d4841f..4cb7bf8a99 100644
--- a/examples/qtestlib/tutorial4/tutorial4.pro
+++ b/examples/qtestlib/tutorial4/tutorial4.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial4
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial4
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60E \ No newline at end of file
diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro
index 0310916ebd..f98890436f 100644
--- a/examples/qtestlib/tutorial5/tutorial5.pro
+++ b/examples/qtestlib/tutorial5/tutorial5.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial5
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial5
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60F \ No newline at end of file
diff --git a/examples/qws/ahigl/ahigl.pro b/examples/qws/ahigl/ahigl.pro
index 1ee8e6e150..c8313351e2 100644
--- a/examples/qws/ahigl/ahigl.pro
+++ b/examples/qws/ahigl/ahigl.pro
@@ -7,6 +7,8 @@ TARGET = qahiglscreen
target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = qwindowsurface_ahigl_p.h \
qscreenahigl_qws.h
diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro
index 172a02a5e7..86152ab6ce 100644
--- a/examples/qws/dbscreen/dbscreen.pro
+++ b/examples/qws/dbscreen/dbscreen.pro
@@ -5,6 +5,8 @@ TARGET = dbscreen
target.path += $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = dbscreen.h
SOURCES = dbscreendriverplugin.cpp \
dbscreen.cpp
diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro
index f9fe850aa9..0379908499 100644
--- a/examples/qws/framebuffer/framebuffer.pro
+++ b/examples/qws/framebuffer/framebuffer.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro
index bd318537a3..6f60b6dce9 100644
--- a/examples/qws/mousecalibration/mousecalibration.pro
+++ b/examples/qws/mousecalibration/mousecalibration.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/qws.pro b/examples/qws/qws.pro
index fb3c3c7c09..e9f310fa18 100644
--- a/examples/qws/qws.pro
+++ b/examples/qws/qws.pro
@@ -5,3 +5,5 @@ SUBDIRS = framebuffer mousecalibration simpledecoration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro
index 8a47c1d1d0..3ab5a1931a 100644
--- a/examples/qws/svgalib/svgalib.pro
+++ b/examples/qws/svgalib/svgalib.pro
@@ -7,6 +7,8 @@ TARGET = svgalibscreen
target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = svgalibscreen.h \
svgalibpaintengine.h \
svgalibsurface.h \
diff --git a/examples/richtext/calendar/calendar.pro b/examples/richtext/calendar/calendar.pro
index bf032f57fc..fb85d96286 100644
--- a/examples/richtext/calendar/calendar.pro
+++ b/examples/richtext/calendar/calendar.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendar.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/orderform/orderform.pro b/examples/richtext/orderform/orderform.pro
index 63739b0501..3875ea0684 100644
--- a/examples/richtext/orderform/orderform.pro
+++ b/examples/richtext/orderform/orderform.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext/orderform
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS orderform.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/orderform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/richtext.pro b/examples/richtext/richtext.pro
index ef8f09453a..d48602ef24 100644
--- a/examples/richtext/richtext.pro
+++ b/examples/richtext/richtext.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS richtext.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
index b861970396..4b90aa379e 100644
--- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -10,6 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS syntaxhighlighter.pro ex
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/syntaxhighlighter
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = main.cpp mainwindow.cpp
addFiles.path = .
diff --git a/examples/script/calculator/calculator.pro b/examples/script/calculator/calculator.pro
index 226d5f4212..734078ced2 100644
--- a/examples/script/calculator/calculator.pro
+++ b/examples/script/calculator/calculator.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/calculator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.js *.ui
sources.path = $$[QT_INSTALL_EXAMPLES]/script/calculator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro
index 30ec9a76ba..be14272b96 100644
--- a/examples/script/context2d/context2d.pro
+++ b/examples/script/context2d/context2d.pro
@@ -21,3 +21,12 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/context2d
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS context2d.pro scripts
sources.path = $$[QT_INSTALL_EXAMPLES]/script/context2d
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+symbian:{
+ TARGET.UID3 = 0xA000C608
+ TARGET.EPOCHEAPSIZE = 0x200000 0xA00000
+ contextScripts.path = .
+ contextScripts.sources = scripts
+ DEPLOYMENT += contextScripts
+} \ No newline at end of file
diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp
index 78c9df9662..08744d3a33 100644
--- a/examples/script/context2d/main.cpp
+++ b/examples/script/context2d/main.cpp
@@ -48,6 +48,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Window win;
- win.show();
+ //win.show();
+ win.showFullScreen();
return app.exec();
}
diff --git a/examples/script/customclass/customclass.pro b/examples/script/customclass/customclass.pro
index ba7f69d9a3..bb263d2709 100644
--- a/examples/script/customclass/customclass.pro
+++ b/examples/script/customclass/customclass.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/customclass
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.pri
sources.path = $$[QT_INSTALL_EXAMPLES]/script/customclass
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/defaultprototypes/defaultprototypes.pro b/examples/script/defaultprototypes/defaultprototypes.pro
index b9a6765ef5..21328e6060 100644
--- a/examples/script/defaultprototypes/defaultprototypes.pro
+++ b/examples/script/defaultprototypes/defaultprototypes.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.js defaultprototypes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/helloscript/helloscript.pro b/examples/script/helloscript/helloscript.pro
index d94a318067..5b04f84ee2 100644
--- a/examples/script/helloscript/helloscript.pro
+++ b/examples/script/helloscript/helloscript.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS helloscript.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/marshal/marshal.pro b/examples/script/marshal/marshal.pro
index 46b33b9019..69fc578640 100644
--- a/examples/script/marshal/marshal.pro
+++ b/examples/script/marshal/marshal.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/marshal
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS marshal.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/marshal
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/qscript/qscript.pro b/examples/script/qscript/qscript.pro
index 759eedf2bf..3c03545177 100644
--- a/examples/script/qscript/qscript.pro
+++ b/examples/script/qscript/qscript.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/qscript
sources.files = $$RESOURCES $$FORMS main.cpp qscript.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/qscript
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro
index c1991230e3..77b55a2c96 100644
--- a/examples/script/qsdbg/qsdbg.pro
+++ b/examples/script/qsdbg/qsdbg.pro
@@ -16,4 +16,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qsdbg.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/script/script.pro b/examples/script/script.pro
index ae3542e145..c5a37ef601 100644
--- a/examples/script/script.pro
+++ b/examples/script/script.pro
@@ -4,8 +4,12 @@ SUBDIRS = helloscript context2d defaultprototypes customclass
!wince*:SUBDIRS += qscript marshal
!wince*:!cross_compile:SUBDIRS += calculator qstetrix
+symbian: SUBDIRS = context2d
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/script
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS script.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/script
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/cachedtable/cachedtable.pro b/examples/sql/cachedtable/cachedtable.pro
index a14aa42d8f..89e97aece0 100644
--- a/examples/sql/cachedtable/cachedtable.pro
+++ b/examples/sql/cachedtable/cachedtable.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/cachedtable
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS cachedtable.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/cachedtable
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro
index e15a4ada6b..7907bd2393 100644
--- a/examples/sql/drilldown/drilldown.pro
+++ b/examples/sql/drilldown/drilldown.pro
@@ -14,3 +14,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS drilldown.pro *.png *.jpg images
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000C612
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 6573ae1fdb..ea66b0ba58 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -101,7 +101,9 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
setWindowFlags(Qt::Window);
enableButtons(false);
setWindowTitle(tr("Office: %1").arg(locationText->text()));
+#ifndef Q_OS_SYMBIAN
resize(320, sizeHint().height());
+#endif
}
//! [4]
diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp
index ee5a4d59a8..c340f5ec96 100644
--- a/examples/sql/drilldown/main.cpp
+++ b/examples/sql/drilldown/main.cpp
@@ -54,6 +54,10 @@ int main(int argc, char *argv[])
return 1;
View view("offices", "images");
+#ifndef Q_OS_SYMBIAN
view.show();
+#else
+ view.showFullScreen();
+#endif
return app.exec();
}
diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp
index 763d094343..778767b315 100644
--- a/examples/sql/drilldown/view.cpp
+++ b/examples/sql/drilldown/view.cpp
@@ -62,10 +62,15 @@ View::View(const QString &offices, const QString &images, QWidget *parent)
QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png"));
logo->setPos(30, 515);
-
+
+#ifndef Q_OS_SYMBIAN
setMinimumSize(470, 620);
- setMaximumSize(470, 620);
- setWindowTitle(tr("Offices World Wide"));
+ setMaximumSize(470, 620);
+#else
+ setDragMode(QGraphicsView::ScrollHandDrag);
+#endif
+
+ setWindowTitle(tr("Offices World Wide"));
}
//! [1]
@@ -126,7 +131,11 @@ void View::showInformation(ImageItem *image)
window->raise();
window->activateWindow();
} else if (window && !window->isVisible()) {
+#ifndef Q_OS_SYMBIAN
window->show();
+#else
+ window->showFullScreen();
+#endif
} else {
InformationWindow *window;
window = new InformationWindow(id, officeTable, this);
@@ -134,8 +143,12 @@ void View::showInformation(ImageItem *image)
connect(window, SIGNAL(imageChanged(int, QString)),
this, SLOT(updateImage(int, QString)));
+#ifndef Q_OS_SYMBIAN
window->move(pos() + QPoint(20, 40));
window->show();
+#else
+ window->showFullScreen();
+#endif
informationWindows.append(window);
}
}
diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro
index 205c54405c..2363e5450c 100644
--- a/examples/sql/masterdetail/masterdetail.pro
+++ b/examples/sql/masterdetail/masterdetail.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/masterdetail
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS masterdetail.pro *.xml images
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/masterdetail
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/querymodel/querymodel.pro b/examples/sql/querymodel/querymodel.pro
index e0e0813890..f20898cc9d 100644
--- a/examples/sql/querymodel/querymodel.pro
+++ b/examples/sql/querymodel/querymodel.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/querymodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS querymodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/querymodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.pro b/examples/sql/relationaltablemodel/relationaltablemodel.pro
index 38f1e210cc..e57729ef91 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.pro
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/relationaltablemodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS relationaltablemodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/relationaltablemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro
index 6d0d4026f3..7bdff69fd7 100644
--- a/examples/sql/sql.pro
+++ b/examples/sql/sql.pro
@@ -1,12 +1,18 @@
TEMPLATE = subdirs
-SUBDIRS = cachedtable \
- drilldown \
- relationaltablemodel \
- sqlwidgetmapper
-!wince*: SUBDIRS += querymodel tablemodel masterdetail
+SUBDIRS = drilldown
+!symbian: SUBDIRS += cachedtable \
+ relationaltablemodel \
+ sqlwidgetmapper
+
+!wince*:!symbian: SUBDIRS += \
+ querymodel \
+ tablemodel \
+ masterdetail
# install
sources.files = connection.h sql.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/sql
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/tablemodel/tablemodel.pro b/examples/sql/tablemodel/tablemodel.pro
index 4d099d09cf..7adf40c10b 100644
--- a/examples/sql/tablemodel/tablemodel.pro
+++ b/examples/sql/tablemodel/tablemodel.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/tablemodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS tablemodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/tablemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro
index 437f449a88..8f552a800a 100644
--- a/examples/threads/mandelbrot/mandelbrot.pro
+++ b/examples/threads/mandelbrot/mandelbrot.pro
@@ -4,10 +4,12 @@ SOURCES = main.cpp \
mandelbrotwidget.cpp \
renderthread.cpp
-unix:!mac:LIBS += -lm
+unix:!mac:!symbian:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/semaphores/semaphores.pro b/examples/threads/semaphores/semaphores.pro
index 2e468b7992..5331383e06 100644
--- a/examples/threads/semaphores/semaphores.pro
+++ b/examples/threads/semaphores/semaphores.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/threads/semaphores
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS semaphores.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/semaphores
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro
index a2ccfa7412..a0e69c81b1 100644
--- a/examples/threads/threads.pro
+++ b/examples/threads/threads.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/threads
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threads.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/threads
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro
index 8c34cecdb8..49fe318537 100644
--- a/examples/threads/waitconditions/waitconditions.pro
+++ b/examples/threads/waitconditions/waitconditions.pro
@@ -10,11 +10,13 @@ INCLUDEPATH += .
# Input
SOURCES += waitconditions.cpp
CONFIG += qt warn_on create_prl link_prl console
-OBJECTS_DIR=.obj/debug-shared
-MOC_DIR=.moc/debug-shared
+OBJECTS_DIR=obj/debug-shared
+MOC_DIR=moc/debug-shared
# install
target.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS waitconditions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/codecs/codecs.pro b/examples/tools/codecs/codecs.pro
index 6ae225a295..7cc0ae836c 100644
--- a/examples/tools/codecs/codecs.pro
+++ b/examples/tools/codecs/codecs.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS encodedfiles codecs.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro
index 4ac50844e8..4f3145438d 100644
--- a/examples/tools/completer/completer.pro
+++ b/examples/tools/completer/completer.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/completer
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS completer.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/completer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/customcompleter/customcompleter.pro b/examples/tools/customcompleter/customcompleter.pro
index ebaa8313a5..8a11cf15d7 100644
--- a/examples/tools/customcompleter/customcompleter.pro
+++ b/examples/tools/customcompleter/customcompleter.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/echoplugin.pro b/examples/tools/echoplugin/echoplugin.pro
index 998f25cab1..6146b4901f 100644
--- a/examples/tools/echoplugin/echoplugin.pro
+++ b/examples/tools/echoplugin/echoplugin.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS echoplugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/echowindow/echowindow.pro b/examples/tools/echoplugin/echowindow/echowindow.pro
index fb1cea9f8c..142438bac0 100644
--- a/examples/tools/echoplugin/echowindow/echowindow.pro
+++ b/examples/tools/echoplugin/echowindow/echowindow.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS echowindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/echowindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/plugin/plugin.pro b/examples/tools/echoplugin/plugin/plugin.pro
index 5c0c5af0a6..d943425f24 100644
--- a/examples/tools/echoplugin/plugin/plugin.pro
+++ b/examples/tools/echoplugin/plugin/plugin.pro
@@ -13,3 +13,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/i18n/i18n.pro b/examples/tools/i18n/i18n.pro
index 0ef9a0b1e9..a065611c87 100644
--- a/examples/tools/i18n/i18n.pro
+++ b/examples/tools/i18n/i18n.pro
@@ -24,3 +24,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n
sources.files = $$SOURCES $$HEADERS $$RESOURCES translations i18n.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaint/plugandpaint.pro b/examples/tools/plugandpaint/plugandpaint.pro
index 15bc21e4a7..fef1b86f7c 100644
--- a/examples/tools/plugandpaint/plugandpaint.pro
+++ b/examples/tools/plugandpaint/plugandpaint.pro
@@ -7,7 +7,11 @@ SOURCES = main.cpp \
mainwindow.cpp \
paintarea.cpp \
plugindialog.cpp
-LIBS = -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins -lpnp_basictools
+symbian {
+ LIBS = -lpnp_basictools.lib
+} else {
+ LIBS = -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins -lpnp_basictools
+}
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
@@ -20,3 +24,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugandpaint.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.pro b/examples/tools/plugandpaintplugins/basictools/basictools.pro
index f015fdc3ea..f9cd4a6a85 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictools.pro
+++ b/examples/tools/plugandpaintplugins/basictools/basictools.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS basictools.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/basictools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
index 3cf2b662b6..7fbb6d1787 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
@@ -13,3 +13,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS extrafilters.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/extrafilters
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
index 89e8b7e6f1..ccc042c307 100644
--- a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
+++ b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugandpaintplugins.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/regexp/regexp.pro b/examples/tools/regexp/regexp.pro
index 15ca9a4959..bbb3fd390e 100644
--- a/examples/tools/regexp/regexp.pro
+++ b/examples/tools/regexp/regexp.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS regexp.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/settingseditor/settingseditor.pro b/examples/tools/settingseditor/settingseditor.pro
index 321c2bb24c..c6838bc73f 100644
--- a/examples/tools/settingseditor/settingseditor.pro
+++ b/examples/tools/settingseditor/settingseditor.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS settingseditor.pro inifiles
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro
index 1e84e3c5c4..2a36d51b34 100644
--- a/examples/tools/styleplugin/plugin/plugin.pro
+++ b/examples/tools/styleplugin/plugin/plugin.pro
@@ -19,3 +19,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/styles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/plugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/styleplugin/styleplugin.pro b/examples/tools/styleplugin/styleplugin.pro
index bf4fa5c639..74f77b5883 100644
--- a/examples/tools/styleplugin/styleplugin.pro
+++ b/examples/tools/styleplugin/styleplugin.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS styleplugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/styleplugin/stylewindow/stylewindow.pro b/examples/tools/styleplugin/stylewindow/stylewindow.pro
index 7c5266df3b..df68168387 100644
--- a/examples/tools/styleplugin/stylewindow/stylewindow.pro
+++ b/examples/tools/styleplugin/stylewindow/stylewindow.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS stylewindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/stylewindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/tools.pro b/examples/tools/tools.pro
index 79f0faab0c..17a3ea2fa4 100644
--- a/examples/tools/tools.pro
+++ b/examples/tools/tools.pro
@@ -20,3 +20,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/treemodelcompleter/treemodelcompleter.pro b/examples/tools/treemodelcompleter/treemodelcompleter.pro
index 8631e2b920..ef5c0cb38b 100644
--- a/examples/tools/treemodelcompleter/treemodelcompleter.pro
+++ b/examples/tools/treemodelcompleter/treemodelcompleter.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS treemodelcompleter.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/undoframework/undoframework.pro b/examples/tools/undoframework/undoframework.pro
index 42010f5499..f797eb501c 100644
--- a/examples/tools/undoframework/undoframework.pro
+++ b/examples/tools/undoframework/undoframework.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS undoframework.pro README images
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/addressbook.pro b/examples/tutorials/addressbook/addressbook.pro
index 4607c25c35..8e9859301d 100644
--- a/examples/tutorials/addressbook/addressbook.pro
+++ b/examples/tutorials/addressbook/addressbook.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS addressbook.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part1/part1.pro b/examples/tutorials/addressbook/part1/part1.pro
index bb181dd392..505f814f4e 100644
--- a/examples/tutorials/addressbook/part1/part1.pro
+++ b/examples/tutorials/addressbook/part1/part1.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part2/part2.pro b/examples/tutorials/addressbook/part2/part2.pro
index 01ce34465f..fdc0079086 100644
--- a/examples/tutorials/addressbook/part2/part2.pro
+++ b/examples/tutorials/addressbook/part2/part2.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part3/part3.pro b/examples/tutorials/addressbook/part3/part3.pro
index 128c0380e9..6e33cb84f0 100644
--- a/examples/tutorials/addressbook/part3/part3.pro
+++ b/examples/tutorials/addressbook/part3/part3.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part3.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part4/part4.pro b/examples/tutorials/addressbook/part4/part4.pro
index 23ce3e6008..0cfb546993 100644
--- a/examples/tutorials/addressbook/part4/part4.pro
+++ b/examples/tutorials/addressbook/part4/part4.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part4.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part5/part5.pro b/examples/tutorials/addressbook/part5/part5.pro
index 95123d000e..92e3d51db5 100644
--- a/examples/tutorials/addressbook/part5/part5.pro
+++ b/examples/tutorials/addressbook/part5/part5.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part5.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part6/part6.pro b/examples/tutorials/addressbook/part6/part6.pro
index dc8956132a..1b57b1670a 100644
--- a/examples/tutorials/addressbook/part6/part6.pro
+++ b/examples/tutorials/addressbook/part6/part6.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part6.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part7/part7.pro b/examples/tutorials/addressbook/part7/part7.pro
index a726d91003..fc47fae4c6 100644
--- a/examples/tutorials/addressbook/part7/part7.pro
+++ b/examples/tutorials/addressbook/part7/part7.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part7.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/tutorials.pro b/examples/tutorials/tutorials.pro
index 8b3f41fd7c..427dc03f87 100644
--- a/examples/tutorials/tutorials.pro
+++ b/examples/tutorials/tutorials.pro
@@ -6,3 +6,5 @@ SUBDIRS = \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro
index 92dda2ee08..5340ac513a 100644
--- a/examples/uitools/multipleinheritance/multipleinheritance.pro
+++ b/examples/uitools/multipleinheritance/multipleinheritance.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/uitools/multipleinheritance
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools/multipleinheritance
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/textfinder/textfinder.pro b/examples/uitools/textfinder/textfinder.pro
index 9d2a96dcf4..f4f14e1418 100644
--- a/examples/uitools/textfinder/textfinder.pro
+++ b/examples/uitools/textfinder/textfinder.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/uitools/textfinder
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro forms
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools/textfinder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro
index ddec822a4f..78c15fa00f 100644
--- a/examples/uitools/uitools.pro
+++ b/examples/uitools/uitools.pro
@@ -1,10 +1,12 @@
TEMPLATE = subdirs
SUBDIRS = multipleinheritance
-!wince*:contains(QT_BUILD_PARTS, tools): SUBDIRS += textfinder
+!wince*:!symbian:contains(QT_BUILD_PARTS, tools): SUBDIRS += textfinder
# install
target.path = $$[QT_INSTALL_EXAMPLES]/uitools
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS uitools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro
index d2cb240d59..ddd39b4c6b 100644
--- a/examples/webkit/formextractor/formextractor.pro
+++ b/examples/webkit/formextractor/formextractor.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/formextractor
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro form.html images
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/formextractor
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/webkit/previewer/previewer.pro b/examples/webkit/previewer/previewer.pro
index 75ab6fbaaa..4c8a09d6ff 100644
--- a/examples/webkit/previewer/previewer.pro
+++ b/examples/webkit/previewer/previewer.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 225816adac..5c954c22ec 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webkit.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro
index 62a1806d33..9865a1134b 100644
--- a/examples/widgets/analogclock/analogclock.pro
+++ b/examples/widgets/analogclock/analogclock.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS analogclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64F \ No newline at end of file
diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro
index a9a50d65a6..178f43e77c 100644
--- a/examples/widgets/calculator/calculator.pro
+++ b/examples/widgets/calculator/calculator.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calculator.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C602 \ No newline at end of file
diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro
index 9326989f66..63c154b5e4 100644
--- a/examples/widgets/calendarwidget/calendarwidget.pro
+++ b/examples/widgets/calendarwidget/calendarwidget.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendarwidget.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C603 \ No newline at end of file
diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro
index fe0733d539..97632875b9 100644
--- a/examples/widgets/charactermap/charactermap.pro
+++ b/examples/widgets/charactermap/charactermap.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS charactermap.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro
index b87b4a0ee1..b7c8e09f1b 100644
--- a/examples/widgets/digitalclock/digitalclock.pro
+++ b/examples/widgets/digitalclock/digitalclock.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS digitalclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro
index 7175f66b28..8d09f5f3b4 100644
--- a/examples/widgets/groupbox/groupbox.pro
+++ b/examples/widgets/groupbox/groupbox.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS groupbox.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro
index 3b432d93ec..ea9c848573 100644
--- a/examples/widgets/icons/icons.pro
+++ b/examples/widgets/icons/icons.pro
@@ -14,6 +14,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS icons.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/icons
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
imageFiles.sources = images/*
wincewm*: {
diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro
index 31c9d470a8..597d95bc3f 100644
--- a/examples/widgets/imageviewer/imageviewer.pro
+++ b/examples/widgets/imageviewer/imageviewer.pro
@@ -8,6 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS imageviewer.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/imageviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qjpeg qmng qgif
}
diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro
index e96302442a..534714805c 100644
--- a/examples/widgets/lineedits/lineedits.pro
+++ b/examples/widgets/lineedits/lineedits.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lineedits.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C604 \ No newline at end of file
diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index 1c7cbae60f..f5c94d38d1 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro
index 21f24ccf85..a9190f7664 100644
--- a/examples/widgets/scribble/scribble.pro
+++ b/examples/widgets/scribble/scribble.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS scribble.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro
index 6ef5dd0b29..c4d48f6d84 100644
--- a/examples/widgets/shapedclock/shapedclock.pro
+++ b/examples/widgets/shapedclock/shapedclock.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS shapedclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C605 \ No newline at end of file
diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro
index b8455542c9..742fc27309 100644
--- a/examples/widgets/sliders/sliders.pro
+++ b/examples/widgets/sliders/sliders.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sliders.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro
index 4edb79afb8..b859ab7330 100644
--- a/examples/widgets/spinboxes/spinboxes.pro
+++ b/examples/widgets/spinboxes/spinboxes.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS spinboxes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro
index 4c6c682b17..8918d21f39 100644
--- a/examples/widgets/styles/styles.pro
+++ b/examples/widgets/styles/styles.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS styles.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro
index 9a64c005cd..71dfc6d1dd 100644
--- a/examples/widgets/stylesheet/stylesheet.pro
+++ b/examples/widgets/stylesheet/stylesheet.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images layouts qss
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro
index 27d8d2cd3c..ee25888942 100644
--- a/examples/widgets/tablet/tablet.pro
+++ b/examples/widgets/tablet/tablet.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tablet.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro
index 59392fa521..2223b8619f 100644
--- a/examples/widgets/tetrix/tetrix.pro
+++ b/examples/widgets/tetrix/tetrix.pro
@@ -11,3 +11,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tetrix.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C606 \ No newline at end of file
diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro
index 9f0bf41e9a..0eca4c8a19 100644
--- a/examples/widgets/tooltips/tooltips.pro
+++ b/examples/widgets/tooltips/tooltips.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tooltips.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro
index 8e7884d56e..d7f9dde851 100644
--- a/examples/widgets/validators/validators.pro
+++ b/examples/widgets/validators/validators.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index 0af83c7030..018cc0c449 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -22,6 +22,15 @@ SUBDIRS = analogclock \
wiggly \
windowflags
+symbian: SUBDIRS = \
+ analogclock \
+ calculator \
+ calendarwidget \
+ lineedits \
+ shapedclock \
+ tetrix \
+ wiggly
+
contains(styles, motif): SUBDIRS += styles
# install
@@ -29,3 +38,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS widgets.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/wiggly/dialog.cpp b/examples/widgets/wiggly/dialog.cpp
index 2f4191d286..4df6aac906 100644
--- a/examples/widgets/wiggly/dialog.cpp
+++ b/examples/widgets/wiggly/dialog.cpp
@@ -45,7 +45,7 @@
#include "wigglywidget.h"
//! [0]
-Dialog::Dialog(QWidget *parent)
+Dialog::Dialog(QWidget *parent, bool smallScreen)
: QDialog(parent)
{
WigglyWidget *wigglyWidget = new WigglyWidget;
@@ -58,9 +58,12 @@ Dialog::Dialog(QWidget *parent)
connect(lineEdit, SIGNAL(textChanged(QString)),
wigglyWidget, SLOT(setText(QString)));
-
- lineEdit->setText(tr("Hello world!"));
-
+ if (!smallScreen){
+ lineEdit->setText(tr("Hello world!"));
+ }
+ else{
+ lineEdit->setText(tr("Hello!"));
+ }
setWindowTitle(tr("Wiggly"));
resize(360, 145);
}
diff --git a/examples/widgets/wiggly/dialog.h b/examples/widgets/wiggly/dialog.h
index 9c209e18b7..70ab11fed9 100644
--- a/examples/widgets/wiggly/dialog.h
+++ b/examples/widgets/wiggly/dialog.h
@@ -50,7 +50,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ Dialog(QWidget *parent = 0, bool smallScreen = false);
};
//! [0]
diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp
index 872dce6fda..ef6ec4d7d0 100644
--- a/examples/widgets/wiggly/main.cpp
+++ b/examples/widgets/wiggly/main.cpp
@@ -46,8 +46,16 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
-
- Dialog dialog;
- dialog.show();
+ bool smallScreen = false;
+ for (int i=0; i<argc; i++)
+ if (QString(argv[i]) == "-small-screen")
+ smallScreen = true;
+ Dialog dialog(0,smallScreen);
+ if (!smallScreen){
+ dialog.show();
+ }
+ else{
+ dialog.showFullScreen();
+ }
return app.exec();
}
diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro
index 5288dd38e9..42407655ba 100644
--- a/examples/widgets/wiggly/wiggly.pro
+++ b/examples/widgets/wiggly/wiggly.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wiggly.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C607 \ No newline at end of file
diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro
index fa8a5674f4..007c10a9b4 100644
--- a/examples/widgets/windowflags/windowflags.pro
+++ b/examples/widgets/windowflags/windowflags.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowflags.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index e55754fd5b..f38321f45c 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -11,6 +11,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dombookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/dombookmarks
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = frank.xbel jennifer.xbel
addFiles.path = \My Documents
diff --git a/examples/xml/htmlinfo/apache_org.html b/examples/xml/htmlinfo/apache_org.html
new file mode 100644
index 0000000000..9e5e4d3a68
--- /dev/null
+++ b/examples/xml/htmlinfo/apache_org.html
@@ -0,0 +1,281 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <!--
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ This file is generated from XML source: DO NOT EDIT!
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ -->
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <link rel="stylesheet" href="./style/compressed.css" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="./style/style.css" type="text/css" media="screen, projection"/>
+ <!--[if IE]><link rel="stylesheet" href="./style/ie.css" type="text/css" media="screen, projection"/><![endif]-->
+<link rel="alternate" title="announce@apache.org Archives" type="application/atom+xml" href="http://mail-archives.apache.org/mod_mbox/www-announce/?format=atom" />
+ <meta name="author" content="The Apache Software Foundation" /><meta name="email" content="apache.AT.apache.DOT.org" />
+ <title>Welcome! - The Apache Software Foundation</title>
+ </head>
+ <body>
+ <div class="navigation">
+ <ul>
+ <li><a href="./foundation" title="About the Foundation">Foundation</a></li>
+ <li><a href="http://projects.apache.org" title="Apache Projects">Projects</a></li>
+ <li><a href="http://people.apache.org" title="Apache People">People</a></li>
+ <li><a href="./foundation/getinvolved.html" title="Get involved in Apache">Get Involved</a></li>
+ <li><a href="./foundation/sponsorship.html" title="Support the mission of Apache">Support Apache</a></li>
+ <li class="dlink"><a href="./dyn/closer.cgi" title="Download Apache projects">Download</a></li>
+ </ul>
+ </div>
+ <div class="container">
+ <hr class="space col"/>
+ <div class="block">
+ <div class="column span-24">
+ <div id="header">
+ <h1>The Apache Software Foundation<br />
+ <span class="alt"><small>Meritocracy in Action.</small></span></h1><p class="blurb">The Apache Software Foundation provides support for the Apache community of open-source software projects. The <a href="http://projects.apache.org/">Apache projects</a> are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field.</p><p class="highlight">We consider ourselves not simply a group of projects sharing a server, but rather a <em>community of developers and users</em>.</p>
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <div class="block">
+ <div class="column span-15 first append-1">
+ <h3>
+ Latest News
+ </h3>
+ </div>
+ <div class="column span-8 las search">
+ <form action="http://www.google.com/search" method="get">
+ <input value="*.apache.org" name="sitesearch" type="hidden"/>
+ <input size="10" name="q" id="query" type="text"/>
+ <input name="Search" value="Go" type="submit"/>
+ </form>
+ </div>
+ </div>
+ <div class="block content">
+ <div class="column span-15 colborder">
+
+<div class="section-content">
+<p><em>If you would like to keep up with news and announcements from the
+foundation and all its projects, you can subscribe to the
+<a href="foundation/mailinglists.html#foundation-announce">Apache
+Announcements List</a></em>.</p>
+
+<h4 id="apachecon-eu">
+ Free Video Streams from ApacheCon Europe 2008
+</h4>
+<div class="section-content">
+<a href="http://www.eu.apachecon.com/"><img src="images/eu_2008_logo.jpg" alt="ApacheCon Europe 2008" title="ApacheCon Europe 2008" border="0" align="right" /></a>
+<p>
+ApacheCon Europe 2008 held in Amsterdam was a great success, and attracted higher
+than ever attendance figures, with about 500 registered attendees. This
+figure represents an increase of more than 40% over the previous year,
+demonstrating the rapidly growing interest in Apache and Open Source software
+amongst European businesses.
+
+If you have not been able to attend ApacheCon Europe, you can still watch
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm">videos of all keynotes and select talks online</a>. Keynote sessions
+and the opening plenary are available <b>free of charge</b>:</p>
+<ul>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/jjagielski/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">State of the Feather</a>
+ by Jim Jagielski, Chairman of the Apache Software Foundation</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/cschmidt/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Using Audio Technology and Open Content to Reduce Global Illiteracy, Poverty and Disease</a>
+ by Cliff Schmidt, Executive Director of Literacy Bridge</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rghosh/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache and Steam Engines: the Magic of Collaborative Innovation</a>
+ by Rishab Aiyer Ghosh, Open Source Initiative Board Member</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rfielding/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache 3.0 (a Tall Tale)</a>
+ by Roy Fielding, Co-founder of The Apache Software Foundation,
+ and Vice President, Apache HTTP Server</li>
+</ul>
+<p>The talks of the following select ApacheCon Europe tracks are
+available for just 49 Euro:
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#wednesday">System Administration</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#thursday">Web Security</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#friday">Web Services and Web 2.0</a>.
+</p>
+<hr />
+</div>
+
+<h4 id="apachecon-us">
+ ApacheCon US 2008 in New Orleans!
+</h4>
+<div class="section-content">
+<p>
+ ApacheCon US 2008 will be held 3 November through 7 November in
+ New Orleans, Louisiana.
+ The Call for Papers has already closed and the program and further
+ information will be made available soon on the ApacheCon US 2008
+ Web site <a href="http://www.us.apachecon.com/us2008/"><strong>www.us.apachecon.com</strong></a>.
+ If you would like to receive information about ApacheCon US 2008, please
+ <a href="mailto:announce-subscribe@apachecon.com">subscribe to
+ the ApacheCon announcement mailing list</a>.
+ </p>
+<hr />
+</div>
+
+<h4 id="sun_jck_letter">
+ Notice regarding open letter to Sun Microsystems
+</h4>
+<div class="section-content">
+<p>
+ The Apache Software Foundation has written an <a href="jcp/sunopenletter.html">open letter</a>
+ to Sun Microsystems regarding our inabillity to acquire an acceptable license for the test kit
+ for Java SE needed by <a href="http://harmony.apache.org">Apache Harmony</a>. For futher information
+ please see the <a href="jcp/sunopenletterfaq.html">FAQ</a> and direct all questions to Apache's VP
+ for JCP issues, geirm at apache dot org, or our regular press inquiry address, press at apache dot org.
+ </p>
+</div>
+</div>
+ </div>
+ <div class="column span-8 last">
+ <div class="block">
+ <div class="nav column span-11">
+ <div>
+ <div class="menuheader"><a
+href="http://projects.apache.org/">Apache Projects</a></div>
+ <ul>
+ <li><a href="http://httpd.apache.org/" title="Apache Web Server (httpd)">HTTP Server</a></li>
+ <li><a href="http://activemq.apache.org/" title="Distributed Messaging System">ActiveMQ</a></li>
+ <li><a href="http://ant.apache.org/" title="Java-based build tool">Ant</a></li>
+ <li><a href="http://apr.apache.org/" title="Apache Portable Runtime libraries">APR</a></li>
+ <li><a href="http://archiva.apache.org/" title="Build Artifact Repository Manager">Archiva</a></li>
+ <li><a href="http://beehive.apache.org/" title="Metadata frameworks for enterprise applications">Beehive</a></li>
+ <li><a href="http://cayenne.apache.org/" title="User-friendly Java ORM with Tools">Cayenne</a></li>
+ <li><a href="http://cocoon.apache.org/" title="Web development framework: separation of concerns, component-based">Cocoon</a></li>
+ <li><a href="http://commons.apache.org/" title="Reusable Java components">Commons</a></li>
+ <li><a href="http://continuum.apache.org/" title="Continuous Integration and Build Server">Continuum</a></li>
+ <li><a href="http://cxf.apache.org/" title="Service Framework">CXF</a></li>
+ <li><a href="http://db.apache.org/" title="Database access">DB</a></li>
+ <li><a href="http://directory.apache.org/" title="Apache Directory Server">Directory</a></li>
+ <li><a href="http://excalibur.apache.org/" title="Embeddable software libraries related to component and service management access">Excalibur</a></li>
+ <li><a href="http://felix.apache.org/" title="OSGi Framework and components.">Felix</a></li>
+ <li><a href="http://forrest.apache.org/" title="Aggregated multi-channel documentation, separation of concerns">Forrest</a></li>
+ <li><a href="http://geronimo.apache.org/" title="Java2, Enterprise Edition (J2EE) container">Geronimo</a></li>
+ <li><a href="http://gump.apache.org/" title="Continuous integration of open source projects">Gump</a></li>
+ <li><a href="http://hadoop.apache.org/" title="Distributed computing platform">Hadoop</a></li>
+ <li><a href="http://harmony.apache.org/" title="Open source implementation of Java SE">Harmony</a></li>
+ <li><a href="http://hivemind.apache.org/" title="A services and configuration microkernel">HiveMind</a></li>
+ <li><a href="http://hc.apache.org/" title="Java toolset of low level HTTP components">HttpComponents</a></li>
+ <li><a href="http://ibatis.apache.org/" title="SQL Data Mapper for Java and .NET">iBATIS</a></li>
+ <li><a href="http://incubator.apache.org/" title="Shepherd for new projects">Incubator</a></li>
+ <li><a href="http://jackrabbit.apache.org/" title="Content Repository for Java">Jackrabbit</a></li>
+ <li><a href="http://jakarta.apache.org/" title="Server-side Java">Jakarta</a></li>
+ <li><a href="http://james.apache.org/" title="Java Apache Mail Enterprise Server">James</a></li>
+ <li><a href="http://labs.apache.org/" title="The Innovation Laboratories of the Apache Software Foundation">Labs</a></li>
+ <li><a href="http://lenya.apache.org/" title="Content Management System">Lenya</a></li>
+ <li><a href="http://logging.apache.org/" title="Cross-language logging services">Logging</a></li>
+ <li><a href="http://lucene.apache.org/" title="Search engine library">Lucene</a></li>
+ <li><a href="http://maven.apache.org/" title="Java project management and comprehension tools">Maven</a></li>
+ <li><a href="http://mina.apache.org/" title="Multipurpose Infrastructure for Network Application">Mina</a></li>
+ <li><a href="http://myfaces.apache.org/" title="JavaServer(tm) Faces implementation and components">MyFaces</a></li>
+ <li><a href="http://ode.apache.org/" title="Orchestration Director Engine: Business Process Management (BPM), Process Orchestration and Workflow through service compositioni.">ODE</a></li>
+ <li><a href="http://ofbiz.apache.org/" title="Open for Business: enterprise automation software">OFBiz</a></li>
+ <li><a href="http://openejb.apache.org/" title="OpenEJB: a modular, configurable, and extendable EJB Container System and Server">OpenEJB</a></li>
+ <li><a href="http://openjpa.apache.org/" title="OpenJPA: Object Relational Mapping for Java">OpenJPA</a></li>
+ <li><a href="http://perl.apache.org/" title="Dynamic websites using Perl">Perl</a></li>
+ <li><a href="http://poi.apache.org/" title="Java API for OLE 2 Compound Documents">POI</a></li>
+ <li><a href="http://portals.apache.org/" title="Portal technology">Portals</a></li>
+ <li><a href="http://roller.apache.org/" title="Java blog server">Roller</a></li>
+ <li><a href="http://santuario.apache.org/" title="XML Security in Java and C++">Santuario</a></li>
+ <li><a href="http://servicemix.apache.org/" title="Enterprise Service Bus">ServiceMix</a></li>
+ <li><a href="http://shale.apache.org/" title="Web application framework based on JavaServer(tm) Faces">Shale</a></li>
+ <li><a href="http://spamassassin.apache.org/" title="Mail filter to identify spam">SpamAssassin</a></li>
+ <li><a href="http://stdcxx.apache.org/" title="Apache C++ Standard Library">STDCXX</a></li>
+ <li><a href="http://struts.apache.org/" title="Model 2 framework for building Java web applications">Struts</a></li>
+ <li><a href="http://synapse.apache.org/" title="Enterprise Service Bus and Mediation Framework">Synapse</a></li>
+ <li><a href="http://tapestry.apache.org/" title="Component-based Java Web Application Framework">Tapestry</a></li>
+ <li><a href="http://tcl.apache.org/" title="Dynamic websites using TCL">TCL</a></li>
+ <li><a href="http://tiles.apache.org/" title="A templating framework for web application user interfaces">Tiles</a></li>
+ <li><a href="http://tomcat.apache.org/" title="A Java Servlet and JSP Container">Tomcat</a></li>
+ <li><a href="http://turbine.apache.org/" title="A Java Servlet Web Application Framework and associated component library">
+ Turbine</a></li>
+ <li><a href="http://velocity.apache.org/" title="A Java Templating Engine">Velocity</a></li>
+ <li><a href="http://wicket.apache.org/" title="Component-based Java Web Application Framework.">Wicket</a></li>
+ <li><a href="http://ws.apache.org/">Web Services</a></li>
+ <li><a href="http://xalan.apache.org/" title="XSLT processors in Java and C++">Xalan</a></li>
+ <li><a href="http://xerces.apache.org/" title="XML parsers in Java, C++ and Perl">Xerces</a></li>
+ <li><a href="http://xml.apache.org/" title="XML solutions focused on the web">XML</a></li>
+ <li><a href="http://xmlbeans.apache.org/" title="XML-Java binding tool">XMLBeans</a></li>
+ <li><a href="http://xmlgraphics.apache.org/" title="Conversion from XML to graphical output">XML Graphics</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="nav column prepend-1 span-12 last">
+ <h6><a
+href="/foundation/">Foundation</a></h6>
+ <ul>
+ <li><a href="/foundation/faq.html">FAQ</a></li>
+ <li><a href="/licenses/">Licenses</a></li>
+ <li><a href="/foundation/news.html">News</a></li>
+ <li><a href="/foundation/records/">Public Records</a></li>
+ <li><a href="/foundation/sponsorship.html">Sponsorship</a></li>
+ <li><a href="/foundation/contributing.html">Donations</a></li>
+ <li><a href="/foundation/thanks.html">Thanks</a></li>
+ <li><a href="/foundation/contact.html">Contact</a></li>
+ </ul>
+ <h6>Foundation Projects</h6>
+ <ul>
+ <li><a href="/foundation/conferences.html" title="Meetings of developers and users">Conferences</a></li>
+ <li><a href="/dev/" title="ASF Infrastructure: Operations and howto documents for PMCs and contributors">Infrastructure</a></li>
+ <li><a href="/jcp/" title="Apache and the Java Community Process">JCP</a></li>
+ </ul>
+ <h6>How it works</h6>
+ <ul>
+ <li><a href="/foundation/how-it-works.html">Introduction</a></li>
+ <li><a href="/foundation/how-it-works.html#meritocracy">Meritocracy</a></li>
+ <li><a href="/foundation/how-it-works.html#structure">Structure</a></li>
+ <li><a href="/foundation/how-it-works.html#roles">Roles</a></li>
+ <li><a href="/foundation/how-it-works.html#management">Collaboration</a></li>
+ <li><a href="/foundation/how-it-works.html#infrastructure">Infrastructure</a></li>
+ <li><a href="/foundation/how-it-works.html#incubator">Incubator</a></li>
+ <li><a href="/foundation/how-it-works.html#other">Other entities</a></li>
+ <li><a href="/foundation/glossary.html">Glossary</a></li>
+ <li><a href="/foundation/voting.html">Voting</a></li>
+ </ul>
+ <h6><a
+href="/foundation/getinvolved.html">Get Involved</a></h6>
+ <ul>
+ <li><a href="/foundation/mailinglists.html">Mailing Lists</a></li>
+ <li><a href="/dev/version-control.html">Version Control</a></li>
+ <li><a href="/dev/">Developer Info</a></li>
+ </ul>
+ <h6>Download</h6>
+ <ul>
+ <li><a href="/dyn/closer.cgi">from a mirror</a></li>
+ </ul>
+ <h6>Related Sites</h6>
+ <ul>
+ <li><a href="http://apachecon.com/" title="Official Apache Conference">ApacheCon</a></li>
+ <li><a href="http://apachebookstore.com/" title="Apache Books">Bookstore</a></li>
+ <li><a href="http://feathercast.org/" title="Apache Podcasts">Feathercast</a></li>
+ <li><a href="http://planetapache.org/" title="Apache Community Blogs">PlanetApache</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="column span-24 footer">
+ <hr/>
+ <p>Copyright &#169; 2008 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
new file mode 100644
index 0000000000..d8285184d4
--- /dev/null
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -0,0 +1,18 @@
+SOURCES += main.cpp
+QT -= gui
+
+wince*|symbian:{
+ htmlfiles.sources = *.html
+ htmlfiles.path = .
+ DEPLOYMENT += htmlfiles
+}
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.html htmlinfo.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
+INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C609
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
new file mode 100644
index 0000000000..fcf480b11f
--- /dev/null
+++ b/examples/xml/htmlinfo/main.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+
+void parseHtmlFile(QTextStream &out, const QString &fileName) {
+ QFile file(fileName);
+
+ out << "Analysis of HTML file: " << fileName << endl;
+
+ if (!file.open(QIODevice::ReadOnly)) {
+ out << " Couldn't open the file." << endl << endl << endl;
+ return;
+ }
+
+//! [0]
+ QXmlStreamReader reader(&file);
+//! [0]
+
+//! [1]
+ int paragraphCount = 0;
+ QStringList links;
+ QString title;
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement()) {
+ if (reader.name() == "title")
+ title = reader.readElementText();
+ else if(reader.name() == "a")
+ links.append(reader.attributes().value("href").toString());
+ else if(reader.name() == "p")
+ ++paragraphCount;
+ }
+ }
+//! [1]
+
+//! [2]
+ if (reader.hasError()) {
+ out << " The HTML file isn't well-formed: " << reader.errorString()
+ << endl << endl << endl;
+ return;
+ }
+//! [2]
+
+ out << " Title: \"" << title << "\"" << endl
+ << " Number of paragraphs: " << paragraphCount << endl
+ << " Number of links: " << links.size() << endl
+ << " Showing first few links:" << endl;
+
+ while(links.size() > 5)
+ links.removeLast();
+
+ foreach(QString link, links)
+ out << " " << link << endl;
+ out << endl << endl;
+}
+
+int main(int argc, char **argv)
+{
+ // intialize QtCore application
+ QCoreApplication app(argc, argv);
+
+ // get a list of all html files in the current directory
+ QStringList filter;
+ filter << "*.htm";
+ filter << "*.html";
+ QStringList htmlFiles = QDir::current().entryList(filter, QDir::Files);
+
+ QTextStream out(stdout);
+
+ if (htmlFiles.isEmpty()) {
+ out << "No html files available.";
+ return 1;
+ }
+
+ // parse each html file and write the result to file/stream
+ foreach(QString file, htmlFiles)
+ parseHtmlFile(out, file);
+
+ return 0;
+}
diff --git a/examples/xml/htmlinfo/nokia_com.html b/examples/xml/htmlinfo/nokia_com.html
new file mode 100644
index 0000000000..46d4c95ee6
--- /dev/null
+++ b/examples/xml/htmlinfo/nokia_com.html
@@ -0,0 +1,215 @@
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+
+
+ <!--startindex-->
+ <title>Nokia - Nokia on the Web</title>
+
+
+ <meta name="description" content="Nokia is the world's leading mobile phone supplier and a leading supplier of mobile and fixed telecom networks including related customer services."/>
+ <meta name="keywords" content="Nokia,mobile phones,cellular,telecommunications,wireless networks,datacom,GSM,multimedia terminals,handsets,customer services,press releases,financial information,student exchange,open positions,employment opportunities,career opportunities"/>
+ <meta name="modified" content=""/>
+ <meta name="category" content="Landing Page Global Flash"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="siteid" content="101"/>
+
+ <!--stopindex-->
+ <link href="/css/style_46.css" rel="stylesheet" type="text/css">
+
+ <link href="/NOKIA_COM_1/Home/Landing_page_2007/wayfinder.css" rel="stylesheet" type="text/css"/>
+
+<script type="text/javascript">
+ var useHbx = true;
+</script>
+
+
+<!--WEBSIDESTORY CODE HBX1.0 (Universal)-->
+<!--COPYRIGHT 1997-2005 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No. 6,393,479B1. MORE INFO:http://websidestory.com/privacy-->
+<script language="javascript">
+var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
+var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="ehg-nokiafin.hitbox.com";
+
+//BEGIN EDITABLE SECTION
+//CONFIGURATION VARIABLES
+hbx.acct="DM550514HPNZ";//ACCOUNT NUMBER(S)
+hbx.pn="Home";//PAGE NAME(S)
+hbx.mlc="/Home";//MULTI-LEVEL CONTENT CATEGORY
+hbx.pndef="title";//DEFAULT PAGE NAME
+hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
+
+//OPTIONAL PAGE VARIABLES
+//ACTION SETTINGS
+hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
+hbx.lt="none";//LINK TRACKING
+hbx.dlf="n";//DOWNLOAD FILTER
+hbx.dft="n";//DOWNLOAD FILE NAMING
+hbx.elf="n";//EXIT LINK FILTER
+
+//SEGMENTS AND FUNNELS
+hbx.seg="";//VISITOR SEGMENTATION
+hbx.fnl="";//FUNNELS
+
+//CAMPAIGNS
+hbx.cmp="";//CAMPAIGN ID
+hbx.cmpn="";//CAMPAIGN ID IN QUERY
+hbx.dcmp="";//DYNAMIC CAMPAIGN ID
+hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
+hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
+hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
+hbx.hra="";//RESPONSE ATTRIBUTE
+hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
+hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
+hbx.hlt="";//LEAD TRACKING
+hbx.hla="";//LEAD ATTRIBUTE
+hbx.gp="";//CAMPAIGN GOAL
+hbx.gpn="";//CAMPAIGN GOAL IN QUERY
+hbx.hcn="";//CONVERSION ATTRIBUTE
+hbx.hcv="";//CONVERSION VALUE
+hbx.cp="null";//LEGACY CAMPAIGN
+hbx.cpd="";//CAMPAIGN DOMAIN
+
+//CUSTOM VARIABLES
+hbx.ci="";//CUSTOMER ID
+hbx.hc1="";//CUSTOM 1
+hbx.hc2="";//CUSTOM 2
+hbx.hc3="";//CUSTOM 3
+hbx.hc4="";//CUSTOM 4
+hbx.hrf="";//CUSTOM REFERRER
+hbx.pec="";//ERROR CODES
+
+
+var cookieName = 'MyNokia';
+var nameEQ = cookieName + "=";
+var ca = document.cookie.split(';');
+for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) {
+ hbx.ci = c.substring(nameEQ.length,c.length);
+ }
+}
+
+//INSERT CUSTOM EVENTS
+hbx.acct="DM550514HPNZ";
+hbx.mlc="/Home";
+hbx.pn="Home";
+hbx.lt="auto";
+
+
+//END EDITABLE SECTION
+
+//REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER)
+</script><script language="javascript1.1" defer src="/Hitbox/hbx_5.js"></script>
+<script language="javascript">if(navigator.appName!='Netscape'&&parseInt(navigator.appVersion)==4)document.write("<\!"+"--")</script><noscript>
+<img src="http://ehg-nokiafin.hitbox.com/HG?hc=we88&cd=1&hv=6&ce=u&hb=DM550514HPNZ&n=Home&vcon=/Home&seg=&cmp=&gp=&fnl=&pec=&dcmp=&ra=&gn=&cv=&ld=&la=&c1=&c2=&c3=&c4=&vpc=090101rn" border="0" width="1" height="1">
+</noscript><!--//-->
+
+<!--END WEBSIDESTORY CODE-->
+
+
+
+
+
+</head>
+<body lang='en'
+ style="margin: 0 0 0 0;" bgcolor="#FFFFFF" link="#0033cc" text="#000000" alink="#0033cc" vlink="#800080">
+ <div class="pagecontainer">
+
+
+<!-- start page template [Generated JSP Servlet: class=jsp_servlet._templates._page.__template6layout] -->
+
+
+
+
+
+
+
+
+
+
+ <!--startindex-->
+
+
+
+<!-- Begin template '/templates/content/plain.jsp' -->
+
+<div id="wayfinderContainer">
+ <div id="branding">
+ <img src="/NOKIA_COM_1/Home/Landing_page_2007/noflash_img/nokia_connecting_people.png" alt="Nokia - Connecting people" />
+
+ </div>
+
+ <div id="flashcontent">
+
+ <!-- main page noflash content -->
+ <div id="mainContentGlobal">
+ <div id="mainHdr"><h1>Welcome to Nokia</h1></div>
+ <div id="selectContainer">
+ <h2>Where would you like to go?</h2>
+ <div id="selectLinks">
+ <ul class="mainpage">
+ <li><a href="/A4176248">Africa</a></li>
+ <li><a href="/A4138125">Asia Pacific</a></li>
+ <li><a href="/A4138121">Europe</a></li>
+ <li><a href="/A4138127">Latin America</a></li>
+ <li><a href="/A4176245">Middle East</a></li>
+ <li><a href="/A4138126">North America</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- <a id="banner" href="http://www.nokia.com/seasonsgreetings/">Seasons Greetings</a> -->
+ </div>
+ <div id="navi">
+ <ul>
+ <li><a href="http://www.nokiaforbusiness.com/">Nokia for Business</a></li>
+ <li><a href="http://www.nokia.com/aboutnokia">About Nokia</a></li>
+ <li><a href="http://www.nokia.com/developers">Developers</a></li>
+ <li><a href="http://www.nokia.com/press">Press</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/investors">Investors</a></li>
+ <!-- <li class="lastitem"><a href="http://www.nokia.com/environment">Environment</a></li> -->
+ </ul>
+ </div>
+ <!-- noflash content ends -->
+
+ </div>
+
+ <div id="footer">
+ <ul>
+ <li><a href="http://www.nokia.com/siteterms">Site Terms</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/privacypolicy">Privacy Policy</a></li>
+ <span>Copyright &copy; 2008 Nokia. All rights reserved</span>
+ </ul>
+ <br /><br />
+ </div>
+</div>
+
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/flash_detection_main.js"></script> <!-- for redirection to mobile site -->
+<script type="text/javascript" src="/EUROPE_NOKIA_COM_3/flash/swfobject.js"></script>
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/cookies.js"></script>
+<script type="text/javascript" >
+ // <![CDATA[
+ var so = new SWFObject("/NOKIA_COM_1/Home/Landing_page_2007/wayfinder_assets.swf", "wayfinder", "736", "560", "7");
+ so.addParam("allowscriptaccess", "always");
+ so.addParam("base", "/NOKIA_COM_1/Home/Landing_page_2007/");
+ so.write("flashcontent");
+ // ]]>
+</script>
+
+<!-- End template '/templates/content/plain.jsp' -->
+ <!--stopindex-->
+
+
+
+
+
+ </div>
+</body>
+
+
+ </html>
+
diff --git a/examples/xml/htmlinfo/simpleexample.html b/examples/xml/htmlinfo/simpleexample.html
new file mode 100644
index 0000000000..87ccf36e27
--- /dev/null
+++ b/examples/xml/htmlinfo/simpleexample.html
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html>
+ <head>
+ <title>Qt is cute! Frans is too!</title>
+ </head>
+ <body>
+ <p>A paragraph.</p>
+ <p>A second paragraph. Check out our <a href="http://labs.trolltech.com/">developer blogs</a></p>
+ <p>And the last paragraph. Or our <a href="http://doc.trolltech.com/">online documentation</a>.</p>
+ </body>
+</html>
diff --git a/examples/xml/htmlinfo/trolltech_com.html b/examples/xml/htmlinfo/trolltech_com.html
new file mode 100644
index 0000000000..180eb74358
--- /dev/null
+++ b/examples/xml/htmlinfo/trolltech_com.html
@@ -0,0 +1,955 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+ lang="en">
+
+ <head>
+ <meta http-equiv="Content-Type"
+ content="text/html;charset=utf-8" />
+
+ <title>
+ Code Less. Create More. Deploy Everywhere.
+ &mdash;
+ Trolltech
+ </title>
+
+
+ <!-- ADD ON UPDATE -->
+
+ <meta name="author" content="Trolltech" />
+ <meta name="description"
+ content="Trolltech creates application development platforms for desktop and mobile device innovation." />
+ <meta name="keywords" content="" />
+
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"><!-- &nbsp;--></script>
+<script type="text/javascript">
+ <!-- Urchin script
+ _uacct = "UA-4457116-1";
+ urchinTracker();
+ -->
+ </script>
+
+ <base href="http://trolltech.com/homepage" />
+
+
+
+ <meta name="generator" content="Plone - http://plone.org" />
+
+
+ <!-- Plone ECMAScripts -->
+
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts2804.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts0445.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts5940.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/linkpopper.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts7743.js">
+ </script>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <style type="text/css"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles1145.css); --></style>
+
+
+
+
+
+
+
+
+ <style type="text/css"
+ media="screen"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles8707.css); --></style>
+
+
+
+
+
+
+
+
+
+
+ <!-- Internet Explorer CSS Fixes -->
+ <!--[if IE]>
+ <style type="text/css" media="all">@import url(http://trolltech.com/IEFixes.css);</style>
+ <![endif]-->
+
+ <link rel="shortcut icon" type="image/x-icon"
+ href="http://trolltech.com/favicon.ico" />
+
+ <link rel="home" href="http://trolltech.com"
+ title="Front page" />
+ <link rel="search"
+ href="http://trolltech.com/search_form"
+ title="Search this site" />
+ <link rel="author"
+ href="http://trolltech.com/author/admin"
+ title="Author information" />
+ <link rel="contents" href="http://trolltech.com/sitemap"
+ title="Site Map" />
+
+
+
+
+
+
+
+
+
+ <!-- Disable IE6 image toolbar -->
+ <meta http-equiv="imagetoolbar" content="no" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </head>
+
+ <body class="section-homepage" dir="ltr">
+ <div id="visual-portal-wrapper">
+ <div id="portal-top">
+
+ <div id="portal-header">
+ <a class="hiddenStructure" accesskey="2"
+ href="http://trolltech.com/#documentContent">Skip to content.</a>
+
+ <a class="hiddenStructure" accesskey="6"
+ href="http://trolltech.com/#portlet-navigation-tree">Skip to navigation</a>
+
+ <div class="middlesex">
+ <ul id="portal-siteactions">
+
+ <li id="siteaction-sitemap"><a
+ href="http://trolltech.com/sitemap" accesskey="3"
+ title="Site Map">Site Map</a></li>
+ <li id="siteaction-accessibility"><a
+ href="http://trolltech.com/accessibility-info"
+ accesskey="0" title="Accessibility">Accessibility</a></li>
+ <li id="siteaction-contact"><a
+ href="http://trolltech.com/contact" accesskey="9"
+ title="Contact">Contact</a></li>
+
+</ul>
+
+ <div id="portal-searchbox">
+ <form name="searchform"
+ action="http://trolltech.com/search"
+ style="white-space:nowrap"
+ onsubmit="return liveSearchSubmit()">
+
+ <label for="searchGadget" class="hiddenStructure">Search Site</label>
+
+ <div class="LSBox">
+ <input id="searchGadget" name="SearchableText"
+ type="text" size="15" title="Search Site"
+ accesskey="4" class="visibility:visible" />
+
+ <input class="searchButton" type="submit"
+ value="Search" />
+
+ <div class="LSResult" id="LSResult" style=""><div class="LSShadow" id="LSShadow"></div></div>
+ </div>
+ </form>
+
+ <div id="portal-advanced-search" class="hiddenStructure">
+ <a href="http://trolltech.com/search_form"
+ accesskey="5">
+ Advanced Search&hellip;
+ </a>
+ </div>
+
+</div>
+
+ <div id="country-flags">
+ <a href="/lang/cn/"><img class="flag"
+ border="0" width="30" height="20" src="chineseflag.png" /></a>
+ <a href="/lang/japanese/"><img
+ class="flag" border="0" width="30" height="20"
+ src="japaneseflag.png" /></a>
+ </div>
+ <h1 id="portal-logo">
+ <a href="http://trolltech.com" accesskey="1">Trolltech</a>
+</h1>
+
+ <div id="portal-skinswitcher">
+
+</div>
+ </div>
+
+
+ <h5 class="hiddenStructure">Sections</h5>
+ <div id="portal-globalnav">
+ <div class="middlesex">
+ <ul>
+ <li id="portaltab-index_html"
+ class="selected indextab"><a
+ href="http://trolltech.com">Home</a></li>
+
+ <li id="portaltab-products"
+ class="plain"><a
+ href="http://trolltech.com/products" title="">Products and Services</a></li>
+
+
+ <li id="portaltab-solutions"
+ class="plain"><a
+ href="http://trolltech.com/solutions" title="">Solutions</a></li>
+
+
+ <li id="portaltab-developer"
+ class="plain"><a
+ href="http://trolltech.com/developer" title="">Developer Resources</a></li>
+
+
+ <li id="portaltab-company" class="plain"><a
+ href="http://trolltech.com/company" title="">Company</a></li>
+
+
+ <li id="portaltab-downloads"
+ class="plain"><a
+ href="http://trolltech.com/downloads" title="">Downloads</a></li>
+
+
+
+
+ </ul>
+ </div>
+ </div>
+
+ </div>
+ <div id="portal-personaltools-wrapper">
+
+<h5 class="hiddenStructure">Personal tools</h5>
+
+
+</div>
+
+ <div class="middlesex">
+ <div id="portal-breadcrumbs">
+
+ <span id="breadcrumbs-you-are-here">You
+are here:</span>
+ <a href="http://trolltech.com">Home</a>
+
+
+</div>
+ </div>
+ </div>
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <table id="portal-columns">
+ <tbody>
+ <tr>
+
+
+
+
+
+ <td id="portal-column-content">
+
+
+ <div id="content" class="">
+
+
+
+ <div class="documentContent" id="region-content">
+
+ <a name="documentContent"></a>
+
+
+
+
+
+
+
+
+
+
+
+ <!-- <table id="frontpagetable" cellpadding="0" cellspacing="0" tal:attributes="width pagew"> --> <!-- tal:on-error="string:replace with error template" Fetch image width here -->
+ <table id="frontpagetable" cellpadding="0"
+ cellspacing="0" width="712">
+ <tr>
+ <td colspan="2">
+
+ <h2>Trolltech provides cross-platform software solutions for:</h2>
+ <table id="fpSolutions" class="solutions" cellpadding="0" cellspacing="6" width="100%">
+ <tbody>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/managing-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Software Development Managers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/industrial-embedded-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Embedded Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/ce-mobile-vendors">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Consumer Electronics Vendors</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/mobile-application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Mobile Application Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Cross-Platform Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/solutions-opensource">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Open Source Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ </td>
+ </tr>
+
+ <!-- BANNER -->
+
+ <tr class="minspacerow">
+ <td colspan="2">
+
+ <div id="flashcontent">
+
+
+ <!-- In case of no imagemap -->
+ <a
+ href="http://trolltech.com/products/qt/learnmore/whitepapers">
+ <img border="0"
+ src="http://trolltech.com/include/features/frontpage/whitepaper-feature/mainsplash"
+ alt="Code Less. Create More. Deploy Everywhere."
+ height="100" width="700" />
+ </a>
+
+
+ </div>
+
+
+
+ </td>
+ </tr>
+
+ <!-- Product Feature rows -->
+ <tr id="productfeatures" class="minspacerow">
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p class="discreet"><a title="Downloads" href="downloads/index"><img class="image-right" src="images/frontpage/qt_download_90.png" alt="Download Qt Button: Grey BG" /></a></p>
+<h2>Qt</h2>
+<p>Qt is a cross-platform application framework.&nbsp; It includes:</p>
+<ul><li>An <a title="C++ Class Library" href="products/qt/features/library/index">intuitive class library</a></li><li>Integrated <a title="Development Tools" href="products/qt/features/tools/index">development tools</a></li><li>Support for <a title="C++ and Java Support" href="products/qt/features/language-support/index">C++ and Java development</a></li><li><a title="Cross-Platform Development" href="products/qt/features/platforms/index">Desktop and embedded</a> development support</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Qt Cross-Platform Application Framework" href="products/qt/index"><span class="button">Learn More</span></a></strong> <strong><a title="How to order" href="products/qt/orderform"><span class="button">Buy Now</span></a></strong></p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+</div>
+ </td>
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p><a title="Qtopia" href="products/qtopia"><img class="image-right" src="images/frontpage/qtopia_learn_more_90.png" alt="Qtopia Learn More button 90px" /></a></p>
+<h2>Qtopia</h2>
+<p><a title="The Qtopia application platform for embedded Linux" href="products/qtopia/index">Qtopia</a> is an application platform and UI for Linux-based <a title="Qtopia Phone Edition" href="products/qtopia/qtopia-product-family/qtopia-phone-edition">mobile</a>, <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">consumer electronics</a> and <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">embedded devices</a>. Qtopia offers:</p>
+<ul><li>Rich <a href="products/qt/features/tools/index">toolkit</a> and intuitive API</li><li>Fully customizable user interface</li><li>Highly efficient development framework</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Customer Devices" href="company/customers/customer-devices"><span class="button">Customer Devices</span></a></strong>&nbsp;<strong><a title="Purchasing Qtopia" href="products/qtopia/orderinfo"><span class="button">Buy Now</span></a></strong></p>
+</div>
+ </td>
+ </tr>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ </div>
+
+
+ </td>
+
+
+
+
+ <!-- News/events -->
+ <td id="frontpage-column-two">
+
+ <div class="viewlet">
+ <h3>Quick Links</h3>
+
+
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/careers"
+ title="Quick Links">Careers at Trolltech</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/whitepapers"
+ title="Quick Links">Whitepapers</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/webinars-videos"
+ title="Quick Links">Webinars and Videos</a>
+ </p>
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Nokia Acquisition</h3>
+
+ <div class="viewletBody">
+<p class="smallerExtendedLink"><a title="Nokia Acquires Trolltech" href="../../../28012008/28012008">Learn more about Nokia's acquisition of Trolltech<br /></a></p>
+</div>
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>News</h3>
+
+
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-06-03.1419977468">Trolltech Releases Qt Jambi 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (Jun&nbsp;03)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-28.9662742780">Trolltech releases Qt 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;28)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-14.1108908046">Award From Qt Developers Recognizes Best Open Source Development Tools</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;14)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-08.1819339587">Trolltech Delivered Revenues of NOK 55.6 Million</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;08)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Events</h3>
+
+ <div class="viewletBody">
+<p>&nbsp;</p>
+</div>
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-15.0963129132">Qt Open Enrollment Training Class</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;09&nbsp;-&nbsp;Jun&nbsp;13)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-02-22.1032431617">Israel Qt User Group</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;16)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-19.5707721007">Webinar: Building Tomorrow’s Virtual Driver Control Center</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;24)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/newsroom/events"
+ title="Events">More events</a>
+ </p>
+
+
+
+ </div>
+
+ </td>
+
+
+ </tr>
+ </tbody>
+ </table>
+
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <hr class="netscape4" />
+
+
+
+ <div id="portal-footer">
+
+
+<p id="bottom-navigation">
+ Trolltech&reg; - Code Less. Create More. Deploy Everywhere.
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Trolltech ASA">
+ Trolltech ASA
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Address: Sandakerveien 116, Oslo">
+ Sandakerveien 116, Oslo
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ class="lastNavItem" title="Phone: +47 21 60 48 00">
+ +47 21 60 48 00
+ </a>
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="International locations">
+ International locations
+ </a>
+ <a href="/trolltech/privacypolicy" title="Privacy policy">
+ Privacy Policy
+ </a>
+ <a href="/trolltech/copyright" title="Trolltech" class="lastNavItem"><span>2008</span> &copy; Trolltech ASA</a>
+</p>
+
+
+</div>
+
+ <div id="portal-colophon">
+
+
+ <a href="http://plone.org"
+ class="colophonIcon colophonIconPlone"
+ title="This Plone site was built using Plone CMS, the Open Source Content Management System. Click for more information.">
+ Powered by Plone CMS, the Open Source Content Management System
+ </a>
+
+
+
+ <p class="discreet">
+ This site conforms to the following standards:
+ </p>
+
+ <div class="colophonWrapper">
+ <ul>
+ <li>
+ <a href="http://www.section508.gov"
+ class="colophonIcon colophonIcon508"
+ title="This Plone site conforms to the US Government Section 508 Accessibility Guidelines.">
+ Section 508
+ </a>
+ </li>
+ <li>
+ <a href="http://www.w3.org/WAI/WCAG1AA-Conformance"
+ class="colophonIcon colophonIconWAI"
+ title="This Plone site conforms to the W3C-WAI Web Content Accessibility Guidelines.">
+ WCAG
+ </a>
+ </li>
+ <li>
+ <a href="http://validator.w3.org/check/referer"
+ class="colophonIcon colophonIconXHTML"
+ title="This Plone site is valid XHTML.">
+ Valid XHTML
+ </a>
+ </li>
+ <li>
+ <a href="http://jigsaw.w3.org/css-validator/check/referer&amp;warning=no&amp;profile=css3&amp;usermedium=all"
+ class="colophonIcon colophonIconCSS"
+ title="This Plone site was built with valid CSS.">
+ Valid CSS
+ </a>
+ </li>
+ <li>
+ <a href="http://plone.org/browsersupport"
+ class="colophonIcon colophonIconAnyBrowser"
+ title="This Plone site is usable in any web browser.">
+ Usable in any browser
+ </a>
+ </li>
+ </ul>
+ </div>
+
+ </div>
+
+ </div>
+<!-- ProspectXtractor tracker script -->
+<script type="text/javascript"><!--
+function _pxPar()
+{
+var p="";
+p+="&ref="+escape(top.document.referrer);
+p+="&dt="+escape(document.title);
+p+="&sr="+screen.width+"x"+screen.height;
+p+="&sd="+screen.colorDepth;
+p+="&fv="+_pxFV();
+return p;
+}
+function _pxFV()
+{
+var f=0,n=navigator;
+if (n.plugins && n.mimeTypes.length) {
+var x=n.plugins["Shockwave Flash"];
+if(x && x.description) {
+var y=x.description;
+f=y.charAt(y.indexOf('.')-1);
+}
+} else {
+r=false;
+for(var i=15;i>=3&&r!=true;i-=1){
+execScript('on error resume next: r=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
+f=i;
+}
+}
+return f;
+}
+document.write('<img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999'+_pxPar()+'" width="1" heigth="1" />');
+//-->
+</script>
+<noscript>
+<div><img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999" width="1" height="1" alt="" /></div>
+</noscript>
+<!-- END ProspectXtractor tracker script -->
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/w3c_org.html b/examples/xml/htmlinfo/w3c_org.html
new file mode 100644
index 0000000000..0fcce48e4a
--- /dev/null
+++ b/examples/xml/htmlinfo/w3c_org.html
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
+<head profile="http://www.w3.org/2000/08/w3c-synd/#"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="HTML Tidy for Mac OS X (vers 1st March 2004), see www.w3.org" />
+
+<meta name="keywords" content="W3C, World Wide Web, Web, WWW, Consortium, computer, access, accessibility, semantic, worldwide, W3, HTML, XML, standard, language, technology, link, CSS, RDF, XSL, Berners-Lee, Berners, Lee, style sheet, cascading, schema, XHTML, mobile, SVG, PNG, PICS, DOM, SMIL, MathML, markup, Amaya, Jigsaw, free, open source, software" />
+<meta name="description" content="The World Wide Web Consortium (W3C) is an international consortium where Member organizations, a full-time staff, and the public work together to develop Web standards. W3C primarily pursues its mission through the creation of Web standards and guidelines designed to ensure long-term growth for the Web. Over 400 organizations are Members of the Consortium. W3C is jointly run by the MIT Computer Science and Artificial Intelligence Laboratory (MIT CSAIL) in the USA, the European Research Consortium for Informatics and Mathematics (ERCIM) headquartered in France, Keio University in Japan, and has additional Offices worldwide." />
+
+<title>World Wide Web Consortium - Web Standards</title>
+<link rel="meta" href="/Overview-about.rdf" />
+<link rel="stylesheet" type="text/css" href="/StyleSheets/home.css" />
+<link rel="bookmark" href="#technologies" title="Technologies |" />
+<link rel="bookmark" href="#news" title="News |" />
+<link rel="bookmark" href="#search" title="Search |" />
+<link rel="contents" href="#contents" title="Contents |" />
+<link rel="bookmark" href="#Offices" title="Offices |" />
+<link rel="bookmark" href="#systems" title="Systems |" />
+<link rel="bookmark" href="#donors" title="Supporters |" />
+<link rel="bookmark" href="#footnotes" title="Footnotes |" />
+<link rel="alternate" type="application/rss+xml" title="W3C Home Page News RSS Channel" href="http://www.w3.org/2000/08/w3c-synd/home.rss" />
+
+<style type="text/css">
+/**/
+ div.spot-image img {
+ margin-bottom: 20px;
+ }
+/**/
+</style>
+</head>
+
+<body>
+<h1 id="logo"><img alt="The World Wide Web Consortium (W3C)" height="48" width="315" src="/Icons/w3c_main" /></h1>
+
+<h2 id="slogan">Leading the Web to Its Full Potential...</h2>
+
+<div>
+<map name="introLinks" id="introLinks" title="Introductory Links">
+<div class="banner">
+<span class="invisible"><a class="bannerLink" title="Skip introductory links and the mission statement" href="#technologies">Skip to Technologies</a> |</span> <a class="bannerLink" title="W3C Activities" accesskey="A" href="/Consortium/activities">Activities</a> | <a class="bannerLink" title="Technical Reports and Recommendations" accesskey="T" href="/TR/">Technical Reports</a> | <a class="bannerLink" title="Alphabetical Site Index" accesskey="S" href="/Consortium/siteindex">Site Index</a> | <a class="bannerLink" title="Help for new visitors" accesskey="N" href="/Consortium/new-to-w3c">New
+Visitors</a> | <a class="bannerLink" title="About W3C" accesskey="B" href="/Consortium/">About W3C</a> | <a class="bannerLink" title="Join W3C" accesskey="J" href="/Consortium/join">Join W3C</a> |
+<a class="bannerLink" title="Contact W3C" accesskey="C" href="/Consortium/contact">Contact W3C</a>
+</div>
+</map>
+</div>
+
+<p class="small">The World Wide Web Consortium (<acronym title="World Wide Web Consortium">W3C</acronym>) develops interoperable
+technologies (specifications, guidelines, software, and tools) to lead
+the Web to its full potential. W3C is a forum for information,
+commerce, communication, and collective understanding. On this page,
+you'll find <a href="#news">W3C news</a>, links to <a href="#technologies">W3C technologies</a> and ways to <a href="#contents">get involved</a>. New visitors can find help in
+<cite><a href="/Consortium/new-to-w3c">Finding Your Way at
+W3C</a></cite>. We encourage organizations to learn more <a href="/Consortium/">about W3C</a> and <a href="/Consortium/membership">about
+W3C Membership</a>.</p>
+
+<div class="navBlock">
+<h2 class="spot-head">XML10</h2>
+
+<div class="spot">
+<div class="spot-image">
+<a href="/2008/xml10/">
+<img src="/2008/xml10/xml-10.png" width="106" height="48" alt="XML 10" />
+</a>
+</div>
+<p class="spot-block">
+To celebrate
+<a href="/2008/xml10/">ten years of XML</a>,
+W3C invites you to
+<a href="/2008/xml10/card/greeting-form">send a greeting</a>
+and tell us about an XML-related blog or article.
+Many thanks to the FLWOR Foundation for their
+generous sponsorship of XML10.
+</p>
+</div>
+
+<h2 class="spot-head">W3C Supporters</h2>
+<div class="spot">
+<p class="spot-block">Help W3C by making a donation through the
+<a href="/Consortium/sup">W3C Supporters Program</a>.</p>
+</div>
+
+
+
+<h2 class="spot-head">Employment</h2>
+
+<div class="spot">
+<p class="spot-block">Current <a href="/Consortium/Recruitment/">job
+opportunities</a> at W3C: <a href="http://www.ercim.org/jobs/wai_consultant.html">Web Accessibility and Ageing Consultant</a>. Current <a href="/Consortium/Recruitment/Fellows#openings">W3C Fellows Program
+openings</a> are <a href="/2007/01/comm-fellow1">Business and
+Technology Communications Specialist</a>, <a href="/2007/01/comm-fellow2">Web / Graphic Designer</a>, and <a href="/2007/01/SysteamFellowsPosition">Software Engineer</a>.</p>
+</div>
+
+<h2 class="navhead"><a name="technologies" id="technologies">W3C A to
+Z</a></h2>
+
+<ul>
+<li class="invisible"><a class="navlink" title="Skip W3C A-Z" href="#news">Skip to News</a></li>
+
+<li><a href="/WAI/" class="navlink">Accessibility</a></li>
+
+<li><a href="/Amaya/" class="navlink">Amaya</a></li>
+
+<li><a href="/Mobile/CCPP/" class="navlink"><abbr title="Composite Capability/Preference Profiles">CC/PP</abbr></a></li>
+
+<li><a href="/2004/CDF/" class="navlink">Compound Document Formats
+(CDF)</a></li>
+
+<li><a href="/Style/CSS/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr></a></li>
+
+<li><a href="http://jigsaw.w3.org/css-validator/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr>
+Validator</a></li>
+
+<li><a href="/2002/ws/databinding/" class="navlink">Databinding</a></li>
+
+<li><a href="/DOM/" class="navlink"><acronym title="Document Object Model">DOM</acronym></a></li>
+
+<li><a href="/XML/EXI" class="navlink">Efficient XML
+Interchange</a></li>
+
+<li><a href="/2007/eGov/" class="navlink">eGovernment</a></li>
+
+<li><a href="/2001/sw/grddl-wg/" class="navlink"><acronym title="Gleaning Resource Descriptions from Dialects of Languages">GRDDL</acronym></a></li>
+
+<li><a href="/2001/sw/hcls/" class="navlink">Health Care and Life
+Sciences</a></li>
+
+<li><a href="/html/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr></a></li>
+
+<li><a href="/People/Raggett/tidy/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Tidy</a></li>
+
+<li><a href="http://validator.w3.org/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Validator</a></li>
+
+<li><a href="/Protocols/" class="navlink"><abbr title="Hypertext Transfer Protocol">HTTP</abbr></a></li>
+
+<li><a href="/2005/Incubator/" class="navlink">Incubator</a></li>
+
+<li><a href="/2002/mmi/ink" class="navlink">InkML</a></li>
+
+<li><a href="/International/" class="navlink">Internationalization</a></li>
+
+<li><a href="/Jigsaw/" class="navlink">Jigsaw</a></li>
+
+<li><a href="/Library/" class="navlink">Libwww</a></li>
+
+<li><a href="/Math/" class="navlink">MathML</a></li>
+
+<li><a href="/Mobile/" class="navlink">Mobile Web Initiative
+(W3C-MWI)</a></li>
+
+<li><a href="/2002/mmi/" class="navlink">Multimodal
+Interaction</a></li>
+
+<li><a href="/2004/OWL/" class="navlink"><acronym title="OWL Web Ontology Language">OWL</acronym></a></li>
+
+<li><a href="/2004/pp/" class="navlink">Patent Policy</a></li>
+
+<li><a href="/PICS/" class="navlink"><acronym title="Platform for Internet Content Selection">PICS</acronym></a></li>
+
+<li><a href="/Graphics/PNG/" class="navlink"><acronym title="Portable Network Graphics">PNG</acronym></a></li>
+
+<li><a href="/2007/powder/" class="navlink"><acronym title="Protocol for Web Description Resources">POWDER</acronym></a></li>
+
+<li><a href="/P3P/" class="navlink">Privacy and <abbr title="Platform for Privacy Preferences">P3P</abbr></a></li>
+
+<li><a href="/RDF/" class="navlink"><abbr title="Resource Description Framework">RDF</abbr></a></li>
+
+<li><a href="/2006/rwc/" class="navlink">Rich Web Clients</a></li>
+
+<li><a href="/2005/rules/" class="navlink">Rules</a></li>
+
+<li><a href="/Security/" class="navlink">Security</a></li>
+
+<li><a href="/2001/sw/" class="navlink">Semantic Web</a></li>
+
+<li><a href="/XML/SML" class="navlink">Service Modeling Language
+(<abbr title="Service Modeling Language">SML</abbr>)</a></li>
+
+<li><a href="/AudioVideo/" class="navlink"><acronym title="Synchronized Multimedia Integration Language">SMIL</acronym></a></li>
+
+<li><a href="/2000/xp/Group/" class="navlink"><acronym title="Soap">SOAP</acronym>/<abbr title="XML Protocol">XMLP</abbr></a></li>
+
+<li><a href="/2002/ws/soapjms/" class="navlink"><acronym title="Soap">SOAP-JMS</acronym></a></li>
+
+<li><a href="/2001/sw/DataAccess/" class="navlink"><acronym title="Simple Protocol and RDF Query Language">SPARQL</acronym></a></li>
+
+<li><a href="/Style/" class="navlink">Style</a></li>
+
+<li><a href="/Graphics/SVG/" class="navlink"><abbr title="Scalable Vector Graphics">SVG</abbr></a></li>
+
+<li><a href="/2001/tag/" class="navlink"><abbr title="Technical Architecture Group">TAG</abbr></a></li>
+
+<li><a href="/AudioVideo/TT/" class="navlink">Timed Text</a></li>
+
+<li><a href="/Addressing/" class="navlink"><abbr title="Uniform Resource Identifiers">URI/URL</abbr></a></li>
+
+<li><a href="/QA/Tools/#validators" class="navlink">Validators</a></li>
+
+<li><a href="/Voice/" class="navlink">Voice</a></li>
+
+<li><a href="/2007/uwa/" class="navlink">Ubiquitous Web
+Applications</a></li>
+
+<li><a href="/WAI/" class="navlink"><acronym title="Web Accessibility Initiative">WAI</acronym></a></li>
+
+<li><a href="/2006/webapi/" class="navlink">Web API</a></li>
+
+<li><a href="/2006/appformats/" class="navlink">Web Application
+Formats</a></li>
+
+<li><a href="/2001/tag/" class="navlink">Web Architecture
+(<acronym title="Technical Architecture Group">TAG</acronym>)</a></li>
+
+<li><a href="/Graphics/WebCGM/WG/" class="navlink"><abbr title="Web Computer Graphics Metafile">WebCGM</abbr></a></li>
+
+<li><a href="/2002/ws/" class="navlink">Web Services</a></li>
+
+<li><a href="/2002/ws/addr/" class="navlink"><abbr title="Web Services">WS</abbr>-Addressing</a></li>
+
+<li><a href="/2002/ws/chor/" class="navlink"><abbr title="Web Services Choreography Description Language">WS-CDL</abbr></a></li>
+
+<li><a href="/2002/ws/desc/" class="navlink"><acronym title="Web Services Description Language">WSDL</acronym></a></li>
+
+<li><a href="/2002/ws/policy/" class="navlink"><abbr title="Web Services">WS</abbr>-Policy</a></li>
+
+<li><a href="/MarkUp/Forms/" class="navlink"><acronym title="Next Generation Web Forms">XForms</acronym></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML</abbr></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML2</abbr></a></li>
+
+<li><a href="/XML/Linking" class="navlink"><acronym title="XML Link">XLink</acronym></a></li>
+
+<li><a href="/XML/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr></a></li>
+
+<li><a href="/TR/xmlbase/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Base</a></li>
+
+<li><a href="/2001/XKMS/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Key Management</a></li>
+
+<li><a href="/XML/Processing/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Processing</a></li>
+
+<li><a href="/XML/Query" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Query</a></li>
+
+<li><a href="/XML/Schema" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Schema</a></li>
+
+<li><a href="/2008/xmlsec/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Signature
+and Encryption</a></li>
+
+<li><a href="/Style/XSL/" class="navlink">XPath</a></li>
+
+<li><a href="/XML/Linking" class="navlink">XPointer</a></li>
+
+<li><a href="/Style/XSL/" class="navlink"><acronym title="Extensible Stylesheet Language">XSL</acronym> and <acronym title="XSL Transformations">XSLT</acronym></a></li>
+</ul>
+
+<p><a href="/Consortium/siteindex" class="navlink">More
+topics...</a></p>
+</div>
+
+<div class="newsBlock">
+<h2 class="newsHeading"><a name="news" id="news">News</a></h2>
+
+<p class="invisible"><a title="Skip News" href="#search">Skip to
+Search</a></p>
+
+<div id="item103" class="item"><h3 class="headline">New eGovernment Activity to Help Improve Government through Better Use of the Web</h3>
+<p><a href="/2007/eGov/"><img class="newsImage" width="300" height="75" src="/2008/06/03-egov" alt="Crowd scene" /></a></p>
+<p><span class="date">2008-06-03:</span> W3C launches today a <a href="/2007/eGov/">new forum</a> for governments, citizens, researchers, and other stakeholders to investigate how best to use Web technology for good governance and citizen participation. "Open Standards, and in particular Semantic Web Standards, can help lower the cost of government, make it easier for independent agencies to work together, and increase flexibility in the face of change," said Tim Berners-Lee, W3C Director. W3C invites participation in the new <a href="/2007/eGov/IG/">eGovernment Interest Group</a>, which is open to the public. The group will identify best practices and guidelines in this area, document where current technology does not adequately address stakeholder needs, and suggest improvements via the standards process. Read the <a href="/2007/eGov/IG/faq">W3C eGovernment FAQ</a> and <a href="/2008/06/egov-pressrelease">press release</a>, and learn more about the <a href="/2007/eGov/">W3C eGovernment Activity</a>.<span class="archive"> (<a title="New eGovernment Activity to Help Improve Government through Better Use of the Web" href="/News/2008#item103" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item105" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Two Group Notes Published About Semantic Web and Life Sciences</h3><p><span class="date">2008-06-05:</span> The <a href="/2001/sw/hcls/">Semantic Web Health Care and Life Sciences Interest Group</a> has published two Group Notes: <a href="/TR/2008/NOTE-hcls-kb-20080604/">A Prototype Knowledge Base for the Life Sciences</a> and <a href="/TR/2008/NOTE-hcls-senselab-20080604/">Experiences with the conversion of SenseLab databases to RDF/OWL</a>. The former describes a prototype of a biomedical knowledge base that integrates 15 distinct data sources using currently available Semantic Web technologies including RDF and OWL. The Note outlines which resources were integrated, how the knowledge base was constructed using free and open source triple store technology, how it can be queried using SPARQL, and what resources and inferences are involved in answering complex queries. While the utility of the knowledge base is illustrated by identifying a set of genes involved in Alzheimer's Disease, the approach described here can be applied to any use case that integrates data from multiple domains. The second document describe the experience of converting SenseLab databases into OWL, an important step towards realizing the benefits of Semantic Web in integrative neuroscience research. Learn more about the <a href="/2001/sw/">Semantic Web Activity</a>.<span class="archive"> (<a title="Two Group Notes Published About Semantic Web and Life Sciences" href="/News/2008#item105" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item104" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Offline Web Applications Published as W3C Note</h3><p><span class="date">2008-06-03:</span> The <a href="/html/wg/">HTML Working Group</a> has published the <a href="/TR/2008/NOTE-offline-webapps-20080530/">Offline Web Applications</a> Group Note. <a href="/TR/html5/">HTML 5</a> contains several features that address the challenge of building Web applications that work while offline. This document highlights these features (SQL, offline application caching APIs as well as online/offline events, status, and the localStorage API) from HTML 5 and provides brief tutorials on how these features might be used to create Web applications that work offline. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Offline Web Applications Published as W3C Note" href="/News/2008#item104" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item102" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Advisory Committee Elects Advisory Board</h3><p><span class="date">2008-06-02:</span> The W3C Advisory Committee has filled six open seats on the <a href="/2002/ab/">W3C Advisory Board</a>. Created in 1998, the Advisory Board provides guidance to the Team on issues of strategy, management, legal matters, process, and conflict resolution. Beginning 1 July, the nine Advisory Board participants are Jean-François Abramatic (ILOG), Ann Bassetti (The Boeing Company), Jim Bell (HP), Don Deutsch (Oracle), Eduardo Gutentag (Sun Microsystems), Steve Holbrook (IBM), Ken Laskey (MITRE), Ora Lassila (Nokia), and Arun Ranganathan (Mozilla Foundation). Steve Zilles continues as interim Advisory Board Chair. Read more about the <a href="/2002/ab/">Advisory Board</a>.<span class="archive"> (<a title="W3C Advisory Committee Elects Advisory Board" href="/News/2008#item102" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item101" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Talks in June</h3><p><span class="date">2008-06-02:</span> Browse <a href="/Talks/">W3C presentations and events</a> also available as an <abbr title="RDF Site Summary"><a href="/2004/08/TalkFiles/Talks.rss">RSS channel</a></abbr>. <span class="archive"> (<a title="W3C Talks in June" href="/News/2008#item101" rel="details">Permalink</a>) </span></p><ul><li><span class="talkstart">2 June, Västerås, Sweden: </span><span class="talktitle" lang="sv" xml:lang="sv">Framtidssäkra eFörvaltningen<span class="hide noprint">.</span></span><span class="talkdesc">Olle Olsson participates in a panel at <a href="http://www.offentligarummet.se/" lang="sv" xml:lang="sv">Offentliga Rummet 2008</a>. </span></li><li><span class="talkstart">4 June, Sao Paulo, Brazil: </span><span class="talktitle">Towards eGovernment 2.0 through better use of the Web<span class="hide noprint">.</span></span><span class="talkdesc">José Manuel Alonso presents at <a href="http://www.w3c.br/2008/launch/">W3C Brazil Office Public Launch</a>. </span></li><li><span class="talkstart">4 June, Sao Paolo, Brazil: </span><span class="talktitle">W3C - Web Open Standards<span class="hide noprint">.</span></span><span class="talkdesc">Daniel Dardailler presents at <a href="http://www.w3c.br/2008/lancamento/">W3C Brazil Office Launch event </a>. </span></li><li><span class="talkstart">10 June, Buenos Aires, Argentina: </span><span class="talktitle">Web Accessibility: People with Disabilities and Elderly Citizens<span class="hide noprint">.</span></span><span class="talkdesc">Shadi Abou-Zahra presents at <a href="http://www.isoc.org.ar/accesibilidad.html" lang="es" xml:lang="es">Web Sin Barreras</a>. </span></li><li><span class="talkstart">11 June, Nashville, TN, USA: </span><span class="talktitle">Color for the Global Web<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">12 June, Nashville, TN, USA: </span><span class="talktitle">Designing for Today's Browsers<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">17 June, New York, NY, USA: </span><span class="talktitle">Web of Data<span class="hide noprint">.</span></span><span class="talkdesc">Tim Berners-Lee presents at <a href="http://www.linkeddataplanet.com/index.php">LinkedData Planet Conference: exploring the new web of linked data</a>. </span></li><li><span class="talkstart">19 June, Tokyo, Japan: </span><span class="talktitle">Update on W3C/WAI Guidelines including WCAG 2.0<span class="hide noprint">.</span></span><span class="talkdesc">Judy Brewer presents at <a>Open Seminar of Information Accessibility</a>. </span></li><li><span class="talkstart">19 June, Nancy, France: </span><span class="talktitle" lang="fr" xml:lang="fr">États des lieux du Web sémantique<span class="hide noprint">.</span></span><span class="talkdesc">Ivan Herman gives a keynote at <a href="http://ic2008.loria.fr/" lang="fr" xml:lang="fr">19èmes Journées Francophones d'Ingénierie des Connaissances (IC2008)</a>. </span></li><li><span class="talkstart">19 June, Baltimore, Maryland, USA: </span><span class="talktitle">How New Web Accessibility Standards Impact User Experience Design<span class="hide noprint">.</span></span><span class="talkdesc">Shawn Henry presents at <a href="http://www.usabilityprofessionals.org/conference/2008/">Usability Professionals' Association International Conference 2008</a>. </span></li><li><span class="talkstart">26 June, Frankfurt, Germany: </span><span class="talktitle">Mobile Internet - the Way Forward<span class="hide noprint">.</span></span><span class="talkdesc">Steve Bratt participates in a panel at <a href="http://www.amiando.com/ngmn-2008">2nd NGMN Industry Conference 2008</a>. </span></li><li class="noprint showuris">View <a href="http://www.w3.org/2004/08/W3CTalks?date=Recent+and+upcoming&amp;countryListing=yes&amp;submit=Submit">upcoming talks by country</a></li><li class="noprint showuris"><a href="/Talks/">More talks...</a></li></ul></div>
+
+<div id="item100" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Launches Group to Help Bridge the Digital Divide</h3><p><a href="/2008/MW4D/"><img class="newsImage" alt="Phone bikes" src="/2008/05/voiturette-sb.png" /></a><span class="date">2008-05-27:</span> As part of the growing set of W3C initiatives related to social development, W3C invites participation in the new <a href="/2008/MW4D/">Mobile Web for Development (MW4D) interest Group</a>, chartered to explore the potential of mobile technology to help bridge the digital divide. "We need to solve important challenges, such as lack of standards in end-user devices, network constraints, service cost, issues of literacy, and an understanding of the real information needs of rural communities," said Ken Banks, kiwanja.net, who Chairs the group. "To do so requires an multidisciplinary approach, a step we take through the creation of this new group." Read more in the <a href="/2008/05/mw4dig-pressrelease">press release</a>. This launch is part of <a href="/Mobile">W3C's Mobile Web Initiative (MWI)</a>, which aims to identify and resolve challenges and issues of accessing the Web when on the move. This work takes place under the auspices of the <a href="http://cordis.europa.eu/fp7/ict/">European Union's 7th Research Framework Programme (FP7)</a>, part of the <a href="http://digitalworld.ercim.org/">Digital World Forum</a> project.<span class="archive"> (Photo credit: Stéphane Boyera. <a title="W3C Launches Group to Help Bridge the Digital Divide" href="/News/2008#item100" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item99" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: XHTML Access Module</h3><p><span class="date">2008-05-26:</span> The <a href="/MarkUp/">XHTML 2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-xhtml-access-20080526/">XHTML Access Module</a>. This document is intended to help make XHTML-family markup languages more effective at supporting the needs of the accessibility community. It does so by providing a generic mechanism for defining the relationship between document components and well-known accessibility taxonomies. Comments are welcome through 16 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>. <span class="archive"> (<a title="Last Call: XHTML Access Module" href="/News/2008#item99" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item98" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)</h3><p><span class="date">2008-05-23:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Candidate Recommendation of <a href="/TR/2008/CR-css3-namespace-20080523/">CSS Namespaces Module</a>. This CSS Namespaces module defines the syntax for using namespaces in CSS. It defines the @namespace rule for declaring the default namespace and binding namespaces to namespace prefixes, and it also defines a syntax that other specifications can adopt for using those prefixes in namespace-qualified names. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)" href="/News/2008#item98" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item97" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Progress Events 1.0</h3><p><span class="date">2008-05-22:</span> The <a href="/2006/webapi/">Web API Working Group</a> has published a Working Draft of <a href="/TR/2008/WD-progress-events-20080521/">Progress Events 1.0</a>.This document describes event types that can be used for monitoring the progress of an operation. It is primarily intended for contexts such as data transfer operations specified by <a href="/TR/XMLHttpRequest">XMLHTTPRequest</a>, or <a href="/TR/MediaAccessEvents/">Media Access Events</a>. Learn more about the <a href="/2006/rwc/">Rich Web Client Activity</a>.<span class="archive"> (<a title="Progress Events 1.0" href="/News/2008#item97" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item96" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />XML Security Working Group to Take Next Steps on XML Signature, Encryption</h3><p><span class="date">2008-05-21:</span> W3C is pleased to announce the creation of the <a href="/2008/xmlsec/">XML Security Working Group</a>, whose mission is to evaluate and act on <a href="/2007/xmlsec/ws/report">recommendations</a> from the <a href="/2007/xmlsec/ws/agenda.html">September 2007 Workshop on XML Signature and XML Encryption</a> regarding next steps for XML Security specifications. The group's <a href="/2008/02/xmlsec-charter.html#deliverables">deliverables</a> include new work on XML Signature Syntax and Processing and XML Encryption Syntax and Processing, as well as maintenance of related specifications. Frederick Hirsch (Nokia) will Chair the group, with Thomas Roessler (W3C) as Team Contact. Learn more about the <a href="/Security/">W3C Security Activity</a>. <span class="archive"> (<a title="XML Security Working Group to Take Next Steps on XML Signature, Encryption" href="/News/2008#item96" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item94" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: Cascading Style Sheets (CSS) Snapshot 2007</h3><p><span class="date">2008-05-16:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-css-beijing-20080516/">Cascading Style Sheets (CSS) Snapshot 2007</a>. This document collects together into one definition all the specifications that together form the current state of Cascading Style Sheets (CSS). The primary audience is CSS implementors, not CSS authors, as this definition includes modules by specification stability, not Web browser adoption rate. Comments are welcome through 09 June. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="Last Call: Cascading Style Sheets (CSS) Snapshot 2007" href="/News/2008#item94" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item93" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available</h3><p><span class="date">2008-05-16:</span> The W3C <a href="http://www.w3.org/XML/Query/">XML Query Working Group</a> and the W3C <a href="http://www.w3.org/Style/XSL/">XSL Working Group</a> jointly published today a Candidate Recommendation of <a href="/TR/2008/CR-xpath-full-text-10-20080516/">XQuery and XPath Full Text 1.0</a>. This document defines the syntax and formal semantics of XQuery and XPath Full Text 1.0 which is a language that extends XQuery 1.0 [XQuery 1.0: An XML Query Language] and XPath 2.0 [XML Path Language (XPath) 2.0] with full-text search capabilities. Implementors are encouraged to run the groups' <a href="http://dev.w3.org:/cvsweb/2007/xpath-full-text-10-test-suite/">test suite</a> and report their results. The Groups also published Working Drafts of <a href="/TR/2008/WD-xpath-full-text-10-requirements-20080516/">XQuery and XPath Full Text 1.0 Requirements</a> and <a href="/TR/2008/WD-xpath-full-text-10-use-cases-20080516/">Use Cases</a>. Learn more about the <a href="/XML/">XML Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available" href="/News/2008#item93" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item95" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />State Chart XML (SCXML) Working Draft Published</h3><p><span class="date">2008-05-16:</span> The <a href="/Voice/">Voice Browser Working Group</a> has published an updated Working Draft of <a href="/TR/2008/WD-scxml-20080516/">State Chart XML (SCXML): State Machine Notation for Control Abstraction</a>. <abbr title="State Chart eXtensible Markup Language">SCXML</abbr> is an execution environment based on <a href="http://www.uml.org/#UML1.5"><abbr title="Unified Modeling Language">UML</abbr></a> Harel State Tables and <a href="/TR/ccxml/"><abbr title="Call Control eXtensible Markup Language">CCXML</abbr></a>. The main differences from the previous draft are (1) the modularization of the language, (2) the introduction of profiles and (3) a revision of the algorithm for document interpretation; the document as a whole has changed significantly and the group welcomes review. Learn more about the <a href="/Voice/">Voice Browser Activity</a>.<span class="archive"> (<a title="State Chart XML (SCXML) Working Draft Published" href="/News/2008#item95" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item92" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />"Web Accessibility for Older Users: A Literature Review"; Comments Welcome on First Public Draft</h3><p><span class="date">2008-05-14:</span> The Web Accessibility Initiative (WAI) <a href="/WAI/EO/">Education and Outreach Working Group Working Group (EOWG)</a> has published <a href="/TR/2008/WD-wai-age-literature-20080514/">Web Accessibility for Older Users: A Literature Review</a> as a First Public Working Draft. The document includes reviews and analysis of guidelines and articles covering the requirements of people with Web accessibility needs related to ageing. This literature review will inform WAI efforts to promote accessibility solutions for older Web users and potentially to develop profiles or extensions to WAI guidelines. The literature review is a deliverable of the <a href="/WAI/WAI-AGE/">WAI-AGE Project</a> (Ageing Education and Harmonisation). See the <a href="http://lists.w3.org/Archives/Public/w3c-wai-ig/2008AprJun/0083.html">call for review and participation</a> for an introduction to the project and an invitation to contribute to the literature review and other WAI-AGE work; and about the <a href="/WAI/">Web Accessibility Initiative</a>.<span class="archive"> (<a title="Web Accessibility for Older Users: A Literature Review; Comments Welcome on First Public Draft" href="/News/2008#item92" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item91" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: CURIE Syntax 1.0</h3><p><span class="date">2008-05-08:</span> The <a href="/MarkUp/">XHTML2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-curie-20080506">CURIE Syntax 1.0</a>, which outlines a syntax for expressing URIs in a generic, abbreviated syntax ("Compact URI"). The specification targets language designers who need a mechanism to permit the use of extensible value collections. Any language designer considering the use of QNames in attribute values should consider instead using CURIEs, since CURIEs are designed for this purpose, while QNames are not. Comments are welcome through 10 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Last Call: CURIE Syntax 1.0" href="/News/2008#item91" rel="details">Permalink</a>) </span></p></div>
+
+
+
+<h3 class="pastNews"><a href="/News/2008">Past News</a></h3>
+</div>
+
+<div class="navBlock">
+<h2 class="navhead"><a name="search" id="search">Search</a></h2>
+
+<p class="invisible"><a class="navlink" title="Skip search" href="#contents">Skip to Contents</a></p>
+
+<form method="get" action="http://www.google.com/custom" enctype="application/x-www-form-urlencoded">
+<div>
+<a class="navlink" href="http://www.google.com"><img src="/Icons/Logo_25wht.gif" width="75" height="32" alt="Google" /></a><br />
+<label for="inputField">Search W3C<br />
+<input type="text" size="15" id="inputField" name="q" accesskey="E" maxlength="255" /></label> <input type="submit" value="Go" id="goButton" name="sa" accesskey="G" /><br />
+<input type="hidden" name="cof" value="T:black;LW:72;ALC:#ff3300;L:http://www.w3.org/Icons/w3c_home;LC:#000099;LH:48;BGC:white;AH:left;VLC:#660066;GL:0;AWFID:0b9847e42caf283e;" />
+ <input type="hidden" id="searchW3C" name="sitesearch" checked="checked" value="www.w3.org" /><input type="hidden" name="domains" value="www.w3.org" />
+</div>
+</form>
+
+<p><a class="navlink" href="/Search/Mail/Public/">Search W3C Mailing
+Lists</a></p>
+
+<h2 class="navhead"><a name="contents" id="contents">Testimonials</a></h2>
+
+<div class="hpmt"><div class="hpmt-name">Fraunhofer Gesellschaft</div><div class="hpmt-logo"><a rel="nofollow" href="http://www.fraunhofer.de/"><img alt="Fraunhofer Gesellschaft" src="http://www.w3.org/Consortium/Member/Testimonial/Logo/119" /></a></div><p class="hpmt-testimonial">The Fraunhofer-Gesellschaft undertakes applied contract research in all fields of engineering sciences. Fraunhofer works with W3C to contribute to the development of Web technologies which are the base of many of our research activities. Fraunhofer hosts the W3C Office in Germany and Austria. <a class="hpmt-more" href="http://www.w3.org/Consortium/Member/Testimonial/List">(Member testimonials)</a></p></div>
+
+<h2 class="navhead">Members</h2>
+
+<ul>
+<li><a href="/Member/" class="navlink">Member Home Page</a></li>
+
+<li><a href="/Submission/" class="navlink">Member Submissions</a></li>
+
+<li><a href="/Consortium/Member/List" class="navlink">Current
+Members</a></li>
+
+<li><a href="/Consortium/meetings" class="navlink">Meetings</a></li>
+
+<li><a href="/Consortium/Recruitment/Fellows" class="navlink">Fellows</a> (<a href="/Consortium/Recruitment/Fellows#openings">New Openings</a>)</li>
+</ul>
+
+<h2 class="navhead">Get Involved</h2>
+
+<ul>
+<li><a href="/Consortium/membership-benefits" class="navlink">W3C
+Membership Benefits</a></li>
+
+<li><a href="/Consortium/membership#bizcase" class="navlink">Reasons to
+Join W3C</a></li>
+
+<li><a href="/Mail/" class="navlink">Mailing Lists</a></li>
+
+<li><a href="http://lists.w3.org/Archives/Public/public-new-work/latest">Potential
+New Work</a></li>
+
+<li><a href="/Consortium/Translation/" class="navlink">Translations</a></li>
+
+<li><a href="/2003/08/Workshops/" class="navlink">Workshops</a></li>
+
+<li><a href="/2001/11/StdLiaison" class="navlink">Liaisons</a></li>
+
+<li><a href="/Status" class="navlink">Open Source Software</a></li>
+
+<li><a href="/QA/" class="navlink">Q&amp;A Blog</a></li>
+
+<li><a href="/Consortium/Recruitment/" class="navlink">Employment</a></li>
+
+<li><span class="navText">More ways to</span> <a href="/Consortium/org#public" class="navlink">participate</a></li>
+</ul>
+
+<h2 class="navhead">Introduction</h2>
+
+<ul>
+<li><a href="/Consortium/" class="navlink">About W3C</a></li>
+
+<li><a href="/Consortium/faq" class="navlink">Frequently Asked
+Questions (FAQ)</a></li>
+
+<li><a href="/2003/glossary/" class="navlink">Glossary</a></li>
+
+<li><a href="/Consortium/Process/" class="navlink">Process
+Document</a></li>
+
+<li><a href="/2002/03/tutorials" class="navlink">Tutorials</a></li>
+
+<li><a href="/2002/03/new-to-w3c" class="navlink">More...</a></li>
+</ul>
+
+<h2 class="navhead">W3C Team</h2>
+
+<ul>
+<li><a href="/People/" class="navlink">People</a></li>
+
+<li><a href="/TeamSubmission/" class="navlink">Team
+Submissions</a></li>
+</ul>
+
+<h2 class="navhead">Presentations</h2>
+
+<ul>
+<li><a href="/Talks/" class="navlink">Public Presentations</a></li>
+</ul>
+
+<h2 class="navhead">News Room</h2>
+
+<ul>
+<li><a href="/News/" class="navlink">W3C News Archive</a> <span class="navText">(</span><a href="/2000/08/w3c-synd/home.rss" class="navlink">RSS</a><span class="navText">)</span></li>
+
+<li><a href="/News/Public/" class="navlink">Weekly Public Newsletter</a></li>
+
+<li><a href="/Press/" class="navlink">Press Releases</a></li>
+
+<li><a href="/Press/#rss" class="navlink">Multilingual Press Release
+RSS</a></li>
+
+<li><a href="/Press/Articles" class="navlink">W3C in the Press</a></li>
+</ul>
+
+<h2 class="navhead"><a name="Offices" id="Offices">World
+Offices</a></h2>
+
+<p class="navPara">The <a href="/Consortium/Offices/" class="navlink">W3C Offices</a>, part of the <a href="/2007/IntlRel.html">W3C
+International Relations team</a> translate many W3C home page news
+items. W3C Offices are located in these parts of the world:</p>
+
+<ul>
+<li><a href="http://www.w3c.org.au/" class="navlink" title="Australia">Australia</a></li>
+
+<li><a href="http://www.w3c.nl/index.shtml.nl" class="navlink" hreflang="nl" title="Benelux"><span xml:lang="nl" lang="nl">Benelux</span></a>/<a href="http://www.w3c.nl/index.shtml.fr" class="navlink" title="Benelux" hreflang="fr"><span xml:lang="fr" lang="fr">Bénélux</span></a></li>
+
+<li><a href="http://www.w3c.br/" class="navlink" title="Brazil" hreflang="pt-br"><span xml:lang="pt-br" lang="pt-br">Brasil</span>
+(Brazil)</a></li>
+
+<li><a href="http://www.chinaw3c.org/" class="navlink" title="China" hreflang="zh-hans"><span xml:lang="zh-hans" lang="zh-hans">中国</span>
+(China)</a></li>
+
+<li><a href="http://www.w3c.tut.fi/" class="navlink" title="Finland" hreflang="fi"><span xml:lang="fi" lang="fi">Suomi</span>
+(Finland)</a></li>
+
+<li><a href="http://www.w3c.de/" class="navlink" title="German and Austria" hreflang="de"><span xml:lang="de" lang="de">Deutschland und Österreich</span> (Germany and Austria)</a></li>
+
+<li><a href="http://www.w3c.gr/" class="navlink" title="Greece" hreflang="el"><span xml:lang="el" lang="el">Ελλάδα</span>
+(Greece)</a></li>
+
+<li><a href="http://www.w3c.hu/" class="navlink" title="Hungary" hreflang="hu"><span xml:lang="hu" lang="hu">Magyarország</span>
+(Hungary)</a></li>
+
+<li><a href="http://www.w3cindia.in/" class="navlink" title="India" hreflang="en"><span xml:lang="hi" lang="hi">भारत</span>
+(India)</a></li>
+
+<li><a href="http://www.w3c.org.il/" class="navlink" title="Israel" hreflang="he"><span xml:lang="he" lang="he">ישר×ל</span>
+(Israel)</a></li>
+
+<li><a href="http://www.w3c.it/" class="navlink" title="Italy" hreflang="it"><span xml:lang="it" lang="it">Italia</span>
+(Italy)</a></li>
+
+<li><a href="http://www.w3c.or.kr/" class="navlink" title="Korea" hreflang="ko"><span xml:lang="ko" lang="ko">한국</span> (Korea)</a></li>
+
+<li><a href="http://www.w3c.org.ma/" class="navlink" title="Morocco" hreflang="ar"><span xml:lang="ar" lang="ar">المغرب</span>
+(Morocco)</a></li>
+
+<li><a href="http://www.w3c.org.za/" class="navlink" title="Southern Africa" hreflang="en">Southern Africa</a></li>
+
+<li><a href="http://www.w3c.es/" class="navlink" title="Spain" hreflang="es"><span xml:lang="es" lang="es">España</span>
+(Spain)</a></li>
+
+<li><a href="http://www.w3c.se" class="navlink" title="Sweden" hreflang="sv"><span xml:lang="sv" lang="sv">Sverige</span>
+(Sweden)</a></li>
+
+<li><a href="http://www.w3c.rl.ac.uk/" class="navlink" title="UK and Ireland" hreflang="en-uk">United Kingdom and Ireland</a></li>
+</ul>
+
+<h2 class="navhead"><a name="systems" id="systems">Systems</a></h2>
+
+<ul>
+<li><a href="/Help/Account/" class="navlink">Get Password</a></li>
+
+<li><a href="/2003/08/system-status" class="navlink">System
+Status</a></li>
+</ul>
+</div>
+<hr class="hide" />
+
+<p class="small">W3C would like to thank the <a name="donors" id="donors" href="/Consortium/sup">Supporters</a> who have contributed
+financially or through a donation of goods to W3C.</p>
+
+<p class="small"><a name="footnotes" id="footnotes">Read</a> <a href="/2002/11/homepage">about the layout</a> and <a href="http://lists.w3.org/Archives/Public/site-comments/">send comments</a>
+about this page. <a href="/2000/08/w3c-synd/home.rss">Syndicate</a>
+this page with <a href="http://purl.org/rss/1.0/">RSS 1.0</a>, an
+<a href="/RDF/">RDF</a> vocabulary used for <a href="/2000/08/w3c-synd/#">site summaries</a>. </p>
+
+<address class="small">
+<a href="/Help/Webmaster">Webmaster</a> · Last modified:
+ $Date: 2008/06/05 17:06:19 $
+ <span class="whiteout">|</span><br />
+<a href="http://validator.w3.org/check?uri=referer"><img src="/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="http://jigsaw.w3.org/css-validator/"><img src="/Icons/valid-css" alt="Valid CSS!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="/WAI/WCAG1AA-Conformance" title="Explanation of Level Double-A Conformance"><img class="conform" height="31" width="88" src="/WAI/wcag1AA" alt="Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" />
+</a> <span class="whiteout">|</span>
+</address>
+
+<p class="copyright"><a rel="Copyright" href="/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1994-2007
+<a href="/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
+<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C
+<a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+<a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
+<a rel="Copyright" href="/Consortium/Legal/copyright-documents">document use</a> and <a rel="Copyright" href="/Consortium/Legal/copyright-software">software
+licensing</a> rules apply. Your interactions with this site are in
+accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy
+statements.</p>
+</body>
+</html>
diff --git a/examples/xml/htmlinfo/youtube_com.html b/examples/xml/htmlinfo/youtube_com.html
new file mode 100644
index 0000000000..1de65a3aa5
--- /dev/null
+++ b/examples/xml/htmlinfo/youtube_com.html
@@ -0,0 +1,1585 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+
+
+ <html lang="en">
+
+<!-- machid: 519 -->
+<head>
+
+ <title>YouTube - Broadcast Yourself.</title>
+
+ <link rel="stylesheet" href="http://s.ytimg.com/yt/css/base_all-vfl42327.css" type="text/css">
+
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch?locale=en_US" title="YouTube Video Search">
+ <link rel="icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+ <link rel="shortcut icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+
+
+ <meta name="description" content="Share your videos with friends and family">
+ <meta name="keywords" content="video,sharing,camera phone,video phone,free">
+
+ <link rel="alternate" type="application/rss+xml" title="YouTube - [RSS]" href="/rssls">
+
+ <link rel="alternate" media="handheld" href="http://m.youtube.com/index?desktop_uri=%2F&">
+
+ <script type="text/javascript">
+ window.google={kHL:"en"};
+ </script>
+
+ <script type="text/javascript" src="http://s.ytimg.com/yt/js/base_all_with_bidi-vfl42302.js"></script>
+
+ <script type="text/javascript">
+
+ function _hbLink (a,b) { return false; }
+ function urchinTracker (a,b) { }
+
+
+ var gXSRF_token = '';
+ var gXSRF_field_name = '';
+ var gXSRF_ql_pair = '';
+
+ gXSRF_token = 'fZg-xPKpfj11aUrz_5__moOGiAp8MTIxMjg1OTQ4OA==';
+ gXSRF_field_name = 'session_token';
+ onLoadFunctionList.push(populate_session_token);
+
+ gXSRF_ql_pair = 'session_token=kVjpl8qnfp7RPuqnTrIu6Q8BT5d8MA==';
+
+
+ var gQuickListTooltipText = 'Add Video to QuickList';
+ var gPartnerVideoText = 'Partner Video';
+ var gGoogleSuggest = true;
+ var gPixelGif = 'http://s.ytimg.com/yt/img/pixel-vfl73.gif';
+
+ var gInQuickListText = 'in <a href="/watch_queue?all">QuickList</a>';
+ var gIsResultsPage = false;
+ </script>
+
+
+
+<script type="text/javascript">
+
+function swapVideoList(linkObj)
+{
+ var linkId = linkObj.id;
+ var queryData = '';
+ var newDivId = '';
+ var headlineObj = document.getElementById('hpVideoListHead');
+ var moreLinkObj = document.getElementById('homepage-featured-more-top');
+ var bottomMoreLinkObj = document.getElementById('homepage-featured-more-bottom');
+
+ if (linkId == 'hpMostViewedLink') {
+ queryData = 'videoListType=mostViewed';
+ newDivId = 'hpMostViewed';
+ headlineObj.innerHTML = "Most Viewed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ }
+ else if (linkId == 'hpMostDiscussedLink') {
+ queryData = 'videoListType=mostDiscussed';
+ newDivId = 'hpMostDiscussed';
+ headlineObj.innerHTML = "Most Discussed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ }
+ else if (linkId == 'hpTopFavoritesLink') {
+ queryData = 'videoListType=topFavorites';
+ newDivId = 'hpTopFavorites';
+ headlineObj.innerHTML = "Top Favorites";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ }
+ else if (linkId == 'hpFeaturedLink') {
+ newDivId = 'hpFeatured';
+ headlineObj.innerHTML = "Featured Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ }
+ self.containerDiv = 'homepage-video-list'
+ self.fillDiv = fillDiv
+ self.linkId = linkId
+ self.newDivId = newDivId
+ addClass(_gel(newDivId + 'Link'), 'hilite');
+ if (newDivId != 'hpMostViewed') {
+ removeClass(_gel('hpMostViewedLink'), 'hilite');
+ }
+ if (newDivId != 'hpMostDiscussed') {
+ removeClass(_gel('hpMostDiscussedLink'), 'hilite');
+ }
+ if (newDivId != 'hpTopFavorites') {
+ removeClass(_gel('hpTopFavoritesLink'), 'hilite');
+ }
+ if (newDivId != 'hpFeatured') {
+ removeClass(_gel('hpFeaturedLink'), 'hilite');
+ }
+ if (document.getElementById(newDivId))
+ {
+ document.getElementById(newDivId).style.display = 'block';
+ if (newDivId != 'hpMostViewed' && document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (newDivId != 'hpMostDiscussed' && document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (newDivId != 'hpTopFavorites' && document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (newDivId != 'hpFeatured' && document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ }
+ else if (queryData != '') {
+ postUrlXMLResponse('/ajax_video_list',queryData,self.fillDiv);
+ }
+}
+function fillDiv(req)
+{
+ if (document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ var newContent = getNodeValue(req.responseXML, "html_content");
+ var newdiv = document.createElement('div');
+ newdiv.setAttribute("id",self.newDivId);
+ newdiv.innerHTML = newContent;
+ var container = document.getElementById(self.containerDiv);
+ container.appendChild(newdiv);
+ addQLIcons(container);
+}
+
+function hide_active_sharing() {
+ hideDiv("active_sharing_div");
+}
+</script>
+
+</head>
+
+
+<body onload="performOnLoadFunctions();" class="en_US is-english">
+
+<div id="baseDiv" class="date-20080606">
+
+ <div id="masthead">
+ <a href="/" class="logo"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" width="132" height="63" border="0" alt=""/></a>
+ <div class="user-info">
+
+ <div id="loginBoxZ">
+ <div class="contentBox">
+ <div>
+ <div id="loginBoxZ-signup">
+ <a href="/signup">Sign Up</a>
+ | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a>
+ </div>
+ <div id="loginBoxZ-login">
+ Login
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginFormZ" action="/signup">
+ <input type="hidden" name="next" value="/" id="loginNextZ"/>
+ <input type="hidden" name="current_form" value="loginForm" />
+ <input type="hidden" name="action_login" value="1">
+ <div id="loginBoxZ-container">
+ <div id="loginBoxZ-labels" class="floatL">
+ <label for="loginUserZ" class="nowrap">Username:</label>
+ <label for="loginPassZ" class="nowrap">Password:</label>
+ </div>
+ <div class="floatL">
+ <input id="loginUserZ" class="loginBoxZ-input" type="text" size="16" name="username" value=""><br/>
+ <input id="loginPassZ" class="loginBoxZ-input" type="password" size="16" name="password"><br/>
+ <input type="submit" class="smallText" value="Login">
+ </div>
+ <div class="clearL"></div>
+ </div>
+ </form>
+ <div id="loginBoxZ-forgot">
+ <a href="/forgot_username?next=/">Forgot Username</a>
+ | <wbr><nobr><a href="/forgot?next=/">Forgot Password</a></nobr>
+ </div>
+ <div id="loginBoxZ-gaia">
+ <a href="https://www.google.com/accounts/ServiceLogin?service=youtube&amp;hl=en_US&amp;continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&amp;passive=true">Login with your Google account</a>&nbsp;
+ <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a>
+ </div>
+ </div>
+ </div>
+
+ <div id="localePickerBox">
+ <div id="flagDiv">
+ <script type="text/javascript">
+ var gLocales = [
+ ['ru_RU','&#x420;&#x43E;&#x441;&#x441;&#x438;&#x44F;'] , ['zh_TW','&#x53F0;&#x7063;'] , ['ja_JP','&#x65E5;&#x672C;'] , ['zh_HK','&#x9999;&#x6E2F;'] , ['ko_KR','&#xD55C;&#xAD6D;'] , ['en_AU','Australia'] , ['pt_BR','Brasil'] , ['en_CA','Canada'] , ['de_DE','Deutschland'] , ['es_ES','Espa&#xF1;a'] , ['fr_FR','France'] , ['en_US','Global'] , ['en_IN','India'] , ['en_IE','Ireland'] , ['it_IT','Italia'] , ['es_MX','M&#xE9;xico'] , ['nl_NL','Nederland'] , ['en_NZ','New Zealand'] , ['pl_PL','Polska'] , ['en_GB','United Kingdom']
+ ];
+ </script>
+ <div id="flagDivInner">
+ </div>
+
+ <div class="alignR smallText"><a href="#" onclick="closeLocalePicker(); return false;">Close</a></div>
+ </div>
+ </div>
+
+
+
+
+
+
+ <div id="util-links" class="normal-utility-links">
+
+ <span class="util-item first"><b><a href="/signup" onclick="_hbLink('SignUp','UtilityLinks');">Sign Up</a></b></span>
+ <span class="util-item"><a href="/watch_queue?all">QuickList</a> (<span id="quicklist-utility">0</span>)</span>
+ <span class="util-item"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help</a></span>
+ <span class="util-item"><a href="#" class="loginBoxZ eLink" onclick="return openLoginBox(event);">Log In</a></span>
+ <span class="util-item"><a href="#" class="localePickerLink eLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;">Site:</a></span>
+ <span class="util-item first">&nbsp;<a href="#" class="localePickerLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="currentFlag globalFlag" alt="Site:"></a></span>
+ </div>
+
+ <form name="logoutForm" method="post" target="_top" action="/index">
+ <input type="hidden" name="action_logout" value="1">
+ </form>
+
+
+ </div>
+ <div class="nav">
+ <div class="nav-item first selected" id="nav-item-home">
+ <span class="leftcap"></span>
+ <a class="content" href="/">Home</a>
+ <span class="rightcap"></span>
+ </div>
+ <div class="nav-item" id="nav-item-videos">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/browse?s=mp">Videos</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-channels">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/members">Channels</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-community">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/community">Community</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ </div>
+
+ <form autocomplete="off" action="/results" method="get" name="searchForm" onsubmit="return submitRegularSearchRequest()">
+
+ <div class="bar">
+ <span class="leftcap"></span>
+ <div class="search-bar">
+ <a href="/my_videos_upload" id="upload-button" class="action-button">
+ <span class="action-button-leftcap"></span>
+ <span class="action-button-text">Upload</span>
+ <span class="action-button-rightcap"></span>
+ </a>
+ <div id="search-form">
+ <input id="search-term" name="search_query" type="text" tabindex="1" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" maxlength="128" />
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input id="search-button" type="submit" value="Search" />
+ </div>
+ <div class="search-settings-link">
+ <a href="#" class="eLink" onClick="return toggleAdvSearch('', '', '', '', '', '')">
+ advanced
+ </a></div>
+ </div>
+ <span class="rightcap"></span>
+ </div>
+
+ </form>
+
+ <div id="search-advanced-form" class="hid">
+ <div class="search-setting-inner alignC">Loading...</div>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ <div id="search-settings-clr" class="hid"></div>
+
+
+
+
+
+
+<div id="homepage-main-content">
+ <div>
+ <div id="active_sharing_div" name="active_sharing_div" style="display:block"></div>
+ <script type="text/javascript">
+ // <![CDATA[
+ var fo = new SWFObject("active_sharing.swf", "active_sharing", "550", "115", 7, "#FFFFFF");
+ var showstr = "Videos being watched right now...";
+ fo.addParam('wmode', 'opaque');
+ fo.addVariable("t", showstr);
+ fo.write("active_sharing_div");
+ // ]]>
+ </script>
+</div>
+
+ <div class="homepage-content-block" style="margin-left:18px; border:0px #CCC solid;">
+ <div class="homepage-block-heading homepage-block-heading-gray">Promoted Videos</div>
+ <div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0"><img src="http://i.ytimg.com/vi/CebHAvPHyyU/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0">Basia Bulat - In Th...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/beggars" class="dg">beggars</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1"><img src="http://i.ytimg.com/vi/Np4bhsmr3iE/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1">Perfection</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/corporalcadet" class="dg">corporalcadet</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2"><img src="http://i.ytimg.com/vi/KExoP97KUnY/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2">What matters to you...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/Jr0canest" class="dg">Jr0canest</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3"><img src="http://i.ytimg.com/vi/l9gjk5hHiGM/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3">LIfe is a Masquerade.</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/bananaruthy" class="dg">bananaruthy</a>
+ </div>
+ </div>
+ <div class="clearL" style="height: 1px;"></div>
+ </div>
+ </div>
+
+
+ <div id="homepage-featured-heading">
+ <div id="homepage-featured-more-top"><a id="hpVideoListMoreLink" href="/browse?s=rf">See More Featured Videos</a></div>
+ <h1 id="hpVideoListHead">Featured Videos</h1>
+ </div>
+
+ <div id="homepage-featured-tabs">
+ <a href="#" id="hpTopFavoritesLink" name="&lid=hpTopFavoritesTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Top Favorites</a>
+ <a href="#" id="hpMostDiscussedLink" name="&lid=hpMostDiscussedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Discussed</a>
+ <a href="#" id="hpMostViewedLink" name="&lid=hpMostViewedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Viewed</a>
+ <a href="#" id="hpFeaturedLink" name="&lid=hpFeaturedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;" class="first hilite">Featured</a>
+ <div class="clear"></div>
+ </div>
+
+
+
+ <div id="homepage-video-list" class="browseListView">
+ <div id="hpFeatured">
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=uu-NTSZ27b0"><img src="http://i.ytimg.com/vi/uu-NTSZ27b0/default.jpg" class="vimg120" title="Caribbean PVC Marimba Children's Orchestra" qliconalt="uu-NTSZ27b0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's Orchestra</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescuuNTSZ27b0">
+ Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marim
+ </span>
+
+ <span id="RemainvidDescuuNTSZ27b0" style="display: none">Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marimba videos for him (that's him on the left in the middle row). He currently teaches the music program at Aveson Charter School http://aveson.org/ and constructs musical instruments in classes with students' participation.<br/><br/>Michael Greiner created this set of plastic pipe marimbas. On this clip are three generations of prototypes designed to be low cost for use by childrens' programming. The top one bass version costs around $200 in materials. The mallets are home made using foam flip-flops mounted to sticks. Filmed at Norma Coombs primary school in Altadena CA in 2007.<br/><br/>*** Edited to Add ****<br/>Wow, it looks like this video's hit YouTube's front page. Thank you for all the wonderfully kind and supportive comments!</span>
+ <span id="MorevidDescuuNTSZ27b0" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescuuNTSZ27b0'); hideDiv('MorevidDescuuNTSZ27b0'); hideDiv('BeginvidDescuuNTSZ27b0'); showDiv('LessvidDescuuNTSZ27b0'); return false;">more</a>)</span>
+ <span id="LessvidDescuuNTSZ27b0" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescuuNTSZ27b0'); hideDiv('LessvidDescuuNTSZ27b0'); showDiv('BeginvidDescuuNTSZ27b0'); showDiv('MorevidDescuuNTSZ27b0'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/PlayHanghang">PlayHanghang</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,853<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.84814814815" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:46</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=CFJRn7akXeQ"><img src="http://i.ytimg.com/vi/CFJRn7akXeQ/default.jpg" class="vimg120" title="&quot;Sharp Teeth&quot; Excerpt #1" qliconalt="CFJRn7akXeQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescCFJRn7akXeQ">
+ Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow
+ </span>
+
+ <span id="RemainvidDescCFJRn7akXeQ" style="display: none">Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow/dp/0061430226/ ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1212767529&sr=8-1<br/><br/>Animation directed by Limbert Fabian. Produced by Matt Thunell. For more information go to sharpteeththebook.com</span>
+ <span id="MorevidDescCFJRn7akXeQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('MorevidDescCFJRn7akXeQ'); hideDiv('BeginvidDescCFJRn7akXeQ'); showDiv('LessvidDescCFJRn7akXeQ'); return false;">more</a>)</span>
+ <span id="LessvidDescCFJRn7akXeQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('LessvidDescCFJRn7akXeQ'); showDiv('BeginvidDescCFJRn7akXeQ'); showDiv('MorevidDescCFJRn7akXeQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/tobybarlowny">tobybarlowny</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 67,438<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.39928057554" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:33</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=sNROaXA6OSI"><img src="http://i.ytimg.com/vi/sNROaXA6OSI/default.jpg" class="vimg120" title="Touring to Alaska on Vegetable Oil!" qliconalt="sNROaXA6OSI" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescsNROaXA6OSI">
+ This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Gi
+ </span>
+
+ <span id="RemainvidDescsNROaXA6OSI" style="display: none">This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Giganticus and The Emotron and this year we are touring to Alaska on Vegetable Oil.</span>
+ <span id="MorevidDescsNROaXA6OSI" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescsNROaXA6OSI'); hideDiv('MorevidDescsNROaXA6OSI'); hideDiv('BeginvidDescsNROaXA6OSI'); showDiv('LessvidDescsNROaXA6OSI'); return false;">more</a>)</span>
+ <span id="LessvidDescsNROaXA6OSI" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescsNROaXA6OSI'); hideDiv('LessvidDescsNROaXA6OSI'); showDiv('BeginvidDescsNROaXA6OSI'); showDiv('MorevidDescsNROaXA6OSI'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/kylemotron">kylemotron</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 122,748<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.44329896907" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:02</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=27">Education</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=6iC3b5JnSIE"><img src="http://i.ytimg.com/vi/6iC3b5JnSIE/default.jpg" class="vimg120" title="JCJC" qliconalt="6iC3b5JnSIE" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesc6iC3b5JnSIE">
+ His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this son
+ </span>
+
+ <span id="RemainvidDesc6iC3b5JnSIE" style="display: none">His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this song is 300ml(milk).<br/>An artist name is Rei harakami. <br/>Check it out!</span>
+ <span id="MorevidDesc6iC3b5JnSIE" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('MorevidDesc6iC3b5JnSIE'); hideDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('LessvidDesc6iC3b5JnSIE'); return false;">more</a>)</span>
+ <span id="LessvidDesc6iC3b5JnSIE" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('LessvidDesc6iC3b5JnSIE'); showDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('MorevidDesc6iC3b5JnSIE'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/YoneyaYu">YoneyaYu</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 532,447<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.83995523223" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:26</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=L9Wu1V1JAHw"><img src="http://i.ytimg.com/vi/L9Wu1V1JAHw/default.jpg" class="vimg120" title="Certainty In Freedom ~ A Song for Burma (Original Song)" qliconalt="L9Wu1V1JAHw" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song fo...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song for Burma (Original Song)</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescL9Wu1V1JAHw">
+ I'm not a particularly political person, by which I mean I'd sooner just not get involved
+ </span>
+
+ <span id="RemainvidDescL9Wu1V1JAHw" style="display: none">I'm not a particularly political person, by which I mean I'd sooner just not get involved in conflict, but I realise that, at times, things happen outside your control which will you to say something or do something.<br/><br/>I got a comment on my last song from 'gersing' asking me if I'd sing a song for the monks and people of Burma. At first I misunderstood the comment but then it clicked and I felt compelled to offer something.. anything. <br/><br/>I know this song is going to change nothing; and I'm cautious calling it a protest song as I don't understand the situation fully (and I wouldn't want to upset anyone), but this is a tune I wrote in response to being repressed (I'm whatever guise) and how beautiful 'freedom' really is. I don't think anyone will ever understand that term fully but by singing and writing and thinking and speaking we can come somewhere close I'm sure. <br/><br/>As a disclaimer, I'd say that, personally, the chords and melody are arbitrary; merely the carrier of the sentiment...<br/><br/>Changing the subject ever so slightly I just wanted to say a big thank you to everyone that's shown support; it's overwhelming. An apology to anyone I've not yet responded to.. I've never been very good at juggling my time but I will be in touch.<br/><br/>Thanks again...<br/><br/>_________________<br/>Certainty In Freedom<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>If I saw you in the street now<br/>Would I look the other way?<br/>I hope I'm strong enough to say - help make it go away<br/><br/>When all you see is hatred<br/>Spirits crushed and souls deflated<br/>Easy to leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>So this, my only voice to speak<br/>My message strong, my tone is weak<br/>I find it hard to say - help make it go away<br/><br/>And if I come across obtuse<br/>I urge you now to cut the noose<br/>Don't leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>_____________________<br/>Peace<br/><br/>Available on the 'Unequal Measures', available through http://www.krisrowley.com<br/>© Kris Rowley 2007</span>
+ <span id="MorevidDescL9Wu1V1JAHw" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('MorevidDescL9Wu1V1JAHw'); hideDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('LessvidDescL9Wu1V1JAHw'); return false;">more</a>)</span>
+ <span id="LessvidDescL9Wu1V1JAHw" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('LessvidDescL9Wu1V1JAHw'); showDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('MorevidDescL9Wu1V1JAHw'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/zzzzzzzzap">zzzzzzzzap</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 136,222<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.65044814341" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">03:55</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=gQNY7Sti8FY"><img src="http://s4.ytimg.com/vi/gQNY7Sti8FY/default.jpg" class="vimg120" title="the world is at your fingertips" qliconalt="gQNY7Sti8FY" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescgQNY7Sti8FY">
+ for the taking.
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/SupaDupaFlyGirl">SupaDupaFlyGirl</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 509,825<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.91057134971" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:15</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=28">Science & Technology</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rGUt7ropzNA"><img src="http://i.ytimg.com/vi/rGUt7ropzNA/default.jpg" class="vimg120" title="Aimee Mann Freeway Video Contest" qliconalt="rGUt7ropzNA" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrGUt7ropzNA">
+ Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemannco
+ </span>
+
+ <span id="RemainvidDescrGUt7ropzNA" style="display: none">Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemanncontest and upload a video of yourself singing Aimee Mann's new song "Freeway."<br/><br/>Aimee Mann and SuperEgo Records will pick their favorite entry to be featured on YouTube and www.aimeemann.com. The winner will have an opportunity to sing live with Aimee at one of her upcoming shows. Ten runners-up will receive an autographed copy of Aimee's new CD, @#%&*! Smilers.<br/><br/>Entrants can get the lyrics, the instrumental version of "Freeway" and contest details at: http://www.aimeemann.com/freewaycontest/<br/>Submissions must be received by July 7th 2008</span>
+ <span id="MorevidDescrGUt7ropzNA" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrGUt7ropzNA'); hideDiv('MorevidDescrGUt7ropzNA'); hideDiv('BeginvidDescrGUt7ropzNA'); showDiv('LessvidDescrGUt7ropzNA'); return false;">more</a>)</span>
+ <span id="LessvidDescrGUt7ropzNA" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrGUt7ropzNA'); hideDiv('LessvidDescrGUt7ropzNA'); showDiv('BeginvidDescrGUt7ropzNA'); showDiv('MorevidDescrGUt7ropzNA'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/aimeemann">aimeemann</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 283,776<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.79036827195" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">02:22</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=tbEei0I3kMQ"><img src="http://i.ytimg.com/vi/tbEei0I3kMQ/default.jpg" class="vimg120" title="Interactive card trick" qliconalt="tbEei0I3kMQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesctbEei0I3kMQ">
+ This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see
+ </span>
+
+ <span id="RemainvidDesctbEei0I3kMQ" style="display: none">This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see our magician site:<br/>orenshalom.co.il</span>
+ <span id="MorevidDesctbEei0I3kMQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('MorevidDesctbEei0I3kMQ'); hideDiv('BeginvidDesctbEei0I3kMQ'); showDiv('LessvidDesctbEei0I3kMQ'); return false;">more</a>)</span>
+ <span id="LessvidDesctbEei0I3kMQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('LessvidDesctbEei0I3kMQ'); showDiv('BeginvidDesctbEei0I3kMQ'); showDiv('MorevidDesctbEei0I3kMQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/werneroi">werneroi</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,155,063<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-3.5" alt="3.41263230956" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=22">People & Blogs</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=irDEzQovftM"><img src="http://i.ytimg.com/vi/irDEzQovftM/default.jpg" class="vimg120" title="Biggest drawing in the world" qliconalt="irDEzQovftM" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescirDEzQovftM">
+ making the biggest drawing in the world
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/erikbjgn">erikbjgn</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 971,773<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.54770783066" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:04</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=iAKJKBCyPUY"><img src="http://i.ytimg.com/vi/iAKJKBCyPUY/default.jpg" class="vimg120" title="Checkmate" qliconalt="iAKJKBCyPUY" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesciAKJKBCyPUY">
+ The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Ch
+ </span>
+
+ <span id="RemainvidDesciAKJKBCyPUY" style="display: none">The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Check-Cashing. Themes explored include usury, economic instability, commercial banks and their profit line, and the cycle of poverty. <br/><br/>Oh yeah, it's a comedy.<br/><br/>The video is shot on location in Bushwick and Carroll Gardens in Brooklyn, New York. Also stars special guest Internets Celebrity Ben Popken of Consumerist.com.<br/><br/>Directed by Casimir Nozkowski<br/>Shot by Ian Savage, Josh Weisbrot<br/>Music by El Keter; instrumental from song "The Bottom Line" off Sankofa's album The Tortoise Hustle. Used with full permission.<br/><br/>http://www.internetscelebrities.com</span>
+ <span id="MorevidDesciAKJKBCyPUY" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('MorevidDesciAKJKBCyPUY'); hideDiv('BeginvidDesciAKJKBCyPUY'); showDiv('LessvidDesciAKJKBCyPUY'); return false;">more</a>)</span>
+ <span id="LessvidDesciAKJKBCyPUY" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('LessvidDesciAKJKBCyPUY'); showDiv('BeginvidDesciAKJKBCyPUY'); showDiv('MorevidDesciAKJKBCyPUY'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/InternetsCelebrities">InternetsCel...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 412,830<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.52936962751" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">09:45</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=yLCl0xIg5-0"><img src="http://i.ytimg.com/vi/yLCl0xIg5-0/default.jpg" class="vimg120" title="Stories from the Front lines, Part 1" qliconalt="yLCl0xIg5-0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Pa...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Part 1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescyLCl0xIg50">
+ Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right f
+ </span>
+
+ <span id="RemainvidDescyLCl0xIg50" style="display: none">Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right from the mouths of the troops themselves. Part 1 of 4</span>
+ <span id="MorevidDescyLCl0xIg50" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescyLCl0xIg50'); hideDiv('MorevidDescyLCl0xIg50'); hideDiv('BeginvidDescyLCl0xIg50'); showDiv('LessvidDescyLCl0xIg50'); return false;">more</a>)</span>
+ <span id="LessvidDescyLCl0xIg50" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescyLCl0xIg50'); hideDiv('LessvidDescyLCl0xIg50'); showDiv('BeginvidDescyLCl0xIg50'); showDiv('MorevidDescyLCl0xIg50'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/3rdID8487">3rdID8487</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 367,189<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="4.2188365651" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">10:35</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rFItE14EeSU"><img src="http://i.ytimg.com/vi/rFItE14EeSU/default.jpg" class="vimg120" title="Amazing video of multiple tornadoes in Northwest Kansas" qliconalt="rFItE14EeSU" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornad...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornadoes in Northwest Kansas</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrFItE14EeSU">
+ Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. In
+ </span>
+
+ <span id="RemainvidDescrFItE14EeSU" style="display: none">Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. Including one beautiful but strong rope and a large wedge tornado from within 1/2 mile. Check out TornadoVdeos.net for live streaming video, breaking weather news, and more extreme tornado footage.</span>
+ <span id="MorevidDescrFItE14EeSU" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrFItE14EeSU'); hideDiv('MorevidDescrFItE14EeSU'); hideDiv('BeginvidDescrFItE14EeSU'); showDiv('LessvidDescrFItE14EeSU'); return false;">more</a>)</span>
+ <span id="LessvidDescrFItE14EeSU" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrFItE14EeSU'); hideDiv('LessvidDescrFItE14EeSU'); showDiv('BeginvidDescrFItE14EeSU'); showDiv('MorevidDescrFItE14EeSU'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/TornadoVideosdotnet">TornadoVideo...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 797,370<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.28912552436" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">07:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+ </div>
+ </div> <!-- end Video List -->
+ <div id="homepage-featured-more-bottom">
+ <div class="floatR"><a href="/browse?s=rf">See More Featured Videos</a></div>
+ <div class="clear"></div>
+ </div>
+</div>
+
+
+<div id="homepage-side-content" style="white-space: normal;">
+ <div>
+
+
+
+
+ <!-- Begin ad tag -->
+
+ <input type="hidden" id="pvaHl" value="en"/>
+ <input type="hidden" id="pvaTag" value="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;"/>
+ <input type="hidden" id="burl" value="http://www.youtube.com/pva/"/>
+ <input type="hidden" id="canv" value="False"/>
+ <div id="myAd_banner" style="visibility:hidden;height:35px;"></div>
+ <div id="myAd_pva">
+
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 3;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/_default;sz=399x299;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/_default;sz=399x299;ord=123456789?" width="399" height="299" border="0" alt=""></a>
+ </noscript>
+
+ </div>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block">
+ <div class="contentBox">
+ <div>
+ <div class="floatR"><span class="smallText"><b><a href="/signup">Sign Up</a> | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a></b></div>
+ <div class="floatL">
+ <span class="headerTitle homepage-block-heading-gray"> Login </span>
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginForm" action="signup">
+ <input type="hidden" name="action_login" value="1">
+ <table width="270">
+ <tr>
+ <td align="right"><label for="homeUsername"><span class="smallText"><b>Username:</b></span></label></td>
+ <td align="left"><input id="homeUsername" tabindex="101" class="smallText" type="text" size="16" name="username" value=""></td>
+ </tr>
+ <tr>
+ <td align="right"><label for="homePassword"><span class="smallText"><b>Password:</b></span></label></td>
+ <td align="left"><input id="homePassword" tabindex="102" class="smallText" type="password" size="16" name="password">
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <span><input type="submit" class="smallText" value="Login"></span>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <div class="padT10 smallText">
+ <p align="center" class="marT0 marB0"><a href="/forgot_username?next=/">Forgot Username</a> | <a href="/forgot?next=/">Forgot Password</a></p>
+ </div>
+ <div class="homepage-border-dotted"></div>
+ <div class="alignC"><span class="smallText"><b><a href="
+https://www.google.com/accounts/ServiceLogin?service=youtube&hl=en_US&continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&passive=true">Login with your Google account</a>&nbsp; <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a></b></span></div>
+ </div>
+ </div> <!-- end homepage-content-block -->
+
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo1;sz=300x50;kl=N;kga=-1;kgg=-1;tile=2;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo1;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo1;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo3;sz=300x50;kl=N;kga=-1;kgg=-1;tile=4;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo3;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo3;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-side-block padT10">
+ <div class="homepage-yellow-block">
+ <div class="homepage-block-heading" style="color:#CC6600">What's New</div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/t/annotations_about"><img src="http://s.ytimg.com/yt/img/whats_new/annotation-vfl42087.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/t/annotations_about">Video Annotations</a></b><br/>Add interactive commentary and links to your videos
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/address_book"><img src="http://s.ytimg.com/yt/img/whats_new/addybook-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/address_book">New Address Book</a></b><br/>Organizing your YouTube friends and contacts just got a lot simpler
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/inbox"><img src="http://s.ytimg.com/yt/img/whats_new/inbox-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/inbox">Updated Inbox</a></b><br/>Manage your messages and invites with ease
+ </div>
+ </div><div class="clear"></div>
+
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/mobile"><img src="http://s.ytimg.com/yt/img/whats_new/pic_home_mobile_30x37-vfl37458.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/mobile">YouTube Mobile</a></b><br/> Watch and upload YouTube videos on your mobile device.
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="bottomBorderDotted"></div>
+ <b><a href="/blog" style="color:#CC6600">Hear Ye, Hear Ye: Calling all Reporters</a></b><br>
+ Today we announce the launch of a new type of YouTube account: the Reporter. Reporter channels are just like the other YouTube channel types, but are specifically intended for citizens and profess...
+ <div class="alignR padT5">
+ <a href="/blog" style="color:#CC6600">Read more in our Blog</a>
+ </div>
+ <div style="font-size: 1px; height: 1px;"><br/></div>
+ </div><img class="homepage-yellow-block-bot" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+</div>
+
+
+ <div class="homepage-side-block">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo2;sz=300x50;kl=N;kga=-1;kgg=-1;tile=3;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo2;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo2;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+
+</div> <!-- end homepage-side-content -->
+
+<div class="clear"></div>
+
+
+
+ <div class="clear"></div>
+ <div id="footer">
+ <div class="search">
+ <div class="promo">
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');"><img id="debates_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt="footer-promo" /></a>
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');">Face The Candidates</a>
+ </div>
+ <form autocomplete="off" name="footer-search-form" method="get" action="/results" style="width: 73.5%;">
+ <a href="http://www.google.com/webmasters/igoogle/youtube.html"><img id="igoogle_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt=""/> <em id="igoogle_footer_text">Add to iGoogle</em></a>
+ <input type="text" name="search_query" maxlength="128" class="query" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" id="footer-search-term">
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input type="submit" name="search" value="Search" class="submit-button">
+ </form>
+ </div>
+ <div class="links">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <th colspan="2">Your Account</th>
+ <th class="separator" colspan="2">Help &amp; Info</th>
+ <th class="separator" colspan="2">YouTube</th>
+ </tr>
+ <tr>
+ <td><a href="/my_videos">Videos</a></td>
+ <td><a href="/inbox">Inbox</a></td>
+ <td class="separator"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help Resources</a></td>
+ <td><a href="/t/safety">Safety Tips</a></td>
+ <td class="separator"><a href="/t/about">Company Info</a></td>
+ <td><a href="/press_room">Press</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_favorites">Favorites</a></td>
+ <td><a href="/subscription_center">Subscriptions</a></td>
+ <td class="separator"><a href="/t/video_toolbox">Video Toolbox</a></td>
+ <td><a href="/t/dmca_policy">Copyright Notices</a></td>
+ <td class="separator"><a href="/testtube">TestTube</a></td>
+ <td><a href="/t/contact_us">Contact</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_playlists">Playlists</a></td>
+ <td><a href="/my_account">more...</a></td>
+ <td class="separator"><a href="/dev">Developer APIs</a></td>
+ <td><a href="/t/community_guidelines">Community Guidelines</a></td>
+ <td class="separator"><a href="/t/terms">Terms of Use</a></td>
+ <td>
+ <a href="/blog">Blog</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ <td class="separator"><a href="/advertise">Advertising</a></td>
+ <td><a href="/youtubeonyoursite">YouTube On Your Site</a></td>
+ <td class="separator"><a href="/t/privacy">Privacy Policy</a></td>
+ <td>
+ <a href="http://www.google.com/jobs/youtube">Jobs</a><br/>
+ </td>
+ </tr>
+
+
+
+ </table>
+ </div>
+ </div>
+ <div id="copyright">
+ &copy; 2008 YouTube, LLC
+ </div>
+
+
+</div> <!-- end baseDiv -->
+
+</body>
+<script type="text/javascript">
+ window.setTimeout('window.google.ac.install(document.searchForm,document.searchForm.search_query,"yt",true,"close",true,"Suggestions")',100);
+</script>
+
+
+
+</html> \ No newline at end of file
diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro
index 95a23e9ff2..c0a1ad33ed 100644
--- a/examples/xml/rsslisting/rsslisting.pro
+++ b/examples/xml/rsslisting/rsslisting.pro
@@ -8,3 +8,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/rsslisting
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/xml/saxbookmarks/frankf.xbel b/examples/xml/saxbookmarks/frankf.xbel
new file mode 100644
index 0000000000..07a9463677
--- /dev/null
+++ b/examples/xml/saxbookmarks/frankf.xbel
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="yes">
+ <title>Literate Programming</title>
+ <bookmark href="http://www.vivtek.com/litprog.html">
+ <title>Synopsis of Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">
+ <title>Literate Programming: Propaganda and Tools</title>
+ </bookmark>
+ <bookmark href="http://www.isy.liu.se/%7Eturbell/litprog/">
+ <title>Literate Programming by Henrik Turbell</title>
+ </bookmark>
+ <bookmark href="http://www.desy.de/user/projects/LitProg.html">
+ <title>Literate Programming Library</title>
+ </bookmark>
+ <bookmark href="http://www.loria.fr/services/tex/english/litte.html">
+ <title>Literate Programming Basics</title>
+ </bookmark>
+ <bookmark href="http://ei.cs.vt.edu/%7Ecs5014/courseNotes/4.LiterateProgramming/literate_prog.html">
+ <title>Literate Programming Overview</title>
+ </bookmark>
+ <bookmark href="http://www.perl.com/pub/a/tchrist/litprog.html">
+ <title>POD is not Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://www.cornellcollege.edu/%7Eltabak/publications/articles/swsafety.html">
+ <title>Computers That We Can Count On</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/litpro/issues-and-problems.html">
+ <title>Literate Programming - Issues and Problems</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?LiterateProgramming">
+ <title>Literate Programming - Wiki Pages</title>
+ </bookmark>
+ <bookmark href="http://developers.slashdot.org/developers/02/05/19/2216233.shtml">
+ <title>What is well-commented code?</title>
+ </bookmark>
+ <bookmark href="http://liinwww.ira.uka.de/bibliography/SE/litprog.html">
+ <title>Bibliography on literate programming - A searchable bibliography</title>
+ </bookmark>
+ <bookmark href="http://www2.umassd.edu/SWPI/ProcessBibliography/bib-codereading.html">
+ <title>Program comprehension and code reading bibliography</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/elucidative-programming/">
+ <title>Elucidative Programming</title>
+ </bookmark>
+ <bookmark href="http://www.msu.edu/%7Epfaffben/avl/index.html">
+ <title>AVL Trees (TexiWeb)</title>
+ </bookmark>
+ <bookmark href="http://literate-programming.wikiverse.org/">
+ <title>Literate Programming on Wikiverse</title>
+ </bookmark>
+ <bookmark href="http://www.pbrt.org/">
+ <title>Physically Based Rendering: From Theory to Implementation</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Useful C++ Links</title>
+ <folder folded="no">
+ <title>STL</title>
+ <bookmark href="http://www.sgi.com/tech/stl/table_of_contents.html">
+ <title>STL Reference Documentation</title>
+ </bookmark>
+ <bookmark href="http://www.yrl.co.uk/~phil/stl/stl.htmlx">
+ <title>STL Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.cppreference.com/cpp_stl.html">
+ <title>STL Reference</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Qt</title>
+ <bookmark href="http://doc.trolltech.com/2.3/">
+ <title>Qt 2.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://doc.trolltech.com/3.3/">
+ <title>Qt 3.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://doc.trolltech.com/4.0/">
+ <title>Qt 4.0 Reference</title>
+ </bookmark>
+ <bookmark href="http://www.trolltech.com/">
+ <title>Trolltech Home Page</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>IOStreams</title>
+ <bookmark href="http://www.cplusplus.com/ref/iostream/index.html">
+ <title>IO Stream Library</title>
+ </bookmark>
+ <bookmark href="http://courses.cs.vt.edu/~cs2604/fall01/binio.html">
+ <title>Binary I/O</title>
+ </bookmark>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/input-output.html">
+ <title>I/O Stream FAQ</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>gdb</title>
+ <bookmark href="http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html">
+ <title>GDB Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.gnu.org/manual/gdb-4.17/html_mono/gdb.html">
+ <title>Debugging with GDB</title>
+ </bookmark>
+ <bookmark href="http://www.cs.washington.edu/orgs/acm/tutorials/dev-in-unix/gdb-refcard.pdf">
+ <title>GDB Quick Reference Page (PDF) (Handy)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Classes and Constructors</title>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/ctors.html">
+ <title>Constructor FAQ</title>
+ </bookmark>
+ <bookmark href="http://www.juicystudio.com/tutorial/cpp/index.html">
+ <title>Organizing Classes</title>
+ </bookmark>
+ </folder>
+ </folder>
+ <folder folded="yes">
+ <title>Software Documentation or System Documentation</title>
+ <bookmark href="http://www.martinfowler.com/distributedComputing/thud.html">
+ <title>The Almighty Thud</title>
+ </bookmark>
+ <bookmark href="http://msdn.microsoft.com/library/techart/cfr.htm">
+ <title>Microsoft Coding Techniques and Programming Practices</title>
+ </bookmark>
+ <bookmark href="http://www.bearcave.com/software/prog_docs.html">
+ <title>Software and Documentation</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?TheSourceCodeIsTheDesign">
+ <title>The Source Code is the Design</title>
+ </bookmark>
+ <bookmark href="http://www.bleading-edge.com/Publications/C++Journal/Cpjour2.htm">
+ <title>What is Software Design?</title>
+ </bookmark>
+ <bookmark href="http://www.mindprod.com/unmain.html">
+ <title>How To Write Unmaintainable Code</title>
+ </bookmark>
+ <bookmark href="http://www.idinews.com/selfDoc.html">
+ <title>Self Documenting Program Code Remains a Distant Goal</title>
+ </bookmark>
+ <bookmark href="http://www.sdmagazine.com/documents/s=730/sdm0106m/0106m.htm">
+ <title>Place Tab A in Slot B</title>
+ </bookmark>
+ <bookmark href="http://www.holub.com/class/uml/uml.html">
+ <title>UML Reference Card</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>TeX Resources</title>
+ <bookmark href="http://www.tug.org/">
+ <title>The TeX User's Group</title>
+ </bookmark>
+ <bookmark href="http://www.miktex.org/">
+ <title>MikTeX website</title>
+ </bookmark>
+ <bookmark href="http://cm.bell-labs.com/who/hobby/MetaPost.html">
+ <title>MetaPost website</title>
+ </bookmark>
+ <bookmark href="http://pauillac.inria.fr/%7Emaranget/hevea/">
+ <title>HEVEA is a quite complete and fast LATEX to HTML translator</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Portable Document Format (PDF)</title>
+ <bookmark href="http://www.adobe.com/">
+ <title>Adobe - The postscript and PDF standards</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html">
+ <title>Reference Manual Portable Document Format</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/acrosdk/main.html">
+ <title>Adobe Acrobat Software Development Kit</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Literature Sites</title>
+ <bookmark href="http://www.cc.columbia.edu/cu/libraries/subjects/speccol.html">
+ <title>Guide to Special Collections (Columbia University)</title>
+ </bookmark>
+ <bookmark href="http://www.ipl.org/ref/litcrit/">
+ <title>Literary Criticism on the Web from the Internet Public Library</title>
+ </bookmark>
+ <bookmark href="http://www.victorianweb.org/">
+ <title>Victorian Web.</title>
+ </bookmark>
+ <bookmark href="http://vos.ucsb.edu/">
+ <title>Voice of the Shuttle.</title>
+ </bookmark>
+ <bookmark href="http://www.modjourn.brown.edu/">
+ <title>Modernist Journals Project</title>
+ </bookmark>
+ <bookmark href="http://www.poetspath.com">
+ <title>Museum of American Poetics</title>
+ </bookmark>
+ <bookmark href="http://www.english.uiuc.edu/maps/">
+ <title>Modern American Poetry</title>
+ </bookmark>
+ <bookmark href="http://www.findarticles.com/">
+ <title>FindArticles.com</title>
+ </bookmark>
+ <bookmark href="http://www.literaryhistory.com">
+ <title>Literary History</title>
+ </bookmark>
+ <bookmark href="http://www.litencyc.com/LitEncycFrame.htm">
+ <title>Literary Encyclopedia</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://texts.cdlib.org/ucpress/">
+ <title>The University of California Press</title>
+ </bookmark>
+ <bookmark href="http://www.letrs.indiana.edu/web/w/wright2/">
+ <title>Wright American Fiction, 1851-1875</title>
+ </bookmark>
+ <bookmark href="http://docsouth.unc.edu/">
+ <title>Documenting the American South: Beginnings to 1920</title>
+ </bookmark>
+ <bookmark href="http://etext.lib.virginia.edu/eng-on.html">
+ <title>Electronic Text Center at the University of Virginia</title>
+ </bookmark>
+ <bookmark href="http://digital.nypl.org/schomburg/writers_aa19/">
+ <title>The Schomburg Center for Research in Black Culture</title>
+ </bookmark>
+ <bookmark href="http://www.infomotions.com/alex2/">
+ <title>Alex Catalogue of Electronic Texts.</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/saxbookmarks/jenniferf.xbel b/examples/xml/saxbookmarks/jenniferf.xbel
new file mode 100644
index 0000000000..1f7810b94b
--- /dev/null
+++ b/examples/xml/saxbookmarks/jenniferf.xbel
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="no">
+ <title>Qt Resources</title>
+ <folder folded="yes">
+ <title>Trolltech Partners</title>
+ <bookmark href="http://partners.trolltech.com/partners/training.html">
+ <title>Training Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/service.html">
+ <title>Consultants and System Integrators</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/tech.html">
+ <title>Technology Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/resellers.html">
+ <title>Value Added Resellers (VARs)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Community Resources</title>
+ <bookmark href="http://www.qtforum.org/">
+ <title>QtForum.org</title>
+ </bookmark>
+ <bookmark href="http://www.digitalfanatics.org/projects/qt_tutorial/">
+ <title>The Independent Qt Tutorial</title>
+ </bookmark>
+ <bookmark href="http://prog.qt.free.fr/">
+ <title>French PROG.Qt</title>
+ </bookmark>
+ <bookmark href="http://www.qtforum.de/">
+ <title>German Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://www.korone.net/">
+ <title>Korean Qt Community Site</title>
+ </bookmark>
+ <bookmark href="http://prog.org.ru/forum/forum_14.html">
+ <title>Russian Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://qt4.digitalfanatics.org/">
+ <title>Digitalfanatics: The QT 4 Resource Center</title>
+ </bookmark>
+ <bookmark href="http://www.qtquestions.org/">
+ <title>QtQuestions</title>
+ </bookmark>
+ </folder>
+ <bookmark href="http://doc.trolltech.com/qq/">
+ <title>Qt Quarterly</title>
+ </bookmark>
+ <bookmark href="http://www.trolltech.com/">
+ <title>Trolltech's home page</title>
+ </bookmark>
+ <bookmark href="http://doc.trolltech.com/4.0/">
+ <title>Qt 4.0 documentation</title>
+ </bookmark>
+ <bookmark href="http://www.trolltech.com/developer/faqs/">
+ <title>Frequently Asked Questions</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Online Dictionaries</title>
+ <bookmark href="http://www.dictionary.com/">
+ <title>Dictionary.com</title>
+ </bookmark>
+ <bookmark href="http://www.m-w.com/">
+ <title>Merriam-Webster Online</title>
+ </bookmark>
+ <bookmark href="http://dictionary.cambridge.org/">
+ <title>Cambridge Dictionaries Online</title>
+ </bookmark>
+ <bookmark href="http://www.onelook.com/">
+ <title>OneLook Dictionary Search</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="www.iee.et.tu-dresden.de/">
+ <title>The New English-German Dictionary</title>
+ </bookmark>
+ <bookmark href="http://dict.tu-chemnitz.de/">
+ <title>TU Chemnitz German-English Dictionary</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://atilf.atilf.fr/tlf.htm">
+ <title>Trésor de la Langue Française informatisé</title>
+ </bookmark>
+ <bookmark href="http://dictionnaires.atilf.fr/dictionnaires/ACADEMIE/">
+ <title>Dictionnaire de l'Académie Française</title>
+ </bookmark>
+ <bookmark href="http://elsap1.unicaen.fr/cgi-bin/cherches.cgi">
+ <title>Dictionnaire des synonymes</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/saxbookmarks/main.cpp b/examples/xml/saxbookmarks/main.cpp
index 3f0a207265..31c2246f07 100644
--- a/examples/xml/saxbookmarks/main.cpp
+++ b/examples/xml/saxbookmarks/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showFullScreen();
+#else
mainWin.show();
+#endif
mainWin.open();
return app.exec();
}
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
index 2cba5590ea..4bdd1f0546 100644
--- a/examples/xml/saxbookmarks/mainwindow.cpp
+++ b/examples/xml/saxbookmarks/mainwindow.cpp
@@ -66,6 +66,9 @@ MainWindow::MainWindow()
void MainWindow::open()
{
+#if defined(Q_OS_SYMBIAN)
+ QDir::setCurrent("/Data/qt/saxbookmarks");
+#endif
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
QDir::currentPath(),
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index d0eec444b2..3556c117ef 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -13,8 +13,17 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS saxbookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/saxbookmarks
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = frank.xbel jennifer.xbel
addFiles.path = \My Documents
DEPLOYMENT += addFiles
}
+
+symbian: {
+ TARGET.UID3 = 0xA000C60A
+ addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.path = /data/qt/saxbookmarks
+ DEPLOYMENT += addFiles
+} \ No newline at end of file
diff --git a/examples/xml/streambookmarks/streambookmarks.pro b/examples/xml/streambookmarks/streambookmarks.pro
index e66b95aa4d..f16a02ebaf 100644
--- a/examples/xml/streambookmarks/streambookmarks.pro
+++ b/examples/xml/streambookmarks/streambookmarks.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xml/streambookmarks
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS streambookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/streambookmarks
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro
index 866b0cc800..2b6415c0cf 100644
--- a/examples/xml/xml.pro
+++ b/examples/xml/xml.pro
@@ -1,12 +1,17 @@
TEMPLATE = subdirs
SUBDIRS = dombookmarks \
+ htmlinfo \
rsslisting \
saxbookmarks \
streambookmarks \
xmlstreamlint
+symbian: SUBDIRS = htmlinfo saxbookmarks
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/xml
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xml.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xml
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro
index 7034e7bbbb..4f97387dfc 100644
--- a/examples/xml/xmlstreamlint/xmlstreamlint.pro
+++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xml/xmlstreamlint
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlstreamlint.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/xmlstreamlint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/filetree/filetree.pro b/examples/xmlpatterns/filetree/filetree.pro
index 469ee8d45b..e30f2cf117 100644
--- a/examples/xmlpatterns/filetree/filetree.pro
+++ b/examples/xmlpatterns/filetree/filetree.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/filetree
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xq *.html
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/filetree
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/recipes/recipes.pro b/examples/xmlpatterns/recipes/recipes.pro
index 87708a99f3..cee7b6d730 100644
--- a/examples/xmlpatterns/recipes/recipes.pro
+++ b/examples/xmlpatterns/recipes/recipes.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/recipes
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xq *.html forms files
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/recipes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xmlpatterns.pro b/examples/xmlpatterns/xmlpatterns.pro
index 1a5700522a..081abdebb7 100644
--- a/examples/xmlpatterns/xmlpatterns.pro
+++ b/examples/xmlpatterns/xmlpatterns.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlpatterns.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
index 8ca900b149..0016c41f33 100644
--- a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
+++ b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery/globalVariables
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.cpp *.pro *.xq *.html globals.gccxml
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery/globalVariables
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xquery/xquery.pro b/examples/xmlpatterns/xquery/xquery.pro
index f7ac5efe92..2a911889cf 100644
--- a/examples/xmlpatterns/xquery/xquery.pro
+++ b/examples/xmlpatterns/xquery/xquery.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xquery.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/mkspecs/common/symbian/fixed_stdlib.h b/mkspecs/common/symbian/fixed_stdlib.h
new file mode 100644
index 0000000000..2346afe58c
--- /dev/null
+++ b/mkspecs/common/symbian/fixed_stdlib.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FIXED_STDLIB_H
+#define FIXED_STDLIB_H
+
+// This hack fixes defect in Symbian stdlib.h. The original file
+// does not work correctly when intermixing C and C++ (STL). Remove the hack
+// when Open C / C++ team has fixed the defect.
+
+// If _WCHAR_T_DECLARED is defined, undef it and store information that we
+// need to revert the _WCHAR_T_DECLARED define after include
+# ifdef _WCHAR_T_DECLARED
+# define REVERT_WCHAR_T_DECLARED
+# undef _WCHAR_T_DECLARED
+# endif //_WCHAR_T_DECLARED
+
+#include <stdlib.h>
+
+// Revert _WCHAR_T_DECLARED if necessary
+# ifdef REVERT_WCHAR_T_DECLARED
+# define _WCHAR_T_DECLARED
+# undef REVERT_WCHAR_T_DECLARED
+# endif //REVERT_WCHAR_T_DECLARED
+
+#endif \ No newline at end of file
diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h
new file mode 100644
index 0000000000..90d3f41d08
--- /dev/null
+++ b/mkspecs/common/symbian/qplatformdefs.h
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
+
+// 1) need to reset default environment if _BSD_SOURCE is defined
+// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
+// 3) it seems older glibc need this to include the X/Open stuff
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#include <unistd.h>
+
+
+// We are hot - unistd.h should have turned on the specific APIs we requested
+
+//#include <features.h>
+#include <pthread.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
+//#include <signal.h>
+#include <dlfcn.h>
+#include <sys/select.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/ipc.h>
+#include <sys/time.h>
+#include <sys/shm.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <netinet/in.h>
+#ifndef QT_NO_IPV6IFNAME
+#include <net/if.h>
+#endif
+#include <arpa/inet.h>
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_STATBUF struct stat64
+#define QT_STATBUF4TSTAT struct stat64
+#define QT_STAT ::stat64
+#define QT_FSTAT ::fstat64
+#define QT_LSTAT ::lstat64
+#define QT_OPEN ::open64
+#define QT_TRUNCATE ::truncate64
+#define QT_FTRUNCATE ::ftruncate64
+#define QT_LSEEK ::lseek64
+#else
+#define QT_STATBUF struct stat
+#define QT_STATBUF4TSTAT struct stat
+#define QT_STAT ::stat
+#define QT_FSTAT ::fstat
+#define QT_LSTAT ::lstat
+#define QT_OPEN ::open
+#define QT_TRUNCATE ::truncate
+#define QT_FTRUNCATE ::ftruncate
+#define QT_LSEEK ::lseek
+#endif
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_FOPEN ::fopen64
+#define QT_FSEEK ::fseeko64
+#define QT_FTELL ::ftello64
+#define QT_FGETPOS ::fgetpos64
+#define QT_FSETPOS ::fsetpos64
+#define QT_FPOS_T fpos64_t
+#define QT_OFF_T off64_t
+#else
+#define QT_FOPEN ::fopen
+#define QT_FSEEK ::fseek
+#define QT_FTELL ::ftell
+#define QT_FGETPOS ::fgetpos
+#define QT_FSETPOS ::fsetpos
+#define QT_FPOS_T fpos_t
+#define QT_OFF_T long
+#endif
+
+#define QT_STAT_REG S_IFREG
+#define QT_STAT_DIR S_IFDIR
+#define QT_STAT_MASK S_IFMT
+#define QT_STAT_LNK S_IFLNK
+#define QT_SOCKET_CONNECT ::connect
+#define QT_SOCKET_BIND ::bind
+#define QT_FILENO fileno
+#define QT_CLOSE ::close
+#define QT_READ ::read
+#define QT_WRITE ::write
+#define QT_ACCESS ::access
+#define QT_GETCWD ::getcwd
+#define QT_CHDIR ::chdir
+#define QT_MKDIR ::mkdir
+#define QT_RMDIR ::rmdir
+#define QT_OPEN_RDONLY O_RDONLY
+#define QT_OPEN_WRONLY O_WRONLY
+#define QT_OPEN_RDWR O_RDWR
+#define QT_OPEN_CREAT O_CREAT
+#define QT_OPEN_TRUNC O_TRUNC
+#define QT_OPEN_APPEND O_APPEND
+
+#define QT_SIGNAL_RETTYPE void
+#define QT_SIGNAL_ARGS int
+#define QT_SIGNAL_IGNORE SIG_IGN
+
+#if (defined(__GLIBC__) && (__GLIBC__ >= 2)) || defined(Q_OS_SYMBIAN)
+#define QT_SOCKLEN_T socklen_t
+#else
+#define QT_SOCKLEN_T int
+#endif
+
+
+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+#define QT_SNPRINTF ::snprintf
+#define QT_VSNPRINTF ::vsnprintf
+#endif
+
+
+#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/common/symbian/stl-off/new b/mkspecs/common/symbian/stl-off/new
new file mode 100644
index 0000000000..3939e1116f
--- /dev/null
+++ b/mkspecs/common/symbian/stl-off/new
@@ -0,0 +1,5 @@
+// new implemented in symbian libs, do nothing here, just keep Qt happpy
+#ifndef __NEW_SYMB_ADDON
+#define __NEW_SYMB_ADDON
+#include <e32base.h>
+#endif //__NEW_SYMB_ADDON
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
new file mode 100644
index 0000000000..2fe93d2d97
--- /dev/null
+++ b/mkspecs/common/symbian/symbian.conf
@@ -0,0 +1,141 @@
+#
+# qmake configuration for symbian-*
+#
+
+TEMPLATE = app
+CONFIG += qt warn_on release incremental
+QT += core gui
+QMAKE_INCREMENTAL_STYLE = sublib
+
+DEFINES += UNICODE QT_KEYPAD_NAVIGATION
+QMAKE_COMPILER_DEFINES += SYMBIAN
+
+QMAKE_EXT_OBJ = .o
+QMAKE_EXT_RES = _res.o
+
+QMAKE_CC = gcc
+QMAKE_LEX = flex
+QMAKE_LEXFLAGS =
+QMAKE_YACC = byacc
+QMAKE_YACCFLAGS = -d
+QMAKE_CFLAGS =
+QMAKE_CFLAGS_DEPS =
+QMAKE_CFLAGS_WARN_ON =
+QMAKE_CFLAGS_WARN_OFF =
+QMAKE_CFLAGS_RELEASE =
+QMAKE_CFLAGS_DEBUG =
+QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+QMAKE_CXX = g++
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS.CW =
+QMAKE_CXXFLAGS.ARMCC = --visibility_inlines_hidden
+QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+QMAKE_CXXFLAGS_RTTI_ON =
+QMAKE_CXXFLAGS_RTTI_OFF =
+QMAKE_CXXFLAGS_EXCEPTIONS_ON =
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
+
+QMAKE_INCDIR =
+QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
+
+QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+QMAKE_LINK = g++
+QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
+QMAKE_LFLAGS_EXCEPTIONS_OFF =
+QMAKE_LFLAGS_RELEASE = -Wl,-s
+QMAKE_LFLAGS_DEBUG =
+QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
+QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
+QMAKE_LFLAGS_DLL = -shared
+QMAKE_LINK_OBJECT_MAX = 10
+QMAKE_LINK_OBJECT_SCRIPT= object_script
+
+QMAKE_DESKTOPSERVICES_LIBS = -lsendui -lplatformenv -lcommonui -letext -lapmime
+QMAKE_STATUSPANE_LIBS = -lavkon -leikcoctl
+
+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 $$QMAKE_DESKTOPSERVICES_LIBS $$QMAKE_STATUSPANE_LIBS -lmediaclientaudio
+QMAKE_LIBS_NETWORK =
+QMAKE_LIBS_OPENGL =
+QMAKE_LIBS_OPENVG = -llibOpenVG -llibEGL -lcone
+QMAKE_LIBS_COMPAT =
+QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib
+
+!isEmpty(QMAKE_SH) {
+ QMAKE_COPY = cp
+ QMAKE_COPY_DIR = cp -r
+ QMAKE_MOVE = mv
+ QMAKE_DEL_FILE = rm
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = test -d
+} else {
+ QMAKE_COPY = copy /y
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = move
+ QMAKE_DEL_FILE = del
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = if not exist
+}
+
+QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
+QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
+QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+
+QMAKE_IDL = midl
+QMAKE_LIB = ar -ru
+QMAKE_RC = windres
+QMAKE_ZIP = zip -r -9
+
+QMAKE_STRIP = strip
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+
+load(qt_config)
+load(platform_paths)
+
+MMP_RULES += EXPORTUNFROZEN PAGED
+SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6
+
+# Legacy support requires some hardcoded stdapis paths.
+INCLUDEPATH = \
+ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \
+ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \
+ $${EPOCROOT}epoc32/include \
+ $${EPOCROOT}epoc32/include/stdapis \
+ $${EPOCROOT}epoc32/include/stdapis/sys \
+ $$OS_LAYER_LIBC_SYSTEMINCLUDE \
+ $${OS_LAYER_LIBC_SYSTEMINCLUDE}/sys \
+ $$INCLUDEPATH
+
+# Supports S60 3.0, 3.1, 3.2 and 5.0 by default
+default_deployment.depends = \
+ "[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+ "[0x102032BE],0,0,0,{\"S60ProductID\"}" \
+ "[0x102752AE],0,0,0,{\"S60ProductID\"}" \
+ "[0x1028315F],0,0,0,{\"S60ProductID\"}"
+
+DEPLOYMENT += default_deployment
+
+exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v5.0.sis) {
+ S60_VERSION = 5.0
+} else {
+ exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v3.2.sis) {
+ S60_VERSION = 3.2
+ } else {
+ S60_VERSION = 3.1
+ }
+}
diff --git a/mkspecs/features/debug_and_release.prf b/mkspecs/features/debug_and_release.prf
index 8b8932184f..19031ef952 100644
--- a/mkspecs/features/debug_and_release.prf
+++ b/mkspecs/features/debug_and_release.prf
@@ -1 +1 @@
-!macx-xcode:addExclusiveBuilds(debug, Debug, release, Release)
+!macx-xcode:!symbian-abld:addExclusiveBuilds(debug, Debug, release, Release)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 0c6e09aa9d..a790b60f48 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -118,6 +118,14 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
}
+ isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:symbian: {
+ QT_ITEM = $${QTPLUG}.dll
+
+ eval(qt_additional_plugin_$${QTPLUG}.sources = $${QT_ITEM})
+ eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
+
+ DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
+ }
}
}
#specific module settings
diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf
index 3e1c9182e9..8c75bb84dd 100644
--- a/mkspecs/features/qttest_p4.prf
+++ b/mkspecs/features/qttest_p4.prf
@@ -10,6 +10,14 @@ CONFIG(debug, debug|release) {
}
}
+symbian:{
+# qt.prf sets TARGET.EPOCSTACKSIZE and TARGET.EPOCHEAPSIZE
+# DEFINES += QTEST_NO_SPECIALIZATIONS
+ TARGET.UID3 = $$generate_test_uid($$TARGET)
+ TARGET.CAPABILITY="ALL -TCB"
+ RSS_RULES ="group_name=\"QtTests\";"
+}
+
# find testlib's prl file and extract the librarie's name
QTEST_LIB =
mac:exists($$[QT_INSTALL_LIBS]/QtTest.framework):QTEST_LIB = QtTest.framework
@@ -21,9 +29,12 @@ CONFIG(debug, debug|release) {
mac {
QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/libQtTest$${QT_LIBINFIX}_debug.prl, QMAKE_PRL_TARGET)
}
- unix:!mac {
+ unix:!mac:!symbian {
QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/libQtTest$${QT_LIBINFIX}.prl, QMAKE_PRL_TARGET)
}
+ symbian {
+ QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/QtTest$${QT_LIBINFIX}.prl, QMAKE_PRL_TARGET).dll
+ }
}
OBJECTS_DIR = tmp/debug
MOC_DIR = tmp/debug
@@ -31,6 +42,8 @@ CONFIG(debug, debug|release) {
isEmpty(QTEST_LIB) {
win32 {
QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/QtTest$${QT_LIBINFIX}.prl, QMAKE_PRL_TARGET)4.dll
+ } symbian {
+ QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/QtTest$${QT_LIBINFIX}.prl, QMAKE_PRL_TARGET).dll
} else {
QTEST_LIB = $$fromfile($$[QT_INSTALL_LIBS]/libQtTest$${QT_LIBINFIX}.prl, QMAKE_PRL_TARGET)
}
@@ -38,11 +51,17 @@ CONFIG(debug, debug|release) {
OBJECTS_DIR = tmp/release
MOC_DIR = tmp/release
}
+
isEmpty(QTEST_LIB) {
warning("Cannot find testlib's prl file, run qmake in $QTDIR/src/testlib")
CONFIG += embed_testlib
} else {
- !exists($$[QT_INSTALL_LIBS]/$$QTEST_LIB):CONFIG += embed_testlib
+ # Never embed automatically in Symbian, as checking for existence is not reliable
+ # due to the fact that we support multiple platforms (WINSCW, ARMV5, GCCE, ...), which
+ # each build the lib to different location.
+ !symbian {
+ !exists($$[QT_INSTALL_LIBS]/$$QTEST_LIB):CONFIG += embed_testlib
+ }
}
# make sure the test is build according to your Qt configuration
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
new file mode 100644
index 0000000000..df4bb1cca1
--- /dev/null
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -0,0 +1,39 @@
+load(data_caging_paths)
+
+# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
+# requires the registration resource file to exist always
+contains( CONFIG, no_icon ) {
+ symbian:RSS_RULES ="hidden = KAppIsHidden;"
+ CONFIG -= no_icon
+} else {
+# There is no sense to compile MIF icon is no_icon CONFIGS is set
+ !isEmpty(ICON) {
+
+ !count(ICON, $$size(TRANSLATIONS)):!count(ICON, 1) {
+ message("ICON keyword must have one or the same amout of items as in TRANSLATIONS keyword")
+ }
+
+ # MIF files will have UID in their names, if TARGET.UID3 is not set we need to generate it
+ isEmpty(TARGET.UID3):TARGET.UID3 = $$generate_test_uid($$TARGET)
+
+ # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
+ symbian-abld {
+ #Makefile: requires paths with backslash
+ ICON = $$replace( ICON, /, \\)
+
+ # Extra compiler rules for mifconv
+ mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${TARGET.UID3}.mif
+ # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library
+ # svg-t icons should always use /c32 depth
+ mifconv.commands = mifconv ${QMAKE_FILE_OUT} $$join(ICON, " /c32 ", "/c32 ",)
+ mifconv.input = ICON
+ mifconv.CONFIG = no_link combine
+ # target_predeps together with combine seems not to work correctly, lets define it by ourselves
+ PRE_TARGETDEPS += $$mifconv.output
+ QMAKE_EXTRA_COMPILERS += mifconv
+ }
+ # Rules to use generated MIF file from symbian resources
+ RSS_RULES.number_of_icons = $$size(ICON)
+ RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif
+ }
+} \ No newline at end of file
diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf
new file mode 100644
index 0000000000..3ed566134f
--- /dev/null
+++ b/mkspecs/features/symbian/data_caging_paths.prf
@@ -0,0 +1,80 @@
+#
+# ==============================================================================
+# Name : data_caging_paths.prf
+# Part of :
+# Interface : Data Caging Path Definitions API for Qt/S60
+# Description : Predefined include paths to be used in the pro-files for the
+# paths related to data caging.
+#
+# Usage examples:
+#
+# # Load these definitions on pro-file if needed:
+# load(data_caging_paths)
+#
+# # These variables are mostly useful when specifying deployment
+#
+# myLib.sources = myLib.dll
+# myLib.path = $$SHARED_LIB_DIR
+# DEPLOYMENT += myLib
+#
+# # Note: Do not use $$PLUGINS_DIR or $$PLUGINS_1_DIR to deploy Qt plugins.
+# # $$QT_PUBLIC_PLUGINS_BASE specifies the public base directory for Qt
+# # plugin stubs:
+#
+# myPublicImageFormatPlugin.sources = myImageFormat.dll
+# myPublicImageFormatPlugin.path = $$QT_PLUGINS_BASE_DIR/imageformats
+# DEPLOYMENT += myPublicImageFormatPlugin
+#
+# ==============================================================================
+
+exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) {
+
+ # Load platform specific paths
+ load($${EPOCROOT}epoc32/include/data_caging_paths.prf)
+
+} else {
+ # No platform specific paths provided, use default paths
+
+ APPARC_RECOGNISER_RESOURCES_DIR = /resource/apps/registrationresourcefiles
+ APP_BITMAP_DIR = /resource/apps
+ APP_RESOURCE_DIR = /resource/apps
+ BITMAP_DIR = /resource/apps
+ BIOFILE_DIR = /resource/messaging/bif
+ CHARCONV_PLUGIN_DIR = /resource/charconv
+ CONTACTS_RESOURCE_DIR = /resource/cntmodel
+ CTRL_PANEL_RESOURCE_DIR = /resource/controls
+ CONVERTER_PLUGIN_RESOURCE_DIR = /resource/convert
+ ECOM_RESOURCE_DIR = /resource/plugins
+ ERROR_RESOURCE_DIR = /resource/errors
+ PROGRAMS_DIR = /sys/bin
+ FEP_RESOURCES_DIR = /resource/fep
+ HELP_FILE_DIR = /resource/help
+ LOG_ENGINE_RESOURCE_DIR = /resource/logengine
+ MTM_RESOURCE_DIR = /resource/messaging
+ MTM_INFO_FILE_DIR = /resource/messaging/mtm
+ PRINTER_DRIVER_DIR = /resource/printers
+ SHARED_LIB_DIR = /sys/bin
+ UIKLAF_RESOURCE_DIR = /resource/uiklaf
+ WAPPUSH_PLUGIN_RESOURCE_DIR = /resource/messaging/wappush
+ WATCHER_PLUGIN_RESOURCE_DIR = /resource/messaging/watchers
+ RECOGNISERS_DIR = /sys/bin
+ PARSERS_DIR = /sys/bin
+ NOTIFIERS_DIR = /sys/bin
+ PLUGINS_DIR = /sys/bin
+ PLUGINS_1_DIR = /sys/bin
+ RESOURCE_FILES_DIR = /resource
+
+ CA_CERTIFICATES_DIR = /private/101f72a6
+ COMMDB_DIR = /private/100012a5
+ SS_CONFIG_FILE_DIR = /private/101f7989/esock
+ TRUSTED_FONTS_DIR = /private/10003a16/fonts
+ UNTRUSTED_FONT_DIR = /private/10003a16/import/fonts
+ WINDOW_SERVER_INI_DIR = /private/10003b20
+ SKINS_DIR = /private/10207114
+ BOOTDATA_DIR = /resource/bootdata
+}
+
+isEmpty(QT_PLUGINS_BASE_DIR): QT_PLUGINS_BASE_DIR = /$$RESOURCE_FILES_DIR/qt/plugins
+isEmpty(HW_ZDIR): HW_ZDIR = epoc32/data/z
+isEmpty(REG_RESOURCE_DIR): REG_RESOURCE_DIR = /private/10003a3f/apps
+isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps \ No newline at end of file
diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf
new file mode 100644
index 0000000000..3c2944cadb
--- /dev/null
+++ b/mkspecs/features/symbian/default_post.prf
@@ -0,0 +1,31 @@
+load(default_post)
+
+contains(TEMPLATE, ".*app") {
+ contains(CONFIG, stdbinary) {
+ QMAKE_LIBS +=
+ } else:contains(QT, gui):contains(CONFIG,qt) {
+ S60MAIN_LIBS = -leuser -lavkon -leikcore -leiksrv -lws32 -lapparc -lcone -leikcoctl -lbafl -lefsrv
+ QMAKE_LIBS += -lqtmain.lib $$S60MAIN_LIBS
+ } else {
+ QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY
+ }
+}
+contains(TEMPLATE, lib): {
+ contains(CONFIG, staticlib)|contains(CONFIG, static): {
+ # Static libs should not have LIBRARY statements in S60
+ QMAKE_LIBS =
+ # Static libs do not need def files
+ MMP_RULES -= EXPORTUNFROZEN
+ }
+ contains(CONFIG, plugin):!contains(CONFIG, stdbinary): {
+ # Plugins based on normal libraries have predefined def file
+ MMP_RULES -= EXPORTUNFROZEN
+ }
+} else {
+ # Applications don't need this
+ MMP_RULES -= EXPORTUNFROZEN
+}
+
+contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG,qt) {
+ load(application_icon.prf)
+} \ No newline at end of file
diff --git a/mkspecs/features/symbian/default_pre.prf b/mkspecs/features/symbian/default_pre.prf
new file mode 100644
index 0000000000..ddb23b3157
--- /dev/null
+++ b/mkspecs/features/symbian/default_pre.prf
@@ -0,0 +1,2 @@
+CONFIG = stl_off $$CONFIG
+load(default_pre)
diff --git a/mkspecs/features/symbian/epocallowdlldata.prf b/mkspecs/features/symbian/epocallowdlldata.prf
new file mode 100644
index 0000000000..b336f488fd
--- /dev/null
+++ b/mkspecs/features/symbian/epocallowdlldata.prf
@@ -0,0 +1 @@
+TARGET.EPOCALLOWDLLDATA=1
diff --git a/mkspecs/features/symbian/moc.prf b/mkspecs/features/symbian/moc.prf
new file mode 100644
index 0000000000..089dddce31
--- /dev/null
+++ b/mkspecs/features/symbian/moc.prf
@@ -0,0 +1,16 @@
+load(moc)
+
+RET = $$find(MOC_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set MOC_DIR to a different value in your profile.")
+}
+
+RET = $$find(RCC_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set RCC_DIR to a different value in your profile.")
+}
+
+RET = $$find(OBJECTS_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set OBJECTS_DIR to a different value in your profile.")
+}
diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf
new file mode 100644
index 0000000000..31ba09e571
--- /dev/null
+++ b/mkspecs/features/symbian/platform_paths.prf
@@ -0,0 +1,456 @@
+#
+# ==============================================================================
+# Name : platform_paths.prf
+# Part of :
+# Interface : Platform Path Definitions API for Qt/S60
+# Description : Predefined include paths to be used in the pro-files for the
+# components in the layered model. There is one definition for
+# each layer. The pro-file should use the statement that is
+# intended for the same layer as where the pro-file resides.
+#
+# Usage examples:
+#
+# Note: this file gets automatically added to all Qt/S60 projects
+#
+# Variable usages to add the system include paths
+#
+# The include paths has to be related to the layer in which your SW
+# resides. Thus as an example: a component residing in middleware
+# layer should use the MW specific macro.
+#
+# INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+# INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE
+#
+# If there is a need to include public headers of some S60 component,
+# various *_EXPORT_PATH macros can be utilized:
+#
+# INCLUDEPATH += $$OS_LAYER_PUBLIC_EXPORT_PATH(somecomponent)
+#
+# Variables related to using various parts of stdapis:
+#
+# To use STLLIB you need to have this in your pro-file:
+#
+# QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+# DEFINES *= $$STLLIB_USAGE_DEFINES
+#
+# Depending on what module you are using from stdapis you need to have
+# one or more of the following variables in your pro-file.
+#
+# INCLUDEPATH += $$OS_LAYER_LIBC_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_GLIB_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_SSL_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_BOOST_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_DBUS_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_LIBUTILITY_SYSTEMINCLUDE
+#
+#
+#
+#
+# ==============================================================================
+
+exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
+
+ # Load platform specific paths
+ load($${EPOCROOT}epoc32/include/platform_paths.prf)
+
+} else {
+
+ # No platform specific paths provided, use default paths
+
+ exists($${EPOCROOT}epoc32/include/platform) { # New SF structure
+
+ # ---------------------------------------
+ # Location, where the applications layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/app/$$1)
+ }
+ defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/app/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the applications layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/app/$$1)
+ }
+ defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/app/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/mw/$$1)
+ }
+ defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/mw/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/mw/$$1)
+ }
+ defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/mw/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/$$1)
+ }
+ defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/$$1)
+ }
+ defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/$$1)
+ }
+
+ # ---------------------------------------
+ # General comments about the 3 define statements related to include paths:
+ # 1) the /epoc32/include/oem is now defined there for backward compability.
+ # Once the directory is empty, the directory will be removed. However this
+ # enables us to ensure that if you use these define statements => you do
+ # not have to remove the statements later on, when the directory no longer
+ # exists.
+ # 2) These statements should be enough in normal cases. For certain specific
+ # cases you might need to add some specific directory from /epoc32/include
+ # (for instance /epoc32/include/ecom).
+ # In normal cases the include staments in code should be relative to one of
+ # the system include paths, but in certain cases, the included files requires
+ # that the subdirectory is also part of the system include paths.
+ # ---------------------------------------
+
+ # This variable defines the include paths, which are intended to be
+ # used in the pro-files that are part of the applications-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # application-layer components.
+ #
+ # Applications layer is the last one in the list, since most likely the most of
+ # the headers come from middleware or os-layer => thus they are first.
+
+ APP_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/mw \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/app \
+ /epoc32/include/platform/app \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/app/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc \
+ /epoc32/include/platform/app/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the middleware-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # middleware-layer components.
+
+ MW_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/mw \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the osextensions-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # os-layer components.
+
+ OS_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the os-layer. This is intended
+ # to be only used by those components which need to use in their mmp-file either
+ # kern_ext.mmh or nkern_ext.mmh. Reason is that those
+ # 2 files already contain the /epoc32/include as system include path.
+
+ OS_LAYER_KERNEL_SYSTEMINCLUDE = \
+ /epoc32/include/platform
+
+
+ # ---------------------------------------
+ # Definitions that also define the systeminclude paths for various
+ # part of stdapis. Append to INCLUDEPATH in pro-file.
+ # ---------------------------------------
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis)
+
+ OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject)
+
+
+ OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl)
+
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
+
+ OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost)
+
+ OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus)
+
+ OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility)
+
+ # ---------------------------------------
+ # Definitions to export IBY files to different folders where they will be taken
+ # to ROM image
+ # ---------------------------------------
+
+ defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/app/$$1)
+ }
+ defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/mw/$$1)
+ }
+ defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/os/$$1)
+ }
+ defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/os/$$1)
+ }
+ defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/$$1)
+ }
+
+ # You need to define the following in pro-file, if you are using the stllib:
+ # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+ # DEFINES *= $$STLLIB_USAGE_DEFINES
+ STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
+ STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
+
+ } else { # Old pre-SF structure
+
+ # ---------------------------------------
+ # Location, where the applications layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/applications/$$1)
+ }
+ defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/applications/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the applications layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/applications/$$1)
+ }
+ defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/applications/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/middleware/$$1)
+ }
+ defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/middleware/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/middleware/$$1)
+ }
+ defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/middleware/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/osextensions/$$1)
+ }
+ defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/osextensions/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/osextensions/$$1)
+ }
+ defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/osextensions/$$1)
+ }
+
+ # ---------------------------------------
+ # General comments about the 3 define statements related to include paths:
+ # 1) the /epoc32/include/oem is now defined there for backward compability.
+ # Once the directory is empty, the directory will be removed. However this
+ # enables us to ensure that if you use these define statements => you do
+ # not have to remove the statements later on, when the directory no longer
+ # exists.
+ # 2) These statements should be enough in normal cases. For certain specific
+ # cases you might need to add some specific directory from /epoc32/include
+ # (for instance /epoc32/include/ecom).
+ # In normal cases the include staments in code should be relative to one of
+ # the system include paths, but in certain cases, the included files requires
+ # that the subdirectory is also part of the system include paths.
+ # ---------------------------------------
+
+ # This variable defines the include paths, which are intended to be
+ # used in the pro-files that are part of the applications-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # application-layer components.
+ #
+ # Applications layer is the last one in the list, since most likely the most of
+ # the headers come from middleware or os-layer => thus they are first.
+
+ APP_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/middleware \
+ /epoc32/include/domain/middleware \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/applications \
+ /epoc32/include/domain/applications \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/middleware/loc \
+ /epoc32/include/domain/applications/loc \
+ /epoc32/include/domain/osextensions/loc/sc \
+ /epoc32/include/domain/middleware/loc/sc \
+ /epoc32/include/domain/applications/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the middleware-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # middleware-layer components.
+
+ MW_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/middleware \
+ /epoc32/include/domain/middleware \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/middleware/loc \
+ /epoc32/include/domain/osextensions/loc/sc \
+ /epoc32/include/domain/middleware/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the osextensions-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # os-layer components.
+
+ OS_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/osextensions/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the os-layer. This is intended
+ # to be only used by those components which need to use in their mmp-file either
+ # kern_ext.mmh or nkern_ext.mmh. Reason is that those
+ # 2 files already contain the /epoc32/include as system include path.
+
+ OS_LAYER_KERNEL_SYSTEMINCLUDE = \
+ /epoc32/include/oem \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions
+
+
+ # ---------------------------------------
+ # Definitions that also define the systeminclude paths for various
+ # part of stdapis. Append to INCLUDEPATH in pro-file.
+ # ---------------------------------------
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis)
+
+ OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject)
+
+
+ OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl)
+
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
+
+ OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost)
+
+ OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus)
+
+ OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility)
+
+ # ---------------------------------------
+ # Definitions to export IBY files to different folders where they will be taken
+ # to ROM image
+ # ---------------------------------------
+
+ defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/app/$$1)
+ }
+ defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/mw/$$1)
+ }
+ defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/osext/$$1)
+ }
+ defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/osext/$$1)
+ }
+ defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/$$1)
+ }
+
+ # You need to define the following in pro-file, if you are using the stllib:
+ # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+ # DEFINES *= $$STLLIB_USAGE_DEFINES
+ STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
+ STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
+
+ }
+}
+
+
+
diff --git a/mkspecs/features/symbian/qt.prf b/mkspecs/features/symbian/qt.prf
new file mode 100644
index 0000000000..29b39a58d5
--- /dev/null
+++ b/mkspecs/features/symbian/qt.prf
@@ -0,0 +1,15 @@
+contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL) {
+ CONFIG *= epocallowdlldata
+}
+
+CONFIG += qtmain
+
+load(qt)
+
+contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0xE001E61C) {
+ default_deployment.depends += \
+ "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {\"QtLibs pre-release\"}"
+}
+
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf
new file mode 100644
index 0000000000..b91d783b62
--- /dev/null
+++ b/mkspecs/features/symbian/stl.prf
@@ -0,0 +1,19 @@
+CONFIG -= stl_off
+
+# STL usage in S60 requires the following mmp variables to be uses
+# OPTION CW -wchar_t on
+# MACRO _WCHAR_T_DECLARED
+
+QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+DEFINES *= $$STLLIB_USAGE_DEFINES
+
+# Legacy support requires some hardcoded stdapis paths.
+# Note: Also the new header is used from STL when it is enabled
+INCLUDEPATH += \
+ $${EPOCROOT}epoc32/include/stdapis/stlport \
+ $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+LIBS *= -llibstdcpp.dll
+
+# Remove mkspecs/common/symbian/stl-off from beginning of includepath
+# in order to use new and delete operators from STL
+INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off
diff --git a/mkspecs/features/symbian/stl_off.prf b/mkspecs/features/symbian/stl_off.prf
new file mode 100644
index 0000000000..d5d1c7c30f
--- /dev/null
+++ b/mkspecs/features/symbian/stl_off.prf
@@ -0,0 +1,2 @@
+CONFIG -= stl
+
diff --git a/mkspecs/symbian-abld/qmake.conf b/mkspecs/symbian-abld/qmake.conf
new file mode 100644
index 0000000000..499bf63cd3
--- /dev/null
+++ b/mkspecs/symbian-abld/qmake.conf
@@ -0,0 +1,9 @@
+#
+# qmake configuration for symbian-abld
+#
+# Written for SYMBIAN_ABLD
+#
+
+MAKEFILE_GENERATOR = SYMBIAN_ABLD
+
+include(../common/symbian/symbian.conf)
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
new file mode 100644
index 0000000000..354ce26051
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
@@ -0,0 +1,39 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+SINGLETON:=$(call sanitise,TARGET_$(DEPLOY_TARGET))
+CLEAN_TARGET:=
+
+define qmake_emulator_deployment
+$(ALLTARGET):: $(1)
+FINAL::$(1)
+
+# Prevent duplicate targets from being created
+$(SINGLETON):=1
+
+CLEAN_TARGET:=$(1)
+
+$(1): $(2)
+ $(call startrule,qmake_emulator_deployment) \
+ $(GNUCP) --no-preserve=mode $(2) "$$@" && \
+ $(GNUCHMOD) a+rw "$$@" \
+ $(call endrule,qmake_emulator_deployment)
+endef
+
+ifeq ($($(SINGLETON)),)
+$(eval $(call qmake_emulator_deployment, $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_TARGET)), $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_SOURCE))))
+$(call makepath,$(dir $(DEPLOY_TARGET)))
+$(eval $(call GenerateStandardCleanTarget,$(CLEAN_TARGET),''))
+endif
+
+
+
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm
new file mode 100644
index 0000000000..9dc529f830
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm
@@ -0,0 +1,35 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+SINGLETON:=$(call sanitise,TARGET_$(PREDEP_TARGET))
+
+define qmake_extra_pre_targetdep
+$(ALLTARGET):: $(PREDEP_TARGET)
+EXPORT:: $(PREDEP_TARGET)
+LIBRARY:: $(PREDEP_TARGET)
+TARGET:: $(PREDEP_TARGET)
+
+# Prevent duplicate targets from being created
+$(SINGLETON):=1
+
+$(PREDEP_TARGET): $(DEPS)
+ $(call startrule,qmake_extra_pre_targetdep) \
+ $(COMMAND) \
+ $(call endrule,qmake_extra_pre_targetdep)
+endef
+
+ifeq ($($(SINGLETON)),)
+$(eval $(qmake_extra_pre_targetdep))
+$(eval $(call GenerateStandardCleanTarget,$(PREDEP_TARGET),''))
+endif
+
+
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm
new file mode 100644
index 0000000000..8cbd0a8dbe
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm
@@ -0,0 +1,34 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+POST_LINK_TARGET:=POST_LINK_$(PLATFORM_PATH)_$(CFG_PATH)_$(call sanitise,$(LINK_TARGET))
+POST_LINK_DEP:=$(EPOCROOT)/epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/$(LINK_TARGET)
+
+# Passing $(PLATFORM_PATH) etc. variables in FLM options makes sbsv2 toolchain to double the dollar signs,
+# requiring evaluating them twice in order to get desired values,
+# so do an extra evaluation before using the command.
+define command_fixer
+ THE_COMMAND:=$(POST_LINK_CMD)
+endef
+
+define qmake_post_link
+$(ALLTARGET):: $(POST_LINK_TARGET)
+FINAL:: $(POST_LINK_TARGET)
+
+$(POST_LINK_TARGET): $(POST_LINK_DEP)
+ $(call startrule,qmake_post_link) \
+ $(THE_COMMAND) \
+ $(call endrule,qmake_post_link)
+endef
+
+$(eval $(command_fixer))
+$(eval $(qmake_post_link))
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qt.xml b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
new file mode 100644
index 0000000000..a5ed1411ef
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+-->
+
+<build xmlns="http://symbian.com/xml/build"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://symbian.com/xml/build http://symbian.com/xml/build/1_0.xsd">
+
+ <!-- Extension interfaces : replacements for Template Extension Makefiles -->
+
+ <interface name="qt.qmake_extra_pre_targetdep" extends="Symbian.UserFLM"
+ flm="qmake_extra_pre_targetdep.flm">
+ <param name='PREDEP_TARGET' />
+ <param name='DEPS' default = '' />
+ <param name='COMMAND' default = '' />
+ </interface>
+
+ <interface name="qt.qmake_emulator_deployment" extends="Symbian.UserFLM"
+ flm="qmake_emulator_deployment.flm">
+ <param name='DEPLOY_SOURCE' />
+ <param name='DEPLOY_TARGET' />
+ </interface>
+
+ <interface name="qt.qmake_post_link" extends="Symbian.UserFLM"
+ flm="qmake_post_link.flm">
+ <param name='POST_LINK_CMD' />
+ <param name='LINK_TARGET' />
+ </interface>
+</build>
diff --git a/mkspecs/symbian-sbsv2/qmake.conf b/mkspecs/symbian-sbsv2/qmake.conf
new file mode 100644
index 0000000000..0a5e8782bf
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/qmake.conf
@@ -0,0 +1,9 @@
+#
+# qmake configuration for symbian-sbsv2
+#
+# Written for SYMBIAN_SBSV2
+#
+
+MAKEFILE_GENERATOR = SYMBIAN_SBSV2
+
+include(../common/symbian/symbian.conf)
diff --git a/mkspecs/win32-mwc/qmake.conf b/mkspecs/win32-mwc/qmake.conf
new file mode 100644
index 0000000000..8ebe4ffc8d
--- /dev/null
+++ b/mkspecs/win32-mwc/qmake.conf
@@ -0,0 +1,110 @@
+#
+# qmake configuration for win32-mwc
+#
+# Written for mwc
+#
+
+MAKEFILE_GENERATOR = MINGW
+TEMPLATE = app
+CONFIG += qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target
+QT += core gui
+DEFINES += UNICODE QT_NO_PROCESS QT_NO_SHAREDMEMORY QT_NO_CONCURRENT QT_NO_SYSTEMSEMAPHORE
+QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
+
+QMAKE_EXT_OBJ = .o
+QMAKE_EXT_RES = _res.o
+
+QMAKE_CC = mwccsym2
+QMAKE_LEX = flex
+QMAKE_LEXFLAGS =
+QMAKE_YACC = byacc
+QMAKE_YACCFLAGS = -d
+QMAKE_CFLAGS = -gccinc -stackcommit 1024000 -stackreserve 1024000
+QMAKE_CFLAGS_DEPS = -M
+QMAKE_CFLAGS_WARN_ON = -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl -w nounusedexpr -w nopossible
+QMAKE_CFLAGS_WARN_OFF = -w off
+QMAKE_CFLAGS_RELEASE = -O2
+QMAKE_CFLAGS_DEBUG = -g -O1
+QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+QMAKE_CXX = mwccsym2
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+QMAKE_CXXFLAGS_RTTI_ON = -RTTI on
+QMAKE_CXXFLAGS_RTTI_OFF = -RTTI off
+QMAKE_CXXFLAGS_EXCEPTIONS_ON = "-Cpp_exceptions on"
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = "-Cpp_exceptions off"
+
+QMAKE_INCDIR =
+QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
+QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
+
+QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+QMAKE_LINK = mwldsym2
+#QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+QMAKE_LFLAGS =
+QMAKE_LFLAGS_EXCEPTIONS_ON =
+QMAKE_LFLAGS_EXCEPTIONS_OFF =
+#QMAKE_LFLAGS_RELEASE = -Wl,-s
+QMAKE_LFLAGS_RELEASE =
+QMAKE_LFLAGS_DEBUG =
+#QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
+#QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
+QMAKE_LFLAGS_CONSOLE =
+QMAKE_LFLAGS_WINDOWS =
+QMAKE_LFLAGS_DLL = -runtime dm
+QMAKE_LINK_OBJECT_MAX = 99999999
+QMAKE_LINK_OBJECT_SCRIPT= object_script
+
+
+QMAKE_LIBS =
+QMAKE_LIBS_CORE = -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
+QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
+QMAKE_LIBS_NETWORK = -lws2_32
+QMAKE_LIBS_OPENGL = -lopengl32 -lglu32 -lgdi32 -luser32
+QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
+#QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
+QMAKE_LIBS_QT_ENTRY = -lqtmain
+
+!isEmpty(QMAKE_SH) {
+ MINGW_IN_SHELL = 1
+ QMAKE_DIR_SEP = /
+ QMAKE_COPY = cp
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = mv
+ QMAKE_DEL_FILE = rm
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = test -d
+} else {
+ QMAKE_COPY = copy /y
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = move
+ QMAKE_DEL_FILE = del
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = if not exist
+}
+
+QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
+QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
+QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+
+QMAKE_IDL = midl
+QMAKE_LIB = $$QMAKE_LINK -library -o
+QMAKE_RC = windres
+QMAKE_ZIP = zip -r -9
+
+QMAKE_STRIP = strip
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+load(qt_config)
diff --git a/mkspecs/win32-mwc/qplatformdefs.h b/mkspecs/win32-mwc/qplatformdefs.h
new file mode 100644
index 0000000000..5eee746224
--- /dev/null
+++ b/mkspecs/win32-mwc/qplatformdefs.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+#ifdef UNICODE
+#ifndef _UNICODE
+#define _UNICODE
+#endif
+#endif
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+#include <tchar.h>
+#include <io.h>
+#include <direct.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <limits.h>
+
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
+typedef enum {
+ NameUnknown = 0,
+ NameFullyQualifiedDN = 1,
+ NameSamCompatible = 2,
+ NameDisplay = 3,
+ NameUniqueId = 6,
+ NameCanonical = 7,
+ NameUserPrincipal = 8,
+ NameCanonicalEx = 9,
+ NameServicePrincipal = 10,
+ NameDnsDomain = 12
+} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
+#endif
+
+#define Q_FS_FAT
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_STATBUF struct _stati64 // non-ANSI defs
+#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
+#define QT_STAT _stati64
+#define QT_FSTAT _fstati64
+#else
+#define QT_STATBUF struct _stat // non-ANSI defs
+#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
+#define QT_STAT _stat
+#define QT_FSTAT _fstat
+#endif
+#define QT_STAT_REG _S_IFREG
+#define QT_STAT_DIR _S_IFDIR
+#define QT_STAT_MASK _S_IFMT
+#if defined(_S_IFLNK)
+# define QT_STAT_LNK _S_IFLNK
+#endif
+#define QT_FILENO _fileno
+#define QT_OPEN _open
+#define QT_CLOSE _close
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_LSEEK _lseeki64
+#ifndef UNICODE
+#define QT_TSTAT _stati64
+#else
+#define QT_TSTAT _wstati64
+#endif
+#else
+#define QT_LSEEK _lseek
+#ifndef UNICODE
+#define QT_TSTAT _stat
+#else
+#define QT_TSTAT _wstat
+#endif
+#endif
+#define QT_READ _read
+#define QT_WRITE _write
+#define QT_ACCESS _access
+#define QT_GETCWD _getcwd
+#define QT_CHDIR _chdir
+#define QT_MKDIR _mkdir
+#define QT_RMDIR _rmdir
+#define QT_OPEN_LARGEFILE 0
+#define QT_OPEN_RDONLY _O_RDONLY
+#define QT_OPEN_WRONLY _O_WRONLY
+#define QT_OPEN_RDWR _O_RDWR
+#define QT_OPEN_CREAT _O_CREAT
+#define QT_OPEN_TRUNC _O_TRUNC
+#define QT_OPEN_APPEND _O_APPEND
+#if defined(O_TEXT)
+# define QT_OPEN_TEXT _O_TEXT
+# define QT_OPEN_BINARY _O_BINARY
+#endif
+
+#define QT_FOPEN fopen
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_FSEEK fseeko64
+#define QT_FTELL ftello64
+#else
+#define QT_FSEEK fseek
+#define QT_FTELL ftell
+#endif
+#define QT_FGETPOS fgetpos
+#define QT_FSETPOS fsetpos
+#define QT_FPOS_T fpos_t
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_OFF_T off64_t
+#else
+#define QT_OFF_T long
+#endif
+
+#define QT_SIGNAL_ARGS int
+
+#define QT_VSNPRINTF _vsnprintf
+#define QT_SNPRINTF _snprintf
+
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+
+#define PATH_MAX 1024
+#endif // QPLATFORMDEFS_H
diff --git a/projects.pro b/projects.pro
index 2596c0a00f..424556ee47 100644
--- a/projects.pro
+++ b/projects.pro
@@ -24,6 +24,10 @@ isEmpty(QT_BUILD_PARTS) { #defaults
}
}
+symbian {
+ QT_BUILD_PARTS = libs examples demos
+}
+
#process the projects
for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
isEqual(PROJECT, tools) {
@@ -45,9 +49,9 @@ for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
}
}
-confclean.depends += clean
+!symbian: confclean.depends += clean
confclean.commands =
-unix {
+unix:!symbian {
confclean.commands += (cd config.tests/unix/stl && $(MAKE) distclean); \
(cd config.tests/unix/endian && $(MAKE) distclean); \
(cd config.tests/unix/ipv6 && $(MAKE) distclean); \
@@ -96,6 +100,19 @@ win32 {
-$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
(cd qmake && $(MAKE) distclean)
}
+symbian {
+ confclean.depends += distclean
+ confclean.commands += \
+ (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \
+ (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \
+ (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \
+ -$(DEL_FILE) src\corelib\global\qconfig.h $$escape_expand(\n\t) \
+ -$(DEL_FILE) src\corelib\global\qconfig.cpp $$escape_expand(\n\t) \
+ -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \
+ -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
+ (cd qmake && $(MAKE) distclean)
+
+}
QMAKE_EXTRA_TARGETS += confclean
qmakeclean.commands += (cd qmake && $(MAKE) clean)
QMAKE_EXTRA_TARGETS += qmakeclean
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 7634021dd5..c7f4dc41e2 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -9,7 +9,8 @@ LFLAGS = @QMAKE_LFLAGS@
OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
mingw_make.o option.o winmakefile.o projectgenerator.o \
meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
- borland_bmake.o msvc_dsp.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o
+ borland_bmake.o msvc_dsp.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \
+ symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o
#qt code
QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
@@ -30,7 +31,7 @@ QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
qscriptgrammar.o qscriptlexer.o qscriptclassdata.o \
qscriptparser.o qscriptprettypretty.o qscriptsyntaxchecker.o \
qscriptvalue.o qscriptvalueimpl.o qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o \
+ qscriptvalueiteratorimpl.o qxmlstream.o qxmlutils.o \
qscriptclass.o qscriptclasspropertyiterator.o \
qscriptengineagent.o qscriptcontextinfo.o qscriptstring.o \
$(QTOBJS)
@@ -44,6 +45,8 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
generators/mac/pbuilder_pbx.cpp generators/mac/xmloutput.cpp generators/metamakefile.cpp \
generators/makefiledeps.cpp option.cpp generators/win32/mingw_make.cpp generators/makefile.cpp \
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \
+ generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \
+ generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
@@ -83,16 +86,18 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp \
$(SOURCE_PATH)/src/script/qscriptvalue.cpp $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp \
$(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp \
+ $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp \
+ $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp \
$(SOURCE_PATH)/src/script/qscriptclass.cpp $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp \
$(SOURCE_PATH)/src/script/qscriptengineagent.cpp $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp \
$(SOURCE_PATH)/src/script/qscriptstring.cpp \
$(QTSRCS)
-CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \
+CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
- -I$(SOURCE_PATH)/src/script -DQT_NO_PCRE \
- -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \
+ -I$(SOURCE_PATH)/src/script -I$(BUILD_PATH)/src/corelib/xml \
+ -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \
-DQT_NO_COMPRESS -I$(QMAKESPEC) -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT \
-DQT_NO_GEOM_VARIANT $(OPENSOURCE_CXXFLAGS)
@@ -292,6 +297,18 @@ pbuilder_pbx.o: generators/mac/pbuilder_pbx.cpp
msvc_dsp.o: generators/win32/msvc_dsp.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_dsp.cpp
+symmake.o: generators/symbian/symmake.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: generators/symbian/symmake_abld.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: generators/symbian/symmake_sbsv2.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
projectgenerator.o: generators/projectgenerator.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/projectgenerator.cpp
@@ -394,6 +411,12 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+
qscriptclass.o: $(SOURCE_PATH)/src/script/qscriptclass.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclass.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 39bac815c6..d8b4056795 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -28,11 +28,12 @@ CFLAGS = /Zc:wchar_t-
CFLAGS = -c -Fo$@ \
-W3 -nologo -O2 \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac \
+ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
-I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
-I$(BUILD_PATH)\include\QtScript \
+ -I$(BUILD_PATH)\src\corelib\xml \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \
-DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \
@@ -54,7 +55,7 @@ BCB = $(MAKEDIR)\..
CXX = bcc32
CFLAGS = -c -o$@ \
-tWR -w -w-hid -w-use -O1 \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac \
+ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
-I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
@@ -74,7 +75,8 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw
option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \
makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
borland_bmake.obj msvc_nmake.obj msvc_dsp.obj msvc_vcproj.obj \
- msvc_objectmodel.obj
+ msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \
+ symmake_abld.obj symmake_sbsv2.obj
!IFDEF QMAKE_OPENSOURCE_EDITION
CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
@@ -158,7 +160,9 @@ QTOBJS= \
qscriptvalue.obj \
qscriptvalueimpl.obj \
qscriptvalueiterator.obj \
- qscriptvalueiteratorimpl.obj
+ qscriptvalueiteratorimpl.obj \
+ qxmlstream.obj \
+ qxmlutils.obj
first all: qmake.exe
@@ -225,6 +229,10 @@ clean::
-del msvc_dsp.obj
-del msvc_vcproj.obj
-del msvc_objectmodel.obj
+ -del symmake.obj
+ -del symmake_abld.obj
+ -del symmake_sbsv2.obj
+ -del initprojectdeploy_symbian.obj
-del pbuilder_pbx.obj
-del qnumeric.obj \
-del qscriptasm.obj \
@@ -265,6 +273,8 @@ clean::
-del qscriptvalueimpl.obj \
-del qscriptvalueiterator.obj \
-del qscriptvalueiteratorimpl.obj
+ -del qxmlstream.obj
+ -del qxmlutils.obj
-del vc60.pdb
-del vc70.pdb
-del qmake.pdb
@@ -444,8 +454,21 @@ msvc_vcproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp
+
project.obj: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -589,3 +612,9 @@ qscriptvalueiterator.obj: $(SOURCE_PATH)\src\script\qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.obj: $(SOURCE_PATH)\src\script\qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptvalueiteratorimpl.cpp
+
+qxmlstream.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp
+
+qxmlutils.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 229a456f20..dd65145c71 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -15,14 +15,17 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
+ -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
-I$(BUILD_PATH)/include/QtScript \
+ -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
- -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_BOOTSTRAPPED
CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = -lole32 -luuid
@@ -35,7 +38,8 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
option.o winmakefile.o projectgenerator.o property.o meta.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
- msvc_objectmodel.o
+ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
+ symmake_abld.o symmake_sbsv2.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -119,7 +123,9 @@ QTOBJS= \
qscriptvalue.o \
qscriptvalueimpl.o \
qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
qmake.exe: $(OBJS) $(QTOBJS)
@@ -294,6 +300,18 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -437,3 +455,9 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index 3f1b1df861..646815b69b 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -15,14 +15,17 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
+ -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
-I$(BUILD_PATH)/include/QtScript \
+ -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
- -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_BOOTSTRAPPED
CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = -lole32 -luuid
@@ -35,7 +38,8 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
option.o winmakefile.o projectgenerator.o property.o meta.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
- msvc_objectmodel.o
+ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
+ symmake_abld.o symmake_sbsv2.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -119,7 +123,9 @@ QTOBJS= \
qscriptvalue.o \
qscriptvalueimpl.o \
qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
qmake.exe: $(OBJS) $(QTOBJS)
$(LINKQMAKE)
@@ -293,6 +299,18 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -436,3 +454,9 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/Makefile.win32-mwc b/qmake/Makefile.win32-mwc
new file mode 100644
index 0000000000..08b6c49917
--- /dev/null
+++ b/qmake/Makefile.win32-mwc
@@ -0,0 +1,469 @@
+ifeq "$(SOURCE_PATH)" ""
+SOURCE_PATH = ..
+endif
+
+# cmd version
+
+ifeq "$(BUILD_PATH)" ""
+BUILD_PATH = ..
+endif
+
+
+# specific stuff for Metroworks compiler
+
+CXX = mwccsym2
+CFLAGS = -gccinc \
+ -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl \
+ -w nounusedexpr -w nopossible -c -o $@ -O \
+ -I. -Igenerators -Igenerators\unix \
+ -Igenerators\win32 -Igenerators\mac \
+ -Igenerators\symbian \
+ -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
+ -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
+ -I$(BUILD_PATH)\src\corelib\global \
+ -I$(SOURCE_PATH)\mkspecs\win32-mwc \
+ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
+ -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_NO_LIBRARY -I$(BUILD_PATH)\include\QtScript \
+ -I$(SOURCE_PATH)\corelib\xml -DQT_BOOTSTRAPPED
+
+CXXFLAGS = $(CFLAGS)
+LFLAGS = -heapcommit 1024 -heapreserve 102400
+LIBS = -ladvapi32.lib
+LINKQMAKE = mwccsym2 $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
+ADDCLEAN =
+
+
+# qmake code
+OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
+ option.o winmakefile.o projectgenerator.o property.o meta.o \
+ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
+ borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
+ msvc_objectmodel.o initprojectdeploy_symbian.o qpopen.o \
+ symmake.o symmake_abld.o symmake_sbsv2.o
+
+ifdef QMAKE_OPENSOURCE_EDITION
+CFLAGS += -DQMAKE_OPENSOURCE_EDITION
+endif
+
+# qt code
+QTOBJS= \
+ qbitarray.o \
+ qbuffer.o \
+ qbytearray.o \
+ qcryptographichash.o \
+ qvsnprintf.o \
+ qbytearraymatcher.o \
+ qconfig.o \
+ qdatetime.o \
+ qdir.o \
+ qdiriterator.o \
+ qfile.o \
+ qtemporaryfile.o \
+ qfileinfo.o \
+ qabstractfileengine.o \
+ qfsfileengine.o \
+ qfsfileengine_iterator.o \
+ qfsfileengine_win.o \
+ qfsfileengine_iterator_win.o \
+ qglobal.o \
+ qhash.o \
+ qiodevice.o \
+ qlibraryinfo.o \
+ qlistdata.o \
+ qlinkedlist.o \
+ qlocale.o \
+ qmalloc.o \
+ qmap.o \
+ qregexp.o \
+ qstring.o \
+ qstringlist.o \
+ qtextstream.o \
+ quuid.o \
+ qvector.o \
+ qurl.o \
+ qsettings.o \
+ qsettings_win.o \
+ qvariant.o \
+ qmetatype.o \
+ qnumeric.o \
+ qscriptasm.o \
+ qscriptast.o \
+ qscriptastvisitor.o \
+ qscriptcompiler.o \
+ qscriptecmaarray.o \
+ qscriptecmaboolean.o \
+ qscriptecmacore.o \
+ qscriptecmadate.o \
+ qscriptecmafunction.o \
+ qscriptecmaglobal.o \
+ qscriptecmamath.o \
+ qscriptecmanumber.o \
+ qscriptecmaobject.o \
+ qscriptecmaregexp.o \
+ qscriptecmastring.o \
+ qscriptecmaerror.o \
+ qscriptcontext_p.o \
+ qscriptengine.o \
+ qscriptengine_p.o \
+ qscriptengineagent.o \
+ qscriptextenumeration.o \
+ qscriptextvariant.o \
+ qscriptcontext.o \
+ qscriptcontextinfo.o \
+ qscriptfunction.o \
+ qscriptgrammar.o \
+ qscriptlexer.o \
+ qscriptclassdata.o \
+ qscriptparser.o \
+ qscriptprettypretty.o \
+ qscriptsyntaxchecker.o \
+ qscriptclass.o \
+ qscriptclasspropertyiterator.o \
+ qscriptstring.o \
+ qscriptvalue.o \
+ qscriptvalueimpl.o \
+ qscriptvalueiterator.o \
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
+
+
+qmake.exe: $(OBJS) $(QTOBJS)
+ $(LINKQMAKE)
+ -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe
+
+Makefile: Makefile.win32-mwc
+ @echo "Out of date, please rerun configure"
+
+clean::
+ -del $(OBJS) $(QTOBJS) $(ADDCLEAN)
+
+distclean:: clean
+ -del qmake.exe
+ -del $(BUILD_PATH)\bin\qmake.exe
+
+.c.o:
+ $(CXX) $(CFLAGS) $<
+
+.cpp.o:
+ $(CXX) $(CXXFLAGS) $<
+
+qconfig.o: $(BUILD_PATH)/src/corelib/global/qconfig.cpp
+ $(CXX) $(CXXFLAGS) $(BUILD_PATH)/src/corelib/global/qconfig.cpp
+
+qsettings_win.o: $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
+
+qsettings.o: $(SOURCE_PATH)/src/corelib/io/qsettings.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings.cpp
+
+qvariant.o: $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp
+
+qurl.o: $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+
+qtextstream.o: $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
+
+qdatastream.o: $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
+
+qiodevice.o: $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+
+qlibraryinfo.o: $(SOURCE_PATH)/src/corelib/global/qlibraryinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qlibraryinfo.cpp
+
+qnumeric.o: $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp
+
+qmalloc.o: $(SOURCE_PATH)/src/corelib/global/qmalloc.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qmalloc.cpp
+
+qglobal.o: $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
+
+qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+
+qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+
+qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
+
+qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+
+qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+
+qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
+
+qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+
+quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
+
+qbuffer.o: $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp
+
+qlistdata.o: $(SOURCE_PATH)/src/corelib/tools/qlistdata.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlistdata.cpp
+
+qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+
+qfile.o: $(SOURCE_PATH)/src/corelib/io/qfile.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfile.cpp
+
+qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
+
+qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
+
+qfsfileengine_win.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
+
+qfsfileengine_iterator_win.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_win.cpp
+
+qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
+
+qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
+
+qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+
+qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+
+qvector.o: $(SOURCE_PATH)/src/corelib/tools/qvector.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qvector.cpp
+
+qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
+
+qdir.o: $(SOURCE_PATH)/src/corelib/io/qdir.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdir.cpp
+
+qdiriterator.o: $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp
+
+qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
+
+qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
+
+qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+
+qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+
+qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+
+makefile.o: $(SOURCE_PATH)/qmake/generators/makefile.cpp
+ $(CXX) $(CXXFLAGS) generators/makefile.cpp
+
+unixmake.o: $(SOURCE_PATH)/qmake/generators/unix/unixmake.cpp
+ $(CXX) $(CXXFLAGS) generators/unix/unixmake.cpp
+
+unixmake2.o: $(SOURCE_PATH)/qmake/generators/unix/unixmake2.cpp
+ $(CXX) $(CXXFLAGS) generators/unix/unixmake2.cpp
+
+winmakefile.o: $(SOURCE_PATH)/qmake/generators/win32/winmakefile.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/winmakefile.cpp
+
+borland_bmake.o: $(SOURCE_PATH)/qmake/generators/win32/borland_bmake.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/borland_bmake.cpp
+
+mingw_make.o: $(SOURCE_PATH)/qmake/generators/win32/mingw_make.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/mingw_make.cpp
+
+msvc_nmake.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_nmake.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp
+
+msvc_dsp.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_dsp.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_dsp.cpp
+
+msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp
+
+msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
+qpopen.o: $(SOURCE_PATH)/qmake/qpopen.cpp $(SOURCE_PATH)/qmake/qpopen.h
+ $(CXX) $(CXXFLAGS) qpopen.cpp
+
+project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) project.cpp
+
+meta.o: $(SOURCE_PATH)/qmake/meta.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) meta.cpp
+
+main.o: $(SOURCE_PATH)/qmake/main.cpp $(SOURCE_PATH)/qmake/project.h
+ $(CXX) $(CXXFLAGS) main.cpp
+
+option.o: $(SOURCE_PATH)/qmake/option.cpp $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) option.cpp
+
+property.o: $(SOURCE_PATH)/qmake/property.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) property.cpp
+
+projectgenerator.o: $(SOURCE_PATH)/qmake/generators/projectgenerator.cpp
+ $(CXX) $(CXXFLAGS) generators/projectgenerator.cpp
+
+pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp
+ $(CXX) $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp
+
+makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp
+ $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp
+
+metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp
+ $(CXX) $(CXXFLAGS) generators/metamakefile.cpp
+
+xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp
+ $(CXX) $(CXXFLAGS) generators/xmloutput.cpp
+
+qscriptasm.o: $(SOURCE_PATH)\src\script\qscriptasm.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptasm.cpp
+
+qscriptast.o: $(SOURCE_PATH)\src\script\qscriptast.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptast.cpp
+
+qscriptastvisitor.o: $(SOURCE_PATH)\src\script\qscriptastvisitor.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptastvisitor.cpp
+
+qscriptcompiler.o: $(SOURCE_PATH)\src\script\qscriptcompiler.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptcompiler.cpp
+
+qscriptecmaarray.o: $(SOURCE_PATH)\src\script\qscriptecmaarray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptecmaarray.cpp
+
+qscriptecmaboolean.o: $(SOURCE_PATH)/src/script/qscriptecmaboolean.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaboolean.cpp
+
+qscriptecmacore.o: $(SOURCE_PATH)/src/script/qscriptecmacore.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmacore.cpp
+
+qscriptecmadate.o: $(SOURCE_PATH)/src/script/qscriptecmadate.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmadate.cpp
+
+qscriptecmafunction.o: $(SOURCE_PATH)/src/script/qscriptecmafunction.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmafunction.cpp
+
+qscriptecmaglobal.o: $(SOURCE_PATH)/src/script/qscriptecmaglobal.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaglobal.cpp
+
+qscriptecmamath.o: $(SOURCE_PATH)/src/script/qscriptecmamath.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmamath.cpp
+
+qscriptecmanumber.o: $(SOURCE_PATH)/src/script/qscriptecmanumber.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmanumber.cpp
+
+qscriptecmaobject.o: $(SOURCE_PATH)/src/script/qscriptecmaobject.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaobject.cpp
+
+qscriptecmaregexp.o: $(SOURCE_PATH)/src/script/qscriptecmaregexp.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaregexp.cpp
+
+qscriptecmastring.o: $(SOURCE_PATH)/src/script/qscriptecmastring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmastring.cpp
+
+qscriptecmaerror.o: $(SOURCE_PATH)/src/script/qscriptecmaerror.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaerror.cpp
+
+qscriptcontext_p.o: $(SOURCE_PATH)/src/script/qscriptcontext_p.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontext_p.cpp
+
+qscriptengine.o: $(SOURCE_PATH)/src/script/qscriptengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengine.cpp
+
+qscriptengine_p.o: $(SOURCE_PATH)/src/script/qscriptengine_p.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengine_p.cpp
+
+qscriptengineagent.o: $(SOURCE_PATH)/src/script/qscriptengineagent.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengineagent.cpp
+
+qscriptextenumeration.o: $(SOURCE_PATH)/src/script/qscriptextenumeration.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptextenumeration.cpp
+
+qscriptextvariant.o: $(SOURCE_PATH)/src/script/qscriptextvariant.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptextvariant.cpp
+
+qscriptcontext.o: $(SOURCE_PATH)/src/script/qscriptcontext.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontext.cpp
+
+qscriptcontextinfo.o: $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp
+
+qscriptfunction.o: $(SOURCE_PATH)/src/script/qscriptfunction.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptfunction.cpp
+
+qscriptgrammar.o: $(SOURCE_PATH)/src/script/qscriptgrammar.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptgrammar.cpp
+
+qscriptlexer.o: $(SOURCE_PATH)/src/script/qscriptlexer.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptlexer.cpp
+
+qscriptclassdata.o: $(SOURCE_PATH)/src/script/qscriptclassdata.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclassdata.cpp
+
+qscriptparser.o: $(SOURCE_PATH)/src/script/qscriptparser.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptparser.cpp
+
+qscriptprettypretty.o: $(SOURCE_PATH)/src/script/qscriptprettypretty.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptprettypretty.cpp
+
+qscriptsyntaxchecker.o: $(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp
+
+qscriptclass.o: $(SOURCE_PATH)/src/script/qscriptclass.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclass.cpp
+
+qscriptclasspropertyiterator.o: $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp
+
+qscriptstring.o: $(SOURCE_PATH)/src/script/qscriptstring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptstring.cpp
+
+qscriptvalue.o: $(SOURCE_PATH)/src/script/qscriptvalue.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalue.cpp
+
+qscriptvalueimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp
+
+qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
+
+qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 67e5bfb124..82703c5489 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -275,10 +275,12 @@ MakefileGenerator::initOutPaths()
int slash = path.lastIndexOf(Option::dir_sep);
if(slash != -1) {
path = path.left(slash);
- if(path != "." &&
- !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
- warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
- (*it).toLatin1().constData(), path.toLatin1().constData());
+ // Make out path only if it does not contains makefile variables
+ if(!path.contains("${"))
+ if(path != "." &&
+ !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
+ warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
+ (*it).toLatin1().constData(), path.toLatin1().constData());
}
}
}
@@ -1580,8 +1582,11 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
if(project->values(comp + ".CONFIG").indexOf("moc_verify") != -1) {
if(!file.isNull()) {
QMakeSourceFileInfo::addSourceFile(file, QMakeSourceFileInfo::SEEK_MOCS);
- if(!mocable(file))
+ if(!mocable(file)) {
return false;
+ } else {
+ project->values("MOCABLES").append(file);
+ }
}
} else if(project->values(comp + ".CONFIG").indexOf("function_verify") != -1) {
QString tmp_out = project->values(comp + ".output").first();
@@ -1698,6 +1703,10 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
if(!cmd.isEmpty())
t << "\n\t" << cmd;
t << endl << endl;
+
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ);
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts);
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd;
}
}
@@ -1785,6 +1794,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
tmp_clean = tmp_out;
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
+ if (isForSymbian())
+ t << " 2> NUL"; // Eliminate unnecessary warnings
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@@ -1813,7 +1824,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
if(!cleans.isEmpty())
- t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
+ if (isForSymbian())
+ t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL");
+ else
+ t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
if(!wrote_clean_cmds) {
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input),
@@ -1840,6 +1854,17 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
tmp_out);
dep_cmd = fixEnvVariables(dep_cmd);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if(!read_in)
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1849,6 +1874,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
+#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -1888,15 +1914,28 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if (inputs.isEmpty())
continue;
- QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
+ QString cmd;
+ if (isForSymbianSbsv2()) {
+ // In sbsv2 the command inputs and outputs need to use absolute paths
+ cmd = replaceExtraCompilerVariables(tmp_cmd,
+ fileFixify(escapeFilePaths(inputs), FileFixifyAbsolute),
+ fileFixify(QStringList(tmp_out), FileFixifyAbsolute));
+ } else {
+ cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
+ }
+
t << escapeDependencyPath(tmp_out) << ":";
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out);
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep;
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps;
}
t << "\n\t" << cmd << endl << endl;
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd;
continue;
}
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
@@ -1909,13 +1948,32 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for(int i = 0; i < pre_deps.size(); ++i)
deps += replaceExtraCompilerVariables(pre_deps.at(i), (*input), out);
}
- QString cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
+ QString cmd;
+ if (isForSymbianSbsv2()) {
+ // In sbsv2 the command inputs and outputs need to use absolute paths
+ cmd = replaceExtraCompilerVariables(tmp_cmd,
+ fileFixify((*input), FileFixifyAbsolute),
+ fileFixify(out, FileFixifyAbsolute));
+ } else {
+ cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
+ }
for(QStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
dep_cmd = fixEnvVariables(dep_cmd);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if(!read_in)
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1925,6 +1983,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
+#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -1999,6 +2058,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << escapeDependencyPath(out) << ": " << valList(escapeDependencyPaths(deps)) << "\n\t"
<< cmd << endl << endl;
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out);
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps;
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd;
}
}
t << "compiler_clean: " << clean_targets << endl << endl;
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index cf09a6aca0..9896c1ddb7 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -53,8 +53,12 @@
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN32
+#if defined(Q_CC_MWERKS)
+#include "qpopen.h"
+#else
#define QT_POPEN _popen
#define QT_PCLOSE _pclose
+#endif
#else
#define QT_POPEN popen
#define QT_PCLOSE pclose
@@ -84,6 +88,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
QString build_args(const QString &outdir=QString());
void checkMultipleDefinition(const QString &, const QString &);
+protected:
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
mutable QHash<QString, QStringList> dependsCache;
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 3f60791157..5a7727128d 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -258,8 +258,9 @@ MakefileGenerator
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
+protected:
+
bool init_flag;
-private:
struct Subdir {
Subdir() : makefile(0), indent(0) { }
~Subdir() { delete makefile; }
@@ -373,6 +374,7 @@ SubdirsMetaMakefileGenerator::init()
self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
self->makefile->init();
subs.append(self);
+
return true;
}
@@ -416,6 +418,306 @@ SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
subs.clear();
}
+class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator {
+
+public:
+ SymbianSubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : SubdirsMetaMakefileGenerator(p, n, op) { }
+ virtual ~SymbianSubdirsMetaMakefileGenerator();
+
+ virtual bool init();
+ virtual bool write(const QString &);
+
+protected:
+
+ static QMap<QString, QString> mmpPaths;
+
+ static QMultiMap<QString, QString> mmpDependency;
+
+ static QStringList getDependencyList(QString mmpFilename, int recursionDepth);
+
+ static QStringList calculateRelativePaths(QString mmpParent, QStringList mmpChildren);
+
+private:
+ QString cleanFromSpecialCharacters(QString& str);
+
+};
+
+QMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpPaths;
+
+QMultiMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpDependency;
+
+QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) {
+
+ QStringList list;
+
+ // printf("Entering recursion mmpFilename = %s and depth = %d \n", qPrintable(mmpFilename), recursionDepth);
+
+ QList<QString> values = mmpDependency.values(mmpFilename);
+ if(recursionDepth < 0) {
+ // special case
+ // just first dependency level
+ list = values;
+ return list;
+
+ }
+ if(values.size() == 0) {
+
+ //reached recursion END condition
+ if(recursionDepth == 0) {
+ --recursionDepth;
+ return list; // empty list // no dependencies / return
+ }
+ else {
+ list.append(mmpFilename);
+ recursionDepth--;
+ return list; // leaf // return
+ }
+ } else {
+ recursionDepth++;
+ for (int i = 0; i < values.size(); ++i) {
+ QString current = values.at(i);
+ QStringList tailList = getDependencyList(current, recursionDepth);
+ for(int j = 0; j < tailList.size(); ++j) {
+ //QString path = mmpFilename + tailList.at(j);
+ QString path = tailList.at(j);
+ list.append(path);
+ //printf("MMPDEPENDENCY: %s\n", path.toAscii().data());
+ }// for(int j = 0; j < values.size(); ++j)
+ //list.append(current);
+ } // for (int i = 0; i < values.size(); ++i)
+
+ if(recursionDepth > 0) {
+ //for mmp somewhere in middle
+ list.append(mmpFilename);
+ }
+ recursionDepth--;
+ return list;
+ }
+
+}
+SymbianSubdirsMetaMakefileGenerator::~SymbianSubdirsMetaMakefileGenerator() { }
+
+bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) {
+ return SubdirsMetaMakefileGenerator::write(oldpwd);
+}
+
+QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) {
+ QString tmp = str;
+
+ tmp.replace(QString("/"), QString("_"));
+ tmp.replace(QString("\\"), QString("_"));
+ tmp.replace(QString("-"), QString("_"));
+ tmp.replace(QString(":"), QString("_"));
+ tmp.replace(QString("."), QString("_"));
+
+ return tmp;
+}
+
+bool SymbianSubdirsMetaMakefileGenerator::init() {
+
+ if(init_flag)
+ return false;
+
+ init_flag = true;
+
+ /*
+ Not neccessary as it was
+ causing second pass through
+ subdir elements
+
+ SubdirsMetaMakefileGenerator::init();
+ */
+
+ /*
+ if we are here then we have template = subdirs
+
+ so... go for it ...
+ */
+
+ Option::recursive = true;
+
+ if(Option::recursive) {
+ QString old_output_dir = QDir::cleanPath(Option::output_dir);
+ if(!old_output_dir.endsWith('/'))
+ old_output_dir += '/';
+ QString old_output = Option::output.fileName();
+ QString oldpwd = QDir::cleanPath(qmake_getpwd());
+
+ if(!oldpwd.endsWith('/'))
+ oldpwd += '/';
+
+ // find the parent mmp filename
+ int end = oldpwd.size() - 1;
+ int start = oldpwd.lastIndexOf("/", end - 2);
+ QString parentMmpFilename = oldpwd.mid(start + 1, end - start - 1);
+ parentMmpFilename.prepend(oldpwd);
+ parentMmpFilename = parentMmpFilename.append(".mmp");
+
+
+ const QStringList &subdirs = project->values("SUBDIRS");
+ static int recurseDepth = -1;
+ ++recurseDepth;
+ for(int i = 0; i < subdirs.size(); ++i) {
+ Subdir *sub = new Subdir;
+ sub->indent = recurseDepth;
+
+ QFileInfo subdir(subdirs.at(i));
+ // childMmpFielname should be derived from subdirName
+ QString subdirName = subdirs.at(i);
+ if(!project->isEmpty(subdirs.at(i) + ".file"))
+ subdir = project->first(subdirs.at(i) + ".file");
+ else if(!project->isEmpty(subdirs.at(i) + ".subdir"))
+ subdir = project->first(subdirs.at(i) + ".subdir");
+ QString sub_name;
+
+ QString childMmpFilename;
+
+ if(subdir.isDir()) {
+ subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext);
+ childMmpFilename = subdir.fileName();
+ // TODO: create Option::mmp_ext
+ childMmpFilename = subdir.absoluteFilePath();
+ childMmpFilename.replace(Option::pro_ext, QString(""));
+ childMmpFilename.append(".mmp");
+ }
+ else {
+ childMmpFilename = subdir.absoluteFilePath();
+ childMmpFilename.replace(QString(".pro"), QString(".mmp"));
+ sub_name = childMmpFilename;
+ sub_name.replace(QString(".mmp"), QString(""));
+ sub_name.replace(0, sub_name.lastIndexOf("/") + 1, QString(""));
+ project->values("SHADOW_BLD_INFS").append(QString("bld.inf.") + sub_name);
+ }
+
+ //handle sub project
+ QMakeProject *sub_proj = new QMakeProject(project->properties());
+ for (int ind = 0; ind < sub->indent; ++ind)
+ printf(" ");
+ sub->input_dir = subdir.absolutePath();
+ if(subdir.isRelative() && old_output_dir != oldpwd) {
+ sub->output_dir = old_output_dir + "/" + subdir.path();
+ printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
+ } else { //what about shadow builds?
+ sub->output_dir = sub->input_dir;
+ printf("Reading %s\n", subdir.absoluteFilePath().toLatin1().constData());
+ }
+
+ // find the child mmp filename
+ qmake_setpwd(sub->input_dir);
+
+ QString newpwd = qmake_getpwd();
+
+ Option::output_dir = sub->output_dir;
+ if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/'))
+ Option::output_dir += QLatin1Char('/');
+ sub_proj->read(subdir.fileName());
+ if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
+ fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n",
+ subdir.fileName().toLatin1().constData(),
+ sub_proj->values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
+ delete sub;
+ delete sub_proj;
+ //continue;
+ } else {
+ // map mmpfile to its absolut filepath
+ mmpPaths.insert(childMmpFilename, newpwd);
+
+ // update mmp files dependency map
+ mmpDependency.insert(parentMmpFilename, childMmpFilename);
+
+ sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
+ if(0 && sub->makefile->type() == SUBDIRSMETATYPE) {
+ subs.append(sub);
+ } else {
+ const QString output_name = Option::output.fileName();
+ Option::output.setFileName(sub->output_file);
+ sub->makefile->write(sub->output_dir);
+ delete sub;
+ qmakeClearCaches();
+ sub = 0;
+ Option::output.setFileName(output_name);
+ }
+ }
+
+ Option::output_dir = old_output_dir;
+ qmake_setpwd(oldpwd);
+
+ }
+ --recurseDepth;
+ Option::output.setFileName(old_output);
+ Option::output_dir = old_output_dir;
+ qmake_setpwd(oldpwd);
+ }
+
+ Subdir *self = new Subdir;
+ self->input_dir = qmake_getpwd();
+
+ // to fully expand find all dependencies
+ // do as recursion, then
+ // insert result
+ // as subdirs data in project
+ QString newpwd = qmake_getpwd();
+ if(!newpwd.endsWith('/'))
+ newpwd += '/';
+ int end = newpwd.size() - 1;
+ int start = newpwd.lastIndexOf("/", end - 2);
+ QString mmpFilename = newpwd.mid(start + 1, end - start - 1);
+ mmpFilename.prepend(newpwd);
+ mmpFilename = mmpFilename.append(".mmp");
+
+ // map mmpfile to its absolut filepath
+ mmpPaths.insert(mmpFilename, newpwd);
+
+ QStringList directDependencyList = getDependencyList(mmpFilename, -1);
+ for(int i = 0; i < directDependencyList.size(); ++i) {
+ project->values("MMPFILES_DIRECT_DEPENDS").append(directDependencyList.at(i));
+ }
+
+ QStringList dependencyList = getDependencyList(mmpFilename, 0);
+/*
+ printf("\n \n PRINTING DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data());
+ // print it for debug
+ for(int i = 0; i < dependencyList.size(); ++i) {
+ printf("FINAL MMP DEPENDENCIES: %s\n", dependencyList.at(i).toAscii().data());
+ }
+ printf("\n \n");
+
+ printf("\n \n PRINTING DIRECT DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data());
+ // print it for debug
+ for(int i = 0; i < directDependencyList.size(); ++i) {
+ printf("DIRECT MMP DEPENDENCIES: %s\n", directDependencyList.at(i).toAscii().data());
+ }
+ printf("\n \n");
+*/
+ self->output_dir = Option::output_dir;
+ if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
+ self->output_file = Option::output.fileName();
+ self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
+ self->makefile->init();
+ subs.append(self);
+ return true;
+}
+
+QStringList SymbianSubdirsMetaMakefileGenerator::calculateRelativePaths(QString mmpParent, QStringList mmpChildren) {
+ QStringList mmpRelativePaths;
+ QString parentDir = mmpPaths.value(mmpParent);
+ QDir directory(parentDir);
+ for(int i = 0; i < mmpChildren.size(); ++i) {
+ QString childDir = mmpPaths.value(mmpChildren.at(i));
+ if(mmpChildren.at(i) == mmpParent)
+ mmpRelativePaths.append(mmpChildren.at(i));
+ else {
+ QString relativePath = directory.relativeFilePath(childDir);
+ if(relativePath.startsWith(".."))
+ mmpRelativePaths.append(childDir);
+ else
+ directory.relativeFilePath(relativePath);
+ //mmpRelativePaths.append(directory.relativeFilePath(childDir) + "/" + mmpChildren.at(i));
+ }
+ }
+ return mmpRelativePaths;
+}
+
//Factory things
QT_BEGIN_INCLUDE_NAMESPACE
#include "unixmake.h"
@@ -426,6 +728,8 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "borland_bmake.h"
#include "msvc_dsp.h"
#include "msvc_vcproj.h"
+#include "symmake_abld.h"
+#include "symmake_sbsv2.h"
QT_END_INCLUDE_NAMESPACE
MakefileGenerator *
@@ -462,6 +766,10 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
mkfile = new NmakeMakefileGenerator;
} else if(gen == "BMAKE") {
mkfile = new BorlandMakefileGenerator;
+ } else if(gen == "SYMBIAN_ABLD") {
+ mkfile = new SymbianAbldMakefileGenerator;
+ } else if(gen == "SYMBIAN_SBSV2") {
+ mkfile = new SymbianSbsv2MakefileGenerator;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
}
@@ -478,7 +786,10 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na
MetaMakefileGenerator *ret = 0;
if((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
- if(proj->first("TEMPLATE").endsWith("subdirs"))
+ if(proj->first("MAKEFILE_GENERATOR").startsWith("SYMBIAN") && proj->values("TEMPLATE").contains("subdirs")) {
+ // new metamakefilegenerator type to support subdirs for symbian related projects
+ ret = new SymbianSubdirsMetaMakefileGenerator(proj, name, op);
+ } else if (proj->first("TEMPLATE").endsWith("subdirs"))
ret = new SubdirsMetaMakefileGenerator(proj, name, op);
}
if(!ret)
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
new file mode 100644
index 0000000000..23b2c50331
--- /dev/null
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "initprojectdeploy_symbian.h"
+#include <QDirIterator>
+#include <project.h>
+#include <qdebug.h>
+
+#define PLUGIN_STUB_DIR "qmakepluginstubs"
+
+static bool isPlugin(const QFileInfo& info, const QString& devicePath)
+{
+ // Libraries are plugins if deployment path is something else than
+ // \\sys\\bin or x:\\sys\\bin
+ if (0 == info.suffix().compare(QLatin1String("dll")) &&
+ (devicePath.size() < 8 ||
+ (0 != devicePath.compare(QLatin1String("\\sys\\bin")) &&
+ 0 != devicePath.mid(1).compare(QLatin1String(":\\sys\\bin"))))) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static bool isBinary(const QFileInfo& info)
+{
+ if (0 == info.suffix().compare(QLatin1String("dll")) ||
+ 0 == info.suffix().compare(QLatin1String("exe"))) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static void createPluginStub(const QFileInfo& info,
+ const QString& devicePath,
+ DeploymentList &deploymentList,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles) {
+ QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\"));
+ if (!generatedDirs.contains(PLUGIN_STUB_DIR))
+ generatedDirs << PLUGIN_STUB_DIR;
+ // Plugin stubs must have different name from the actual plugins, because
+ // the toolchain for creating ROM images cannot handle non-binary .dll files properly.
+ QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "\\") + info.completeBaseName() + ".qtplugin");
+ if(stubFile.open(QIODevice::WriteOnly)) {
+ if (!generatedFiles.contains(stubFile.fileName()))
+ generatedFiles << stubFile.fileName();
+ QTextStream t(&stubFile);
+ // Add note to stub so that people will not wonder what it is.
+ // Creation date is added to make new stub to deploy always to
+ // force plugin cache miss when loading plugins.
+ t << "This file is a Qt plugin stub file. The real Qt plugin is located in \\sys\\bin. Created:" << QDateTime::currentDateTime().toString(Qt::ISODate) << "\n";
+ } else {
+ fprintf(stderr, "cannot deploy \"%s\" because of plugin stub file creation failed\n", info.fileName().toLatin1().constData());
+ }
+ QFileInfo stubInfo(stubFile);
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(stubInfo.absoluteFilePath()),
+ Option::fixPathToLocalOS(devicePath + "\\" + stubInfo.fileName())));
+}
+
+void initProjectDeploySymbian(QMakeProject* project,
+ DeploymentList &deploymentList,
+ const QString &testPath,
+ bool deployBinaries,
+ const QString &platform,
+ const QString &build,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles)
+{
+ QString targetPath = project->values("deploy.path").join(" ");
+ if (targetPath.isEmpty())
+ targetPath = testPath;
+ if (targetPath.endsWith("/") || targetPath.endsWith("\\"))
+ targetPath = targetPath.mid(0,targetPath.size()-1);
+
+ bool targetPathHasDriveLetter = false;
+ if (targetPath.size() > 1) {
+ targetPathHasDriveLetter = targetPath.at(1) == QLatin1Char(':');
+ }
+ QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:");
+
+ // foreach item in DEPLOYMENT
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ // get item.path
+ QString devicePath = project->first(item + ".path");
+ if (!deployBinaries
+ && !devicePath.isEmpty()
+ && (0 == devicePath.compare(project->values("APP_RESOURCE_DIR").join(""))
+ || 0 == devicePath.compare(project->values("REG_RESOURCE_IMPORT_DIR").join("")))) {
+ // Do not deploy resources in emulator builds, as that seems to cause conflicts
+ // If there is ever a real need to deploy pre-built resources for emulator,
+ // BLD_INF_RULES.prj_exports can be used as a workaround.
+ continue;
+ }
+
+ bool devicePathHasDriveLetter = false;
+ if (devicePath.size() > 1) {
+ devicePathHasDriveLetter = devicePath.at(1) == QLatin1Char(':');
+ }
+
+ if (devicePath.isEmpty() || devicePath == QLatin1String(".")) {
+ devicePath = targetPath;
+ }
+ // check if item.path is relative (! either / or \)
+ else if (!(devicePath.at(0) == QLatin1Char('/')
+ || devicePath.at(0) == QLatin1Char('\\')
+ || devicePathHasDriveLetter)) {
+ // create output path
+ devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath));
+ } else {
+ if (0 == platform.compare(QLatin1String("winscw"))) {
+ devicePath = epocRoot() + "epoc32\\winscw\\c" + devicePath;
+ } else {
+ // Drive letter needed if targetpath contains one and it is not already in
+ if (targetPathHasDriveLetter && !devicePathHasDriveLetter) {
+ devicePath = deploymentDrive + devicePath;
+ }
+ }
+ }
+
+ devicePath.replace(QLatin1String("/"), QLatin1String("\\"));
+
+ if (!deployBinaries &&
+ 0 == devicePath.right(8).compare(QLatin1String("\\sys\\bin"))) {
+ // Skip deploying to \\sys\\bin for anything but binary deployments
+ // Note: Deploying pre-built binaries also follow this rule, so emulator builds
+ // will not get those deployed. Since there is no way to differentiate currently
+ // between pre-built binaries for emulator and HW anyway, this is not a major issue.
+ continue;
+ }
+
+ // foreach d in item.sources
+ foreach(QString source, project->values(item + ".sources")) {
+ source = Option::fixPathToLocalOS(source);
+ QString nameFilter;
+ QFileInfo info(source);
+ QString searchPath;
+ bool dirSearch = false;
+
+ if (info.isDir()) {
+ nameFilter = QLatin1String("*");
+ searchPath = info.absoluteFilePath();
+ dirSearch = true;
+ } else {
+ if (info.exists() || source.indexOf('*') != -1) {
+ nameFilter = source.split('\\').last();
+ searchPath = info.absolutePath();
+ } else {
+ // Entry was not found. That is ok if it is a binary, since those do not necessarily yet exist.
+ // Dlls need to be processed even when not deploying binaries for the stubs
+ if (isBinary(info)) {
+ if (deployBinaries) {
+ // Executables and libraries are deployed to \sys\bin
+ QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\");
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName()),
+ Option::fixPathToLocalOS(deploymentDrive + QLatin1String("\\sys\\bin\\") + info.fileName())));
+ }
+ if (isPlugin(info, devicePath)) {
+ createPluginStub(info, devicePath, deploymentList, generatedDirs, generatedFiles);
+ continue;
+ }
+ } else {
+ // Generate deployment even if file doesn't exist, as this may be the case
+ // when generating .pkg files.
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()),
+ Option::fixPathToLocalOS(devicePath + "\\" + info.fileName())));
+ continue;
+ }
+ }
+ }
+
+ int pathSize = info.absolutePath().size();
+ QDirIterator iterator(searchPath, QStringList() << nameFilter
+ , QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks
+ , dirSearch ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags );
+ // foreach dirIterator-entry in d
+ while(iterator.hasNext()) {
+ iterator.next();
+ QFileInfo iteratorInfo(iterator.filePath());
+ QString absoluteItemPath = Option::fixPathToLocalOS(iteratorInfo.absolutePath());
+ int diffSize = absoluteItemPath.size() - pathSize;
+
+ if (!iteratorInfo.isDir()) {
+ if (isPlugin(iterator.fileInfo(), devicePath)) {
+ // This deploys pre-built plugins. Other pre-built binaries will deploy normally,
+ // as they have \sys\bin target path.
+ if (deployBinaries) {
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
+ Option::fixPathToLocalOS(deploymentDrive + QLatin1String("\\sys\\bin\\") + iterator.fileName())));
+ }
+ createPluginStub(info, devicePath + "\\" + absoluteItemPath.right(diffSize), deploymentList, generatedDirs, generatedFiles);
+ continue;
+ } else {
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
+ Option::fixPathToLocalOS(devicePath + "\\" + absoluteItemPath.right(diffSize) + "\\" + iterator.fileName())));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
new file mode 100644
index 0000000000..c4adde4315
--- /dev/null
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef INITPROJECTDEPLOYSYMBIAN_H
+#define INITPROJECTDEPLOYSYMBIAN_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdatetime.h>
+#include <option.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <stdlib.h>
+
+struct CopyItem
+{
+ CopyItem(const QString& f, const QString& t) : from(f) , to(t) { }
+ QString from;
+ QString to;
+};
+typedef QList<CopyItem> DeploymentList;
+
+extern void initProjectDeploySymbian(QMakeProject* project,
+ DeploymentList &deploymentList,
+ const QString &testPath,
+ bool deployBinaries,
+ const QString &platform,
+ const QString &build,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles);
+#endif // INITPROJECTDEPLOYSYMBIAN_H \ No newline at end of file
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
new file mode 100644
index 0000000000..5c9ec131b8
--- /dev/null
+++ b/qmake/generators/symbian/symmake.cpp
@@ -0,0 +1,1620 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qhash.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <stdlib.h>
+#include <qdebug.h>
+
+#define RESOURCE_DIRECTORY_MMP "/resource/apps"
+#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
+#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
+#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
+#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"
+#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
+
+#define BLD_INF_RULES_BASE "BLD_INF_RULES."
+#define BLD_INF_TAG_PLATFORMS "prj_platforms"
+#define BLD_INF_TAG_MMPFILES "prj_mmpfiles"
+#define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles"
+#define BLD_INF_TAG_EXTENSIONS "prj_extensions"
+#define RSS_RULES "RSS_RULES"
+#define RSS_RULES_BASE "RSS_RULES."
+#define RSS_TAG_NBROFICONS "number_of_icons"
+#define RSS_TAG_ICONFILE "icon_file"
+
+#define DUMP_VAR(v) \
+{ \
+ QString s(v); \
+ QStringList list = project->values(s); \
+ printf("----------------------------------\n", qPrintable(s)); \
+ printf("Dumping %s (%d items) from %s, %d\n", \
+ qPrintable(s), \
+ list.count(), \
+ __FILE__, \
+ __LINE__); \
+ foreach(QString l, list) \
+ printf("\t%s\n", qPrintable(l)); \
+}
+
+QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir)
+{
+ static QString epocRootStr;
+ if (epocRootStr.isEmpty()) {
+ QFileInfo efi(epocRoot());
+ epocRootStr = efi.canonicalFilePath();
+ if (epocRootStr.isEmpty()) {
+ fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot()));
+ epocRootStr = "/";
+ }
+ if (!epocRootStr.endsWith("/"))
+ epocRootStr += "/";
+
+ epocRootStr += "epoc32/";
+ }
+
+ QString resultPath = origPath;
+
+ // Make it relative, unless it starts with "%epocroot%/epoc32/"
+ if (resultPath.startsWith(epocRootStr, Qt::CaseInsensitive)) {
+ resultPath.replace(epocRootStr, "/epoc32/", Qt::CaseInsensitive);
+ } else {
+ resultPath = parentDir.relativeFilePath(resultPath);
+ }
+ resultPath = QDir::cleanPath(resultPath);
+
+ if (resultPath.isEmpty())
+ resultPath = ".";
+
+ return resultPath;
+}
+
+QString SymbianMakefileGenerator::canonizePath(const QString& origPath)
+{
+ // Since current path gets appended almost always anyway, use it as default
+ // for nonexisting paths.
+ static QString defaultPath;
+ if (defaultPath.isEmpty()) {
+ QFileInfo fi(".");
+ defaultPath = fi.canonicalFilePath();
+ }
+
+ // Prepend epocroot to any paths beginning with "/epoc32/"
+ QString resultPath = QDir::fromNativeSeparators(origPath);
+ if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive))
+ resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1);
+
+ QFileInfo fi(fileInfo(resultPath));
+ if(fi.isDir()) {
+ resultPath = fi.canonicalFilePath();
+ } else {
+ resultPath = fi.canonicalPath();
+ }
+
+ resultPath = QDir::cleanPath(resultPath);
+
+ if (resultPath.isEmpty())
+ resultPath = defaultPath;
+
+ return resultPath;
+}
+
+SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { }
+SymbianMakefileGenerator::~SymbianMakefileGenerator() { }
+
+// check this out
+bool SymbianMakefileGenerator::writeStubMakefile(QTextStream &t) { t; return false; }
+
+void SymbianMakefileGenerator::writeHeader(QTextStream &t) {
+ t << "// ============================================================================" << endl;
+ t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// * Project: " << fileFixify(project->projectFile()) << endl;
+ t << "// * Template: " << var("TEMPLATE") << endl;
+ //if(!project->isActiveConfig("build_pass"))
+ // t << "// = Command: " << build_args().replace("$(QMAKE)",
+ // (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE"))) << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+
+ // defining define for bld.inf
+
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString bldinfDefine = shortProFilename;
+ bldinfDefine.append("_");
+ bldinfDefine.append(generate_uid(project->projectFile()));
+
+ bldinfDefine.prepend("BLD_INF_");
+ removeSpecialCharacters(bldinfDefine);
+
+ t << "#define " << bldinfDefine.toUpper() << endl << endl;
+}
+
+bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) {
+ writeHeader(t);
+
+ QString numberOfIcons;
+ QString iconFile;
+ QStringList userRssRules;
+ readRssRules(numberOfIcons, iconFile, userRssRules);
+
+ // Get the application translations and convert to symbian OS lang code, i.e. decical number
+ QStringList symbianLangCodes = symbianLangCodesFromTsFiles();
+
+ // Generate pkg files if there are any actual files to deploy
+ bool generatePkg = false;
+ if (getTargetExtension() == "exe") {
+ generatePkg = true;
+ } else {
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ if (!project->values(item + ".sources").isEmpty()) {
+ generatePkg = true;
+ break;
+ }
+ }
+ }
+
+ if (generatePkg) {
+ QStringList platformList = project->values("SYMBIAN_PLATFORMS");
+ foreach(QString platform, platformList) {
+ if(platform.compare("WINSCW", Qt::CaseInsensitive)) {
+ generatePkgFile(platform.toLower(), "udeb", iconFile);
+ generatePkgFile(platform.toLower(), "urel", iconFile);
+ }
+ }
+ }
+
+ writeBldInfContent(t, generatePkg);
+
+ // Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile,
+ // but all required data is not yet available.
+ bool isPrimaryMakefile = true;
+ QString wrapperFileName("Makefile");
+ QString outputFileName = fileInfo(Option::output.fileName()).fileName();
+ if (outputFileName != BLD_INF_FILENAME) {
+ wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName);
+ isPrimaryMakefile = false;
+ }
+
+ QFile wrapperMakefile(wrapperFileName);
+ if(wrapperMakefile.open(QIODevice::WriteOnly)) {
+ generatedFiles << wrapperFileName;
+ } else {
+ fprintf(stderr, "Error: Could not open wrapper makefile '%s'\n", qPrintable(wrapperFileName));
+ return false;
+ }
+
+ if (getTargetExtension() == "subdirs") {
+ // If we have something to deploy, generate extension makefile for just that, since
+ // normal extension makefile is not getting generated and we need emulator deployment to be done.
+ if (generatePkg)
+ writeMkFile(wrapperFileName, true);
+ writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
+ return true;
+ }
+
+ writeMkFile(wrapperFileName, false);
+
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString mmpFilename = shortProFilename;
+ mmpFilename.append("_");
+ mmpFilename.append(uid3);
+ mmpFilename.append(".mmp");
+ writeMmpFile(mmpFilename, symbianLangCodes);
+
+ if (getTargetExtension() == "exe") {
+ if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ QString appname = escapeFilePath(fileFixify(project->first("TARGET")));
+ appname = removePathSeparators(appname);
+ writeRegRssFile(appname, userRssRules);
+ writeRssFile(appname, numberOfIcons, iconFile);
+ writeLocFile(appname, symbianLangCodes);
+ }
+ }
+
+ writeCustomDefFile();
+ writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) {
+ QString pkgFilename = QString("%1_%2_%3.%4")
+ .arg(fileInfo(project->projectFile()).completeBaseName())
+ .arg(compiler)
+ .arg(config)
+ .arg("pkg");
+ QFile pkgFile(pkgFilename);
+ if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text))
+ return false;
+
+ generatedFiles << pkgFile.fileName();
+
+ // header info
+ QTextStream t(&pkgFile);
+ t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl;
+ t << "; This file is generated by qmake and should not be modified by the user" << endl;
+ t << ";" << endl << endl;
+
+ // language, (*** hardcoded to english atm)
+ t << "; Language" << endl;
+ t << "&EN" << endl << endl;
+
+ // name of application, UID and version
+ QString applicationName = project->first("TARGET");
+ int last = applicationName.lastIndexOf(QLatin1Char('/'));
+ applicationName = applicationName.mid( last == -1 ? 0 : last+1 );
+
+ QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
+
+ t << "; SIS header: name, uid, version" << endl;
+ t << QString("#{\"%1\"},(%2),%3").arg(applicationName).arg(uid3).arg(applicationVersion) << endl << endl;
+
+ // vendor names (*** hardcoded for now)
+ t << "; Localised Vendor name" << endl;
+ t << "%{\"Nokia, Qt Software\"}" << endl << endl;
+ t << "; Unique Vendor name" << endl;
+ t << ":\"Nokia, Qt Software\"" << endl << endl;
+
+ // Dependencies
+ t << "; Dependencies" << endl;
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ QStringList dependencies = project->values(item + ".depends");
+ foreach(QString dependency, dependencies) {
+ t << dependency << endl;
+ }
+ }
+ t << endl;
+
+ // install paths on the phone *** should be dynamic at some point
+ QString installPathBin = "!:\\sys\\bin";
+ QString installPathResource = "!:\\resource\\apps";
+ QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";
+
+ // find location of builds
+ QString epocReleasePath = QString("%1epoc32/release/%2/%3")
+ .arg(epocRoot())
+ .arg(compiler)
+ .arg(config);
+
+
+ if (getTargetExtension() == "exe") {
+ // deploy .exe file
+ t << "; Executable and default resource files" << endl;
+ QString exeFile = applicationName + ".exe";
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
+ .arg(epocReleasePath)
+ .arg(exeFile)
+ .arg(installPathBin)
+ .arg(exeFile) << endl;
+
+ // deploy rsc & reg_rsc file
+ if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")
+ .arg(epocRoot())
+ .arg(applicationName + ".rsc")
+ .arg(installPathResource)
+ .arg(applicationName + ".rsc") << endl;
+
+ t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"")
+ .arg(epocRoot())
+ .arg(applicationName + "_reg.rsc")
+ .arg(installPathRegResource)
+ .arg(applicationName + "_reg.rsc") << endl;
+
+ QString myIconFile = iconFile;
+ myIconFile = myIconFile.replace("\\\\", "\\");
+
+ if (!iconFile.isEmpty()) {
+ t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
+ .arg(epocRoot())
+ .arg(QString(myIconFile).replace('\\','/'))
+ .arg(myIconFile) << endl << endl;
+ }
+ }
+ }
+
+ // deploy any additional DEPLOYMENT files
+ DeploymentList depList;
+ QString remoteTestPath;
+ remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
+
+ initProjectDeploySymbian( project, depList, remoteTestPath, true, compiler, config, generatedDirs, generatedFiles );
+ if (depList.size())
+ t << "; DEPLOYMENT" << endl;
+ for (int i=0; i<depList.size(); ++i) {
+ t << QString("\"%1\" - \"%2\"")
+ .arg(QString(depList.at(i).from).replace('\\','/'))
+ .arg(depList.at(i).to) << endl;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeCustomDefFile() {
+ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ // Create custom def file for plugin
+ QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
+
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+
+ t << "; ==============================================================================" << endl;
+ t << "; Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "; This file is generated by qmake and should not be modified by the" << endl;
+ t << "; user." << endl;
+ t << "; Name : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl;
+ t << "; Part of : " << project->values("TARGET").join(" ") << endl;
+ t << "; Description : Fixes common plugin symbols to known ordinals" << endl;
+ t << "; Version : " << endl;
+ t << ";" << endl;
+ t << "; ==============================================================================" << "\n" << endl;
+
+ t << endl;
+
+ t << "EXPORTS" << endl;
+ t << "\tqt_plugin_query_verification_data @ 1 NONAME" << endl;
+ t << "\tqt_plugin_instance @ 2 NONAME" << endl;
+ t << endl;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void SymbianMakefileGenerator::init()
+{
+ MakefileGenerator::init();
+/*
+ DUMP_VAR("GENERATED_SOURCES");
+*/
+ // fixing again !!!
+ if(0 != project->values("QMAKE_PLATFORM").size())
+ platform = varGlue("QMAKE_PLATFORM", "", " ", "");
+
+ if(0 == project->values("QMAKESPEC").size())
+ project->values("QMAKESPEC").append(qgetenv("QMAKESPEC"));
+
+ if(!isConfigSetToSymbian())
+ project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS"));
+
+
+ // bld.inf
+ project->values("MAKEFILE") += BLD_INF_FILENAME;
+
+ // .mmp
+ initMmpVariables();
+
+ // UID1
+ uid1 = generateUID1();
+
+ // check TARGET.UID2 and TARGET.UID3 presence
+ if(0 != project->values("TARGET.UID3").size()) {
+ uid3 = project->first("TARGET.UID3");
+ } else {
+ uid3 = generateUID3();
+ }
+
+ // some fix
+ if((project->values("TEMPLATE")).contains("app"))
+ targetType = "exe";
+ else if((project->values("TEMPLATE")).contains("lib")) {
+ // check CONFIG to see if we are to build staticlib or dll
+ if(project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static"))
+ targetType = "staticlib";
+ else if (project->values("CONFIG").contains("plugin"))
+ targetType = "plugin";
+ else // for now it will be default
+ targetType = "dll";
+ }
+ else // fix
+ targetType = "subdirs";
+
+ if(0 != project->values("TARGET.UID2").size()) {
+ uid2 = project->first("TARGET.UID2");
+ } else if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ uid2 = "0x20004C45";
+ } else {
+ if(getTargetExtension() == "exe") {
+ if(project->values("QT").contains("gui", Qt::CaseInsensitive)) {
+ // exe and also gui
+ uid2 = "0x100039CE";
+ } else {
+ // exe but not gui.. uid2 is ignored anyway
+ // set it to 0
+ uid2 = "0";
+ }
+ } else if(getTargetExtension() == "dll" || getTargetExtension() == "lib") {
+ uid2 = "0x1000008d";
+ }
+ }
+
+ uid2 = uid2.trimmed();
+ uid3 = uid3.trimmed();
+
+ // UID is valid as either hex or decimal, so just convert it to number and back to hex
+ // to get proper string for private dir
+ bool conversionOk = false;
+ uint uidNum = uid3.toUInt(&conversionOk, 0);
+
+ if (!conversionOk) {
+ fprintf(stderr, "Error: Invalid UID \"%s\".", uid3.toUtf8().constData());
+ } else {
+ privateDirUid.setNum(uidNum, 16);
+ while (privateDirUid.length() < 8)
+ privateDirUid.insert(0,QLatin1Char('0'));
+ }
+}
+
+QString SymbianMakefileGenerator::getTargetExtension() {
+ QString ret;
+ if(targetType.compare("exe", Qt::CaseInsensitive) == 0 || targetType.compare("app", Qt::CaseInsensitive) == 0) {
+ ret.append("exe");
+ } else if (targetType.compare("staticlib",Qt::CaseInsensitive) == 0) {
+ ret.append("lib");
+ } else if (targetType.compare("dll", Qt::CaseInsensitive) == 0 || targetType.compare("plugin", Qt::CaseInsensitive) == 0) {
+ ret.append("dll");
+ } else if (targetType.compare("subdirs", Qt::CaseInsensitive) == 0) {
+ // just fix
+ ret.append("subdirs");
+ } else {
+ // if nothing said then assume "exe"
+ ret.append("exe");
+ }
+
+ return ret;
+}
+
+bool SymbianMakefileGenerator::isConfigSetToSymbian() {
+ return project->values("CONFIG").contains("symbian", Qt::CaseInsensitive);
+}
+
+QString SymbianMakefileGenerator::generateUID1() {
+ // just for now
+ return QString("");
+}
+
+QString SymbianMakefileGenerator::generateUID2() {
+ // standard stuff; picked form symbian
+ // later meybe read from somewhere
+ return QString("");
+}
+
+QString SymbianMakefileGenerator::generateUID3() {
+
+ QString target = project->first("TARGET");
+ QString currPath = qmake_getpwd();
+ target.prepend("/").prepend(currPath);
+ return generate_test_uid(target);
+
+}
+
+bool SymbianMakefileGenerator::initMmpVariables() {
+ QStringList sysincspaths;
+ QStringList srcincpaths;
+ QStringList srcpaths;
+
+ srcpaths << project->values("SOURCES") << project->values("GENERATED_SOURCES");
+ srcpaths << project->values("UNUSED_SOURCES") << project->values("UI_SOURCES_DIR");
+ srcpaths << project->values("UI_DIR");
+
+ QDir current = QDir::current();
+ QString canonizedCurrent = canonizePath(".");
+
+ for(int j = 0; j < srcpaths.size(); ++j) {
+ QFileInfo fi(fileInfo(srcpaths.at(j)));
+ // Sometimes sources have other than *.c* files (e.g. *.moc); prune them.
+ if (fi.suffix().startsWith("c")) {
+ if(fi.filePath().length() > fi.fileName().length() ) {
+ appendIfnotExist(srcincpaths, fi.path() );
+ sources[canonizePath(fi.path())] += fi.fileName();
+ } else {
+ sources[canonizedCurrent] += fi.fileName();
+ appendIfnotExist(srcincpaths, canonizedCurrent);
+ }
+ }
+ }
+
+ QStringList incpaths;
+ incpaths << project->values("INCLUDEPATH");
+ incpaths << QLibraryInfo::location(QLibraryInfo::HeadersPath);
+ incpaths << project->values("HEADERS");
+ incpaths << srcincpaths;
+ incpaths << project->values("UI_HEADERS_DIR");
+ incpaths << project->values("UI_DIR");
+
+ QString epocPath("epoc32");
+ for(int j = 0; j < incpaths.size(); ++j) {
+ QString includepath = canonizePath(incpaths.at(j));
+ appendIfnotExist(sysincspaths, includepath);
+ if (!includepath.contains(epocPath)) // No temp dirs for epoc includes
+ appendIfnotExist(sysincspaths, includepath + QString("/tmp"));
+ }
+
+ // remove duplicate include path entries
+ // convert to native directory separators
+ // to check if includepaths are same
+ QStringList temporary;
+ for(int i = 0; i < sysincspaths.size(); ++i) {
+ QString origPath = sysincspaths.at(i);
+ QFileInfo origPathInfo(fileInfo(origPath));
+ bool bFound = false;
+
+ for(int j = 0; j < temporary.size(); ++j) {
+ QString tmpPath = temporary.at(j);
+ QFileInfo tmpPathInfo(fileInfo(tmpPath));
+
+ if(origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) {
+ bFound = true;
+ if(!tmpPathInfo.isRelative() && origPathInfo.isRelative()) {
+ // we keep the relative notation
+ temporary.removeOne(tmpPath);
+ temporary << origPath;
+ }
+ }
+ }
+
+ if(!bFound)
+ temporary << origPath;
+
+ }
+
+ sysincspaths.clear();
+ sysincspaths << temporary;
+
+ systeminclude.insert("SYSTEMINCLUDE", sysincspaths);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) {
+
+ QStringList tmpStringList;
+
+ for(int i = 0; i < stringList.size(); ++i) {
+ QString string = stringList.at(i);
+ if(tmpStringList.contains(string))
+ continue;
+ else
+ tmpStringList.append(string);
+ }
+
+ stringList.clear();
+ stringList = tmpStringList;
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t){
+ t << "// ==============================================================================" << endl;
+ t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// This file is generated by qmake and should not be modified by the" << endl;
+ t << "// user." << endl;
+ t << "// Name : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length()-4,4))) << ".mmp" << endl;
+ t << "// ==============================================================================" << endl << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)
+{
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+
+ //printf("WRITING: %s \n", qPrintable(filename));
+
+ QTextStream t(&ft);
+
+ writeMmpFileHeader(t);
+
+ writeMmpFileTargetPart(t);
+
+ writeMmpFileResourcePart(t, symbianLangCodes);
+
+ writeMmpFileMacrosPart(t);
+
+ writeMmpFileIncludePart(t);
+
+ QDir current = QDir::current();
+
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QStringList values = it.value();
+ QString currentSourcePath = it.key();
+
+ if (values.size())
+ t << "SOURCEPATH \t" << fixPathForMmp(currentSourcePath, current) << endl;
+
+ for (int i = 0; i < values.size(); ++i) {
+ QString sourceFileName = values.at(i);
+ t << "SOURCE\t\t" << sourceFileName << endl;
+ }
+ t << endl;
+ }
+ t << endl;
+
+ writeMmpFileLibraryPart(t);
+
+ writeMmpFileCapabilityPart(t);
+
+ writeMmpFileCompilerOptionPart(t);
+
+ writeMmpFileBinaryVersionPart(t);
+
+ writeMmpFileRulesPart(t);
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) {
+
+ t << endl;
+
+ if(isConfigSetToSymbian())
+ return true;
+
+ QStringList &defines = project->values("DEFINES");
+ if (defines.size())
+ t << "// Qt Macros" << endl;
+ for(int i = 0; i < defines.size(); ++i) {
+ QString def = defines.at(i);
+ addMacro(t, def);
+ }
+
+ // These are required in order that all methods will be correctly exported e.g from qtestlib
+ QStringList &exp_defines = project->values("PRL_EXPORT_DEFINES");
+ if (exp_defines.size())
+ t << endl << "// Qt Export Defines" << endl;
+ for(int i = 0; i < exp_defines.size(); ++i) {
+ QString def = exp_defines.at(i);
+ addMacro(t, def);
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) {
+ t << "MACRO" << "\t\t" << value << endl;
+ return true;
+}
+
+
+bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) {
+ if(getTargetExtension() == "exe") {
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDEXE" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "EXE" << endl;
+ } else if (getTargetExtension() == "dll"){
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".dll")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDDLL" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "DLL" << endl;
+ } else if (getTargetExtension() == "lib"){
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".lib")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDLIB" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "LIB" << endl;
+ } else {
+ printf("unexpected target and targettype %s\n", getTargetExtension().toAscii().data());
+ }
+
+ t << endl;
+
+ t << "UID" << "\t\t" << uid2 << " " << uid3 << endl;
+
+ if(0 != project->values("TARGET.SID").size()) {
+ t << "SECUREID" << "\t\t" << project->values("TARGET.SID").join(" ") << endl;
+ } else {
+ if(0 == uid3.size())
+ t << "SECUREID" << "\t\t" << "0" << endl;
+ else
+ t << "SECUREID" << "\t\t" << uid3 << endl;
+ }
+
+ // default value used from mkspecs..qconfig.h is 0
+ if(0 != project->values("TARGET.VID").size()) {
+ t << "VENDORID" << "\t\t" << project->values("TARGET.VID").join(" ") << endl;
+ }
+
+ t << endl;
+
+ if(0 != project->first("TARGET.EPOCSTACKSIZE").size())
+ t << "EPOCSTACKSIZE" << "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl;
+ if(0 != project->values("TARGET.EPOCHEAPSIZE").size())
+ t << "EPOCHEAPSIZE" << "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl;
+ if(0 != project->values("TARGET.EPOCALLOWDLLDATA").size())
+ t << "EPOCALLOWDLLDATA" << endl;
+
+ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ // use custom def file for Qt plugins
+ t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl;
+ }
+
+ t << endl;
+
+ return true;
+}
+
+
+/*
+ Application registration resource files
+ should be installed to the
+
+ \private\10003a3f\import\apps directory.
+*/
+bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) {
+ if((getTargetExtension() == "exe") &&
+ !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ QString target = escapeFilePath(fileFixify(project->first("TARGET")));
+ target = removePathSeparators(target);
+
+ QString locTarget = target;
+ locTarget.append(".rss");
+
+ t << "SOURCEPATH\t\t\t. " << endl;
+ t << "LANG SC "; // no endl
+ foreach(QString lang, symbianLangCodes) {
+ t << lang << " "; // no endl
+ }
+ t << endl;
+ t << "START RESOURCE\t\t" << locTarget << endl;
+ t << "HEADER" << endl;
+ t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP<< endl;
+ t << "END" << endl << endl;
+
+ // now append extension
+ QString regTarget = target;
+ regTarget.append("_reg.rss");
+ // must state SOURCEPATH for resources
+ // relative placement (relative to dir where .mmp located)
+ // absolute placement (!RELATIVE! to EPOCROOT dir)
+
+
+ t << "SOURCEPATH\t\t\t. " << endl;
+ t << "START RESOURCE\t\t" << regTarget << endl;
+ t << "DEPENDS " << target << ".rsg" << endl;
+ t << "\tTARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
+ t << "END" << endl << endl;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) {
+
+ QDir current = QDir::current();
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString handledPath = values.at(i);
+ t << "SYSTEMINCLUDE" << "\t\t" << fixPathForMmp(handledPath, current) << endl;
+ }
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) {
+
+ writeMmpFileSystemIncludePart(t);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) {
+ QStringList &libs = project->values("LIBS");
+ libs << project->values("QMAKE_LIBS");
+
+ removeDuplicatedStrings(libs);
+
+ for(int i = 0; i < libs.size(); ++i) {
+ QString lib = libs.at(i);
+ // The -L flag is uninteresting, since all symbian libraries exist in the
+ // same directory.
+ if(lib.startsWith("-l")) {
+ lib.remove(0,2);
+ QString mmpStatement;
+ if (lib.endsWith(".dll")) {
+ lib.chop(4);
+ mmpStatement = "LIBRARY\t\t";
+ } else if (lib.endsWith(".lib")) {
+ lib.chop(4);
+ mmpStatement = "STATICLIBRARY\t";
+ } else {
+ // Hacky way to find out what kind of library it is. Check the
+ // ARMV5 build directory for library type. We default to shared
+ // library, since that is probably more common.
+ QString udebStaticLibLocation(epocRoot());
+ QString urelStaticLibLocation(udebStaticLibLocation);
+ udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib);
+ urelStaticLibLocation += QString("epoc32/release/armv5/urel/%1.lib").arg(lib);
+ if (QFile::exists(udebStaticLibLocation) || QFile::exists(urelStaticLibLocation)) {
+ mmpStatement = "STATICLIBRARY\t";
+ } else {
+ mmpStatement = "LIBRARY\t\t";
+ }
+ }
+ t << mmpStatement << lib << ".lib" << endl;
+ }
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) {
+ if(0 != project->first("TARGET.CAPABILITY").size()) {
+ QStringList &capabilities = project->values("TARGET.CAPABILITY");
+ t << "CAPABILITY" << "\t\t";
+
+ for(int i = 0; i < capabilities.size(); ++i) {
+ QString cap = capabilities.at(i);
+ t << cap << " ";
+ }
+ }
+ else {
+ t << "CAPABILITY" << "\t\t" << "None";
+ }
+ t << endl << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) {
+ QString cw, armcc;
+
+ if(0 != project->values("QMAKE_CXXFLAGS.CW").size()) {
+ cw.append(project->values("QMAKE_CXXFLAGS.CW").join(" "));
+ cw.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CXXFLAGS.ARMCC").size()) {
+ armcc.append(project->values("QMAKE_CXXFLAGS.ARMCC").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS.CW").size()) {
+ cw.append(project->values("QMAKE_CFLAGS.CW").join(" "));
+ cw.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS.ARMCC").size()) {
+ armcc.append(project->values("QMAKE_CFLAGS.ARMCC").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CXXFLAGS").size()) {
+ cw.append(project->values("QMAKE_CXXFLAGS").join(" "));
+ cw.append(" ");
+ armcc.append(project->values("QMAKE_CXXFLAGS").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS").size()) {
+ cw.append(project->values("QMAKE_CFLAGS").join(" "));
+ cw.append(" ");
+ armcc.append(project->values("QMAKE_CFLAGS").join(" "));
+ armcc.append(" ");
+ }
+
+ if (!cw.isEmpty() && cw[cw.size()-1] == ' ')
+ cw.chop(1);
+ if (!armcc.isEmpty() && armcc[armcc.size()-1] == ' ')
+ armcc.chop(1);
+
+ if (!cw.isEmpty())
+ t << "OPTION" << '\t' << " CW " << cw << endl;
+ if (!armcc.isEmpty())
+ t << "OPTION" << '\t' << " ARMCC "<< armcc << endl;
+ // others to come
+
+ t << endl;
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) {
+ QString applicationVersion = project->first("VERSION");
+ QStringList verNumList = applicationVersion.split('.');
+ uint major = 0;
+ uint minor = 0;
+ uint patch = 0;
+ bool success = false;
+
+ if (verNumList.size() > 0) {
+ major = verNumList[0].toUInt(&success);
+ if (success && verNumList.size() > 1) {
+ minor = verNumList[1].toUInt(&success);
+ if (success && verNumList.size() > 2) {
+ patch = verNumList[2].toUInt(&success);
+ }
+ }
+ }
+
+ QString mmpVersion;
+ if (success && major <= 0xFFFF && minor <= 0xFF && patch <= 0xFF) {
+ // Symbian binary version only has major and minor components, so compress
+ // Qt's minor and patch values into the minor component. Since Symbian's minor
+ // component is a 16 bit value, only allow 8 bits for each to avoid overflow.
+ mmpVersion.append(QString::number(major))
+ .append('.')
+ .append(QString::number((minor << 8) + patch));
+ } else {
+ if (!applicationVersion.isEmpty())
+ fprintf(stderr, "Invalid VERSION string: %s\n", qPrintable(applicationVersion));
+ mmpVersion = "10.0"; // Default binary version for symbian is 10.0
+ }
+
+ t << "VERSION " << mmpVersion << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) {
+ foreach(QString item, project->values("MMP_RULES")) {
+ t << endl;
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (project->values(item).isEmpty()) {
+ t << item << endl;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ t << itemRow << endl;
+ }
+ }
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) {
+ // Read user defined bld inf rules
+ QMap<QString, QStringList> userBldInfRules;
+ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
+ if (it.key().startsWith(BLD_INF_RULES_BASE)) {
+ QString newKey = it.key().mid(sizeof(BLD_INF_RULES_BASE)-1);
+ if (newKey.isEmpty()) {
+ fprintf(stderr, "Warning: Empty BLD_INF_RULES key encountered\n");
+ continue;
+ }
+ QStringList newValues;
+ QStringList values = it.value();
+ foreach(QString item, values) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (project->values(item).isEmpty()) {
+ newValues << item;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ newValues << itemRow;
+ }
+ }
+ }
+ userBldInfRules.insert(newKey, newValues);
+ }
+ }
+
+ // Add includes of subdirs bld.inf files
+
+ QString mmpfilename = escapeFilePath(fileFixify(project->projectFile()));
+ mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf(".")+1, 3, "mmp");
+ QString currentPath = qmake_getpwd();
+
+ if(!currentPath.endsWith(QString("/")))
+ currentPath.append("/");
+
+ QStringList mmpProjects = project->values("MMPFILES_DIRECT_DEPENDS");
+ QStringList shadowProjects = project->values("SHADOW_BLD_INFS");
+
+ removeDuplicatedStrings(mmpProjects);
+ removeDuplicatedStrings(shadowProjects);
+
+ // go in reverse order ... as that is the way how I build the list
+ QListIterator<QString> iT(mmpProjects);
+ iT.toBack();
+ while(iT.hasPrevious()) {
+ QString fullMmpName = iT.previous();
+ QString relativePath;
+ QString bldinfFilename;
+
+ QString fullProFilename = fullMmpName;
+ fullProFilename.replace(QString(".mmp"), QString(".pro"));
+ QString uid = generate_uid(fullProFilename);
+
+ QString cleanMmpName = fullProFilename;
+ cleanMmpName.replace(QString(".pro"), QString(""));
+ cleanMmpName.replace(0, cleanMmpName.lastIndexOf("/") + 1, QString(""));
+
+ if(shadowProjects.contains(BLD_INF_FILENAME "." + cleanMmpName)) { // shadow project
+ QDir directory(currentPath);
+ relativePath = directory.relativeFilePath(fullProFilename);
+ bldinfFilename = BLD_INF_FILENAME "." + cleanMmpName;
+ if(relativePath.contains("/")) {
+ // shadow .pro not in same
+ // directory as parent .pro
+ if(relativePath.startsWith("..")) {
+ // shadow .pro out of parent .pro
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename.prepend("/").prepend(relativePath);
+ } else {
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename.prepend("/").prepend(relativePath);
+ }
+ } else {
+ // shadow .pro and parent .pro in same directory
+ bldinfFilename.prepend("./");
+ }
+ } else { // regular project
+ // calc relative path
+ QDir directory(currentPath);
+ relativePath = directory.relativeFilePath(fullProFilename);
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename = relativePath.append("/").append(BLD_INF_FILENAME);
+ }
+
+ QString bldinfDefine = QString("BLD_INF_") + cleanMmpName + QString("_") + uid;
+ bldinfDefine = bldinfDefine.toUpper();
+ removeSpecialCharacters(bldinfDefine);
+
+ t << "#ifndef " << bldinfDefine << endl;
+ t << "\t#include \"" << QDir::toNativeSeparators(bldinfFilename) << "\"" << endl;
+ t << "#endif // " << bldinfDefine << endl;
+ }
+
+ // Add supported project platforms
+
+ t << endl << BLD_INF_TAG_PLATFORMS << endl << endl;
+ if(0 != project->values("SYMBIAN_PLATFORMS").size())
+ t << project->values("SYMBIAN_PLATFORMS").join(" ") << endl;
+
+ QStringList userItems = userBldInfRules.value(BLD_INF_TAG_PLATFORMS);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(BLD_INF_TAG_PLATFORMS);
+ t << endl;
+
+ // Add project mmps and old style extension makefiles
+ QString mmpTag;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES);
+ else
+ mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
+
+ t << endl << mmpTag << endl << endl;
+
+ writeBldInfMkFilePart(t, addDeploymentExtension);
+ if (getTargetExtension() == "subdirs") {
+ mmpProjects.removeOne(mmpfilename);
+ }
+
+ if(getTargetExtension() != "subdirs") {
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString mmpFilename = shortProFilename + QString("_") + uid3 + QString(".mmp");
+
+ t << mmpFilename << endl;
+ }
+
+ userItems = userBldInfRules.value(mmpTag);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(mmpTag);
+
+ t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl;
+
+ // Generate extension rules
+ writeBldInfExtensionRulesPart(t);
+
+ userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS);
+
+ // Add rest of the user defined content
+
+ for(QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) {
+ t << endl << endl << it.key() << endl << endl;
+ userItems = it.value();
+ foreach(QString item, userItems)
+ t << item << endl;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) {
+ QString filename(appName);
+ filename.append("_reg.rss");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <" << appName << ".rsg>" << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << endl;
+ //t << "#include <data_caging_paths.hrh>" << "\n" << endl;
+ t << "UID2 " << "KUidAppRegistrationResourceFile" << endl;
+ t << "UID3 " << uid3 << endl << endl;
+ t << "RESOURCE APP_REGISTRATION_INFO" << endl;
+ t << "\t{" << endl;
+ t << "\tapp_file=\"" << appName << "\";" << endl;
+ t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << appName << "\";" << endl;
+ t << endl;
+
+ foreach(QString item, userItems)
+ t << "\t" << item << endl;
+ t << "\t}" << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) {
+ QString filename(appName);
+ filename.append(".rss");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << "#include \"" << appName << ".loc\"" << endl;
+ t << endl;
+ t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl;
+ t << "\t{" << endl;
+ t << "\tshort_caption = STRING_r_short_caption;" << endl;
+ t << "\tcaption_and_icon =" << endl;
+ t << "\tCAPTION_AND_ICON_INFO" << endl;
+ t << "\t\t{" << endl;
+ t << "\t\tcaption = STRING_r_caption;" << endl;
+
+ if(numberOfIcons.isEmpty() || iconFile.isEmpty() ) {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = 0;" << endl;
+ t << "\t\ticon_file = \"\";" << endl;
+ }
+ else {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;
+ t << "\t\ticon_file = \"" << iconFile << "\";" << endl;
+ }
+ t << "\t\t};" << endl;
+ t << "\t}" << endl;
+ t << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) {
+ QString filename(appName);
+ filename.append(".loc");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#ifdef LANGUAGE_SC" << endl;
+ //t << "#include \"" << appName << ".l01\"" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ foreach(QString lang, symbianLangCodes) {
+ t << "#elif defined LANGUAGE_" << lang << endl;
+ //t << "#include \"" << appName << ".l" << lang << "\"" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ }
+ t << "#else" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ t << "#endif" << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) {
+ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
+ if (it.key().startsWith(RSS_RULES_BASE)) {
+ QString newKey = it.key().mid(sizeof(RSS_RULES_BASE)-1);
+ if (newKey.isEmpty()) {
+ fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n");
+ continue;
+ }
+ QStringList newValues;
+ QStringList values = it.value();
+ foreach(QString item, values) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (project->values(item).isEmpty()) {
+ newValues << item;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ newValues << itemRow;
+ }
+ }
+ }
+ // Verify thet there is exactly one value in RSS_TAG_NBROFICONS
+ if (newKey == RSS_TAG_NBROFICONS) {
+ if (newValues.count() == 1) {
+ numberOfIcons = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS);
+ continue;
+ }
+ // Verify thet there is exactly one value in RSS_TAG_ICONFILE
+ } else if (newKey == RSS_TAG_ICONFILE) {
+ if (newValues.count() == 1) {
+ iconFile = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_ICONFILE);
+ continue;
+ }
+ } else {
+ fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",
+ RSS_RULES_BASE, newKey.toLatin1().constData());
+ continue;
+ }
+ }
+ }
+
+ foreach(QString item, project->values(RSS_RULES)) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (project->values(item).isEmpty()) {
+ userRssRules << item;
+ } else {
+ userRssRules << project->values(item);
+ }
+ }
+
+ // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist
+ // or neither of them exist
+ if ( !((numberOfIcons.isEmpty() && iconFile.isEmpty()) ||
+ (!numberOfIcons.isEmpty() && !iconFile.isEmpty())) ) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE );
+ }
+
+ // Validate that RSS_TAG_NBROFICONS contains only numbers
+ if( !numberOfIcons.isEmpty() ) {
+ bool ok;
+ numberOfIcons = numberOfIcons.simplified();
+ int tmp = numberOfIcons.toInt(&ok);
+ if (!ok) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS );
+ }
+ }
+}
+
+QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() {
+ QStringList tsfiles;
+ QStringList symbianLangCodes;
+ tsfiles << project->values("TRANSLATIONS");
+
+ fillQt2S60LangMapTable();
+
+ foreach(QString file, tsfiles) {
+ int extIndex = file.lastIndexOf(".");
+ int langIndex = file.lastIndexOf("_", (extIndex - file.length()));
+ langIndex += 1;
+ QString qtlang = file.mid(langIndex, extIndex - langIndex );
+ QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC"));
+
+ if( !symbianLangCodes.contains(s60lang) && s60lang != "SC" )
+ symbianLangCodes += s60lang;
+ }
+
+ return symbianLangCodes;
+}
+
+void SymbianMakefileGenerator::fillQt2S60LangMapTable() {
+ qt2S60LangMapTable.reserve(170); // 165 items at time of writing.
+ qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian //
+ qt2S60LangMapTable.insert("om", "SC"); //Afan //
+ qt2S60LangMapTable.insert("aa", "SC"); //Afar //
+ qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans
+ qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian
+ qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic
+ qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic
+ qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian
+ qt2S60LangMapTable.insert("as", "SC"); //Assamese //
+ qt2S60LangMapTable.insert("ay", "SC"); //Aymara //
+ qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani //
+ qt2S60LangMapTable.insert("ba", "SC"); //Bashkir //
+ qt2S60LangMapTable.insert("eu", "SC"); //Basque //
+ qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali
+ qt2S60LangMapTable.insert("dz", "SC"); //Bhutani //
+ qt2S60LangMapTable.insert("bh", "SC"); //Bihari //
+ qt2S60LangMapTable.insert("bi", "SC"); //Bislama //
+ qt2S60LangMapTable.insert("br", "SC"); //Breton //
+ qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian
+ qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese
+ qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian
+ qt2S60LangMapTable.insert("km", "SC"); //Cambodian //
+ qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan
+ qt2S60LangMapTable.insert("zh", "SC"); //Chinese //
+ qt2S60LangMapTable.insert("co", "SC"); //Corsican //
+ qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian
+ qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech
+ qt2S60LangMapTable.insert("da", "07"); //Danish //Danish
+ qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch
+ qt2S60LangMapTable.insert("en", "01"); //English //English(UK)
+ qt2S60LangMapTable.insert("eo", "SC"); //Esperanto //
+ qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian
+ qt2S60LangMapTable.insert("fo", "SC"); //Faroese //
+ qt2S60LangMapTable.insert("fj", "SC"); //Fiji //
+ qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish
+ qt2S60LangMapTable.insert("fr", "02"); //French //French
+ qt2S60LangMapTable.insert("fy", "SC"); //Frisian //
+ qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic
+ qt2S60LangMapTable.insert("gl", "SC"); //Galician //
+ qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian
+ qt2S60LangMapTable.insert("de", "03"); //German //German
+ qt2S60LangMapTable.insert("el", "54"); //Greek //Greek
+ qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic //
+ qt2S60LangMapTable.insert("gn", "SC"); //Guarani //
+ qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati
+ qt2S60LangMapTable.insert("ha", "SC"); //Hausa //
+ qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew
+ qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi
+ qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian
+ qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic
+ qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian
+ qt2S60LangMapTable.insert("ia", "SC"); //Interlingua //
+ qt2S60LangMapTable.insert("ie", "SC"); //Interlingue //
+ qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut //
+ qt2S60LangMapTable.insert("ik", "SC"); //Inupiak //
+ qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish
+ qt2S60LangMapTable.insert("it", "05"); //Italian //Italian
+ qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese
+ qt2S60LangMapTable.insert("jv", "SC"); //Javanese //
+ qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada
+ qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri //
+ qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh
+ qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda //
+ qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz //
+ qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean
+ qt2S60LangMapTable.insert("ku", "SC"); //Kurdish //
+ qt2S60LangMapTable.insert("rn", "SC"); //Kurundi //
+ qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian
+ qt2S60LangMapTable.insert("la", "SC"); //Latin //
+ qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian
+ qt2S60LangMapTable.insert("ln", "SC"); //Lingala //
+ qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian
+ qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian
+ qt2S60LangMapTable.insert("mg", "SC"); //Malagasy //
+ qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay
+ qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam
+ qt2S60LangMapTable.insert("mt", "SC"); //Maltese //
+ qt2S60LangMapTable.insert("mi", "SC"); //Maori //
+ qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi
+ qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian
+ qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian
+ qt2S60LangMapTable.insert("na", "SC"); //Nauru //
+ qt2S60LangMapTable.insert("ne", "SC"); //Nepali //
+ qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian
+ qt2S60LangMapTable.insert("oc", "SC"); //Occitan //
+ qt2S60LangMapTable.insert("or", "SC"); //Oriya //
+ qt2S60LangMapTable.insert("ps", "SC"); //Pashto //
+ qt2S60LangMapTable.insert("fa", "SC"); //Persian //
+ qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish
+ qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese
+ qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi
+ qt2S60LangMapTable.insert("qu", "SC"); //Quechua //
+ qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance //
+ qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian
+ qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian
+ qt2S60LangMapTable.insert("sm", "SC"); //Samoan //
+ qt2S60LangMapTable.insert("sg", "SC"); //Sangho //
+ qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit //
+ qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian
+ qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian //
+ qt2S60LangMapTable.insert("st", "SC"); //Sesotho //
+ qt2S60LangMapTable.insert("tn", "SC"); //Setswana //
+ qt2S60LangMapTable.insert("sn", "SC"); //Shona //
+ qt2S60LangMapTable.insert("sd", "SC"); //Sindhi //
+ qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese
+ qt2S60LangMapTable.insert("ss", "SC"); //Siswati //
+ qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak
+ qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian
+ qt2S60LangMapTable.insert("so", "81"); //Somali //Somali
+ qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish
+ qt2S60LangMapTable.insert("su", "SC"); //Sundanese //
+ qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili
+ qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish
+ qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog
+ qt2S60LangMapTable.insert("tg", "SC"); //Tajik //
+ qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil
+ qt2S60LangMapTable.insert("tt", "SC"); //Tatar //
+ qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu
+ qt2S60LangMapTable.insert("th", "33"); //Thai //Thai
+ qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan
+ qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya
+ qt2S60LangMapTable.insert("to", "SC"); //Tonga //
+ qt2S60LangMapTable.insert("ts", "SC"); //Tsonga //
+ qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish
+ qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen
+ qt2S60LangMapTable.insert("tw", "SC"); //Twi //
+ qt2S60LangMapTable.insert("ug", "SC"); //Uigur //
+ qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian
+ qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu
+ qt2S60LangMapTable.insert("uz", "SC"); //Uzbek //
+ qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese
+ qt2S60LangMapTable.insert("vo", "SC"); //Volapuk //
+ qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh
+ qt2S60LangMapTable.insert("wo", "SC"); //Wolof //
+ qt2S60LangMapTable.insert("xh", "SC"); //Xhosa //
+ qt2S60LangMapTable.insert("yi", "SC"); //Yiddish //
+ qt2S60LangMapTable.insert("yo", "SC"); //Yoruba //
+ qt2S60LangMapTable.insert("za", "SC"); //Zhuang //
+ qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu
+ qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk
+ qt2S60LangMapTable.insert("bs", "SC"); //Bosnian //
+ qt2S60LangMapTable.insert("dv", "SC"); //Divehi //
+ qt2S60LangMapTable.insert("gv", "SC"); //Manx //
+ qt2S60LangMapTable.insert("kw", "SC"); //Cornish //
+ qt2S60LangMapTable.insert("ak", "SC"); //Akan //
+ qt2S60LangMapTable.insert("kok", "SC"); //Konkani //
+ qt2S60LangMapTable.insert("gaa", "SC"); //Ga //
+ qt2S60LangMapTable.insert("ig", "SC"); //Igbo //
+ qt2S60LangMapTable.insert("kam", "SC"); //Kamba //
+ qt2S60LangMapTable.insert("syr", "SC"); //Syriac //
+ qt2S60LangMapTable.insert("byn", "SC"); //Blin //
+ qt2S60LangMapTable.insert("gez", "SC"); //Geez //
+ qt2S60LangMapTable.insert("kfo", "SC"); //Koro //
+ qt2S60LangMapTable.insert("sid", "SC"); //Sidamo //
+ qt2S60LangMapTable.insert("cch", "SC"); //Atsam //
+ qt2S60LangMapTable.insert("tig", "SC"); //Tigre //
+ qt2S60LangMapTable.insert("kaj", "SC"); //Jju //
+ qt2S60LangMapTable.insert("fur", "SC"); //Friulian //
+ qt2S60LangMapTable.insert("ve", "SC"); //Venda //
+ qt2S60LangMapTable.insert("ee", "SC"); //Ewe //
+ qt2S60LangMapTable.insert("wa", "SC"); //Walamo //
+ qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian //
+ qt2S60LangMapTable.insert("kcg", "SC"); //Tyap //
+ qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
+}
+
+void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value)
+{
+ if(!list.contains(value))
+ list += value;
+}
+
+void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QStringList values)
+{
+ foreach(QString item, values)
+ appendIfnotExist(list, item);
+}
+
+QString SymbianMakefileGenerator::removePathSeparators(QString &file)
+{
+ QString ret = file;
+ while(ret.indexOf(QDir::separator()) > 0) {
+ ret.remove(0, ret.indexOf(QDir::separator())+1);
+ }
+
+ return ret;
+}
+
+
+QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file)
+{
+ QString ret = file;
+ if(ret.endsWith(QDir::separator())) {
+ ret.remove(ret.length()-1,1);
+ }
+
+ return ret;
+}
+
+bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
+ const QStringList& toClean,
+ const QString& cmd,
+ const QString& cmdOptions,
+ const QString& itemPrefix,
+ const QString& itemSuffix) {
+ for (int i = 0; i < toClean.size(); ++i) {
+ QString item = toClean.at(i);
+ item.prepend(itemPrefix).append(itemSuffix);
+#if defined(Q_OS_WIN)
+ t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" ";
+ t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl;
+#else
+ t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then ";
+ t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
+#endif
+ }
+
+ return true;
+}
+
+QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
+ QString tmp = str;
+
+ tmp.replace(QString("/"), QString("_"));
+ tmp.replace(QString("\\"), QString("_"));
+ tmp.replace(QString("-"), QString("_"));
+ tmp.replace(QString(":"), QString("_"));
+ tmp.replace(QString("."), QString("_"));
+
+ return tmp;
+}
+
+void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
+ str.replace(QString("/"), QString("_"));
+ str.replace(QString("\\"), QString("_"));
+ str.replace(QString("-"), QString("_"));
+ str.replace(QString(":"), QString("_"));
+ str.replace(QString("."), QString("_"));
+ str.replace(QString(" "), QString("_"));
+}
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
new file mode 100644
index 0000000000..06732b5453
--- /dev/null
+++ b/qmake/generators/symbian/symmake.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKEFILE_H
+#define SYMMAKEFILE_H
+
+#include <makefile.h>
+
+QT_BEGIN_NAMESPACE
+
+// In the Qt evaluation and educational version, we have a postfix in the
+// library name (e.g. qtmteval301.dll). QTDLL_POSTFIX is used for this.
+// A script modifies these lines when building eval/edu version, so be careful
+// when changing them.
+#ifndef QTDLL_POSTFIX
+#define QTDLL_POSTFIX ""
+#endif
+
+#define BLD_INF_FILENAME "bld.inf"
+#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
+
+class SymbianMakefileGenerator : public MakefileGenerator {
+
+protected:
+
+ QString platform;
+ QString uid1;
+ QString uid2;
+ QString uid3;
+ QString privateDirUid;
+ QString targetType;
+ QMap<QString, QStringList> sources;
+ QMap<QString, QStringList> systeminclude;
+ QMap<QString, QStringList> library;
+ // (output file) (source , command)
+ QMap<QString, QStringList> makmakeCommands;
+
+ QStringList generatedFiles;
+ QStringList generatedDirs;
+ QHash<QString, QString> qt2S60LangMapTable;
+
+ void removeSpecialCharacters(QString& str);
+ QString getWithoutSpecialCharacters(QString& str);
+ QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
+ QString canonizePath(const QString& origPath);
+
+ virtual bool writeStubMakefile(QTextStream &t);
+ virtual bool writeMakefile(QTextStream &t);
+ bool generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile);
+
+ virtual void init();
+
+ QString getTargetExtension();
+ bool isConfigSetToSymbian();
+
+ QString generateUID1();
+ QString generateUID2();
+ QString generateUID3();
+
+ bool initMmpVariables();
+
+ void writeHeader(QTextStream &t);
+ bool writeBldInfContent(QTextStream& t, bool addDeploymentExtension);
+
+ static bool removeDuplicatedStrings(QStringList& stringList);
+
+ bool writeMmpFileHeader(QTextStream &t);
+ bool writeMmpFile(QString &filename, QStringList &symbianLangCodes);
+ bool writeMmpFileMacrosPart(QTextStream& t);
+ bool addMacro(QTextStream& t, const QString& value);
+ bool writeMmpFileTargetPart(QTextStream& t);
+ bool writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes);
+ bool writeMmpFileSystemIncludePart(QTextStream& t);
+ bool writeMmpFileIncludePart(QTextStream& t);
+ bool writeMmpFileLibraryPart(QTextStream& t);
+ bool writeMmpFileCapabilityPart(QTextStream& t);
+ bool writeMmpFileCompilerOptionPart(QTextStream& t);
+ bool writeMmpFileBinaryVersionPart(QTextStream& t);
+ bool writeMmpFileRulesPart(QTextStream& t);
+
+ bool writeRegRssFile(QString &appname, QStringList &useritems);
+ bool writeRssFile(QString &appName, QString &numberOfIcons, QString &iconfile);
+ bool writeLocFile(QString &appName, QStringList &symbianLangCodes);
+ void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
+ QStringList symbianLangCodesFromTsFiles();
+ void fillQt2S60LangMapTable();
+
+ void appendIfnotExist(QStringList &list, QString value);
+ void appendIfnotExist(QStringList &list, QStringList values);
+
+ QString removePathSeparators(QString &file);
+ QString removeTrailingPathSeparators(QString &file);
+ bool generateCleanCommands(QTextStream& t,
+ const QStringList& toClean,
+ const QString& cmd,
+ const QString& cmdOptions,
+ const QString& itemPrefix,
+ const QString& itemSuffix);
+
+
+ bool writeCustomDefFile();
+
+ // Subclass implements
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t) = 0;
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0;
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0;
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0;
+
+public:
+
+ SymbianMakefileGenerator();
+ ~SymbianMakefileGenerator();
+
+};
+
+#endif // SYMMAKEFILE_H
+
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
new file mode 100644
index 0000000000..aee9745bcd
--- /dev/null
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -0,0 +1,436 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake_abld.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <qdebug.h>
+
+#define DO_NOTHING_TARGET "do_nothing"
+#define CREATE_TEMPS_TARGET "create_temps"
+#define EXTENSION_CLEAN "extension_clean"
+#define PRE_TARGETDEPS_TARGET "pre_targetdeps"
+#define COMPILER_CLEAN_TARGET "compiler_clean"
+#define FINALIZE_TARGET "finalize"
+#define GENERATED_SOURCES_TARGET "generated_sources"
+#define ALL_SOURCE_DEPS_TARGET "all_source_deps"
+#define WINSCW_DEPLOYMENT_TARGET "winscw_deployment"
+#define WINSCW_DEPLOYMENT_CLEAN_TARGET "winscw_deployment_clean"
+
+SymbianAbldMakefileGenerator::SymbianAbldMakefileGenerator() : SymbianMakefileGenerator() { }
+SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { }
+
+bool SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
+{
+
+ QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
+ removeSpecialCharacters(gnuMakefileName);
+ gnuMakefileName.append(".mk");
+
+ QFile ft(gnuMakefileName);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << gnuMakefileName << endl;
+ t << "# Part of : " << project->values("TARGET").join(" ") << endl;
+ t << "# Description : This file is used to call necessary targets on wrapper makefile" << endl;
+ t << "# during normal Symbian build process." << endl;
+ t << "# Version : " << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+
+ t << endl << endl;
+
+ t << "MAKE = make" << endl;
+ t << endl;
+
+ t << DO_NOTHING_TARGET " :" << endl;
+ t << "\t" << "@rem " DO_NOTHING_TARGET << endl << endl;
+
+ QString buildDeps;
+ QString cleanDeps;
+ QString finalDeps;
+ QString cleanDepsWinscw;
+ QString finalDepsWinscw;
+ QStringList wrapperTargets;
+ if (deploymentOnly) {
+ buildDeps.append(DO_NOTHING_TARGET);
+ cleanDeps.append(DO_NOTHING_TARGET);
+ cleanDepsWinscw.append( WINSCW_DEPLOYMENT_CLEAN_TARGET);
+ finalDeps.append(DO_NOTHING_TARGET);
+ finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET);
+ wrapperTargets << WINSCW_DEPLOYMENT_TARGET << WINSCW_DEPLOYMENT_CLEAN_TARGET;
+ } else {
+ buildDeps.append(CREATE_TEMPS_TARGET " " PRE_TARGETDEPS_TARGET);
+ cleanDeps.append(EXTENSION_CLEAN);
+ cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET);
+ finalDeps.append(FINALIZE_TARGET);
+ finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET);
+ wrapperTargets << PRE_TARGETDEPS_TARGET
+ << CREATE_TEMPS_TARGET
+ << EXTENSION_CLEAN
+ << FINALIZE_TARGET
+ << WINSCW_DEPLOYMENT_CLEAN_TARGET
+ << WINSCW_DEPLOYMENT_TARGET;
+ }
+
+ t << "MAKMAKE: " << buildDeps << endl << endl;
+ t << "LIB: " << buildDeps << endl << endl;
+ t << "BLD: " << buildDeps << endl << endl;
+ t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
+ t << "CLEAN: " << cleanDepsWinscw << endl;
+ t << "else" << endl;
+ t << "CLEAN: " << cleanDeps << endl;
+ t << "endif" << endl << endl;
+ t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl;
+ t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl;
+ t << "FREEZE: " DO_NOTHING_TARGET << endl << endl;
+ t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl;
+ t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl;
+ t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
+ t << "FINAL: " << finalDepsWinscw << endl;
+ t << "else" << endl;
+ t << "FINAL: " << finalDeps << endl;
+ t << "endif" << endl << endl;
+
+ QString makefile(Option::fixPathToTargetOS(fileInfo(wrapperFileName).canonicalFilePath()));
+ foreach(QString target, wrapperTargets) {
+ t << target << " : " << makefile << endl;
+ t << "\t-$(MAKE) -f \"" << makefile << "\" " << target << endl << endl;
+ }
+
+ t << endl;
+ } // if(ft.open(QIODevice::WriteOnly))
+
+ return true;
+}
+
+void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
+{
+ QStringList allPlatforms;
+ foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
+ allPlatforms << platform.toLower();
+ }
+
+ QStringList debugPlatforms = allPlatforms;
+ QStringList releasePlatforms = allPlatforms;
+ releasePlatforms.removeAll("winscw"); // No release for emulator
+
+ bool isSubdirs = getTargetExtension() == "subdirs";
+
+ QString testClause;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ testClause = QLatin1String(" test");
+ else
+ testClause = QLatin1String("");
+
+ QTextStream t(&wrapperFile);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << wrapperFile.fileName() << endl;
+ t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+ t << endl;
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "XCOPY = xcopy /d /f /h /r /y /i" << endl;
+ t << "ABLD = ABLD.BAT" << endl;
+ t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
+ t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
+ t << "MAKE = make" << endl;
+ t << endl;
+ t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl;
+ t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl;
+ t << "else" << endl;
+ t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl;
+ t << "endif" << endl;
+ t << endl;
+ t << "DEFINES" << '\t' << " = "
+ << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","") << endl;
+
+ t << "INCPATH" << '\t' << " = ";
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << " -I\"" << values.at(i) << "\"";
+ }
+ }
+ t << endl;
+ t << "first: default" << endl;
+ if (debugPlatforms.contains("winscw"))
+ t << "default: debug-winscw";
+ else if (debugPlatforms.contains("armv5"))
+ t << "default: debug-armv5";
+ else if (debugPlatforms.size())
+ t << "default: debug-" << debugPlatforms.first();
+ else
+ t << "default: all";
+
+ t << endl;
+ if (!isPrimaryMakefile) {
+ t << "all:" << endl;
+ } else {
+ t << "all: debug release" << endl;
+ t << endl;
+ t << "qmake:" << endl;
+ t << "\t$(QMAKE) -spec symbian-abld -o \"" << fileInfo(Option::output.fileName()).fileName()
+ << "\" \"" << project->projectFile() << "\"" << endl;
+ t << endl;
+ t << BLD_INF_FILENAME ":" << endl;
+ t << "\t$(QMAKE)" << endl;
+ t << endl;
+ t << "$(ABLD): " BLD_INF_FILENAME << endl;
+ t << "\tbldmake bldfiles" << endl;
+ t << endl;
+
+ t << "debug: $(ABLD)" << endl;
+ foreach(QString item, debugPlatforms) {
+ t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
+ }
+ t << endl;
+ t << "release: $(ABLD)" << endl;
+ foreach(QString item, releasePlatforms) {
+ t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
+ }
+ t << endl;
+
+ // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
+ foreach(QString item, debugPlatforms) {
+ t << "debug-" << item << ": $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
+ }
+
+ foreach(QString item, releasePlatforms) {
+ t << "release-" << item << ": $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
+ }
+
+ t << endl;
+ t << "export: $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " export" << endl;
+ t << endl;
+
+ t << "cleanexport: $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " cleanexport" << endl;
+ t << endl;
+
+ }
+
+ writeExtraTargets(t);
+
+ // pre_targetdeps target depends on:
+ // - all targets specified in PRE_TARGETDEPS
+ // - the GENERATED_SOURCES sources (so that they get generated)
+ // - all dependencies of sources targeted for compilation
+ // (mainly to ensure that any included UNUSED_SOURCES that need to be generated get generated)
+ //
+ // Unfortunately, Symbian build chain doesn't support linking generated objects to target,
+ // so supporting generating sources is the best we can do. This is enough for mocs.
+
+ if (!isSubdirs) {
+ writeExtraCompilerTargets(t);
+
+ t << CREATE_TEMPS_TARGET ":" << endl;
+ // generate command lines like this ...
+ // -@ if NOT EXIST ".\somedir" mkdir ".\somedir"
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << "\t-@ if NOT EXIST \"" << QDir::toNativeSeparators(values.at(i)) << "\\tmp\" mkdir \""
+ << QDir::toNativeSeparators(values.at(i)) << "\\tmp\"" << endl;
+ }
+ }
+ t << endl;
+
+ // Note: EXTENSION_CLEAN will get called many times when doing reallyclean
+ // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
+ t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList dirsToClean = it.value();
+ generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "/tmp");
+ }
+ t << endl;
+
+ t << PRE_TARGETDEPS_TARGET ":"
+ << MAKEFILE_DEPENDENCY_SEPARATOR GENERATED_SOURCES_TARGET
+ << MAKEFILE_DEPENDENCY_SEPARATOR ALL_SOURCE_DEPS_TARGET;
+ if (project->values("PRE_TARGETDEPS").size())
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("PRE_TARGETDEPS").join(MAKEFILE_DEPENDENCY_SEPARATOR);
+ t << endl << endl;
+ t << GENERATED_SOURCES_TARGET ":";
+ if (project->values("GENERATED_SOURCES").size())
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("GENERATED_SOURCES").join(MAKEFILE_DEPENDENCY_SEPARATOR);
+ t << endl << endl;
+ t << ALL_SOURCE_DEPS_TARGET ":";
+
+ QStringList allDeps;
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QString currentSourcePath = it.key();
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ // we need additional check
+ QString sourceFile = currentSourcePath + "/" + values.at(i);
+ QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
+ appendIfnotExist(allDeps, deps);
+ }
+ }
+
+ foreach(QString item, allDeps) {
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << item;
+ }
+ t << endl << endl;
+
+ // Post link operations
+ t << FINALIZE_TARGET ":" << endl;
+ if(!project->isEmpty("QMAKE_POST_LINK")) {
+ t << '\t' << var("QMAKE_POST_LINK");
+ t << endl;
+ }
+ t << endl;
+ }
+
+ writeDeploymentTargets(t);
+
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.canonicalFilePath()) << "\\Makefile\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.canonicalPath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).canonicalFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+ t << "clean: $(ABLD)" << endl;
+ t << "\t-$(ABLD)" << testClause << " reallyclean" << endl;
+ t << "\t-bldmake clean" << endl;
+ t << endl;
+
+ // create execution target
+ if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") {
+ t << "run:" << endl;
+ t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
+ }
+}
+
+bool SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+{
+ // We don't use extensions for anything in abld
+ Q_UNUSED(t);
+ return true;
+}
+
+bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
+{
+ t << WINSCW_DEPLOYMENT_TARGET ":" << endl;
+
+ QString remoteTestPath = epocRoot() + QLatin1String("epoc32\\winscw\\c\\private\\") + privateDirUid; // default 4 OpenC; 4 all Symbian too
+ DeploymentList depList;
+ initProjectDeploySymbian( project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles );
+
+ if (depList.size())
+ t << "\t-echo Deploying changed files..." << endl;
+
+ for (int i=0; i<depList.size(); ++i) {
+ // xcopy prompts for selecting file or directory if target doesn't exist,
+ // and doesn't provide switch to force file selection. It does provide dir forcing, though,
+ // so strip the last part of the destination.
+ t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\")+1) << "\"" << endl;
+ }
+
+ t << endl;
+
+ t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl;
+ QStringList cleanList;
+ for (int i=0; i<depList.size(); ++i) {
+ cleanList.append(depList.at(i).to);
+ }
+ generateCleanCommands(t, cleanList, "$(DEL_FILE)", "", "", "");
+
+ // Note: If deployment creates any directories, they will not get deleted after cleanup.
+ // To do this in robust fashion could be quite complex.
+
+ t << endl;
+
+ return true;
+}
+
+void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
+{
+ // Normally emulator deployment gets done via regular makefile, but since subdirs
+ // do not get that, special deployment only makefile is generated for them if needed.
+ if(getTargetExtension() != "subdirs" || addDeploymentExtension) {
+ QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
+ removeSpecialCharacters(gnuMakefileName);
+ gnuMakefileName.append(".mk");
+ t << "gnumakefile " << gnuMakefileName << endl;
+ }
+}
+
diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h
new file mode 100644
index 0000000000..18cbb9eaa5
--- /dev/null
+++ b/qmake/generators/symbian/symmake_abld.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKE_ABLD_H
+#define SYMMAKE_ABLD_H
+
+#include <symmake.h>
+
+QT_BEGIN_NAMESPACE
+
+class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator {
+
+protected:
+
+ // Inherited from parent
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
+
+ bool writeDeploymentTargets(QTextStream &t);
+
+public:
+
+ SymbianAbldMakefileGenerator();
+ ~SymbianAbldMakefileGenerator();
+
+};
+
+#endif // SYMMAKE_ABLD_H
+
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
new file mode 100644
index 0000000000..5afa83d6ab
--- /dev/null
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -0,0 +1,409 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake_sbsv2.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <qdebug.h>
+
+SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { }
+SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { }
+
+#define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt"
+#define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt"
+
+// Copies Qt FLMs to correct location under epocroot.
+// This is not done by configure as it is possible to change epocroot after configure.
+void SymbianSbsv2MakefileGenerator::exportFlm()
+{
+ static bool flmExportDone = false;
+
+ if (!flmExportDone) {
+ QDir sourceDir = QDir(QLibraryInfo::location(QLibraryInfo::PrefixPath) + FLM_SOURCE_DIR);
+ QFileInfoList sourceInfos = sourceDir.entryInfoList(QDir::Files);
+
+ QDir destDir(epocRoot() + FLM_DEST_DIR);
+ if (!destDir.exists()) {
+ if (destDir.mkpath(destDir.absolutePath()))
+ generatedDirs << destDir.absolutePath();
+ }
+
+ foreach(QFileInfo item, sourceInfos) {
+ QFileInfo destInfo = QFileInfo(destDir.absolutePath() + "/" + item.fileName());
+ if (!destInfo.exists() || destInfo.lastModified() < item.lastModified()) {
+ if (destInfo.exists())
+ QFile::remove(destInfo.absoluteFilePath());
+ if (QFile::copy(item.absoluteFilePath(), destInfo.absoluteFilePath()))
+ generatedFiles << destInfo.absoluteFilePath();
+ else
+ fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", qPrintable(item.absoluteFilePath()), qPrintable(destInfo.absoluteFilePath()));
+ }
+ }
+ flmExportDone = true;
+ }
+}
+
+bool SymbianSbsv2MakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
+{
+ // Can't use extension makefile with sbsv2
+ Q_UNUSED(wrapperFileName);
+ Q_UNUSED(deploymentOnly);
+ return true;
+}
+
+void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
+{
+ QStringList allPlatforms;
+ foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
+ allPlatforms << platform.toLower();
+ }
+
+ QStringList debugPlatforms = allPlatforms;
+ QStringList releasePlatforms = allPlatforms;
+ releasePlatforms.removeAll("winscw"); // No release for emulator
+
+ bool isSubdirs = getTargetExtension() == "subdirs";
+
+ QString testClause;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ testClause = QLatin1String(".test");
+ else
+ testClause = QLatin1String("");
+
+ QTextStream t(&wrapperFile);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << wrapperFile.fileName() << endl;
+ t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+ t << endl;
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
+ t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
+ t << "MAKE = make" << endl;
+ t << "SBS = sbs" << endl;
+ t << endl;
+ t << "DEFINES" << '\t' << " = "
+ << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","") << endl;
+
+ t << "INCPATH" << '\t' << " = ";
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << " -I\"" << values.at(i) << "\" ";
+ }
+ }
+ t << endl;
+ t << "first: default" << endl;
+ if (debugPlatforms.contains("winscw"))
+ t << "default: debug-winscw";
+ else if (debugPlatforms.contains("armv5"))
+ t << "default: debug-armv5";
+ else if (debugPlatforms.size())
+ t << "default: debug-" << debugPlatforms.first();
+ else
+ t << "default: all";
+
+ t << endl;
+ if (!isPrimaryMakefile) {
+ t << "all:" << endl;
+ } else {
+ t << "all: debug release" << endl;
+ t << endl;
+ t << "qmake:" << endl;
+ t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName()
+ << "\" \"" << project->projectFile() << "\"" << endl;
+ t << endl;
+ t << BLD_INF_FILENAME ":" << endl;
+ t << "\t$(QMAKE)" << endl;
+ t << endl;
+
+ t << "debug: " << BLD_INF_FILENAME << endl;
+ foreach(QString item, debugPlatforms) {
+ t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl;
+ }
+ t << endl;
+ t << "release: " << BLD_INF_FILENAME << endl;
+ foreach(QString item, releasePlatforms) {
+ t << "\t$(SBS) -c " << item << "_urel" << testClause << endl;
+ }
+ t << endl;
+
+ // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
+ foreach(QString item, debugPlatforms) {
+ t << "debug-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl;
+ }
+
+ foreach(QString item, releasePlatforms) {
+ t << "release-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) -c " << item << "_urel" << testClause << endl;
+ }
+
+ t << endl;
+ t << "export: " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) export" << endl;
+ t << endl;
+
+ t << "cleanexport: " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) cleanexport" << endl;
+ t << endl;
+
+ }
+
+ // Add all extra targets including extra compiler targest also to wrapper makefile,
+ // even though many of them may have already been added to bld.inf as FLMs.
+ // This is to enable use of targets like 'mocables', which call targets generated by extra compilers.
+ t << extraTargetsCache;
+
+ if (!isSubdirs) {
+ t << extraCompilersCache;
+ }
+
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+ t << "clean: " << BLD_INF_FILENAME << endl;
+ t << "\t-$(SBS) reallyclean" << endl;
+ t << endl;
+
+ // create execution target
+ if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") {
+ t << "run:" << endl;
+ t << "\t-call " << epocRoot() << "epoc32/release/winscw/udeb/" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
+ }
+}
+
+bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+{
+ // Makes sure we have needed FLMs in place.
+ exportFlm();
+
+ // Parse extra compilers data
+ QStringList defines;
+ QStringList incPath;
+
+ defines << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","");
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ incPath << QLatin1String(" -I\"") + values.at(i) + "\"";
+ }
+ }
+
+ // Write extra compilers and targets to initialize QMAKE_ET_* variables
+ // Cache results to avoid duplicate calls when creating wrapper makefile
+ QTextStream extraCompilerStream(&extraCompilersCache);
+ QTextStream extraTargetStream(&extraTargetsCache);
+ writeExtraCompilerTargets(extraCompilerStream);
+ writeExtraTargets(extraTargetStream);
+
+ // Figure out everything the target depends on as we don't want to run extra targets that
+ // are not necessary.
+ QStringList allPreDeps;
+ foreach(QString item, project->values("PRE_TARGETDEPS")) {
+ // Predeps get mangled in windows, so fix them to more sbsv2 friendly format
+#if defined(Q_OS_WIN)
+ if (item.mid(1,1) == ":")
+ item = item.mid(0,1).toUpper().append(item.mid(1)); // Fix drive to uppercase
+#endif
+ item.replace("\\", "/");
+ allPreDeps << escapeDependencyPath(item);
+ }
+
+ foreach (QString item, project->values("GENERATED_SOURCES")) {
+ allPreDeps.append(fileInfo(item).absoluteFilePath());
+ }
+
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QString currentSourcePath = it.key();
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString sourceFile = currentSourcePath + "/" + values.at(i);
+ QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
+ foreach(QString depItem, deps) {
+ appendIfnotExist(allPreDeps, fileInfo(depItem).absoluteFilePath());
+ }
+ }
+ }
+
+ // Write FLM rules for all extra targets and compilers that we depend on to build the target.
+ QStringList extraTargets;
+ extraTargets << project->values("QMAKE_EXTRA_TARGETS") << project->values("QMAKE_EXTRA_COMPILERS");
+ foreach(QString item, extraTargets) {
+ foreach(QString targetItem, project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + item)) {
+ // Make sure targetpath is absolute
+ QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
+ if (allPreDeps.contains(absoluteTarget)) {
+ QStringList deps = project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + item + targetItem);
+ //QString depsItem = project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + item + targetItem).join(" ");
+ QString commandItem = project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + item + targetItem).join(" ");
+
+
+ // Make sure all deps paths are absolute
+ QString absoluteDeps;
+ foreach (QString depItem, deps) {
+ if (!depItem.isEmpty()) {
+ absoluteDeps.append(fileInfo(depItem).absoluteFilePath());
+ absoluteDeps.append(" ");
+ }
+ }
+
+ t << "START EXTENSION qt/qmake_extra_pre_targetdep" << endl;
+ t << "OPTION PREDEP_TARGET " << absoluteTarget << endl;
+ t << "OPTION DEPS " << absoluteDeps << endl;
+ //t << "OPTION DEPS " << depsItem << endl;
+
+ if (commandItem.indexOf("$(INCPATH)") != -1)
+ commandItem.replace("$(INCPATH)", incPath.join(" "));
+ if (commandItem.indexOf("$(DEFINES)") != -1)
+ commandItem.replace("$(DEFINES)", defines.join(" "));
+
+ // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes
+ // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck...
+ commandItem.replace("\\", "/");
+ t << "OPTION COMMAND " << commandItem << endl;
+ t << "END" << endl;
+ }
+ }
+ }
+
+ t << endl;
+
+ // Write winscw deployment rules
+ QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
+ DeploymentList depList;
+ initProjectDeploySymbian( project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles );
+
+ t << "#if defined(WINSCW)" << endl;
+ for (int i=0; i<depList.size(); ++i) {
+ t << "START EXTENSION qt/qmake_emulator_deployment" << endl;
+ QString fromItem = depList.at(i).from;
+ QString toItem = depList.at(i).to;
+ fromItem.replace("\\", "/");
+ toItem.replace("\\", "/");
+#if defined(Q_OS_WIN)
+ toItem.prepend(QDir::current().absolutePath().left(2)); // add drive
+#endif
+ t << "OPTION DEPLOY_SOURCE " << fromItem << endl;
+ t << "OPTION DEPLOY_TARGET " << toItem << endl;
+ t << "END" << endl;
+ }
+ t << "#endif" << endl;
+
+ t << endl;
+
+ // ### TODO: Linux emulator (platsim?) deployment
+
+ // Write post link rules
+ if(!project->isEmpty("QMAKE_POST_LINK")) {
+ t << "START EXTENSION qt/qmake_post_link" << endl;
+ t << "OPTION POST_LINK_CMD " << var("QMAKE_POST_LINK") << endl;
+ t << "OPTION LINK_TARGET " << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".").append(getTargetExtension())) << endl;
+ t << "END" << endl;
+ t << endl;
+ }
+
+ // Application icon generation
+ QStringList icons = project->values("ICON");
+ if (icons.size()) {
+ QString icon = icons.first();
+ if (icons.size() > 1)
+ fprintf(stderr, "Warning: Only first icon specified in ICON variable is used: '%s'.", icon);
+
+ t << "START EXTENSION s60/mifconv" << endl;
+
+ QFileInfo iconInfo = fileInfo(icon);
+ QString iconPath = iconInfo.path();
+ QString iconFile = iconInfo.baseName();
+
+ t << "OPTION SOURCES -c32 " << iconFile << endl;
+ t << "OPTION SOURCEDIR " << iconPath << endl;
+ t << "OPTION TARGETFILE " << uid3 << ".mif" << endl;
+ t << "OPTION SVGENCODINGVERSION 3" << endl; // Compatibility with S60 3.1 devices and up
+ t << "END" << endl;
+ }
+
+ t << endl;
+
+ return true;
+}
+
+void SymbianSbsv2MakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
+{
+ // We don't generate extension makefile in sbsb2
+ Q_UNUSED(t);
+ Q_UNUSED(addDeploymentExtension);
+}
+
diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h
new file mode 100644
index 0000000000..8f6183abbd
--- /dev/null
+++ b/qmake/generators/symbian/symmake_sbsv2.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKE_SBSV2_H
+#define SYMMAKE_SBSV2_H
+
+#include <symmake.h>
+
+QT_BEGIN_NAMESPACE
+
+class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator {
+
+protected:
+
+ // Inherited from parent
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
+
+public:
+
+ SymbianSbsv2MakefileGenerator();
+ ~SymbianSbsv2MakefileGenerator();
+
+private:
+ void exportFlm();
+
+ QString extraTargetsCache;
+ QString extraCompilersCache;
+};
+
+#endif // SYMMAKE_SBSV2_H
+
diff --git a/qmake/generators/win32/msvc_dsp.cpp b/qmake/generators/win32/msvc_dsp.cpp
index 17a5154f6a..0fc309e8f0 100644
--- a/qmake/generators/win32/msvc_dsp.cpp
+++ b/qmake/generators/win32/msvc_dsp.cpp
@@ -1123,6 +1123,20 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
fileOut);
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(config->canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty())
+ step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1135,6 +1149,7 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
if(!indeps.isEmpty())
step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
+#endif
}
}
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index c1f5ce133d..6e36c47fce 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2215,6 +2215,26 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
Option::fixPathToLocalOS(inFile, true, false),
out);
if(Project->canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty()) {
+ QStringList extradeps = indeps.split(QLatin1Char('\n'));
+ for (int i = 0; i < extradeps.count(); ++i) {
+ QString dd = extradeps.at(i).simplified();
+ if (!dd.isEmpty())
+ deps += Project->fileFixify(dd);
+ }
+ }
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -2233,6 +2253,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
}
}
+#endif
}
}
for (int i = 0; i < deps.count(); ++i)
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 8901289186..bbbb02787e 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1448,6 +1448,20 @@ void VcprojGenerator::initResourceFiles()
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty())
+ deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1460,6 +1474,7 @@ void VcprojGenerator::initResourceFiles()
if(!indeps.isEmpty())
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
+#endif
}
}
vcProject.ResourceFiles.addFiles(deps);
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 00bb2f0c8b..7cd4c0803d 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -52,6 +52,8 @@
#include <qtextstream.h>
#include <qstack.h>
#include <qhash.h>
+#include <qxmlstream.h>
+#include <qsettings.h>
#include <qdebug.h>
#ifdef Q_OS_UNIX
#include <unistd.h>
@@ -63,8 +65,12 @@
#include <stdlib.h>
#ifdef Q_OS_WIN32
+#if defined(Q_CC_MWERKS)
+#include "qpopen.h"
+#else
#define QT_POPEN _popen
#define QT_PCLOSE _pclose
+#endif
#else
#define QT_POPEN popen
#define QT_PCLOSE pclose
@@ -76,7 +82,8 @@ QT_BEGIN_NAMESPACE
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_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE,
+ E_GENERATE_TEST_UID, E_SIZE };
QMap<QString, ExpandFunc> qmake_expandFunctions()
{
static QMap<QString, ExpandFunc> *qmake_expand_functions = 0;
@@ -107,6 +114,8 @@ QMap<QString, ExpandFunc> qmake_expandFunctions()
qmake_expand_functions->insert("files", E_FILES);
qmake_expand_functions->insert("prompt", E_PROMPT);
qmake_expand_functions->insert("replace", E_REPLACE);
+ qmake_expand_functions->insert("generate_test_uid", E_GENERATE_TEST_UID);
+ qmake_expand_functions->insert("size", E_SIZE);
}
return *qmake_expand_functions;
}
@@ -596,6 +605,69 @@ static void qmake_error_msg(const QString &msg)
msg.toLatin1().constData());
}
+enum isForSymbian_enum
+{
+ isForSymbian_NOT_SET = -1,
+ isForSymbian_FALSE = 0,
+ isForSymbian_ABLD = 1,
+ isForSymbian_SBSV2 = 2,
+};
+
+static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;
+
+// Checking for symbian build is primarily determined from the qmake spec,
+// but if that is not specified, detect if symbian is the default spec
+// by checking the MAKEFILE_GENERATOR variable value.
+static void init_isForSymbian(const QMap<QString, QStringList>& vars)
+{
+ if (isForSymbian_value != isForSymbian_NOT_SET)
+ return;
+
+ QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();
+ if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {
+ isForSymbian_value = isForSymbian_ABLD;
+ return;
+ }
+ if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
+ isForSymbian_value = isForSymbian_SBSV2;
+ return;
+ }
+
+ QStringList generatorList = vars["MAKEFILE_GENERATOR"];
+
+ if (!generatorList.isEmpty()) {
+ QString generator = generatorList.first();
+ if (generator.startsWith("SYMBIAN_ABLD"))
+ isForSymbian_value = isForSymbian_ABLD;
+ else if (generator.startsWith("SYMBIAN_SBSV2"))
+ isForSymbian_value = isForSymbian_SBSV2;
+ else
+ isForSymbian_value = isForSymbian_FALSE;
+ } else {
+ isForSymbian_value = isForSymbian_FALSE;
+ }
+}
+
+bool isForSymbian()
+{
+ // If isForSymbian_value has not been initialized explicitly yet,
+ // call initializer with dummy map to check qmake spec.
+ if (isForSymbian_value == isForSymbian_NOT_SET)
+ init_isForSymbian(QMap<QString, QStringList>());
+
+ return (isForSymbian_value == isForSymbian_ABLD || isForSymbian_value == isForSymbian_SBSV2);
+}
+
+bool isForSymbianSbsv2()
+{
+ // If isForSymbian_value has not been initialized explicitly yet,
+ // call initializer with dummy map to check qmake spec.
+ if (isForSymbian_value == isForSymbian_NOT_SET)
+ init_isForSymbian(QMap<QString, QStringList>());
+
+ return (isForSymbian_value == isForSymbian_SBSV2);
+}
+
/*
1) environment variable QMAKEFEATURES (as separated by colons)
2) property variable QMAKEFEATURES (as separated by colons)
@@ -622,11 +694,21 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
concat << base_concat + QDir::separator() + "unix";
break;
case Option::TARG_UNIX_MODE:
- concat << base_concat + QDir::separator() + "unix";
- break;
+ {
+ if (isForSymbian())
+ concat << base_concat + QDir::separator() + "symbian";
+ else
+ concat << base_concat + QDir::separator() + "unix";
+ break;
+ }
case Option::TARG_WIN_MODE:
- concat << base_concat + QDir::separator() + "win32";
- break;
+ {
+ if (isForSymbian())
+ concat << base_concat + QDir::separator() + "symbian";
+ else
+ concat << base_concat + QDir::separator() + "win32";
+ break;
+ }
case Option::TARG_MAC9_MODE:
concat << base_concat + QDir::separator() + "mac";
concat << base_concat + QDir::separator() + "mac9";
@@ -1483,6 +1565,9 @@ QMakeProject::read(uchar cmd)
fprintf(stderr, "Failure to read QMAKESPEC conf file %s.\n", spec.toLatin1().constData());
return false;
}
+
+ init_isForSymbian(base_vars);
+
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) {
debug_msg(1, "QMAKECACHE file: reading %s", Option::mkfile::cachefile.toLatin1().constData());
read(Option::mkfile::cachefile, base_vars);
@@ -1617,25 +1702,34 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString
else if(x == "false")
return false;
+ static QString spec;
+ if(spec.isEmpty())
+ spec = QFileInfo(Option::mkfile::qmakespec).fileName();
+
+ // Symbian is an exception to how scopes are resolved. Since we do not
+ // have a separate target mode for Symbian, but we expect the scope to resolve
+ // on other platforms we base it entirely on the mkspec. This means that
+ // using a mkspec starting with 'symbian*' will resolve both the 'symbian'
+ // and the 'unix' (because of Open C) scopes to true.
+ if(isForSymbian() && (x == "symbian" || x == "unix"))
+ return true;
+
//mkspecs
if((Option::target_mode == Option::TARG_MACX_MODE || Option::target_mode == Option::TARG_QNX6_MODE ||
Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_MACX_MODE && x == "macx")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_QNX6_MODE && x == "qnx6")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_MAC9_MODE && x == "mac9")
- return true;
+ return !isForSymbian();
else if((Option::target_mode == Option::TARG_MAC9_MODE || Option::target_mode == Option::TARG_MACX_MODE) &&
x == "mac")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_WIN_MODE && x == "win32")
- return true;
+ return !isForSymbian();
QRegExp re(x, Qt::CaseSensitive, QRegExp::Wildcard);
- static QString spec;
- if(spec.isEmpty())
- spec = QFileInfo(Option::mkfile::qmakespec).fileName();
if((regex && re.exactMatch(spec)) || (!regex && spec == x))
return true;
#ifdef Q_OS_UNIX
@@ -1726,6 +1820,7 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL
if(file.indexOf(Option::dir_sep) == -1 || !QFile::exists(file)) {
static QStringList *feature_roots = 0;
if(!feature_roots) {
+ init_isForSymbian(base_vars);
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots);
}
@@ -2166,11 +2261,33 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
} else {
QMakeProjectEnv env(place);
char buff[256];
- FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
bool singleLine = true;
if(args.count() > 1)
singleLine = (args[1].toLower() == "true");
QString output;
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( !procPipe.init(args[0].toLatin1(), "r") ) {
+ fprintf(stderr, "%s:%d system(%s) failed.\n",
+ parser.file.toLatin1().constData(),
+ parser.line_no,
+ qPrintable(args[0]));
+ }
+
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ for(int i = 0; i < read_in; ++i) {
+ if((singleLine && buff[i] == '\n') || buff[i] == '\t')
+ buff[i] = ' ';
+ }
+ buff[read_in] = '\0';
+ output += buff;
+ }
+ ret += split_value_list(output);
+#else
+ FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
while(proc && !feof(proc)) {
int read_in = int(fread(buff, 1, 255, proc));
if(!read_in)
@@ -2185,6 +2302,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret += split_value_list(output);
if(proc)
QT_PCLOSE(proc);
+#endif
}
break; }
case E_UNIQUE: {
@@ -2319,6 +2437,32 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret += it->replace(before, after);
}
break; }
+ case E_GENERATE_TEST_UID: {
+ if(args.count() != 1) {
+ fprintf(stderr, "%s:%d: generate_test_uid(targetname) requires one argument.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
+ } else {
+ QString target = args[0];
+
+ QString currPath = qmake_getpwd();
+ target.prepend("/").prepend(currPath);
+
+
+ QString tmp = generate_test_uid(target);
+
+ ret += tmp;
+ }
+ break; }
+ case E_SIZE: {
+ if(args.count() != 1) {
+ fprintf(stderr, "%s:%d: size(var) requires one argument.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
+ } else {
+ //QString target = args[0];
+ int size = values(args[0]).size();
+ ret += QString::number(size);
+ }
+ break; }
default: {
#ifdef QTSCRIPT_SUPPORT
{
@@ -3193,9 +3337,161 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
} else if (var == QLatin1String("QMAKE_DIR_SEP")) {
if (place[var].isEmpty())
return values("DIR_SEPARATOR", place);
+ } else if (var == QLatin1String("EPOCROOT")) {
+ if (place[var].isEmpty())
+ place[var] = QStringList(epocRoot());
}
//qDebug("REPLACE [%s]->[%s]", qPrintable(var), qPrintable(place[var].join("::")));
return place[var];
}
+
+// UIDs starting with 0xE are test UIDs in symbian
+QString generate_test_uid(const QString& target) {
+ QString tmp = generate_uid(target);
+ tmp.replace(0,1,"E");
+ tmp.prepend("0x");
+
+ // printf("generate_test_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+
+ return tmp;
+}
+
+
+// UIDs starting with 0xE are test UIDs in symbian
+QString generate_uid(const QString& target) {
+
+ static QMap<QString, QString> targetToUid;
+
+ QString tmp = targetToUid[target];
+
+ if(!tmp.isEmpty()) {
+ // printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+ return tmp;
+ }
+
+ unsigned long hash = 5381;
+ int c;
+
+ for(int i = 0; i < target.size(); ++i) {
+ c = target.at(i).toAscii();
+ hash ^= c + ((c-i) << i%20) + ((c+i) << (i+5)%20) + ((c-2*i) << (i+10)%20) + ((c+2*i) << (i+15)%20);
+ }
+
+ tmp.setNum(hash, 16);
+ for(int i = tmp.size(); i < 8; ++i)
+ tmp.prepend("0");
+
+#if 0
+ static QMap<QString, QString> uidConflictCheckList;
+ QString testStr = tmp;
+ testStr.replace(0,1,"E"); // Simulate actual UID generation
+ if (uidConflictCheckList.contains(testStr)) {
+ printf("\n\n!!!! generated duplicate uid for %s is %s <-> %s !!!!\n\n\n",
+ qPrintable(target),
+ qPrintable(testStr),
+ qPrintable(uidConflictCheckList.value(testStr)));
+ }
+ uidConflictCheckList.insert(testStr, target);
+ printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+#endif
+
+ targetToUid[target] = tmp;
+
+ return tmp;
+}
+
+static void fixEpocRootStr(QString& path)
+{
+ path.replace("\\","/");
+
+ if (path.size() > 1 && path[1] == QChar(':')) {
+ path = path.mid(2);
+ }
+
+ if (!path.size() || path[path.size()-1] != QChar('/')) {
+ path += QChar('/');
+ }
+}
+
+#define SYMBIAN_SDKS_KEY "HKEY_LOCAL_MACHINE\\Software\\Symbian\\EPOC SDKs"
+
+static QString epocRootStr;
+
+QString epocRoot()
+{
+ if (!epocRootStr.isEmpty())
+ {
+ return epocRootStr;
+ }
+
+ // First, check the env variable
+ epocRootStr = qgetenv("EPOCROOT");
+
+ if (epocRootStr.isEmpty()) {
+ // No EPOCROOT set, check the default device
+ // First check EPOCDEVICE env variable
+ QString defaultDevice = qgetenv("EPOCDEVICE");
+
+ // Check the windows registry via QSettings for devices.xml path
+ QSettings settings(SYMBIAN_SDKS_KEY, QSettings::NativeFormat);
+ QString devicesXmlPath = settings.value("CommonPath").toString();
+
+ if (!devicesXmlPath.isEmpty()) {
+ // Parse xml for correct device
+ devicesXmlPath += "/devices.xml";
+ QFile devicesFile(devicesXmlPath);
+ if (devicesFile.open(QIODevice::ReadOnly)) {
+ QXmlStreamReader xml(&devicesFile);
+ while (!xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "devices") {
+ if (xml.attributes().value("version") == "1.0") {
+ // Look for correct device
+ while (!(xml.isEndElement() && xml.name() == "devices") && !xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "device") {
+ if ((defaultDevice.isEmpty() && xml.attributes().value("default") == "yes") ||
+ (!defaultDevice.isEmpty() && (xml.attributes().value("id").toString() + QString(":") + xml.attributes().value("name").toString()) == defaultDevice)) {
+ // Found the correct device
+ while (!(xml.isEndElement() && xml.name() == "device") && !xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "epocroot") {
+ epocRootStr = xml.readElementText();
+ fixEpocRootStr(epocRootStr);
+ return epocRootStr;
+ }
+ }
+ xml.raiseError("No epocroot element found");
+ }
+ }
+ }
+ } else {
+ xml.raiseError("Invalid 'devices' element version");
+ }
+ }
+ }
+ if (xml.hasError()) {
+ fprintf(stderr, "ERROR: \"%s\" when parsing devices.xml\n", qPrintable(xml.errorString()));
+ }
+ } else {
+ fprintf(stderr, "Could not open devices.xml (%s)\n", qPrintable(devicesXmlPath));
+ }
+ } else {
+ fprintf(stderr, "Could not retrieve " SYMBIAN_SDKS_KEY " setting\n");
+ }
+
+ fprintf(stderr, "Failed to determine epoc root.\n");
+ if (!defaultDevice.isEmpty())
+ fprintf(stderr, "The device indicated by EPOCDEVICE environment variable (%s) could not be found.\n", qPrintable(defaultDevice));
+ fprintf(stderr, "Either set EPOCROOT or EPOCDEVICE environment variable to a valid value, or provide a default Symbian device.\n");
+
+ // No valid device found; set epocroot to "/"
+ epocRootStr = QLatin1String("/");
+ }
+
+ fixEpocRootStr(epocRootStr);
+ return epocRootStr;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/project.h b/qmake/project.h
index 1e2b754c9e..30041e5765 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -203,6 +203,13 @@ inline QString QMakeProject::first(const QString &v)
inline QMap<QString, QStringList> &QMakeProject::variables()
{ return vars; }
+// Helper functions needed for Symbian .mmp files and deployment
+QString generate_test_uid(const QString& target);
+QString generate_uid(const QString& target);
+QString epocRoot();
+bool isForSymbian();
+bool isForSymbianSbsv2();
+
QT_END_NAMESPACE
#endif // PROJECT_H
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 02ff38ea56..b51db32a8c 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -9,18 +9,28 @@ DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODET
SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/unix/unixmake2.cpp generators/unix/unixmake.cpp meta.cpp \
option.cpp generators/win32/winmakefile.cpp generators/win32/mingw_make.cpp \
+ qpopen.cpp \
generators/makefiledeps.cpp generators/metamakefile.cpp generators/mac/pbuilder_pbx.cpp \
generators/xmloutput.cpp generators/win32/borland_bmake.cpp \
generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \
generators/win32/msvc_dsp.cpp generators/win32/msvc_vcproj.cpp \
- generators/win32/msvc_objectmodel.cpp
+ generators/win32/msvc_objectmodel.cpp \
+ generators/symbian/symmake.cpp \
+ generators/symbian/symmake_abld.cpp \
+ generators/symbian/symmake_sbsv2.cpp \
+ generators/symbian/initprojectdeploy_symbian.cpp
+
HEADERS += project.h property.h generators/makefile.h \
generators/unix/unixmake.h meta.h option.h cachekeys.h \
generators/win32/winmakefile.h generators/projectgenerator.h \
generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \
generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \
generators/win32/msvc_dsp.h generators/win32/msvc_vcproj.h \
- generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h
+ generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \
+ generators/symbian/symmake.h \
+ generators/symbian/symmake_abld.h \
+ generators/symbian/symmake_sbsv2.h \
+ generators/symbian/initprojectdeploy_symbian.h
contains(QT_EDITION, OpenSource) {
DEFINES += QMAKE_OPENSOURCE_EDITION
@@ -63,7 +73,9 @@ bootstrap { #Qt code
qlibraryinfo.cpp \
qvariant.cpp \
qvector.cpp \
- qvsnprintf.cpp
+ qvsnprintf.cpp \
+ qxmlstream.cpp \
+ qxmlutils.cpp
HEADERS+= \
qbitarray.h \
@@ -98,7 +110,9 @@ bootstrap { #Qt code
qtextstream.h \
qurl.h \
quuid.h \
- qvector.h
+ qvector.h \
+ qxmlstream.h \
+ qxmlutils.h
unix {
SOURCES += qfsfileengine_unix.cpp qfsfileengine_iterator_unix.cpp
@@ -110,6 +124,7 @@ bootstrap { #Qt code
} else:win32 {
SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp
win32-msvc*:LIBS += ole32.lib advapi32.lib
+ win32-mwc:LIBS += -lole32.lib -ladvapi32.lib
}
qnx {
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 38c58fbe7f..594e698966 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -17,8 +17,9 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \
$$QT_SOURCE_TREE/src/corelib/kernel \
$$QT_SOURCE_TREE/src/corelib/plugin \
$$QT_SOURCE_TREE/src/corelib/io \
+ $$QT_SOURCE_TREE/src/corelib/xml \
$$QT_SOURCE_TREE/src/script
-INCPATH += generators generators/unix generators/win32 generators/mac \
+INCPATH += generators generators/unix generators/win32 generators/mac generators/symbian \
$$QT_SOURCE_TREE/include $$QT_SOURCE_TREE/include/QtCore \
$$QT_SOURCE_TREE/qmake $$QT_SOURCE_TREE/include/QtScript
include(qmake.pri)
diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp
new file mode 100644
index 0000000000..3b0e2dafce
--- /dev/null
+++ b/qmake/qpopen.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qpopen.h"
+
+
+QPopen::QPopen()
+{
+}
+
+bool QPopen::init(const char *command, const char* /* mode */)
+{
+ SECURITY_ATTRIBUTES attributes;
+
+ attributes.nLength = sizeof(SECURITY_ATTRIBUTES);
+ attributes.bInheritHandle = TRUE;
+ attributes.lpSecurityDescriptor = NULL;
+
+ if (! CreatePipe(&childStdOutR, &childStdOutW, &attributes, 0)) {
+ return false;
+ }
+
+ // Ensure that the read handle to the child process's pipe for STDOUT is not inherited.
+ SetHandleInformation( childStdOutR, HANDLE_FLAG_INHERIT, 0);
+
+ // Create a pipe for the child process's STDIN.
+ if (! CreatePipe(&childStdInR, &childStdInW, &attributes, 0)) {
+ return false;
+ }
+
+ // Ensure that the write handle to the child process's pipe for STDIN is not inherited.
+ SetHandleInformation( childStdInW, HANDLE_FLAG_INHERIT, 0);
+
+ //TCHAR szCmdline[strlen(command)]=TEXT(command);
+ TCHAR *szCmdLine = new TCHAR[strlen(command)+1];
+ strcpy(szCmdLine, command);
+
+ // Set up members of the PROCESS_INFORMATION structure.
+
+ ZeroMemory( &processInfo, sizeof(PROCESS_INFORMATION) );
+
+ // Set up members of the STARTUPINFO structure.
+
+ ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
+ siStartInfo.cb = sizeof(STARTUPINFO);
+ siStartInfo.hStdError = childStdOutW;
+ siStartInfo.hStdOutput = childStdOutW;
+ siStartInfo.hStdInput = childStdInR;
+ siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ // Create the child process.
+
+ bool success = CreateProcess(NULL,
+ szCmdLine, // command line
+ NULL, // process security attributes
+ NULL, // primary thread security attributes
+ TRUE, // handles are inherited
+ 0, // creation flags
+ NULL, // use parent's environment
+ NULL, // use parent's current directory
+ &siStartInfo, // STARTUPINFO pointer
+ &processInfo); // receives PROCESS_INFORMATION
+
+ delete szCmdLine;
+
+ return success;
+}
+
+QPopen::~QPopen()
+{
+ CloseHandle(processInfo.hProcess);
+ CloseHandle(processInfo.hThread);
+ CloseHandle(childStdInR);
+ CloseHandle(childStdInW);
+ CloseHandle(childStdOutR);
+ CloseHandle(childStdOutW);
+}
+
+int QPopen::fwrite(char* buffer, int maxBytes)
+{
+ DWORD bytesWritten;
+
+ bool success = WriteFile(childStdInW, buffer, maxBytes, &bytesWritten, NULL);
+ if(success) {
+ return bytesWritten;
+ }
+
+ return 0;
+}
+
+
+int QPopen::fread(char* buffer, int maxBytes)
+{
+ DWORD bytesRead;
+
+ if( !CloseHandle(childStdOutW) )
+ return 0;
+
+ bool success = ReadFile(childStdOutR, buffer, maxBytes, &bytesRead, NULL);
+ if(success)
+ return bytesRead;
+
+ return 0;
+}
+
diff --git a/qmake/qpopen.h b/qmake/qpopen.h
new file mode 100644
index 0000000000..c739e926ea
--- /dev/null
+++ b/qmake/qpopen.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPOPEN_H
+#define QPOPEN_H
+
+#include <windows.h>
+#include <tchar.h>
+#include <stdio.h>
+#include <string.h>
+
+class QPopen
+{
+public:
+ QPopen();
+ ~QPopen();
+ int fread(char* buffer, int maxBytes);
+ int fwrite(char* buffer, int maxBytes);
+ bool init(const char* command, const char* mode);
+
+private:
+ // This pair of handles represent the "Write" pipe
+ // ie: Parent -> Child
+ HANDLE childStdInR;
+ HANDLE childStdInW;
+
+ // This pair of handles represent the "Read" pipe
+ // ie: Child -> Parent
+ HANDLE childStdOutR;
+ HANDLE childStdOutW;
+ PROCESS_INFORMATION processInfo;
+ STARTUPINFO siStartInfo;
+};
+
+#endif
diff --git a/selfsigned.cer b/selfsigned.cer
new file mode 100644
index 0000000000..af7244934d
--- /dev/null
+++ b/selfsigned.cer
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDFTCCAtOgAwIBAgIBADALBgcqhkjOOAQDBQAwcDELMAkGA1UEBhMCTk8xDjAM
+BgNVBAoTBU5va2lhMRQwEgYDVQQLEwtRdCBTb2Z0d2FyZTEOMAwGA1UEAxMFVHJv
+bGwxKzApBgkqhkiG9w0BCQEWHHF0czYwLWZlZWRiYWNrQHRyb2xsdGVjaC5jb20w
+HhcNMDgxMDAzMTMwNDM1WhcNMDkxMDAzMTMwNDM1WjBwMQswCQYDVQQGEwJOTzEO
+MAwGA1UEChMFTm9raWExFDASBgNVBAsTC1F0IFNvZnR3YXJlMQ4wDAYDVQQDEwVU
+cm9sbDErMCkGCSqGSIb3DQEJARYccXRzNjAtZmVlZGJhY2tAdHJvbGx0ZWNoLmNv
+bTCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQC7OyI3lyV06OqahpbeEa5p9ucmoBxV
+n6YKvBjliPNMhQe7Di1Igv63rllQPqABv1Qu1YJc5CPiF4dSSQ/R7XjKEQqPZY4A
+PZooTKWVCs+e3Yo2HWaZYRks/euvcqvEOqmkZ2RUccaTb1T+b2et0vphFmlVYXPx
+BrIlbKtgJg+6QwIVAJnqTjBmWtEYQ6kFWfLE3yFIKx0BAoGAais4n6lD7yFJHB2F
+mb4W09EPx+LZTFSHgj9uzLiWWDEVl+j9jA4eYZBMb2yRBZ9zVXqjDSrFLWMuoNrV
+taqAVb9V2DrDHx3s0gSQmS5BNK2KThZCNOgj3YT4GRIZR4L6gqDBS5dkWLrwFUfC
+l6Hw9tizQR4EO4HgjEnMSxzXDzsDgYQAAoGAJH/tVAEb1boQKTt5eHRI/zCtw4ab
+Vtw7jHMzqQ+m921izJyzz5AJCVjtu6a1bLnW09i9oFIZ7bYs+Cd+qRgac2cVkX4x
+xmMXuAgw03VMf3vEbK2M2+BkjpUGrfoST5XG/eJbno6Tp1BGvYd88ZLt3gXBPnqi
+2QpMaOGqMED4mWkwCwYHKoZIzjgEAwUAAy8AMCwCFGCSlB1FYaBiIAuirrAACZzi
+p2jnAhQ/hlJjpxOgF7Z5RZCNAhz6HNhZ3g==
+-----END CERTIFICATE-----
diff --git a/selfsigned.key b/selfsigned.key
new file mode 100644
index 0000000000..47c51a0a56
--- /dev/null
+++ b/selfsigned.key
@@ -0,0 +1,12 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBugIBAAKBgQC7OyI3lyV06OqahpbeEa5p9ucmoBxVn6YKvBjliPNMhQe7Di1I
+gv63rllQPqABv1Qu1YJc5CPiF4dSSQ/R7XjKEQqPZY4APZooTKWVCs+e3Yo2HWaZ
+YRks/euvcqvEOqmkZ2RUccaTb1T+b2et0vphFmlVYXPxBrIlbKtgJg+6QwIVAJnq
+TjBmWtEYQ6kFWfLE3yFIKx0BAoGAais4n6lD7yFJHB2Fmb4W09EPx+LZTFSHgj9u
+zLiWWDEVl+j9jA4eYZBMb2yRBZ9zVXqjDSrFLWMuoNrVtaqAVb9V2DrDHx3s0gSQ
+mS5BNK2KThZCNOgj3YT4GRIZR4L6gqDBS5dkWLrwFUfCl6Hw9tizQR4EO4HgjEnM
+SxzXDzsCgYAkf+1UARvVuhApO3l4dEj/MK3DhptW3DuMczOpD6b3bWLMnLPPkAkJ
+WO27prVsudbT2L2gUhnttiz4J36pGBpzZxWRfjHGYxe4CDDTdUx/e8RsrYzb4GSO
+lQat+hJPlcb94luejpOnUEa9h3zxku3eBcE+eqLZCkxo4aowQPiZaQIUV0KZx9KH
+Qp9/xwskqgJvmWgR8KQ=
+-----END DSA PRIVATE KEY-----
diff --git a/src/3rdparty/freetype/src/gzip/zconf.h b/src/3rdparty/freetype/src/gzip/zconf.h
index 3ccc3a66ab..2030a7e8d4 100644
--- a/src/3rdparty/freetype/src/gzip/zconf.h
+++ b/src/3rdparty/freetype/src/gzip/zconf.h
@@ -5,6 +5,11 @@
/* @(#) $Id: zconf.h,v 1.4 2007/06/01 06:56:17 wl Exp $ */
+#if defined(__ARMCC__) || defined(__CC_ARM)
+/* Ultra ugly hack that convinces RVCT to use the systems zlib */
+#include <stdapis/zconf.h>
+#else /* defined(__ARMCC__) || defined(__CC_ARM) */
+
#ifndef _ZCONF_H
#define _ZCONF_H
@@ -276,3 +281,5 @@ typedef uLong FAR uLongf;
#endif
#endif /* _ZCONF_H */
+
+#endif /* defined(__ARMCC__) || defined(__CC_ARM) */
diff --git a/src/3rdparty/freetype/src/gzip/zlib.h b/src/3rdparty/freetype/src/gzip/zlib.h
index 50d0d3f146..0f98fdcbd3 100644
--- a/src/3rdparty/freetype/src/gzip/zlib.h
+++ b/src/3rdparty/freetype/src/gzip/zlib.h
@@ -28,6 +28,11 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
+#if defined(__ARMCC__) || defined(__CC_ARM)
+/* Ultra ugly hack that convinces RVCT to use the systems zlib */
+#include <stdapis/zlib.h>
+#else /* defined(__ARMCC__) || defined(__CC_ARM) */
+
#ifndef _ZLIB_H
#define _ZLIB_H
@@ -828,3 +833,5 @@ ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits,
#endif
#endif /* _ZLIB_H */
+
+#endif /* defined(__ARMCC__) || defined(__CC_ARM) */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index d4e6b466b6..393cc7bdb7 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -28,7 +28,13 @@
#ifndef HARFBUZZ_GLOBAL_H
#define HARFBUZZ_GLOBAL_H
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
+
#include <string.h>
#ifdef __cplusplus
diff --git a/src/3rdparty/libjpeg/jinclude.h b/src/3rdparty/libjpeg/jinclude.h
index 0a4f15146a..725bd518db 100644
--- a/src/3rdparty/libjpeg/jinclude.h
+++ b/src/3rdparty/libjpeg/jinclude.h
@@ -36,7 +36,12 @@
#endif
#ifdef HAVE_STDLIB_H
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#ifdef NEED_SYS_TYPES_H
diff --git a/src/3rdparty/libmng/libmng_types.h b/src/3rdparty/libmng/libmng_types.h
index 81fb29f528..45be543295 100644
--- a/src/3rdparty/libmng/libmng_types.h
+++ b/src/3rdparty/libmng/libmng_types.h
@@ -198,7 +198,12 @@
#endif /* MNG_INCLUDE_IJG6B */
#if defined(MNG_INTERNAL_MEMMNGMT) || defined(MNG_INCLUDE_FILTERS)
-#include <stdlib.h> /* "calloc" & "free" & "abs" */
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
+#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#include <limits.h> /* get proper integer widths */
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 19e4732fec..9edb468508 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -353,7 +353,12 @@
/* Other defines for things like memory and the like can go here. */
#ifdef PNG_INTERNAL
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
* aren't usually used outside the library (as far as I know), so it is
@@ -1333,7 +1338,9 @@ typedef z_stream FAR * png_zstreamp;
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
# ifndef PNGAPI
-# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
+# if (defined(__GNUC__) && defined(__arm__)) || defined (__ARMCC__)
+# define PNGAPI
+# elif defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) || defined(__WINSCW__)
# define PNGAPI __cdecl
# else
# define PNGAPI _cdecl
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h
index e95f7a47d2..324fbe89a7 100644
--- a/src/3rdparty/libtiff/libtiff/tif_config.h
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h
@@ -104,7 +104,7 @@
/* #undef HAVE_PTHREAD */
/* Define to 1 if you have the <search.h> header file. */
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
#define HAVE_SEARCH_H 1
#endif
diff --git a/src/3rdparty/libtiff/libtiff/tif_unix.c b/src/3rdparty/libtiff/libtiff/tif_unix.c
index 28de5c9fe5..b60a0e13f7 100644
--- a/src/3rdparty/libtiff/libtiff/tif_unix.c
+++ b/src/3rdparty/libtiff/libtiff/tif_unix.c
@@ -35,7 +35,12 @@
#endif
#include <stdarg.h>
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
@@ -181,7 +186,7 @@ TIFFOpen(const char* name, const char* mode)
return tif;
}
-#ifdef __WIN32__
+#if defined (__WIN32__) && !defined(__SYMBIAN32__)
#include <windows.h>
/*
* Open a TIFF file with a Unicode filename, for read/writing.
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h
index 7aaf561386..96223d7ae5 100644
--- a/src/3rdparty/libtiff/libtiff/tiffio.h
+++ b/src/3rdparty/libtiff/libtiff/tiffio.h
@@ -71,6 +71,11 @@ typedef uint32 toff_t; /* file offset */
#define __WIN32__
#endif
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
+
/*
* On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
* or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
diff --git a/src/3rdparty/phonon/phonon/phonon_export.h b/src/3rdparty/phonon/phonon/phonon_export.h
index e579f67b04..5f93ea07a0 100644
--- a/src/3rdparty/phonon/phonon/phonon_export.h
+++ b/src/3rdparty/phonon/phonon/phonon_export.h
@@ -32,7 +32,11 @@
# define PHONON_EXPORT Q_DECL_IMPORT
# endif
# else /* UNIX */
-# define PHONON_EXPORT Q_DECL_EXPORT
+# ifdef MAKE_PHONON_LIB /* We are building this library */
+# define PHONON_EXPORT Q_DECL_EXPORT
+# else /* We are using this library */
+# define PHONON_EXPORT Q_DECL_IMPORT
+# endif
# endif
#endif
diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
index b7d5eff81b..3ecb1bbb1d 100644
--- a/src/3rdparty/zlib/zutil.h
+++ b/src/3rdparty/zlib/zutil.h
@@ -21,7 +21,12 @@
# include <stddef.h>
# endif
# include <string.h>
-# include <stdlib.h>
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
+#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#ifdef NO_ERRNO_H
# ifdef _WIN32_WCE
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 20b9227ee7..de4de1f405 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -4,7 +4,10 @@ win32:HEADERS += arch/qatomic_windows.h \
mac:HEADERS += arch/qatomic_macosx.h \
arch/qatomic_generic.h
-!wince*:!win32:!mac:HEADERS += arch/qatomic_alpha.h \
+symbian:HEADERS += arch/qatomic_symbian.h \
+ arch/qatomic_generic.h
+
+!wince*:!win32:!mac:!symbian:HEADERS += arch/qatomic_alpha.h \
arch/qatomic_avr32.h \
arch/qatomic_ia64.h \
arch/qatomic_parisc.h \
diff --git a/src/corelib/arch/generic/qatomic_generic_unix.cpp b/src/corelib/arch/generic/qatomic_generic_unix.cpp
index 15918bec87..876042fff9 100644
--- a/src/corelib/arch/generic/qatomic_generic_unix.cpp
+++ b/src/corelib/arch/generic/qatomic_generic_unix.cpp
@@ -39,10 +39,13 @@
**
****************************************************************************/
+#if !defined(Q_OS_SYMBIAN) || (defined(Q_OS_SYMBIAN) && !defined(Q_CC_RVCT))
+
#include "qplatformdefs.h"
#include <QtCore/qatomic.h>
+QT_BEGIN_NAMESPACE
static pthread_mutex_t qAtomicMutex = PTHREAD_MUTEX_INITIALIZER;
Q_CORE_EXPORT
@@ -116,3 +119,5 @@ void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff
pthread_mutex_unlock(&qAtomicMutex);
return returnValue;
}
+QT_END_NAMESPACE
+#endif //!defined(Q_OS_SYMBIAN) && !defined(Q_CC_RVCT)
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
index 33641fc3d3..78891472be 100644
--- a/src/corelib/arch/qatomic_arch.h
+++ b/src/corelib/arch/qatomic_arch.h
@@ -80,6 +80,8 @@ QT_BEGIN_HEADER
# include "QtCore/qatomic_windowsce.h"
#elif defined(QT_ARCH_X86_64)
# include "QtCore/qatomic_x86_64.h"
+#elif defined(QT_ARCH_SYMBIAN)
+# include "QtCore/qatomic_symbian.h"
#elif defined(QT_ARCH_SH)
# include "QtCore/qatomic_sh.h"
#elif defined(QT_ARCH_SH4A)
diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h
index 07ad70ca50..c02563778c 100644
--- a/src/corelib/arch/qatomic_arm.h
+++ b/src/corelib/arch/qatomic_arm.h
@@ -116,6 +116,12 @@ extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval
extern Q_CORE_EXPORT char q_atomic_lock;
Q_CORE_EXPORT void qt_atomic_yield(int *);
+#ifdef Q_CC_RVCT
+
+Q_CORE_EXPORT __asm char q_atomic_swp(volatile char *ptr, char newval);
+
+#else
+
inline char q_atomic_swp(volatile char *ptr, char newval)
{
register char ret;
@@ -126,7 +132,9 @@ inline char q_atomic_swp(volatile char *ptr, char newval)
return ret;
}
-#endif
+#endif // Q_CC_RVCT
+
+#endif // QT_NO_ARM_EABI
// Reference counting
@@ -213,6 +221,8 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
// Fetch and store for integers
+#ifndef Q_CC_RVCT
+
inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
{
int originalValue;
@@ -223,6 +233,8 @@ inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
return originalValue;
}
+#endif
+
inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
{
return fetchAndStoreOrdered(newValue);
@@ -323,6 +335,22 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValu
// Fetch and store for pointers
+#ifdef Q_CC_RVCT
+
+template <typename T>
+__asm T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swp r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+#else
+
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
{
@@ -334,6 +362,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
return originalValue;
}
+#endif // Q_CC_RVCT
+
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
{
diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h
new file mode 100644
index 0000000000..902b320ea7
--- /dev/null
+++ b/src/corelib/arch/qatomic_symbian.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QATOMIC_SYMBIAN_H
+#define QATOMIC_SYMBIAN_H
+
+QT_BEGIN_HEADER
+
+#if defined(Q_CC_RVCT)
+# define QT_NO_ARM_EABI
+# include <QtCore/qatomic_arm.h>
+#elif defined(Q_CC_NOKIAX86) || defined(Q_CC_GCCE)
+# include <QtCore/qatomic_generic.h>
+#endif
+
+QT_END_HEADER
+
+#endif // QATOMIC_SYMBIAN_H
diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h
index ac26b4f6cb..c795ea6468 100644
--- a/src/corelib/arch/qatomic_windows.h
+++ b/src/corelib/arch/qatomic_windows.h
@@ -107,7 +107,7 @@ template <typename T>
Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
{ return true; }
-#if defined(Q_CC_MSVC)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MWERKS)
// MSVC++ 6.0 doesn't generate correct code when optimizations are turned on!
#if _MSC_VER < 1300 && defined (_M_IX86)
@@ -218,7 +218,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#else
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_CC_MWERKS)
// use compiler intrinsics for all atomic functions
extern "C" {
long __cdecl _InterlockedIncrement(volatile long *);
@@ -313,7 +313,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#else // Q_OS_WINCE
-#if _WIN32_WCE < 0x600 && defined(_X86_)
+#if (_WIN32_WCE < 0x600 && defined(_X86_)) || defined(Q_CC_MWERKS)
// For X86 Windows CE build we need to include winbase.h to be able
// to catch the inline functions which overwrite the regular
// definitions inside of coredll.dll. Though one could use the
@@ -321,8 +321,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
// exported at all.
#include <winbase.h>
#else
-
-#if _WIN32_WCE >= 0x600
+#if _WIN32_WCE >= 0x600 || defined(Q_CC_MWERKS)
#define Q_ARGUMENT_TYPE volatile
# if defined(_X86_)
# define InterlockedIncrement _InterlockedIncrement
diff --git a/src/corelib/arch/symbian/arch.pri b/src/corelib/arch/symbian/arch.pri
new file mode 100644
index 0000000000..deb94b15e7
--- /dev/null
+++ b/src/corelib/arch/symbian/arch.pri
@@ -0,0 +1,5 @@
+#
+# Symbian architecture
+#
+SOURCES += $$QT_ARCH_CPP/qatomic_symbian.cpp \
+ $$QT_ARCH_CPP/../generic/qatomic_generic_unix.cpp
diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp
new file mode 100644
index 0000000000..bcb0bd493a
--- /dev/null
+++ b/src/corelib/arch/symbian/qatomic_symbian.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qatomic.h>
+
+#if defined(Q_CC_RVCT)
+
+#include "../arm/qatomic_arm.cpp"
+
+QT_BEGIN_NAMESPACE
+
+// This declspec needs to be explicit. RVCT has a bug which prevents embedded
+// assembler functions from being exported (normally all functions are
+// exported, and Q_CORE_EXPORT resolves to nothing).
+__declspec(dllexport) __asm char q_atomic_swp(volatile char *ptr, char newval)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swpb r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+__declspec(dllexport) __asm int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swp r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+QT_END_NAMESPACE
+
+#endif // Q_CC_RVCT
+
diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp b/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
index 5c201466e9..bfc0e82640 100644
--- a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
+++ b/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
@@ -108,11 +108,17 @@ static qint64 getticks()
return 0;
return (ts.tv_sec * 1000000000) + ts.tv_nsec;
#else
+
+#ifdef Q_OS_SYMBIAN
+ return clock();
+#else
// no clock_gettime(), fall back to wall time
struct timeval tv;
gettimeofday(&tv, 0);
return (tv.tv_sec * 1000000) + tv.tv_usec;
#endif
+
+#endif
}
#elif defined(Q_OS_WIN)
diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.h b/src/corelib/concurrent/qtconcurrentiteratekernel.h
index 01c54a71f9..5cf4ebe082 100644
--- a/src/corelib/concurrent/qtconcurrentiteratekernel.h
+++ b/src/corelib/concurrent/qtconcurrentiteratekernel.h
@@ -49,8 +49,10 @@
#include <QtCore/qatomic.h>
#include <QtCore/qtconcurrentmedian.h>
#include <QtCore/qtconcurrentthreadengine.h>
-#include <iterator>
+#ifndef QT_NO_STL
+# include <iterator>
+#endif
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -148,6 +150,7 @@ public:
inline void * getPointer() { return 0; }
};
+#ifndef QT_NO_STL
inline bool selectIteration(std::bidirectional_iterator_tag)
{
return false; // while
@@ -162,6 +165,14 @@ inline bool selectIteration(std::random_access_iterator_tag)
{
return true; // for
}
+#else
+// no stl support, always use while iteration
+template <typename T>
+inline bool selectIteration(T)
+{
+ return false; // while
+}
+#endif
template <typename Iterator, typename T>
class IterateKernel : public ThreadEngine<T>
@@ -170,7 +181,10 @@ public:
typedef T ResultType;
IterateKernel(Iterator _begin, Iterator _end)
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
+#if defined (QT_NO_STL)
+ : begin(_begin), end(_end), current(_begin), currentIndex(0),
+ forIteration(false), progressReportingEnabled(true)
+#elif !defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION)
: begin(_begin), end(_end), current(_begin), currentIndex(0),
forIteration(selectIteration(typename std::iterator_traits<Iterator>::iterator_category())), progressReportingEnabled(true)
#else
@@ -178,7 +192,12 @@ public:
forIteration(selectIteration(std::iterator_category(_begin))), progressReportingEnabled(true)
#endif
{
+#if defined (QT_NO_STL)
+ iterationCount = 0;
+#else
iterationCount = forIteration ? std::distance(_begin, _end) : 0;
+
+#endif
}
virtual ~IterateKernel() { }
diff --git a/src/corelib/concurrent/qtconcurrentthreadengine.h b/src/corelib/concurrent/qtconcurrentthreadengine.h
index 9e7d12e865..444e0db60f 100644
--- a/src/corelib/concurrent/qtconcurrentthreadengine.h
+++ b/src/corelib/concurrent/qtconcurrentthreadengine.h
@@ -51,6 +51,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qtconcurrentexception.h>
#include <QtCore/qwaitcondition.h>
+#include <QtCore/qmutex.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index f99d57f64e..c55c2da1ab 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -26,3 +26,11 @@ QMAKE_LIBS += $$QMAKE_LIBS_CORE
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
contains(DEFINES,QT_EVAL):include(eval.pri)
+
+symbian: {
+ TARGET.UID3=0x2001B2DC
+
+ # Workaroud for problems with paging this dll
+ MMP_RULES -= PAGED
+ MMP_RULES *= UNPAGED
+} \ No newline at end of file
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 8324d05cb7..dd1dbd251f 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -44,6 +44,8 @@
#include "qvector.h"
#include "qlist.h"
#include "qthreadstorage.h"
+#include "qdir.h"
+#include "qstringlist.h"
#ifndef QT_NO_QOBJECT
#include <private/qthread_p.h>
@@ -62,10 +64,14 @@
# endif
#endif
-#ifdef Q_CC_MWERKS
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
#include <CoreServices/CoreServices.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <e32debug.h>
+#endif
+
QT_BEGIN_NAMESPACE
@@ -1024,6 +1030,20 @@ bool qSharedBuild()
*/
/*!
+ \fn QSysInfo::SymVersion QSysInfo::symbianVersion()
+
+ Returns the version of the Symbian operating system on which the
+ application is run (Symbian only).
+*/
+
+/*!
+ \fn QSysInfo::S60Version QSysInfo::s60Version()
+
+ Returns the version of the S60 SDK system on which the
+ application is run (S60 only).
+*/
+
+/*!
\enum QSysInfo::Endian
\value BigEndian Big-endian byte order (also called Network byte order)
@@ -1079,7 +1099,7 @@ bool qSharedBuild()
\value WV_NT_based NT-based version of Windows
\value WV_CE_based CE-based version of Windows
- \sa MacVersion
+ \sa MacVersion, SymVersion
*/
/*!
@@ -1108,7 +1128,39 @@ bool qSharedBuild()
\value MV_LEOPARD Apple codename for MV_10_5
\value MV_SNOWLEOPARD Apple codename for MV_10_6
- \sa WinVersion
+ \sa WinVersion, SymVersion
+*/
+
+/*!
+ \enum QSysInfo::SymVersion
+
+ This enum provides symbolic names for the various versions of the
+ Symbian operating system. On Symbian, the
+ QSysInfo::symbianVersion() function gives the version of the
+ system on which the application is run.
+
+ \value SV_9_2 Symbian OS 9.2
+ \value SV_9_3 Symbian OS 9.3
+ \value SV_9_4 Symbian OS 9.4
+ \value SV_Unknown An unknown and currently unsupported platform
+
+ \sa S60Version, WinVersion, MacVersion
+*/
+
+/*!
+ \enum QSysInfo::S60Version
+
+ This enum provides symbolic names for the various versions of the
+ S60 SDK. On S60, the
+ QSysInfo::s60Version() function gives the version of the
+ SDK on which the application is run.
+
+ \value SV_S60_3_1 S60 3rd Edition Feature Pack 1
+ \value SV_S60_3_2 S60 3rd Edition Feature Pack 2
+ \value SV_S60_5_0 S60 5th Edition
+ \value SV_S60_Unknown An unknown and currently unsupported platform
+
+ \sa SymVersion, WinVersion, MacVersion
*/
/*!
@@ -1686,6 +1738,79 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
#endif
+#ifdef Q_OS_SYMBIAN
+# ifdef Q_WS_S60
+static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1);
+
+QSysInfo::S60Version QSysInfo::s60Version()
+{
+# ifdef Q_CC_NOKIAX86
+ // For emulator builds. Emulators don't support the trick we use to figure
+ // out which SDK we are running under, so simply hardcode it there.
+# if defined(__SERIES60_31__)
+ return SV_S60_3_1;
+
+# elif defined(__S60_32__)
+ return SV_S60_3_2;
+
+# elif defined(__S60_50__)
+ return SV_S60_5_0;
+
+# else
+ return SV_S60_Unknown;
+
+# endif
+
+# else
+ // For hardware builds.
+ if (cachedS60Version != -1)
+ return cachedS60Version;
+
+ QDir dir(QLatin1String("z:\\system\\install"));
+ QStringList filters;
+ filters << QLatin1String("Series60v?.*.sis");
+ dir.setNameFilters(filters);
+
+ QStringList names = dir.entryList(QDir::NoFilter, QDir::Name | QDir::Reversed | QDir::IgnoreCase);
+ if (names.size() == 0)
+ return cachedS60Version = SV_S60_Unknown;
+
+ int major, minor;
+ major = names[0][9].toAscii() - '0';
+ minor = names[0][11].toAscii() - '0';
+ if (major == 3) {
+ if (minor == 1) {
+ return cachedS60Version = SV_S60_3_1;
+ } else if (minor == 2) {
+ return cachedS60Version = SV_S60_3_2;
+ }
+ } else if (major == 5) {
+ if (minor == 0) {
+ return cachedS60Version = SV_S60_5_0;
+ }
+ }
+
+ return cachedS60Version = SV_S60_Unknown;
+# endif
+}
+# else
+# error Qt does not support non-S60 Symbian versions yet.
+# endif // ifdef Q_WS_S60
+QSysInfo::SymVersion QSysInfo::symbianVersion()
+{
+ switch (s60Version()) {
+ case SV_S60_3_1:
+ return SV_9_2;
+ case SV_S60_3_2:
+ return SV_9_3;
+ case SV_S60_5_0:
+ return SV_9_4;
+ default:
+ return SV_Unknown;
+ }
+}
+#endif // ifdef Q_OS_SYMBIAN
+
/*!
\macro void Q_ASSERT(bool test)
\relates <QtGlobal>
@@ -1835,7 +1960,7 @@ void *qMemSet(void *dest, int c, size_t n) { return memset(dest, c, n); }
static QtMsgHandler handler = 0; // pointer to debug handler
-#ifdef Q_CC_MWERKS
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
extern bool qt_is_gui_used;
static void mac_default_handler(const char *msg)
{
@@ -1847,7 +1972,7 @@ static void mac_default_handler(const char *msg)
fprintf(stderr, msg);
}
}
-#endif // Q_CC_MWERKS
+#endif // Q_CC_MWERKS && Q_OS_MACX
@@ -1981,12 +2106,23 @@ void qt_message_output(QtMsgType msgType, const char *buf)
if (handler) {
(*handler)(msgType, buf);
} else {
-#if defined(Q_CC_MWERKS)
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
mac_default_handler(buf);
#elif defined(Q_OS_WINCE)
QString fstr = QString::fromLatin1(buf);
fstr += QLatin1String("\n");
OutputDebugString(reinterpret_cast<const wchar_t *> (fstr.utf16()));
+#elif defined(Q_OS_SYMBIAN)
+ // RDebug::Print has a cap of 256 characters so break it up
+ _LIT(format, "[Qt Message] %S");
+ const int maxBlockSize = 256 - ((const TDesC &)format).Length();
+ const TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf));
+ HBufC* hbuffer = HBufC::NewL(qMin(maxBlockSize, ptr.Length()));
+ for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) {
+ hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
+ RDebug::Print(format, hbuffer);
+ }
+ delete hbuffer;
#else
fprintf(stderr, "%s\n", buf);
fflush(stderr);
@@ -2013,7 +2149,9 @@ void qt_message_output(QtMsgType msgType, const char *buf)
_CrtDbgBreak();
#endif
-#if (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
+#if defined(Q_OS_SYMBIAN)
+ User::Invariant(); // Panic the current thread
+#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
@@ -2282,7 +2420,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
SeedStorageType *pseed = randTLS()->localData();
if (!pseed)
randTLS()->setLocalData(pseed = new SeedStorageType);
@@ -2311,7 +2449,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
SeedStorageType *pseed = randTLS()->localData();
if (!pseed) {
randTLS()->setLocalData(pseed = new SeedStorageType);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 36d87e2da4..15b2d53e0b 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -144,6 +144,7 @@ namespace QT_NAMESPACE {}
The operating system, must be one of: (Q_OS_x)
DARWIN - Darwin OS (synonym for Q_OS_MAC)
+ SYMBIAN - Symbian
MSDOS - MS-DOS and Windows
OS2 - OS/2
OS2EMX - XFree86 on OS/2 (not PM)
@@ -182,6 +183,11 @@ namespace QT_NAMESPACE {}
# else
# define Q_OS_DARWIN32
# endif
+#elif defined(__SYMBIAN32__) || defined(SYMBIAN)
+# define Q_OS_SYMBIAN
+# define Q_NO_POSIX_SIGNALS
+// TODO: should this be in qconfig.h
+# define QT_NO_GETIFADDRS
#elif defined(__CYGWIN__)
# define Q_OS_CYGWIN
#elif defined(MSDOS) || defined(_MSDOS)
@@ -351,7 +357,9 @@ namespace QT_NAMESPACE {}
HIGHC - MetaWare High C/C++
PGI - Portland Group C++
GHS - Green Hills Optimizing C++ Compilers
+ GCCE - GCCE (Symbian GCCE builds)
RVCT - ARM Realview Compiler Suite
+ NOKIAX86 - Nokia x86 (Symbian WINSCW builds)
Should be sorted most to least authoritative.
@@ -372,6 +380,9 @@ namespace QT_NAMESPACE {}
#elif defined(__MWERKS__)
# define Q_CC_MWERKS
+# if defined(__EMU_SYMBIAN_OS__)
+# define Q_CC_NOKIAX86
+# endif
/* "explicit" recognized since 4.0d1 */
#elif defined(_MSC_VER)
@@ -442,7 +453,15 @@ namespace QT_NAMESPACE {}
# define QT_NO_QWS_CURSOR
# endif
-#elif defined(__CC_ARM)
+/* Symbian GCCE */
+#elif defined(__GCCE__)
+# define Q_CC_GCCE
+# define QT_VISIBILITY_AVAILABLE
+
+/* ARM Realview Compiler Suite
+ RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
+ so check for it before that */
+#elif defined(__ARMCC__) || defined(__CC_ARM)
# define Q_CC_RVCT
#elif defined(__GNUC__)
@@ -684,6 +703,11 @@ namespace QT_NAMESPACE {}
# endif
# define Q_NO_USING_KEYWORD /* ### check "using" status */
+#elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86)
+# define Q_CC_NOKIAX86
+// # define Q_CC_MWERKS // May be required
+
+
#else
# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
#endif
@@ -731,6 +755,7 @@ namespace QT_NAMESPACE {}
QWS - Qt for Embedded Linux
WIN32 - Windows
X11 - X Window System
+ S60 - Symbian S60
PM - unsupported
WIN16 - unsupported
*/
@@ -759,6 +784,8 @@ namespace QT_NAMESPACE {}
# elif defined(Q_OS_MAC32)
# define Q_WS_MAC32
# endif
+# elif defined(Q_OS_SYMBIAN)
+# define Q_WS_S60
# elif !defined(Q_WS_QWS)
# define Q_WS_X11
# endif
@@ -783,7 +810,7 @@ typedef short qint16; /* 16 bit signed */
typedef unsigned short quint16; /* 16 bit unsigned */
typedef int qint32; /* 32 bit signed */
typedef unsigned int quint32; /* 32 bit unsigned */
-#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
+#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS)
# define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */
# define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */
typedef __int64 qint64; /* 64 bit signed */
@@ -801,7 +828,7 @@ typedef quint64 qulonglong;
#ifndef QT_POINTER_SIZE
# if defined(Q_OS_WIN64)
# define QT_POINTER_SIZE 8
-# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
# define QT_POINTER_SIZE 4
# endif
#endif
@@ -853,6 +880,12 @@ QT_END_INCLUDE_NAMESPACE
*/
#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
+/* Symbian OS defines TRUE = 1 and FALSE = 0,
+redefine to built-in booleans to make autotests work properly */
+#ifdef Q_OS_SYMBIAN
+ #undef TRUE
+ #undef FALSE
+#endif
# ifndef TRUE
# define TRUE true
# define FALSE false
@@ -1006,7 +1039,7 @@ typedef int QNoImplicitBoolCast;
#if defined(QT_COORD_TYPE)
typedef QT_COORD_TYPE qreal;
-#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE)
+#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
typedef float qreal;
#else
typedef double qreal;
@@ -1085,6 +1118,8 @@ class QDataStream;
#ifndef Q_DECL_EXPORT
# ifdef Q_OS_WIN
# define Q_DECL_EXPORT __declspec(dllexport)
+# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
+# define Q_DECL_EXPORT __declspec(dllexport)
# elif defined(QT_VISIBILITY_AVAILABLE)
# define Q_DECL_EXPORT __attribute__((visibility("default")))
# endif
@@ -1095,6 +1130,8 @@ class QDataStream;
#ifndef Q_DECL_IMPORT
# if defined(Q_OS_WIN)
# define Q_DECL_IMPORT __declspec(dllimport)
+# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
+# define Q_DECL_IMPORT __declspec(dllimport)
# else
# define Q_DECL_IMPORT
# endif
@@ -1104,7 +1141,7 @@ class QDataStream;
Create Qt DLL if QT_DLL is defined (Windows only)
*/
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
# if defined(QT_NODLL)
# undef QT_MAKEDLL
# undef QT_DLL
@@ -1249,11 +1286,11 @@ class QDataStream;
for Trolltech's internal unit tests. If you want slower loading times and more
symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
*/
-#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_MAKEDLL)
+#if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL)
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
-#elif defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_DLL)
+#elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL)
# define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
-#elif defined(QT_BUILD_INTERNAL) && !defined(Q_OS_WIN) && defined(QT_SHARED)
+#elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED)
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
#else
# define Q_AUTOTEST_EXPORT
@@ -1355,6 +1392,24 @@ public:
};
static const MacVersion MacintoshVersion;
#endif
+#ifdef Q_OS_SYMBIAN
+ enum SymVersion {
+ SV_Unknown = 0x0000,
+ SV_9_2 = 0x0001,
+ SV_9_3 = 0x0002,
+ SV_9_4 = 0x0004
+ };
+ static SymVersion symbianVersion();
+# ifdef Q_WS_S60
+ enum S60Version {
+ SV_S60_Unknown = 0x0000,
+ SV_S60_3_1 = 0x0001,
+ SV_S60_3_2 = 0x0002,
+ SV_S60_5_0 = 0x0004
+ };
+ static S60Version s60Version();
+# endif
+#endif
};
Q_CORE_EXPORT const char *qVersion();
@@ -1382,6 +1437,9 @@ inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
#ifdef Q_OS_WINCE
#define QT_WA(uni, ansi) uni
#define QT_WA_INLINE(uni, ansi) (uni)
+#elif defined(Q_CC_MWERKS)
+#define QT_WA(uni, ansi) ansi
+#define QT_WA_INLINE(uni, ansi) (ansi)
#elif defined(UNICODE)
#define QT_WA(uni, ansi) if (!(QSysInfo::windowsVersion() & QSysInfo::WV_DOS_based)) { uni } else { ansi }
@@ -1419,6 +1477,10 @@ inline void qUnused(T &x) { (void)x; }
Debugging and error handling
*/
+#if defined(Q_OS_SYMBIAN) && defined(NDEBUG)
+# define QT_NO_DEBUG
+#endif
+
#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
# define QT_DEBUG
#endif
@@ -1531,7 +1593,7 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int);
# define Q_FUNC_INFO __FUNCSIG__
# endif
#else
-# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
+# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN)
# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
# else
/* These two macros makes it possible to turn the builtin line expander into a
@@ -1540,9 +1602,9 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int);
# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
# endif
- /* The MIPSpro compiler postpones macro expansion, and therefore macros must be in scope
- * when being used. */
-# if !defined(Q_CC_MIPS)
+ /* The MIPSpro and RVCT compilers postpones macro expansion,
+ and therefore macros must be in scope when being used. */
+# if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86)
# undef QT_STRINGIFY2
# undef QT_STRINGIFY
# endif
@@ -1859,7 +1921,7 @@ public: \
types must declare a 'bool isDetached(void) const;' member for this
to work.
*/
-#if defined Q_CC_MSVC && _MSC_VER < 1300
+#if (defined Q_CC_MSVC && _MSC_VER < 1300) || defined(Q_CC_MWERKS)
template <typename T>
inline void qSwap_helper(T &value1, T &value2, T*)
{
@@ -2042,7 +2104,7 @@ typedef uint Flags;
#endif /* Q_NO_TYPESAFE_FLAGS */
-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
/* make use of typeof-extension */
template <typename T>
class QForeachContainer {
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index a519f4a419..e0ca27cc43 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -44,6 +44,10 @@
#include <QtCore/qglobal.h>
+#ifdef Q_OS_SYMBIAN
+# include <e32def.h>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -1390,8 +1394,25 @@ public:
ImFont,
ImCursorPosition,
ImSurroundingText,
- ImCurrentSelection
- };
+ ImCurrentSelection,
+ ImMaximumTextLength
+ };
+
+ enum InputMethodHint {
+ ImhNone = 0x0,
+ ImhHiddenText = 0x1,
+ ImhDigitsOnly = 0x2,
+ ImhFormattedNumbersOnly = 0x4,
+ ImhUppercaseOnly = 0x8,
+ ImhLowercaseOnly = 0x10,
+ ImhNoAutoUppercase = 0x20,
+ ImhPreferNumbers = 0x40,
+ ImhPreferUppercase = 0x80,
+ ImhPreferLowercase = 0x100,
+ ImhNoPredictiveText = 0x200,
+ ImhDialableCharactersOnly = 0x400
+ };
+ Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
enum ToolButtonStyle {
ToolButtonIconOnly,
@@ -1485,6 +1506,8 @@ public:
typedef unsigned long HANDLE;
#elif defined(Q_WS_QWS)
typedef void * HANDLE;
+#elif defined(Q_WS_S60)
+ typedef unsigned long int HANDLE; // equivalent to TUint32
#endif
typedef WindowFlags WFlags;
@@ -1552,6 +1575,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DropActions)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ItemFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints)
typedef bool (*qInternalCallback)(void **);
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 3690d4bbf5..845dc2e669 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -62,7 +62,8 @@ win32 {
} else:unix {
SOURCES += io/qfsfileengine_unix.cpp
SOURCES += io/qfsfileengine_iterator_unix.cpp
- SOURCES += io/qprocess_unix.cpp
+ symbian:SOURCES += io/qprocess_symbian.cpp
+ else:SOURCES += io/qprocess_unix.cpp
mac:SOURCES += io/qsettings_mac.cpp
linux-*:{
@@ -79,4 +80,9 @@ win32 {
SOURCES += io/qfilesystemwatcher_kqueue.cpp
HEADERS += io/qfilesystemwatcher_kqueue_p.h
}
+
+ symbian {
+ SOURCES += io/qfilesystemwatcher_symbian.cpp
+ HEADERS += io/qfilesystemwatcher_symbian_p.h
+ }
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index b7861babfe..901641c048 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
static QString driveSpec(const QString &path)
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (path.size() < 2)
return QString();
char c = path.at(0).toAscii();
@@ -147,7 +147,7 @@ private:
QString path = p;
if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
&& path.length() > 1) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
#endif
path.truncate(path.length() - 1);
@@ -772,6 +772,8 @@ QString QDir::relativeFilePath(const QString &fileName) const
if (fileDrive.toLower() != dirDrive.toLower()
|| (file.startsWith(QLatin1String("//"))
&& !dir.startsWith(QLatin1String("//"))))
+#elif defined(Q_OS_SYMBIAN)
+ if (fileDrive.toLower() != dirDrive.toLower())
#else
if (fileDrive != dirDrive)
#endif
@@ -787,7 +789,7 @@ QString QDir::relativeFilePath(const QString &fileName) const
int i = 0;
while (i < dirElts.size() && i < fileElts.size() &&
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
dirElts.at(i).toLower() == fileElts.at(i).toLower())
#else
dirElts.at(i) == fileElts.at(i))
@@ -834,7 +836,7 @@ QString QDir::convertSeparators(const QString &pathName)
QString QDir::toNativeSeparators(const QString &pathName)
{
QString n(pathName);
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
for (int i=0; i<(int)n.length(); i++) {
if (n[i] == QLatin1Char('/'))
n[i] = QLatin1Char('\\');
@@ -858,7 +860,7 @@ QString QDir::toNativeSeparators(const QString &pathName)
QString QDir::fromNativeSeparators(const QString &pathName)
{
QString n(pathName);
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
for (int i=0; i<(int)n.length(); i++) {
if (n[i] == QLatin1Char('\\'))
n[i] = QLatin1Char('/');
@@ -1800,10 +1802,10 @@ QFileInfoList QDir::drives()
QChar QDir::separator()
{
-#if defined(Q_OS_UNIX)
- return QLatin1Char('/');
-#elif defined (Q_FS_FAT) || defined(Q_WS_WIN)
+#if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
return QLatin1Char('\\');
+#elif defined(Q_OS_UNIX)
+ return QLatin1Char('/');
#elif defined (Q_OS_MAC)
return QLatin1Char(':');
#else
@@ -1903,7 +1905,8 @@ QString QDir::currentPath()
Under non-Windows operating systems the \c HOME environment
variable is used if it exists, otherwise the path returned by the
- rootPath() function is used.
+ rootPath() function is used, except in Symbian, where c:\\data is
+ returned.
\sa home(), currentPath(), rootPath(), tempPath()
*/
@@ -2054,7 +2057,7 @@ QString QDir::cleanPath(const QString &path)
QString name = path;
QChar dir_separator = separator();
if(dir_separator != QLatin1Char('/'))
- name.replace(dir_separator, QLatin1Char('/'));
+ name.replace(dir_separator, QLatin1Char('/'));
int used = 0, levels = 0;
const int len = name.length();
@@ -2123,7 +2126,7 @@ QString QDir::cleanPath(const QString &path)
levels++;
}
} else if(last != -1 && iwrite - last == 1) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
eaten = (iwrite > 2);
#else
eaten = true;
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index d7da800860..4a20c970fc 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -737,15 +737,18 @@ QFile::rename(const QString &newName)
error = true;
}
if(!error) {
- if (!in.remove()) {
+ in.close();
+ if (!remove()) {
d->setError(QFile::RenameError, tr("Cannot remove source file"));
error = true;
}
}
- if (error)
+ if (error) {
out.remove();
- else
+ } else {
+ fileEngine()->setFileName(newName);
setFileName(newName);
+ }
return !error;
}
}
@@ -785,6 +788,9 @@ QFile::rename(const QString &oldName, const QString &newName)
\note To create a valid link on Windows, \a linkName must have a \c{.lnk} file extension.
+ \note On Symbian, no link is created and false is returned if fileName()
+ currently specifies a directory.
+
\sa setFileName()
*/
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index e073a082a8..b83ab853c9 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -59,6 +59,8 @@
# include "qfilesystemwatcher_dnotify_p.h"
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
# include "qfilesystemwatcher_kqueue_p.h"
+#elif defined(Q_OS_SYMBIAN)
+# include "qfilesystemwatcher_symbian_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -244,6 +246,8 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
return eng;
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
return QKqueueFileSystemWatcherEngine::create();
+#elif defined(Q_OS_SYMBIAN)
+ return new QSymbianFileSystemWatcherEngine;
#else
return 0;
#endif
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
new file mode 100644
index 0000000000..883b70f260
--- /dev/null
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -0,0 +1,252 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qfilesystemwatcher.h"
+#include "qfilesystemwatcher_symbian_p.h"
+#include "qfileinfo.h"
+#include "qdebug.h"
+#include "private/qcore_symbian_p.h"
+#include <QDir>
+
+#ifndef QT_NO_FILESYSTEMWATCHER
+
+
+QT_BEGIN_NAMESPACE
+
+CNotifyChangeEvent* CNotifyChangeEvent::New(RFs &fs, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* e)
+{
+ CNotifyChangeEvent* self = new CNotifyChangeEvent(fs, file, e);
+ return self;
+}
+
+CNotifyChangeEvent::CNotifyChangeEvent(RFs &fs, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* e, TInt aPriority) :
+ CActive(aPriority),
+ fsSession(fs),
+ watchedPath(file),
+ engine(e)
+{
+ fsSession.NotifyChange(ENotifyAll, iStatus, file);
+ CActiveScheduler::Add(this);
+ SetActive();
+}
+
+CNotifyChangeEvent::~CNotifyChangeEvent()
+{
+ Cancel();
+}
+
+void CNotifyChangeEvent::RunL()
+{
+ if (iStatus.Int() == KErrNone){
+ fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath);
+ SetActive();
+ engine->emitPathChanged(this);
+ } else {
+ qWarning("CNotifyChangeEvent::RunL() - Failed to order change notifications: %d", iStatus.Int());
+ }
+}
+
+void CNotifyChangeEvent::DoCancel()
+{
+ fsSession.NotifyChangeCancel();
+}
+
+QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() :
+ watcherStarted(false)
+{
+ moveToThread(this);
+}
+
+QSymbianFileSystemWatcherEngine::~QSymbianFileSystemWatcherEngine()
+{
+ stop();
+}
+
+QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths,
+ QStringList *files, QStringList *directories)
+{
+ QMutexLocker locker(&mutex);
+ QStringList p = paths;
+
+ if (!startWatcher()) {
+ qWarning("Could not start QSymbianFileSystemWatcherEngine thread");
+
+ return p;
+ }
+
+ QMutableListIterator<QString> it(p);
+ while (it.hasNext()) {
+ QString path = it.next();
+ QFileInfo fi(path);
+ if (!fi.exists())
+ continue;
+
+ bool isDir = fi.isDir();
+ if (isDir) {
+ if (directories->contains(path))
+ continue;
+ } else {
+ if (files->contains(path))
+ continue;
+ }
+
+ // Use absolute filepath as relative paths seem to have some issues.
+ QString filePath = fi.absoluteFilePath();
+ if(isDir && filePath.at(filePath.size()-1) != QChar('/')) {
+ filePath += QChar('/');
+ }
+
+ currentEvent = NULL;
+ QMetaObject::invokeMethod(this,
+ "addNativeListener",
+ Qt::QueuedConnection,
+ Q_ARG(QString, filePath));
+
+ syncCondition.wait(&mutex);
+
+ if (currentEvent) {
+ currentEvent->isDir = isDir;
+
+ activeObjectToPath.insert(currentEvent, path);
+ it.remove();
+
+ if (isDir)
+ directories->append(path);
+ else
+ files->append(path);
+ }
+ }
+
+ return p;
+}
+
+QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &paths,
+ QStringList *files, QStringList *directories)
+{
+ QMutexLocker locker(&mutex);
+
+ QStringList p = paths;
+ QMutableListIterator<QString> it(p);
+ while (it.hasNext()) {
+ QString path = it.next();
+
+ currentEvent = activeObjectToPath.key(path);
+ if (!currentEvent)
+ continue;
+ activeObjectToPath.remove(currentEvent);
+
+ QMetaObject::invokeMethod(this,
+ "removeNativeListener",
+ Qt::QueuedConnection);
+
+ syncCondition.wait(&mutex);
+
+ it.remove();
+
+ files->removeAll(path);
+ directories->removeAll(path);
+ }
+
+ if (activeObjectToPath.size() == 0)
+ stop();
+
+ return p;
+}
+
+void QSymbianFileSystemWatcherEngine::emitPathChanged(CNotifyChangeEvent *e)
+{
+ QMutexLocker locker(&mutex);
+
+ QString path = activeObjectToPath.value(e);
+ QFileInfo fi(path);
+
+ if (e->isDir) {
+ emit directoryChanged(path, !fi.exists());
+ } else {
+ emit fileChanged(path, !fi.exists());
+ }
+}
+
+void QSymbianFileSystemWatcherEngine::stop()
+{
+ QMetaObject::invokeMethod(this, "quit");
+ wait();
+}
+
+// This method must be called inside mutex
+bool QSymbianFileSystemWatcherEngine::startWatcher()
+{
+ bool retval = true;
+
+ if (!watcherStarted) {
+#if defined(Q_OS_SYMBIAN)
+ setStackSize(0x5000);
+#endif
+ start();
+ syncCondition.wait(&mutex);
+
+ if (errorCode != KErrNone) {
+ retval = false;
+ } else {
+ watcherStarted = true;
+ }
+ }
+ return retval;
+}
+
+
+void QSymbianFileSystemWatcherEngine::run()
+{
+ // Initialize file session
+
+ errorCode = fsSession.Connect();
+
+ mutex.lock();
+ syncCondition.wakeOne();
+ mutex.unlock();
+
+ if (errorCode == KErrNone) {
+ exec();
+
+ foreach(CNotifyChangeEvent* e, activeObjectToPath.keys()) {
+ e->Cancel();
+ delete e;
+ }
+
+ activeObjectToPath.clear();
+ fsSession.Close();
+ watcherStarted = false;
+ }
+}
+
+void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath)
+{
+ QMutexLocker locker(&mutex);
+ HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(directoryPath));
+ currentEvent = CNotifyChangeEvent::New(fsSession, *buffer, this);
+ delete buffer;
+ syncCondition.wakeOne();
+}
+
+void QSymbianFileSystemWatcherEngine::removeNativeListener()
+{
+ QMutexLocker locker(&mutex);
+ currentEvent->Cancel();
+ delete currentEvent;
+ currentEvent = NULL;
+ syncCondition.wakeOne();
+}
+
+
+QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h
new file mode 100644
index 0000000000..b34418a79c
--- /dev/null
+++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QFILESYSTEMWATCHER_SYMBIAN_P_H
+#define QFILESYSTEMWATCHER_SYMBIAN_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qfilesystemwatcher_p.h"
+#include "qhash.h"
+#include "qmutex.h"
+#include "qwaitcondition.h"
+
+#ifndef QT_NO_FILESYSTEMWATCHER
+
+#include <e32base.h>
+#include <f32file.h>
+
+QT_BEGIN_NAMESPACE
+
+class QSymbianFileSystemWatcherEngine;
+
+class CNotifyChangeEvent : public CActive
+{
+public:
+ CNotifyChangeEvent(RFs &fsSession, const TDesC& file, QSymbianFileSystemWatcherEngine* engine,
+ TInt aPriority = EPriorityStandard);
+ ~CNotifyChangeEvent();
+ static CNotifyChangeEvent* New(RFs &fsSession, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* engine);
+
+ bool isDir;
+
+private:
+ void RunL();
+ void DoCancel();
+
+ RFs &fsSession;
+ TPath watchedPath;
+ QSymbianFileSystemWatcherEngine *engine;
+};
+
+class QSymbianFileSystemWatcherEngine : public QFileSystemWatcherEngine
+{
+ Q_OBJECT
+
+public:
+ QSymbianFileSystemWatcherEngine();
+ ~QSymbianFileSystemWatcherEngine();
+
+ QStringList addPaths(const QStringList &paths, QStringList *files,
+ QStringList *directories);
+ QStringList removePaths(const QStringList &paths, QStringList *files,
+ QStringList *directories);
+
+ void stop();
+
+protected:
+ void run();
+
+public Q_SLOTS:
+ void addNativeListener(const QString &directoryPath);
+ void removeNativeListener();
+
+private:
+ friend class CNotifyChangeEvent;
+ void emitPathChanged(CNotifyChangeEvent *e);
+
+ bool startWatcher();
+
+ RFs fsSession;
+ QHash<CNotifyChangeEvent*, QString> activeObjectToPath;
+ QMutex mutex;
+ QWaitCondition syncCondition;
+ int errorCode;
+ bool watcherStarted;
+ CNotifyChangeEvent *currentEvent;
+};
+
+#endif // QT_NO_FILESYSTEMWATCHER
+
+QT_END_NAMESPACE
+
+#endif // QFILESYSTEMWATCHER_WIN_P_H
diff --git a/src/corelib/io/qfsfileengine.h b/src/corelib/io/qfsfileengine.h
index a2b732e84e..f54a6e82a6 100644
--- a/src/corelib/io/qfsfileengine.h
+++ b/src/corelib/io/qfsfileengine.h
@@ -83,6 +83,9 @@ public:
FileFlags fileFlags(FileFlags type) const;
bool setPermissions(uint perms);
QString fileName(FileName file) const;
+#ifdef Q_OS_SYMBIAN
+ QString fileNameSymbian(FileName file) const;
+#endif
uint ownerId(FileOwner) const;
QString owner(FileOwner) const;
QDateTime fileTime(FileTime time) const;
diff --git a/src/corelib/io/qfsfileengine_iterator_unix.cpp b/src/corelib/io/qfsfileengine_iterator_unix.cpp
index 2284d9ba85..fd95f818f2 100644
--- a/src/corelib/io/qfsfileengine_iterator_unix.cpp
+++ b/src/corelib/io/qfsfileengine_iterator_unix.cpp
@@ -53,7 +53,7 @@ class QFSFileEngineIteratorPlatformSpecificData
public:
inline QFSFileEngineIteratorPlatformSpecificData()
: dir(0), dirEntry(0), done(false)
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
, mt_file(0)
#endif
{ }
@@ -62,7 +62,7 @@ public:
dirent *dirEntry;
bool done;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
// for readdir_r
dirent *mt_file;
#endif
@@ -75,7 +75,7 @@ void QFSFileEngineIterator::advance()
if (!platform->dir)
return;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
if (::readdir_r(platform->dir, platform->mt_file, &platform->dirEntry) != 0)
platform->done = true;
#else
@@ -86,7 +86,7 @@ void QFSFileEngineIterator::advance()
::closedir(platform->dir);
platform->dir = 0;
platform->done = true;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
delete [] platform->mt_file;
platform->mt_file = 0;
#endif
@@ -102,7 +102,7 @@ void QFSFileEngineIterator::deletePlatformSpecifics()
{
if (platform->dir) {
::closedir(platform->dir);
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
delete [] platform->mt_file;
platform->mt_file = 0;
#endif
@@ -123,7 +123,7 @@ bool QFSFileEngineIterator::hasNext() const
if ((int) maxPathName == -1)
maxPathName = FILENAME_MAX;
maxPathName += sizeof(dirent) + 1;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
if (that->platform->mt_file)
delete [] that->platform->mt_file;
that->platform->mt_file = (dirent *)new char[maxPathName];
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 18b92e2d41..72ea065cd4 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -51,12 +51,16 @@
#include "qfile.h"
#include "qdir.h"
#include "qdatetime.h"
-#include "qdebug.h"
#include "qvarlengtharray.h"
#include <sys/mman.h>
#include <stdlib.h>
#include <limits.h>
+#if defined(Q_OS_SYMBIAN)
+# include <syslimits.h>
+# include <f32file.h>
+# include "private/qcore_symbian_p.h"
+#endif
#include <errno.h>
#if !defined(QWS) && defined(Q_OS_MAC)
# include <private/qcore_mac_p.h>
@@ -64,6 +68,22 @@
QT_BEGIN_NAMESPACE
+
+#ifdef Q_OS_SYMBIAN
+/*!
+ \internal
+
+ Returns true if supplied path is a relative path
+*/
+static bool isRelativePathSymbian(const QString& fileName)
+{
+ return !(fileName.startsWith(QLatin1Char('/'))
+ || (fileName.length() >= 2
+ && ((fileName.at(0).isLetter() && fileName.at(1) == QLatin1Char(':'))
+ || (fileName.at(0) == QLatin1Char('/') && fileName.at(1) == QLatin1Char('/')))));
+}
+#endif
+
/*!
\internal
@@ -379,10 +399,39 @@ bool QFSFileEngine::remove()
return unlink(d->nativeFilePath.constData()) == 0;
}
-bool QFSFileEngine::copy(const QString &)
+bool QFSFileEngine::copy(const QString &newName)
{
+#if defined(Q_OS_SYMBIAN)
+ Q_D(QFSFileEngine);
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ CFileMan* fm = NULL;
+ HBufC* oldBuf = NULL;
+ HBufC* newBuf = NULL;
+ TRAP (err,
+ fm = CFileMan::NewL(rfs);
+ oldBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(d->filePath));
+ RFile rfile;
+ err = rfile.Open(rfs, *oldBuf, EFileShareReadersOrWriters);
+ if (err == KErrNone) {
+ QFileInfo fi(newName);
+ QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName();
+ newBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(absoluteNewName));
+ err = fm->Copy(rfile, *newBuf);
+ rfile.Close();
+ }
+ ) // End TRAP
+ delete oldBuf;
+ delete newBuf;
+ delete fm;
+ rfs.Close();
+ }
+ return (err == KErrNone);
+#else
// ### Add copy code for Unix here
return false;
+#endif
}
bool QFSFileEngine::rename(const QString &newName)
@@ -406,7 +455,11 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con
{
QString dirName = name;
if (createParentDirectories) {
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
+#else
dirName = QDir::cleanPath(dirName);
+#endif
for(int oldslash = -1, slash=0; slash != -1; oldslash = slash) {
slash = dirName.indexOf(QDir::separator(), oldslash+1);
if (slash == -1) {
@@ -438,7 +491,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
{
QString dirName = name;
if (recurseParentDirectories) {
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
+#else
dirName = QDir::cleanPath(dirName);
+#endif
for(int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
QByteArray chunk = QFile::encodeName(dirName.left(slash));
QT_STATBUF st;
@@ -459,7 +516,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
bool QFSFileEngine::caseSensitive() const
{
+#if defined(Q_OS_SYMBIAN)
+ return false;
+#else
return true;
+#endif
}
bool QFSFileEngine::setCurrentPath(const QString &path)
@@ -473,6 +534,16 @@ QString QFSFileEngine::currentPath(const QString &)
{
QString result;
QT_STATBUF st;
+#if defined(Q_OS_SYMBIAN)
+ char currentName[PATH_MAX+1];
+ if (::getcwd(currentName, PATH_MAX))
+ result = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(currentName)));
+ if (result.isEmpty()) {
+# if defined(QT_DEBUG)
+ qWarning("QDir::currentPath: getcwd() failed");
+# endif
+ } else
+#endif
if (QT_STAT(".", &st) == 0) {
#if defined(__GLIBC__) && !defined(PATH_MAX)
char *currentName = ::get_current_dir_name();
@@ -480,18 +551,26 @@ QString QFSFileEngine::currentPath(const QString &)
result = QFile::decodeName(QByteArray(currentName));
::free(currentName);
}
-#else
+#elif !defined(Q_OS_SYMBIAN)
char currentName[PATH_MAX+1];
if (::getcwd(currentName, PATH_MAX))
result = QFile::decodeName(QByteArray(currentName));
-#endif
-#if defined(QT_DEBUG)
+# if defined(QT_DEBUG)
if (result.isNull())
qWarning("QDir::currentPath: getcwd() failed");
+# endif
#endif
} else {
-#if defined(QT_DEBUG)
+#if defined(Q_OS_SYMBIAN)
+ // If current dir returned by Open C doesn't exist,
+ // try to create it (can happen with application private dirs)
+ // Ignore mkdir failures; we want to be consistent with Open C
+ // current path regardless.
+ ::mkdir(QFile::encodeName(currentName), 0777);
+#else
+# if defined(QT_DEBUG)
qWarning("QDir::currentPath: stat(\".\") failed");
+# endif
#endif
}
return result;
@@ -500,28 +579,61 @@ QString QFSFileEngine::currentPath(const QString &)
QString QFSFileEngine::homePath()
{
QString home = QFile::decodeName(qgetenv("HOME"));
+#if defined(Q_OS_SYMBIAN)
+ if (home.isEmpty())
+ home = QLatin1String("C:/Data");
+#else
if (home.isNull())
home = rootPath();
+#endif
return home;
}
QString QFSFileEngine::rootPath()
{
+#if defined(Q_OS_SYMBIAN)
+ return QString::fromLatin1("C:/");
+#else
return QString::fromLatin1("/");
+#endif
}
QString QFSFileEngine::tempPath()
{
- QString temp = QFile::decodeName(qgetenv("TMPDIR"));
- if (temp.isEmpty())
- temp = QString::fromLatin1("/tmp/");
+#ifdef Q_OS_SYMBIAN
+ QString temp = QDir::currentPath().left(2);
+ temp += QString::fromLatin1( "/system/temp/");
+#else
+ QString temp = QFile::decodeName(qgetenv("TMPDIR"));
+ if (temp.isEmpty())
+ temp = QString::fromLatin1("/tmp/");
+#endif
return temp;
}
QFileInfoList QFSFileEngine::drives()
{
QFileInfoList ret;
+#if defined(Q_OS_SYMBIAN)
+ TDriveList driveList;
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ err = rfs.DriveList(driveList);
+ if (err == KErrNone) {
+ for(char i=0; i < KMaxDrives; i++) {
+ if (driveList[i]) {
+ ret.append(QString("%1:/").arg(QChar('A'+i)));
+ }
+ }
+ } else {
+ qWarning("QDir::drives: Getting drives failed");
+ }
+ rfs.Close();
+ }
+#else
ret.append(rootPath());
+#endif
return ret;
}
@@ -554,6 +666,32 @@ bool QFSFileEnginePrivate::isSymlink() const
return is_link;
}
+#if defined(Q_OS_SYMBIAN)
+static bool _q_isSymbianHidden(const QString &path, bool isDir)
+{
+ bool retval = false;
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ QFileInfo fi(path);
+ QString absPath = fi.absoluteFilePath();
+ if (isDir && absPath.at(absPath.size()-1) != QChar('/')) {
+ absPath += QChar('/');
+ }
+ HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(absPath));
+ TUint attributes;
+ err = rfs.Att(*buffer, attributes);
+ delete buffer;
+ rfs.Close();
+ if (err == KErrNone && (attributes & KEntryAttHidden)) {
+ retval = true;
+ }
+ }
+
+ return retval;
+}
+#endif
+
#if !defined(QWS) && defined(Q_OS_MAC)
static bool _q_isMacHidden(const QString &path)
{
@@ -674,20 +812,147 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
ret |= LocalDiskFlag;
if (exists)
ret |= ExistsFlag;
+#if defined(Q_OS_SYMBIAN)
+ if (d->filePath == QLatin1String("/") || (d->filePath.at(0).isLetter() && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")))
+ ret |= RootFlag;
+
+ // In Symbian, all symlinks have hidden attribute for some reason;
+ // lets make them visible for better compatibility with other platforms.
+ // If somebody actually wants a hidden link, then they are out of luck.
+ if (!(ret & RootFlag) && !d->isSymlink())
+ if(_q_isSymbianHidden(d->filePath, ret & DirectoryType)
+#else
if (fileName(BaseName)[0] == QLatin1Char('.')
-#if !defined(QWS) && defined(Q_OS_MAC)
+# if !defined(QWS) && defined(Q_OS_MAC)
|| _q_isMacHidden(d->filePath)
+# endif
#endif
)
ret |= HiddenFlag;
+#if !defined(Q_OS_SYMBIAN)
if (d->filePath == QLatin1String("/"))
ret |= RootFlag;
+#endif
}
return ret;
}
+#ifdef Q_OS_SYMBIAN
+QString QFSFileEngine::fileNameSymbian(FileName file) const
+{
+ Q_D(const QFSFileEngine);
+ if(file == BaseName) {
+ int slash = d->filePath.lastIndexOf(QLatin1Char('/'));
+ if(slash == -1) {
+ int colon = d->filePath.lastIndexOf(QLatin1Char(':'));
+ if(colon != -1)
+ return d->filePath.mid(colon + 1);
+ return d->filePath;
+ }
+ return d->filePath.mid(slash + 1);
+ } else if(file == PathName) {
+ if(!d->filePath.size())
+ return d->filePath;
+
+ int slash = d->filePath.lastIndexOf(QLatin1Char('/'));
+ if(slash == -1) {
+ if(d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
+ return d->filePath.left(2);
+ return QString::fromLatin1(".");
+ } else {
+ if(!slash)
+ return QString::fromLatin1("/");
+ if(slash == 2 && d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
+ slash++;
+ return d->filePath.left(slash);
+ }
+ } else if(file == AbsoluteName || file == AbsolutePathName) {
+ QString ret;
+ if (!isRelativePath()) {
+ if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':')
+ && d->filePath.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
+ d->filePath.startsWith(QLatin1Char('/')) // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
+ ) {
+ ret = QString(QDir::currentPath().left(2) + QDir::fromNativeSeparators(d->filePath));
+ } else {
+ ret = d->filePath;
+ }
+ } else {
+ ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
+ }
+
+ // The path should be absolute at this point.
+ // From the docs :
+ // Absolute paths begin with the directory separator "/"
+ // (optionally preceded by a drive specification under Windows).
+ if (ret.at(0) != QLatin1Char('/')) {
+ Q_ASSERT(ret.length() >= 2);
+ Q_ASSERT(ret.at(0).isLetter());
+ Q_ASSERT(ret.at(1) == QLatin1Char(':'));
+
+ // Force uppercase drive letters.
+ ret[0] = ret.at(0).toUpper();
+ }
+
+ if (file == AbsolutePathName) {
+ int slash = ret.lastIndexOf(QLatin1Char('/'));
+ if (slash < 0)
+ return ret;
+ else if (ret.at(0) != QLatin1Char('/') && slash == 2)
+ return ret.left(3); // include the slash
+ else
+ return ret.left(slash > 0 ? slash : 1);
+ }
+ return ret;
+ } else if(file == CanonicalName || file == CanonicalPathName) {
+ if (!(fileFlags(ExistsFlag) & ExistsFlag))
+ return QString();
+
+ QString ret = QFSFileEnginePrivate::canonicalized(fileName(AbsoluteName));
+ if (!ret.isEmpty() && file == CanonicalPathName) {
+ int slash = ret.lastIndexOf(QLatin1Char('/'));
+ if (slash == -1)
+ ret = QDir::fromNativeSeparators(QDir::currentPath());
+ else if (slash == 0)
+ ret = QLatin1String("/");
+ ret = ret.left(slash);
+ }
+ return ret;
+ } else if(file == LinkName) {
+ if (d->isSymlink()) {
+ char s[PATH_MAX+1];
+ int len = readlink(d->nativeFilePath.constData(), s, PATH_MAX);
+ if (len > 0) {
+ s[len] = '\0';
+ QString ret = QFile::decodeName(QByteArray(s));
+
+ if (isRelativePathSymbian(ret)) {
+ if (!isRelativePathSymbian(d->filePath)) {
+ ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
+ + QLatin1Char('/'));
+ } else {
+ ret.prepend(QDir::currentPath() + QLatin1Char('/'));
+ }
+ }
+ ret = QDir::cleanPath(ret);
+ if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
+ ret.chop(1);
+ return ret;
+ }
+ }
+ return QString();
+ } else if(file == BundleName) {
+ return QString();
+ }
+ return d->filePath;
+}
+#endif
+
QString QFSFileEngine::fileName(FileName file) const
{
+#ifdef Q_OS_SYMBIAN
+ return fileNameSymbian(file);
+#endif
Q_D(const QFSFileEngine);
if (file == BundleName) {
#if !defined(QWS) && defined(Q_OS_MAC)
@@ -831,10 +1096,14 @@ QString QFSFileEngine::fileName(FileName file) const
bool QFSFileEngine::isRelativePath() const
{
Q_D(const QFSFileEngine);
+#ifdef Q_OS_SYMBIAN
+ return isRelativePathSymbian(d->filePath);
+#else
int len = d->filePath.length();
if (len == 0)
return true;
return d->filePath[0] != QLatin1Char('/');
+#endif
}
uint QFSFileEngine::ownerId(FileOwner own) const
@@ -870,6 +1139,9 @@ QString QFSFileEngine::owner(FileOwner own) const
if (pw)
return QFile::decodeName(QByteArray(pw->pw_name));
} else if (own == OwnerGroup) {
+#ifdef Q_OS_SYMBIAN
+ return QString();
+#endif
struct group *gr = 0;
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 63506c2c14..2df13f031f 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1459,7 +1459,7 @@ bool QFSFileEnginePrivate::doStat() const
static QString readLink(const QString &link)
{
#if !defined(Q_OS_WINCE)
-#if !defined(QT_NO_LIBRARY)
+#if !defined(QT_NO_LIBRARY) && !defined(Q_CC_MWERKS)
QString ret;
QT_WA({
bool neededCoInit = false;
@@ -1562,7 +1562,7 @@ QString QFSFileEnginePrivate::getLink() const
bool QFSFileEngine::link(const QString &newName)
{
#if !defined(Q_OS_WINCE)
-#if !defined(QT_NO_LIBRARY)
+#if !defined(QT_NO_LIBRARY) && !defined(Q_CC_MWERKS)
bool ret = false;
QString linkName = newName;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index efa4b258ab..38168030f8 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1032,6 +1032,15 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
if (readSoFar)
debugBinaryString(data, int(readSoFar));
#endif
+#if defined(Q_OS_SYMBIAN)
+ // Open C fgets strips '\r' but readSoFar gets returned as if it was still there
+ if ((d->openMode & Text) &&
+ readSoFar > 1 &&
+ data[readSoFar - 1] == '\0' &&
+ data[readSoFar - 2] == '\n') {
+ --readSoFar;
+ }
+#endif
if (readSoFar && data[readSoFar - 1] == '\n') {
if (d->openMode & Text) {
// QRingBuffer::readLine() isn't Text aware.
@@ -1070,6 +1079,12 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
data[readSoFar] = '\0';
if (d->openMode & Text) {
+#if defined(Q_OS_SYMBIAN)
+ // Open C fgets strips '\r' but readSoFar gets returned as if it was still there
+ if (readSoFar > 1 && data[readSoFar - 1] == '\0' && data[readSoFar - 2] == '\n') {
+ --readSoFar;
+ }
+#endif
if (readSoFar > 1 && data[readSoFar - 1] == '\n' && data[readSoFar - 2] == '\r') {
data[readSoFar - 2] = '\n';
data[readSoFar - 1] = '\0';
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index a1284822db..8183527cdb 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -153,7 +153,8 @@ void QProcessPrivate::Channel::clear()
used as an input source for QXmlReader, or for generating data to
be uploaded using QFtp.
- \note On Windows CE, reading and writing to a process is not supported.
+ \note On Windows CE and Symbian, reading and writing to a process
+ is not supported.
When the process exits, QProcess reenters the \l NotRunning state
(the initial state), and emits finished().
@@ -203,6 +204,10 @@ void QProcessPrivate::Channel::clear()
setWorkingDirectory(). By default, processes are run in the
current working directory of the calling process.
+ \note On Symbian, setting environment or working directory
+ is not supported. The working directory will always be the private
+ directory of the running process.
+
\section1 Synchronous Process API
QProcess provides a set of functions which allow it to be used
@@ -436,6 +441,10 @@ QProcessPrivate::QProcessPrivate()
#ifdef Q_OS_UNIX
serial = 0;
#endif
+#ifdef Q_OS_SYMBIAN
+ symbianProcess = NULL;
+ processLaunched = false;
+#endif
}
/*! \internal
@@ -508,6 +517,13 @@ void QProcessPrivate::cleanup()
#ifdef Q_OS_UNIX
serial = 0;
#endif
+#ifdef Q_OS_SYMBIAN
+ if (symbianProcess) {
+ symbianProcess->Close();
+ delete symbianProcess;
+ symbianProcess = NULL;
+ }
+#endif
}
/*! \internal
@@ -765,7 +781,7 @@ void QProcessPrivate::closeWriteChannel()
if (stdinChannel.notifier) {
qDeleteInEventHandler(stdinChannel.notifier);
stdinChannel.notifier = 0;
- }
+ }
}
#ifdef Q_OS_WIN
// ### Find a better fix, feeding the process little by little
@@ -1064,6 +1080,10 @@ QString QProcess::workingDirectory() const
process in this directory. The default behavior is to start the
process in the working directory of the calling process.
+ \note The working directory setting is ignored on Symbian;
+ the private directory of the process is considered its working
+ directory.
+
\sa workingDirectory(), start()
*/
void QProcess::setWorkingDirectory(const QString &dir)
@@ -1205,7 +1225,7 @@ void QProcess::setEnvironment(const QStringList &environment)
using setEnvironment(). If no environment has been set, the
environment of the calling process will be used.
- \note The environment settings are ignored on Windows CE,
+ \note The environment settings are ignored on Windows CE and Symbian,
as there is no concept of an environment.
\sa setEnvironment(), systemEnvironment()
@@ -1636,6 +1656,9 @@ void QProcess::start(const QString &program, OpenMode mode)
event loop does not handle the WM_CLOSE message, can only be terminated by
calling kill().
+ \note Terminating running processes from other processes will typically
+ cause a panic in Symbian due to platform security.
+
\sa kill()
*/
void QProcess::terminate()
@@ -1650,6 +1673,9 @@ void QProcess::terminate()
On Windows, kill() uses TerminateProcess, and on Unix and Mac OS X, the
SIGKILL signal is sent to the process.
+ \note Killing running processes from other processes will typically
+ cause a panic in Symbian due to platform security.
+
\sa terminate()
*/
void QProcess::kill()
@@ -1796,9 +1822,9 @@ QT_BEGIN_INCLUDE_NAMESPACE
#ifdef Q_OS_MAC
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
-#elif defined(Q_OS_WINCE)
- static char *qt_wince_environ[] = { 0 };
-#define environ qt_wince_environ
+#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ static char *qt_empty_environ[] = { 0 };
+#define environ qt_empty_environ
#elif !defined(Q_OS_WIN)
extern char **environ;
#endif
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 54a96c7640..ae40de3ebb 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -53,8 +53,13 @@ QT_MODULE(Core)
#ifndef QT_NO_PROCESS
-#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)) || defined(qdoc)
+#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)) || defined(qdoc)
typedef qint64 Q_PID;
+#elif defined(Q_OS_SYMBIAN)
+QT_END_NAMESPACE
+# include <e32std.h>
+QT_BEGIN_NAMESPACE
+typedef TProcessId Q_PID;
#else
QT_END_NAMESPACE
typedef struct _PROCESS_INFORMATION *Q_PID;
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index 33059dd95a..554c47781d 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -180,7 +180,7 @@ public:
QWinEventNotifier *processFinishedNotifier;
void startProcess();
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
void execChild(const char *workingDirectory, char **path, char **argv, char **envp);
#endif
bool processStarted();
@@ -221,6 +221,11 @@ public:
#ifdef Q_OS_UNIX
static void initializeProcessManager();
#endif
+
+#ifdef Q_OS_SYMBIAN
+ bool processLaunched;
+ RProcess* symbianProcess;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
new file mode 100644
index 0000000000..ae7f51a10e
--- /dev/null
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -0,0 +1,1003 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+//#define QPROCESS_DEBUG
+
+#ifdef QPROCESS_DEBUG
+#include "qdebug.h"
+#define QPROCESS_DEBUG_PRINT(args...) qDebug(args);
+#else
+#define QPROCESS_DEBUG_PRINT(args...)
+#endif
+
+#ifndef QT_NO_PROCESS
+
+#define QPROCESS_ASSERT(check, panicReason, args...) \
+ if (!(check)) { \
+ qWarning(args); \
+ User::Panic(KQProcessPanic, panicReason); \
+ }
+
+#include <e32base.h>
+#include <e32std.h>
+#include <stdio.h>
+#include "qplatformdefs.h"
+
+#include "qstring.h"
+#include "qprocess.h"
+#include "qprocess_p.h"
+
+#include <private/qthread_p.h>
+#include <qmutex.h>
+#include <qmap.h>
+#include <qsocketnotifier.h>
+
+#include <errno.h>
+
+
+QT_BEGIN_NAMESPACE
+
+_LIT(KQProcessManagerThreadName, "QProcManThread");
+_LIT(KQProcessPanic, "QPROCESS");
+enum TQProcessPanic {
+ EProcessManagerMediatorRunError = 1,
+ EProcessManagerMediatorInactive = 2,
+ EProcessManagerMediatorNotPending = 3,
+ EProcessManagerMediatorInvalidCmd = 4,
+ EProcessManagerMediatorCreationFailed = 5,
+ EProcessManagerMediatorThreadOpenFailed = 6,
+ EProcessManagerMediatorNullObserver = 7,
+ EProcessActiveRunError = 10,
+ EProcessActiveNullParameter = 11,
+ EProcessManagerMutexCreationFail = 20,
+ EProcessManagerThreadCreationFail = 21,
+ EProcessManagerSchedulerCreationFail = 22,
+ EProcessManagerNullParam = 23
+};
+
+// Forward declarations
+class QProcessManager;
+
+
+// Active object to listen for child process death
+class CProcessActive : public CActive
+{
+public:
+ static CProcessActive* construct(QProcess* process,
+ RProcess** proc,
+ int serial,
+ int deathPipe);
+
+ virtual ~CProcessActive();
+
+ void start();
+ void stop();
+
+ bool error();
+
+protected:
+
+ // From CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+ CProcessActive();
+
+private:
+
+ QProcess* process;
+ RProcess** pproc;
+ int serial;
+ int deathPipe;
+ bool errorValue;
+};
+
+// Active object to communicate synchronously with process manager thread
+class CProcessManagerMediator : public CActive
+{
+public:
+ static CProcessManagerMediator* construct();
+
+ virtual ~CProcessManagerMediator();
+
+ bool add(CProcessActive* processObserver);
+ void remove(CProcessActive* processObserver);
+ void terminate();
+
+protected:
+
+ enum Commands {
+ ENoCommand,
+ EAdd,
+ ERemove,
+ ETerminate
+ };
+
+ // From CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+ CProcessManagerMediator();
+
+ bool notify(CProcessActive* processObserver, Commands command);
+
+private:
+ CProcessActive* currentObserver;
+ Commands currentCommand;
+
+ RThread processManagerThread;
+};
+
+// Process manager manages child process death listeners
+class QProcessManager
+{
+public:
+ QProcessManager();
+ ~QProcessManager();
+
+ void startThread();
+
+ TInt run(void* param);
+ bool add(QProcess *process);
+ void remove(QProcess *process);
+
+ inline void setMediator(CProcessManagerMediator* newMediator) {mediator = newMediator;};
+
+private:
+ inline void lock() {managerMutex.Wait();};
+ inline void unlock() {managerMutex.Signal();};
+
+ QMap<int, CProcessActive *> children;
+ CProcessManagerMediator* mediator;
+ RMutex managerMutex;
+ bool threadStarted;
+ RThread managerThread;
+};
+
+static bool qt_rprocess_running(RProcess* proc)
+{
+ if(proc && proc->Handle()) {
+ TExitType et = proc->ExitType();
+ if (et == EExitPending) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static void qt_create_symbian_commandline(const QStringList &arguments, QString& commandLine)
+{
+ for (int i=0; i<arguments.size(); ++i) {
+ QString tmp = arguments.at(i);
+ // in the case of \" already being in the string the \ must also be escaped
+ tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") );
+ // escape a single " because the arguments will be parsed
+ tmp.replace( QLatin1String("\""), QLatin1String("\\\"") );
+ if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
+ // The argument must not end with a \ since this would be interpreted
+ // as escaping the quote -- rather put the \ behind the quote: e.g.
+ // rather use "foo"\ than "foo\"
+ QString endQuote(QLatin1String("\""));
+ int i = tmp.length();
+ while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) {
+ --i;
+ endQuote += QLatin1String("\\");
+ }
+ commandLine += QLatin1String(" \"") + tmp.left(i) + endQuote;
+ } else {
+ commandLine += QLatin1Char(' ') + tmp;
+ }
+ }
+}
+
+static TInt qt_create_symbian_process(RProcess **proc, const QString &programName, const QStringList &arguments)
+{
+ RProcess* newProc = NULL;
+ newProc = new RProcess();
+
+ if (!newProc) {
+ return KErrNoMemory;
+ }
+
+ QString commandLine;
+ qt_create_symbian_commandline(arguments, commandLine);
+
+ TPtrC program_ptr(reinterpret_cast<const TText*>(programName.constData()));
+ TPtrC cmdline_ptr(reinterpret_cast<const TText*>(commandLine.constData()));
+
+ TInt err = newProc->Create(program_ptr, cmdline_ptr);
+
+ if (err == KErrNotFound){
+ // Strip path from program name and try again (i.e. try from default location "\sys\bin")
+ int index = programName.lastIndexOf(QChar('\\'));
+ int index2 = programName.lastIndexOf(QChar('/'));
+ index = qMax(index, index2);
+
+ if(index != -1 && programName.length() >= index){
+ QString strippedName;
+ strippedName = programName.mid(index+1);
+ QPROCESS_DEBUG_PRINT("qt_create_symbian_process() Process '%s' not found, try stripped version '%s'", qPrintable(programName), qPrintable(strippedName));
+
+ TPtrC stripped_ptr(reinterpret_cast<const TText*>(strippedName.constData()));
+ err = newProc->Create(stripped_ptr, cmdline_ptr);
+
+ if (err != KErrNone) {
+ QPROCESS_DEBUG_PRINT("qt_create_symbian_process() Unable to create process '%s': %d", qPrintable(strippedName), err);
+ }
+ }
+ }
+
+ if (err == KErrNone) {
+ *proc = newProc;
+ } else {
+ delete newProc;
+ }
+
+ return err;
+}
+
+static qint64 qt_native_read(int fd, char *data, qint64 maxlen)
+{
+ qint64 ret = 0;
+ do {
+ ret = ::read(fd, data, maxlen);
+ } while (ret == -1 && errno == EINTR);
+
+ QPROCESS_DEBUG_PRINT("qt_native_read(): fd: %d, result: %d, errno = %d", fd, (int)ret, errno);
+
+ return ret;
+}
+
+static qint64 qt_native_write(int fd, const char *data, qint64 len)
+{
+ qint64 ret = 0;
+ do {
+ ret = ::write(fd, data, len);
+ } while (ret == -1 && errno == EINTR);
+
+ QPROCESS_DEBUG_PRINT("qt_native_write(): fd: %d, result: %d, errno = %d", fd, (int)ret, errno);
+
+ return ret;
+}
+
+static void qt_native_close(int fd)
+{
+ int ret;
+ do {
+ ret = ::close(fd);
+ } while (ret == -1 && errno == EINTR);
+}
+
+static void qt_create_pipe(int *pipe)
+{
+ if (pipe[0] != -1)
+ qt_native_close(pipe[0]);
+ if (pipe[1] != -1)
+ qt_native_close(pipe[1]);
+ if (::pipe(pipe) != 0) {
+ qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",
+ pipe, qPrintable(qt_error_string(errno)));
+ } else {
+ QPROCESS_DEBUG_PRINT("qt_create_pipe(): Created pipe %d - %d", pipe[0], pipe[1]);
+ }
+}
+
+// Called from ProcessManagerThread
+CProcessActive* CProcessActive::construct(QProcess* process,
+ RProcess** proc,
+ int serial,
+ int deathPipe)
+{
+ QPROCESS_ASSERT((process || proc || *proc),
+ EProcessActiveNullParameter,
+ "CProcessActive::construct(): process (0x%x), proc (0x%x) or *proc == NULL, not creating an instance", process, proc)
+
+ CProcessActive* newInstance = new CProcessActive();
+
+ if (!newInstance) {
+ QPROCESS_DEBUG_PRINT("CProcessActive::construct(): Failed to create new instance");
+ } else {
+ newInstance->process = process;
+ newInstance->pproc = proc;
+ newInstance->serial = serial;
+ newInstance->deathPipe = deathPipe;
+ newInstance->errorValue = false;
+ }
+
+ return newInstance;
+}
+
+// Called from ProcessManagerThread
+CProcessActive::CProcessActive()
+ : CActive(CActive::EPriorityStandard)
+{
+ // Nothing to do
+}
+
+// Called from ProcessManagerThread
+CProcessActive::~CProcessActive()
+{
+ process = NULL;
+ pproc = NULL;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::start()
+{
+ if (qt_rprocess_running(*pproc)) {
+ CActiveScheduler::Add(this);
+ (*pproc)->Logon(iStatus);
+ SetActive();
+ QPROCESS_DEBUG_PRINT("CProcessActive::start(): Started monitoring for process exit.");
+ } else {
+ QPROCESS_DEBUG_PRINT("CProcessActive::start(): Process doesn't exist or is already dead");
+ // Assume process has already died
+ qt_native_write(deathPipe, "", 1);
+ errorValue = true;
+ }
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::stop()
+{
+ QPROCESS_DEBUG_PRINT("CProcessActive::stop()");
+
+ // Remove this from scheduler (also cancels the request)
+ Deque();
+}
+
+bool CProcessActive::error()
+{
+ return errorValue;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::RunL()
+{
+ // If this method gets executed, the monitored process has died
+
+ // Notify main thread
+ qt_native_write(deathPipe, "", 1);
+ QPROCESS_DEBUG_PRINT("CProcessActive::RunL() sending death notice to %d", deathPipe);
+}
+
+// Called from ProcessManagerThread
+TInt CProcessActive::RunError(TInt aError)
+{
+ Q_UNUSED(aError);
+ // Handle RunL leave (should never happen)
+ QPROCESS_ASSERT(0, EProcessActiveRunError, "CProcessActive::RunError(): Should never get here!")
+ return 0;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::DoCancel()
+{
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel()");
+
+ if (qt_rprocess_running(*pproc)) {
+ (*pproc)->LogonCancel(iStatus);
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel(): Stopped monitoring for process exit.");
+ } else {
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel(): Process doesn't exist");
+ }
+}
+
+
+// Called from ProcessManagerThread
+CProcessManagerMediator* CProcessManagerMediator::construct()
+{
+ CProcessManagerMediator* newInstance = new CProcessManagerMediator;
+ TInt err(KErrNone);
+
+ newInstance->currentCommand = ENoCommand;
+ newInstance->currentObserver = NULL;
+
+ if (newInstance) {
+ err = newInstance->processManagerThread.Open(newInstance->processManagerThread.Id());
+ QPROCESS_ASSERT((err == KErrNone),
+ EProcessManagerMediatorThreadOpenFailed,
+ "CProcessManagerMediator::construct(): Failed to open processManagerThread (err:%d)", err)
+ } else {
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorCreationFailed,
+ "CProcessManagerMediator::construct(): Failed to open construct mediator")
+ }
+
+ // Activate mediator
+ CActiveScheduler::Add(newInstance);
+ newInstance->iStatus = KRequestPending;
+ newInstance->SetActive();
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::construct(): new instance successfully created and activated");
+
+ return newInstance;
+}
+
+// Called from ProcessManagerThread
+CProcessManagerMediator::CProcessManagerMediator()
+ : CActive(CActive::EPriorityStandard)
+{
+ // Nothing to do
+}
+
+// Called from ProcessManagerThread
+CProcessManagerMediator::~CProcessManagerMediator()
+{
+ processManagerThread.Close();
+ currentCommand = ENoCommand;
+ currentObserver = NULL;
+}
+
+// Called from main thread
+bool CProcessManagerMediator::add(CProcessActive* processObserver)
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::add()");
+ return notify(processObserver, EAdd);
+}
+
+// Called from main thread
+void CProcessManagerMediator::remove(CProcessActive* processObserver)
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::remove()");
+ notify(processObserver, ERemove);
+}
+
+// Called from main thread
+void CProcessManagerMediator::terminate()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::terminate()");
+ notify(NULL, ETerminate);
+}
+
+// Called from main thread
+bool CProcessManagerMediator::notify(CProcessActive* processObserver, Commands command)
+{
+ bool success(true);
+
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Command: %d, processObserver: 0x%x", command, processObserver);
+
+ QPROCESS_ASSERT((command == ETerminate || processObserver),
+ EProcessManagerMediatorNullObserver,
+ "CProcessManagerMediator::Notify(): NULL processObserver not allowed for command: %d", command)
+
+ QPROCESS_ASSERT(IsActive(),
+ EProcessManagerMediatorInactive,
+ "CProcessManagerMediator::Notify(): Mediator is not active!")
+
+ QPROCESS_ASSERT(iStatus==KRequestPending,
+ EProcessManagerMediatorNotPending,
+ "CProcessManagerMediator::Notify(): Mediator request not pending!")
+
+ currentObserver = processObserver;
+ currentCommand = command;
+
+ // Sync with process manager thread
+ TRequestStatus pmStatus;
+ processManagerThread.Rendezvous(pmStatus);
+
+ // Complete request -> RunL will run in the process manager thread
+ TRequestStatus* status = &iStatus;
+ processManagerThread.RequestComplete(status, command);
+
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Waiting process manager to complete...");
+ User::WaitForRequest(pmStatus);
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Wait over");
+
+ if (currentObserver) {
+ success = !(currentObserver->error());
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): success = %d", success);
+ }
+
+ currentObserver = NULL;
+ currentCommand = ENoCommand;
+
+ return success;
+}
+
+// Called from ProcessManagerThread
+void CProcessManagerMediator::RunL()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::RunL(): currentCommand: %d, iStatus: %d", currentCommand, iStatus.Int());
+ switch (currentCommand) {
+ case EAdd:
+ currentObserver->start();
+ break;
+ case ERemove:
+ currentObserver->stop();
+ break;
+ case ETerminate:
+ Deque();
+ CActiveScheduler::Stop();
+ return;
+ default:
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorInvalidCmd,
+ "CProcessManagerMediator::RunL(): Invalid command!")
+ break;
+ }
+
+ iStatus = KRequestPending;
+ SetActive();
+
+ // Notify main thread that we are done
+ RThread::Rendezvous(KErrNone);
+}
+
+// Called from ProcessManagerThread
+TInt CProcessManagerMediator::RunError(TInt aError)
+{
+ Q_UNUSED(aError);
+ // Handle RunL leave (should never happen)
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorRunError,
+ "CProcessManagerMediator::RunError(): Should never get here!")
+ return 0;
+}
+
+// Called from ProcessManagerThread
+void CProcessManagerMediator::DoCancel()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::DoCancel()");
+ TRequestStatus* status = &iStatus;
+ processManagerThread.RequestComplete(status, KErrCancel);
+}
+
+Q_GLOBAL_STATIC(QProcessManager, processManager)
+
+TInt processManagerThreadFunction(TAny* param)
+{
+ QPROCESS_ASSERT(param,
+ EProcessManagerNullParam,
+ "processManagerThreadFunction(): NULL param")
+
+ QProcessManager* manager = reinterpret_cast<QProcessManager*>(param);
+
+ CActiveScheduler* scheduler = new CActiveScheduler();
+
+ QPROCESS_ASSERT(scheduler,
+ EProcessManagerSchedulerCreationFail,
+ "processManagerThreadFunction(): Scheduler creation failed")
+
+ CActiveScheduler::Install(scheduler);
+
+ //Creating mediator also adds it to scheduler and activates it. Failure will panic.
+ manager->setMediator(CProcessManagerMediator::construct());
+ RThread::Rendezvous(KErrNone);
+
+ CActiveScheduler::Start();
+
+ CActiveScheduler::Install(NULL);
+ delete scheduler;
+
+ return KErrNone;
+}
+
+QProcessManager::QProcessManager()
+ : mediator(NULL), threadStarted(false)
+{
+ TInt err = managerMutex.CreateLocal();
+
+ QPROCESS_ASSERT(err == KErrNone,
+ EProcessManagerMutexCreationFail,
+ "QProcessManager::QProcessManager(): Failed to create new managerMutex (err: %d)", err)
+}
+
+QProcessManager::~QProcessManager()
+{
+ QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager()");
+ // Cancel death listening for all child processes
+ if (mediator) {
+ QMap<int, CProcessActive *>::Iterator it = children.begin();
+ while (it != children.end()) {
+ // Remove all monitors
+ CProcessActive *active = it.value();
+ mediator->remove(active);
+
+ QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process");
+ ++it;
+ }
+
+ // Terminate process manager thread.
+ mediator->terminate();
+ delete mediator;
+ }
+
+ qDeleteAll(children.values());
+ children.clear();
+ managerThread.Close();
+ managerMutex.Close();
+}
+
+void QProcessManager::startThread()
+{
+ lock();
+
+ if (!threadStarted) {
+ TInt err = managerThread.Create(KQProcessManagerThreadName,
+ processManagerThreadFunction,
+ 0x5000,
+ (RAllocator*)NULL,
+ (TAny*)this,
+ EOwnerProcess);
+
+ QPROCESS_ASSERT(err == KErrNone,
+ EProcessManagerThreadCreationFail,
+ "QProcessManager::startThread(): Failed to create new managerThread (err:%d)", err)
+
+ threadStarted = true;
+
+ // Manager thread must start running before we continue, so sync with rendezvous
+ TRequestStatus status;
+ managerThread.Rendezvous(status);
+ managerThread.Resume();
+ User::WaitForRequest(status);
+ }
+
+ unlock();
+}
+
+static QBasicAtomicInt idCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
+
+bool QProcessManager::add(QProcess *process)
+{
+ QPROCESS_ASSERT(process,
+ EProcessManagerNullParam,
+ "QProcessManager::add(): Failed to add CProcessActive to ProcessManager - NULL process")
+
+ lock();
+
+ int serial = idCounter.fetchAndAddRelaxed(1);
+ process->d_func()->serial = serial;
+
+ QPROCESS_DEBUG_PRINT("QProcessManager::add(): serial: %d, deathPipe: %d - %d, symbianProcess: 0x%x", serial, process->d_func()->deathPipe[0], process->d_func()->deathPipe[1], process->d_func()->symbianProcess);
+
+ CProcessActive* newActive =
+ CProcessActive::construct(process,
+ &(process->d_func()->symbianProcess),
+ serial,
+ process->d_func()->deathPipe[1]);
+
+ if (newActive){
+ if (mediator->add(newActive)) {
+ children.insert(serial, newActive);
+ unlock();
+ return true;
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessManager::add(): Failed to add CProcessActive to ProcessManager");
+ delete newActive;
+ }
+ }
+
+ unlock();
+
+ return false;
+}
+
+void QProcessManager::remove(QProcess *process)
+{
+ QPROCESS_ASSERT(process,
+ EProcessManagerNullParam,
+ "QProcessManager::remove(): Failed to remove CProcessActive from ProcessManager - NULL process")
+
+ lock();
+
+ int serial = process->d_func()->serial;
+ CProcessActive *active = children.value(serial);
+ if (!active) {
+ unlock();
+ return;
+ }
+
+ mediator->remove(active);
+
+ children.remove(serial);
+ delete active;
+
+ unlock();
+}
+
+void QProcessPrivate::destroyPipe(int *pipe)
+{
+ if (pipe[1] != -1) {
+ qt_native_close(pipe[1]);
+ pipe[1] = -1;
+ }
+ if (pipe[0] != -1) {
+ qt_native_close(pipe[0]);
+ pipe[0] = -1;
+ }
+}
+
+bool QProcessPrivate::createChannel(Channel &channel)
+{
+ Q_UNUSED(channel);
+ // No channels used
+ return false;
+}
+
+void QProcessPrivate::startProcess()
+{
+ Q_Q(QProcess);
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess()");
+
+ // Start the process (platform dependent)
+ q->setProcessState(QProcess::Starting);
+
+ processManager()->startThread();
+
+ qt_create_pipe(deathPipe);
+ if (threadData->eventDispatcher) {
+ deathNotifier = new QSocketNotifier(deathPipe[0],
+ QSocketNotifier::Read, q);
+ QObject::connect(deathNotifier, SIGNAL(activated(int)),
+ q, SLOT(_q_processDied()));
+ }
+
+ TInt err = qt_create_symbian_process(&symbianProcess, program, arguments);
+
+ if (err == KErrNone) {
+ pid = symbianProcess->Id();
+
+ ::fcntl(deathPipe[0], F_SETFL, ::fcntl(deathPipe[0], F_GETFL) | O_NONBLOCK);
+
+ if (!processManager()->add(q)) {
+ qWarning("QProcessPrivate::startProcess(): Failed to start monitoring for process death.");
+ err = KErrNoMemory;
+ }
+ }
+
+ if (err != KErrNone) {
+ // Cleanup, report error and return
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess() Process open failed, err: %d, '%s'", err, qPrintable(program));
+ q->setProcessState(QProcess::NotRunning);
+ processError = QProcess::FailedToStart;
+ q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Resource error (qt_create_symbian_process failure)")));
+ emit q->error(processError);
+ cleanup();
+ return;
+ }
+
+ processLaunched = true;
+
+ symbianProcess->Resume();
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess(): this: 0x%x, pid: %d", this, (TUint)pid);
+
+ // Notify child start
+ _q_startupNotification();
+
+}
+
+bool QProcessPrivate::processStarted()
+{
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::processStarted() == %s", processLaunched ? "true" : "false");
+
+ // Since we cannot get information whether process has actually been launched
+ // or not in Symbian, we need to fake it. Assume process is started if launch was
+ // successful.
+
+ return processLaunched;
+}
+
+qint64 QProcessPrivate::bytesAvailableFromStdout() const
+{
+ // In Symbian, zero bytes are always available
+ return 0;
+}
+
+qint64 QProcessPrivate::bytesAvailableFromStderr() const
+{
+ // In Symbian, zero bytes are always available
+ return 0;
+}
+
+qint64 QProcessPrivate::readFromStdout(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always read
+ return 0;
+}
+
+qint64 QProcessPrivate::readFromStderr(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always read
+ return 0;
+}
+
+qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always written
+ return 0;
+}
+
+void QProcessPrivate::terminateProcess()
+{
+ // Not allowed by platform security - will panic kern-exec 46 if process has been started.
+ // Works if process is not yet started.
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Terminate(0);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::terminateProcess(), Process not running");
+ }
+}
+
+void QProcessPrivate::killProcess()
+{
+ // Not allowed by platform security - will panic kern-exec 46 if process has been started.
+ // Works if process is not yet started.
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Kill(0);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::killProcess(), Process not running");
+ }
+}
+
+bool QProcessPrivate::waitForStarted(int msecs)
+{
+ Q_UNUSED(msecs);
+ // Since we can get no actual feedback from process beyond its death,
+ // assume that started has already been emitted if process has been launched
+ return processLaunched;
+}
+
+bool QProcessPrivate::waitForReadyRead(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+bool QProcessPrivate::waitForBytesWritten(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+bool QProcessPrivate::waitForFinished(int msecs)
+{
+ Q_Q(QProcess);
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(%d)", msecs);
+
+ TRequestStatus timerStatus = 0;
+ TRequestStatus logonStatus = 0;
+ bool timeoutOccurred = false;
+
+ // Logon to process to observe its death
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Logon(logonStatus);
+
+ // Create timer
+ RTimer timer;
+ timer.CreateLocal();
+ TTimeIntervalMicroSeconds32 interval(msecs*1000);
+ timer.After(timerStatus, interval);
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Waiting...");
+ User::WaitForRequest(logonStatus, timerStatus);
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Wait completed");
+
+ if (timerStatus == KErrNone) {
+ timeoutOccurred = true;
+ }
+
+ timer.Cancel();
+ timer.Close();
+
+ symbianProcess->LogonCancel(logonStatus);
+
+ // Eat cancel request completion so that it won't mess up main thread scheduling later
+ User::WaitForRequest(logonStatus, timerStatus);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(), qt_rprocess_running returned false");
+ }
+
+ if (timeoutOccurred) {
+ processError = QProcess::Timedout;
+ q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Process operation timed out")));
+ return false;
+ }
+
+ _q_processDied();
+
+ return true;
+}
+
+bool QProcessPrivate::waitForWrite(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+// Deceptively named function. Exit code is actually got in waitForDeadChild().
+void QProcessPrivate::findExitCode()
+{
+ Q_Q(QProcess);
+ processManager()->remove(q);
+}
+
+bool QProcessPrivate::waitForDeadChild()
+{
+ Q_Q(QProcess);
+
+ // read a byte from the death pipe
+ char c;
+ qt_native_read(deathPipe[0], &c, 1);
+
+ if (symbianProcess && symbianProcess->Handle()) {
+ TExitType et = symbianProcess->ExitType();
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForDeadChild() symbianProcess->ExitType: %d", et);
+ if (et != EExitPending) {
+ processManager()->remove(q);
+ exitCode = symbianProcess->ExitReason();
+ crashed = (et == EExitPanic);
+#if defined QPROCESS_DEBUG
+ TExitCategoryName catName = symbianProcess->ExitCategory();
+ qDebug() << "QProcessPrivate::waitForDeadChild() dead with exitCode"
+ << exitCode << ", crashed:" << crashed
+ << ", category:" << QString::fromUtf16(catName.Ptr());
+#endif
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForDeadChild() not dead!");
+ }
+ }
+
+ return true;
+}
+
+void QProcessPrivate::_q_notified()
+{
+ // Nothing to do in Symbian
+}
+
+/*! \internal
+ */
+bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
+{
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startDetached()");
+ Q_UNUSED(workingDirectory);
+
+ RProcess* newProc = NULL;
+
+ TInt err = qt_create_symbian_process(&newProc, program, arguments);
+
+ if (err == KErrNone) {
+ if (pid) {
+ *pid = (qint64)newProc->Id();
+ }
+
+ newProc->Resume();
+ newProc->Close();
+ return true;
+ }
+
+ return false;
+}
+
+
+void QProcessPrivate::initializeProcessManager()
+{
+ (void) processManager();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_PROCESS
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 6a9125c075..e120f28833 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -476,6 +476,10 @@ QTemporaryFile::QTemporaryFile()
{
Q_D(QTemporaryFile);
d->templateName = QDir::tempPath() + QLatin1String("/qt_temp.XXXXXX");
+#ifdef Q_OS_SYMBIAN
+ //Just for verify that folder really exist on hardware
+ fileEngine()->mkdir( QDir::tempPath(), true );
+#endif
}
/*!
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index d90ecae98d..94589467fa 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -87,9 +87,7 @@ mac {
unix {
SOURCES += \
- kernel/qcrashhandler.cpp \
- kernel/qsharedmemory_unix.cpp \
- kernel/qsystemsemaphore_unix.cpp
+ kernel/qcrashhandler.cpp
HEADERS += \
kernel/qcrashhandler_p.h
@@ -101,10 +99,24 @@ unix {
QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
LIBS +=$$QT_LIBS_GLIB
}
+
+ symbian {
+ SOURCES += \
+ kernel/qeventdispatcher_symbian.cpp \
+ kernel/qcore_symbian_p.cpp \
+ kernel/qsharedmemory_symbian.cpp \
+ kernel/qsystemsemaphore_symbian.cpp
+ HEADERS += \
+ kernel/qeventdispatcher_symbian_p.h \
+ kernel/qcore_symbian_p.h
+ } else {
SOURCES += \
- kernel/qeventdispatcher_unix.cpp
+ kernel/qeventdispatcher_unix.cpp \
+ kernel/qsharedmemory_unix.cpp \
+ kernel/qsystemsemaphore_unix.cpp
HEADERS += \
kernel/qeventdispatcher_unix_p.h
+ }
contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
}
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
new file mode 100644
index 0000000000..19c1510a29
--- /dev/null
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <e32base.h>
+#include <e32uid.h>
+#include "qcore_symbian_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Helper function for calling into Symbian classes that expect a TDes&.
+ This function converts a QString to a TDes by allocating memory that
+ must be deleted by the caller.
+*/
+
+Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString)
+{
+ HBufC *buffer;
+#ifdef QT_NO_UNICODE
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(aString.toLocal8Bit().constData()));
+ buffer = HBufC8::NewL(ptr.Length());
+ buffer->Des().Copy(ptr);
+#else
+ TPtrC16 ptr(reinterpret_cast<const TUint16*>(aString.utf16()));
+ buffer = HBufC16::NewL(ptr.Length());
+ buffer->Des().Copy(ptr);
+#endif
+ return buffer;
+}
+
+Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor)
+{
+#ifdef QT_NO_UNICODE
+ return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
+#else
+ return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+#endif
+}
+
+QHBufC::QHBufC()
+ : m_hBufC(0)
+{
+}
+
+QHBufC::QHBufC(const QHBufC &src)
+{
+ m_hBufC = src.m_hBufC->AllocL();
+}
+
+/*!
+ \internal
+ Constructs a QHBufC from an HBufC. Note that the QHBufC instance takes
+ ownership of the HBufC.
+*/
+QHBufC::QHBufC(HBufC *src)
+ : m_hBufC(src)
+{
+}
+
+QHBufC::QHBufC(const QString &src)
+{
+ m_hBufC = qt_QString2HBufCNewL(src);
+}
+
+QHBufC::~QHBufC()
+{
+ if (m_hBufC)
+ delete m_hBufC;
+}
+
+class QS60PluginResolver
+{
+public:
+ QS60PluginResolver()
+ : initTried(false) {}
+
+ ~QS60PluginResolver() {
+ lib.Close();
+ }
+
+ TLibraryFunction resolve(int ordinal) {
+ if (!initTried) {
+ init();
+ initTried = true;
+ }
+
+ if (lib.Handle())
+ return lib.Lookup(ordinal);
+ else
+ return reinterpret_cast<TLibraryFunction>(NULL);
+ }
+
+private:
+ void init() {
+ _LIT(KLibName_3_1, "qts60plugin_3_1.dll");
+ _LIT(KLibName_3_2, "qts60plugin_3_2.dll");
+ _LIT(KLibName_5_0, "qts60plugin_5_0.dll");
+ TPtrC libName;
+ TInt uidValue;
+ switch (QSysInfo::s60Version()) {
+ case QSysInfo::SV_S60_3_1:
+ libName.Set(KLibName_3_1);
+ uidValue = 0x2001E620;
+ break;
+ case QSysInfo::SV_S60_3_2:
+ libName.Set(KLibName_3_2);
+ uidValue = 0x2001E621;
+ break;
+ case QSysInfo::SV_S60_5_0: // Fall through to default
+ default:
+ // Default to 5.0 version, as any unknown platform is likely to be newer than that
+ libName.Set(KLibName_5_0);
+ uidValue = 0x2001E622;
+ break;
+ }
+
+ TUidType libUid(KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid(uidValue));
+ lib.Load(libName, libUid);
+ }
+
+ RLibrary lib;
+ bool initTried;
+};
+
+Q_GLOBAL_STATIC(QS60PluginResolver, qt_s60_plugin_resolver);
+
+/*!
+ \internal
+ Resolves a platform version specific function from S60 plugin.
+ If plugin is missing or resolving fails for another reason, NULL is returned.
+*/
+Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
+{
+ return qt_s60_plugin_resolver()->resolve(ordinal);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
new file mode 100644
index 0000000000..a7d2ce48c6
--- /dev/null
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCORE_SYMBIAN_P_H
+#define QCORE_SYMBIAN_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <e32std.h>
+#include <QtCore/qglobal.h>
+#include <qstring.h>
+#include <qrect.h>
+#include <qhash.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString);
+
+Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor);
+inline QString qt_TDes2QStringL(const TDes& aDescriptor) { return qt_TDesC2QStringL(aDescriptor); }
+
+static inline QSize qt_TSize2QSize(const TSize& ts)
+{
+ return QSize(ts.iWidth, ts.iHeight);
+}
+
+static inline TSize qt_QSize2TSize(const QSize& qs)
+{
+ return TSize(qs.width(), qs.height());
+}
+
+static inline QRect qt_TRect2QRect(const TRect& tr)
+{
+ return QRect(tr.iTl.iX, tr.iTl.iY, tr.Width(), tr.Height());
+}
+
+static inline TRect qt_QRect2TRect(const QRect& qr)
+{
+ return TRect(TPoint(qr.left(), qr.top()), TSize(qr.width(), qr.height()));
+}
+
+// Returned TPtrC is valid as long as the given parameter is valid and unmodified
+static inline TPtrC qt_QString2TPtrC( const QString& string )
+{
+ return reinterpret_cast<const TUint16*>(string.utf16());
+}
+
+class Q_CORE_EXPORT QHBufC
+{
+public:
+ QHBufC();
+ QHBufC(const QHBufC &src);
+ QHBufC(HBufC *src);
+ QHBufC(const QString &src);
+ ~QHBufC();
+
+ inline operator HBufC *() { return m_hBufC; }
+ inline operator const HBufC *() const { return m_hBufC; }
+ inline HBufC *data() { return m_hBufC; }
+ inline const HBufC *data() const { return m_hBufC; }
+ inline HBufC & operator*() { return *m_hBufC; }
+ inline const HBufC & operator*() const { return *m_hBufC; }
+ inline HBufC * operator->() { return m_hBufC; }
+ inline const HBufC * operator->() const { return m_hBufC; }
+
+ inline bool operator==(const QHBufC &param) const { return data() == param.data(); }
+ inline bool operator!=(const QHBufC &param) const { return data() != param.data(); }
+
+private:
+ HBufC *m_hBufC;
+};
+
+inline uint qHash(TUid uid)
+{
+ return qHash(uid.iUid);
+}
+
+// S60 version specific function ordinals that can be resolved
+enum S60PluginFuncOrdinals
+{
+ S60Plugin_TimeFormatL = 1,
+ S60Plugin_GetTimeFormatSpec = 2,
+ S60Plugin_GetLongDateFormatSpec = 3,
+ S60Plugin_GetShortDateFormatSpec = 4,
+ S60Plugin_LocalizedDirectoryName = 5
+};
+
+Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal);
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //QCORE_SYMBIAN_P_H
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index f6ce4b3318..7d8a77a00b 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -62,7 +62,10 @@
#include <qlibraryinfo.h>
#include <private/qfactoryloader_p.h>
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_SYMBIAN
+# include <f32file.h>
+# include "qeventdispatcher_symbian_p.h"
+#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
# include "qeventdispatcher_glib_p.h"
# endif
@@ -268,7 +271,9 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
void QCoreApplicationPrivate::createEventDispatcher()
{
Q_Q(QCoreApplication);
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_SYMBIAN)
+ eventDispatcher = new QEventDispatcherSymbian(q);
+#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
eventDispatcher = new QEventDispatcherGlib(q);
@@ -313,10 +318,17 @@ void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
QStringList *app_libpaths = coreappdata()->app_libpaths;
Q_ASSERT(app_libpaths);
+# if defined(Q_OS_SYMBIAN)
+ QString app_location( QCoreApplication::applicationDirPath() );
+ // File existence check for application's private dir requires additional '\' or
+ // platform security will not allow it.
+ if (app_location != QLibraryInfo::location(QLibraryInfo::PluginsPath) && QFile::exists(app_location + QLatin1Char('\\')) && !app_libpaths->contains(app_location))
+# else
QString app_location( QCoreApplication::applicationFilePath() );
app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
app_location = QDir(app_location).canonicalPath();
if (app_location != QLibraryInfo::location(QLibraryInfo::PluginsPath) && QFile::exists(app_location) && !app_libpaths->contains(app_location))
+# endif
app_libpaths->append(app_location);
#endif
}
@@ -444,6 +456,13 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
{
init();
QCoreApplicationPrivate::eventDispatcher->startingUp();
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) && defined(Q_OS_SYMBIAN)
+ // Refresh factoryloader, as text codecs are requested during lib path
+ // resolving process and won't be therefore properly loaded.
+ // Unknown if this is symbian specific issue.
+ QFactoryLoader::refreshAll();
+#endif
+
}
extern void set_winapp_name();
@@ -602,7 +621,16 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
d->inEventHandler = true;
#endif
-#if defined(QT_NO_EXCEPTIONS)
+#if defined(Q_OS_SYMBIAN)
+// __UHEAP_MARK;
+ TInt error;
+ bool returnValue = false;
+ TRAP(error, returnValue = notify(receiver, event));
+ if (error != KErrNone) {
+ qWarning(QString("Symbian OS error: %1").arg(error).toAscii().constData());
+ }
+// __UHEAP_MARKEND;
+#elif defined(QT_NO_EXCEPTIONS)
bool returnValue = notify(receiver, event);
#else
bool returnValue;
@@ -941,7 +969,7 @@ void QCoreApplication::exit(int returnCode)
The event is \e not deleted when the event has been sent. The normal
approach is to create the event on the stack, for example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 0
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 0
\sa postEvent(), notify()
*/
@@ -1458,7 +1486,7 @@ bool QCoreApplication::event(QEvent *e)
Example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 1
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 1
\sa exit(), aboutToQuit(), QApplication::lastWindowClosed()
*/
@@ -1686,6 +1714,10 @@ bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator)
function also assumes that the current directory has not been
changed by the application.
+ In Symbian this function will return the application private directory
+ in C-drive, not the path to executable itself, as those are always in
+ /sys/bin.
+
\sa applicationFilePath()
*/
QString QCoreApplication::applicationDirPath()
@@ -1697,7 +1729,32 @@ QString QCoreApplication::applicationDirPath()
QCoreApplicationPrivate *d = self->d_func();
if (d->cachedApplicationDirPath.isNull())
+#if defined(Q_OS_SYMBIAN)
+ {
+ QString appPath;
+ RProcess proc;
+ TInt err = proc.Open(proc.Id());
+ if (err == KErrNone) {
+#if defined(Q_CC_NOKIAX86)
+ // In emulator, always resolve the private dir on C-drive
+ appPath.append(QChar('C'));
+#else
+ appPath.append(QChar((proc.FileName())[0]));
+#endif
+ appPath.append(QLatin1String(":\\private\\"));
+ QString sid;
+ sid.setNum(proc.SecureId().iId, 16);
+ appPath.append(sid);
+ appPath.append(QLatin1Char('\\'));
+ proc.Close();
+ }
+
+ QFileInfo fi(appPath);
+ d->cachedApplicationDirPath = fi.exists() ? fi.canonicalFilePath() : QString();
+ }
+#else
d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path();
+#endif
return d->cachedApplicationDirPath;
}
@@ -1751,7 +1808,20 @@ QString QCoreApplication::applicationFilePath()
return d->cachedApplicationFilePath;
}
#endif
-#if defined( Q_OS_UNIX )
+#if defined(Q_OS_SYMBIAN)
+ QString appPath;
+ RProcess proc;
+ TInt err = proc.Open(proc.Id());
+ if (err == KErrNone) {
+ TFileName procName = proc.FileName();
+ appPath.append(QString(reinterpret_cast<const QChar*>(procName.Ptr()), procName.Length()));
+ proc.Close();
+ }
+
+ d->cachedApplicationFilePath = appPath;
+ return d->cachedApplicationFilePath;
+
+#elif defined( Q_OS_UNIX )
# ifdef Q_OS_LINUX
// Try looking for a /proc/<pid>/exe symlink first which points to
// the absolute path of the executable
@@ -2043,7 +2113,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
If you want to iterate over the list, you can use the \l foreach
pseudo-keyword:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 2
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 2
\sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), QLibrary,
{How to Create Qt Plugins}
@@ -2054,12 +2124,37 @@ QStringList QCoreApplication::libraryPaths()
if (!coreappdata()->app_libpaths) {
QStringList *app_libpaths = coreappdata()->app_libpaths = new QStringList;
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
+#if defined(Q_OS_SYMBIAN)
+ // Add existing path on all drives for relative PluginsPath in Symbian
+ if (installPathPlugins.at(1) != QChar(':')) {
+ QString tempPath = installPathPlugins;
+ if (tempPath.at(tempPath.length()-1) != QChar('\\')) {
+ tempPath += QChar('\\');
+ }
+ RFs fs;
+ TInt err = fs.Connect();
+ if (err == KErrNone) {
+ TPtrC tempPathPtr(reinterpret_cast<const TText*>(tempPath.constData()));
+ TFindFile finder(fs);
+ err = finder.FindByDir(tempPathPtr, tempPathPtr);
+ while (err == KErrNone) {
+ QString foundDir = QString::fromUtf16(finder.File().Ptr(), finder.File().Length());
+ foundDir = QDir(foundDir).canonicalPath();
+ if (!app_libpaths->contains(foundDir))
+ app_libpaths->append(foundDir);
+ err = finder.Find();
+ }
+ fs.Close();
+ }
+ }
+#else
if (QFile::exists(installPathPlugins)) {
// Make sure we convert from backslashes to slashes.
installPathPlugins = QDir(installPathPlugins).canonicalPath();
if (!app_libpaths->contains(installPathPlugins))
app_libpaths->append(installPathPlugins);
}
+#endif
// If QCoreApplication is not yet instantiated,
// make sure we add the application path when we construct the QCoreApplication
@@ -2067,7 +2162,7 @@ QStringList QCoreApplication::libraryPaths()
const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
if (!libPathEnv.isEmpty()) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QLatin1Char pathSep(';');
#else
QLatin1Char pathSep(':');
@@ -2169,7 +2264,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
A function with the following signature that can be used as an
event filter:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 3
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 3
\sa setEventFilter()
*/
@@ -2366,7 +2461,7 @@ int QCoreApplication::loopLevel()
The function specified by \a ptr should take no arguments and should
return nothing. For example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 4
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 4
Note that for an application- or module-wide cleanup,
qAddPostRoutine() is often not suitable. For example, if the
@@ -2380,7 +2475,7 @@ int QCoreApplication::loopLevel()
parent-child mechanism to call a cleanup function at the right
time:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 5
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 5
By selecting the right parent object, this can often be made to
clean up the module's data at the right moment.
@@ -2394,7 +2489,7 @@ int QCoreApplication::loopLevel()
translation functions, \c tr() and \c trUtf8(), with these
signatures:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 6
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 6
This macro is useful if you want to use QObject::tr() or
QObject::trUtf8() in classes that don't inherit from QObject.
@@ -2403,7 +2498,7 @@ int QCoreApplication::loopLevel()
class definition (before the first \c{public:} or \c{protected:}).
For example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 7
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 7
The \a context parameter is normally the class name, but it can
be any string.
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index f7175ae84b..65733ac155 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -165,7 +165,7 @@ public:
virtual bool winEventFilter(MSG *message, long *result);
#endif
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
static void watchUnixSignal(int signal, bool watch);
#endif
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 11a2d3cff3..e0be174e5c 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -108,6 +108,7 @@ 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).
@@ -186,6 +187,7 @@ QT_BEGIN_NAMESPACE
\value Polish The widget is polished.
\value PolishRequest The widget should be polished.
\value QueryWhatsThis The widget should accept the event if it has "What's This?" help.
+ \value RequestSoftwareInputPanel A widget wants to open a software input panel (SIP).
\value Resize Widget's size changed (QResizeEvent).
\value Shortcut Key press in child for shortcut key handling (QShortcutEvent).
\value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent).
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index fa472e6d79..d229ac9f4b 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -266,6 +266,9 @@ public:
CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window
MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear
+ RequestSoftwareInputPanel = 192,
+ CloseSoftwareInputPanel = 193,
+
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
new file mode 100644
index 0000000000..d7454066db
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -0,0 +1,930 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qeventdispatcher_symbian_p.h"
+#include <private/qthread_p.h>
+#include <qcoreapplication.h>
+#include <private/qcoreapplication_p.h>
+#include <qdatetime.h>
+
+#include <unistd.h>
+#include <errno.h>
+
+QT_BEGIN_NAMESPACE
+
+#define WAKE_UP_PRIORITY CActive::EPriorityStandard
+#define TIMER_PRIORITY CActive::EPriorityLow
+#define COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY CActive::EPriorityIdle
+
+static inline int qt_pipe_write(int socket, const char *data, qint64 len)
+{
+ return ::write(socket, data, len);
+}
+#if defined(write)
+# undef write
+#endif
+
+static inline int qt_pipe_close(int socket)
+{
+ return ::close(socket);
+}
+#if defined(close)
+# undef close
+#endif
+
+static inline int qt_pipe_fcntl(int socket, int command)
+{
+ return ::fcntl(socket, command);
+}
+static inline int qt_pipe2_fcntl(int socket, int command, int option)
+{
+ return ::fcntl(socket, command, option);
+}
+#if defined(fcntl)
+# undef fcntl
+#endif
+
+static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
+{
+ return ::select(nfds, readfds, writefds, exceptfds, timeout);
+}
+
+// This simply interrupts the select and locks the mutex until destroyed.
+class QSelectMutexGrabber
+{
+public:
+ QSelectMutexGrabber(int fd, QMutex *mutex)
+ : m_mutex(mutex)
+ {
+ if (m_mutex->tryLock())
+ return;
+
+ char dummy = 0;
+ qt_pipe_write(fd, &dummy, 1);
+
+ m_mutex->lock();
+ }
+
+ ~QSelectMutexGrabber()
+ {
+ m_mutex->unlock();
+ }
+
+private:
+ QMutex *m_mutex;
+};
+
+/*
+ * This class is designed to aid in implementing event handling in a more round robin fashion. We
+ * cannot change active objects that we do not own, but the active objects that Qt owns will use
+ * this as a base class with convenience functions.
+ *
+ * Here is how it works: On every RunL, the deriving class should call okToRun(). This will allow
+ * exactly one run of the active object, and mark it as such. If it is called again, it will return
+ * false, and add the object to a queue so it can be run later.
+ *
+ * The QCompleteDeferredAOs class is a special object that runs after all others, which will
+ * reactivate the objects that were previously not run.
+ */
+inline QActiveObject::QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher)
+ : CActive(priority),
+ m_dispatcher(dispatcher),
+ m_hasAlreadyRun(false),
+ m_hasRunAgain(false),
+ m_iterationCount(1)
+{
+}
+
+QActiveObject::~QActiveObject()
+{
+ if (m_hasRunAgain)
+ m_dispatcher->removeDeferredActiveObject(this);
+}
+
+bool QActiveObject::okToRun()
+{
+ Q_ASSERT(!m_hasRunAgain);
+
+ if (!m_hasAlreadyRun || m_dispatcher->iterationCount() != m_iterationCount) {
+ // First occurrence of this event in this iteration.
+ m_hasAlreadyRun = true;
+ m_iterationCount = m_dispatcher->iterationCount();
+ return true;
+ } else {
+ // The event has already occurred.
+ m_dispatcher->addDeferredActiveObject(this);
+ m_hasRunAgain = true;
+ return false;
+ }
+}
+
+void QActiveObject::reactivateAndComplete()
+{
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+
+ m_hasRunAgain = false;
+ m_hasAlreadyRun = false;
+}
+
+QWakeUpActiveObject::QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher)
+ : CActive(WAKE_UP_PRIORITY),
+ m_dispatcher(dispatcher)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QWakeUpActiveObject::~QWakeUpActiveObject()
+{
+ Cancel();
+}
+
+void QWakeUpActiveObject::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QWakeUpActiveObject::RunL()
+{
+ iStatus = KRequestPending;
+ SetActive();
+ m_dispatcher->wakeUpWasCalled();
+}
+
+QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
+ : QActiveObject(TIMER_PRIORITY, dispatcher),
+ m_timerInfo(timerInfo)
+{
+}
+
+QTimerActiveObject::~QTimerActiveObject()
+{
+ Cancel();
+}
+
+void QTimerActiveObject::DoCancel()
+{
+ if (m_timerInfo->interval > 0) {
+ m_rTimer.Cancel();
+ m_rTimer.Close();
+ } else {
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+ }
+}
+
+void QTimerActiveObject::RunL()
+{
+ if (!okToRun())
+ return;
+
+ if (m_timerInfo->interval > 0) {
+ // Start a new timer immediately so that we don't lose time.
+ iStatus = KRequestPending;
+ SetActive();
+ m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+
+ m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
+ } else {
+ // However, we only complete zero timers after the event has finished,
+ // in order to prevent busy looping when doing nested loops.
+
+ // Keep the refpointer around in order to avoid deletion until the end of this function.
+ SymbianTimerInfoPtr timerInfoPtr(m_timerInfo);
+
+ m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
+
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QTimerActiveObject::Start()
+{
+ CActiveScheduler::Add(this);
+ if (m_timerInfo->interval > 0) {
+ m_rTimer.CreateLocal();
+ iStatus = KRequestPending;
+ SetActive();
+ m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+ } else {
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+SymbianTimerInfo::~SymbianTimerInfo()
+{
+ delete timerAO;
+}
+
+QCompleteDeferredAOs::QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher)
+ : CActive(COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY),
+ m_dispatcher(dispatcher)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QCompleteDeferredAOs::~QCompleteDeferredAOs()
+{
+ Cancel();
+}
+
+void QCompleteDeferredAOs::complete()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QCompleteDeferredAOs::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QCompleteDeferredAOs::RunL()
+{
+ iStatus = KRequestPending;
+ SetActive();
+
+ m_dispatcher->reactivateDeferredActiveObjects();
+}
+
+QSelectThread::QSelectThread()
+ : m_quit(false)
+{
+ if (::pipe(m_pipeEnds) != 0) {
+ qWarning("Select thread was unable to open a pipe, errno: %i", errno);
+ } else {
+ int flags0 = qt_pipe_fcntl(m_pipeEnds[0], F_GETFL);
+ int flags1 = qt_pipe_fcntl(m_pipeEnds[1], F_GETFL);
+ // We should check the error code here, but Open C has a bug that returns
+ // failure even though the operation was successful.
+ qt_pipe2_fcntl(m_pipeEnds[0], F_SETFL, flags0 | O_NONBLOCK);
+ qt_pipe2_fcntl(m_pipeEnds[1], F_SETFL, flags1 | O_NONBLOCK);
+ }
+}
+
+QSelectThread::~QSelectThread()
+{
+ qt_pipe_close(m_pipeEnds[1]);
+ qt_pipe_close(m_pipeEnds[0]);
+}
+
+void QSelectThread::run()
+{
+ Q_D(QThread);
+
+ m_mutex.lock();
+
+ while (!m_quit) {
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptionfds;
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptionfds);
+
+ int maxfd = 0;
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
+ maxfd = qMax(maxfd, m_pipeEnds[0]);
+ maxfd++;
+
+ FD_SET(m_pipeEnds[0], &readfds);
+
+ int ret;
+ int savedSelectErrno;
+ //do {
+ ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
+ savedSelectErrno = errno;
+ //} while (ret == 0);
+
+ char buffer;
+
+ while (::read(m_pipeEnds[0], &buffer, 1) > 0) {}
+
+ if(ret == 0) {
+ // do nothing
+ } else if (ret < 0) {
+ switch (savedSelectErrno) {
+ case EBADF:
+ case EINVAL:
+ case ENOMEM:
+ case EFAULT:
+ qWarning("::select() returned an error: %i", savedSelectErrno);
+ break;
+ case ECONNREFUSED:
+ case EPIPE:
+ qWarning("::select() returned an error: %i (go through sockets)", savedSelectErrno);
+ // prepare to go through all sockets
+ // mark in fd sets both:
+ // good ones
+ // ones that return -1 in select
+ // after loop update notifiers for all of them
+
+ // as we dont have "exception" notifier type
+ // we should force monitoring fd_set of this
+ // type as well
+
+ // clean @ start
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptionfds);
+ {
+ for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+
+ fd_set onefds;
+ FD_ZERO(&onefds);
+ FD_SET(i.key()->socket(), &onefds);
+
+ fd_set excfds;
+ FD_ZERO(&excfds);
+ FD_SET(i.key()->socket(), &excfds);
+
+ maxfd = i.key()->socket() + 1;
+
+ struct timeval timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+
+ ret = 0;
+
+ if(i.key()->type() == QSocketNotifier::Read) {
+ ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
+ if(ret != 0) FD_SET(i.key()->socket(), &readfds);
+ } else if(i.key()->type() == QSocketNotifier::Write) {
+ ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
+ if(ret != 0) FD_SET(i.key()->socket(), &writefds);
+ }
+
+ } // end for
+ }
+
+ // traversed all, so update
+ updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+ updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+
+ break;
+ case EINTR: // Should never occur on Symbian, but this is future proof!
+ default:
+ qWarning("::select() returned an unknown error: %i", savedSelectErrno);
+
+ break;
+ }
+ } else {
+ updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+ updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+ }
+
+ m_waitCond.wait(&m_mutex);
+ }
+
+ m_mutex.unlock();
+}
+
+void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestStatus *status )
+{
+ Q_D(QThread);
+
+ if (!isRunning()) {
+ start();
+ }
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ Q_ASSERT(!m_AOStatuses.contains(notifier));
+
+ m_AOStatuses.insert(notifier, status);
+
+ m_waitCond.wakeAll();
+}
+
+void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
+{
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ m_AOStatuses.remove(notifier);
+
+ m_waitCond.wakeAll();
+}
+
+void QSelectThread::restart()
+{
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ m_waitCond.wakeAll();
+}
+
+int QSelectThread::updateSocketSet(QSocketNotifier::Type type, fd_set *fds)
+{
+ int maxfd = 0;
+ if(m_AOStatuses.isEmpty()) {
+ /*
+ * Wonder if should return -1
+ * to signal that no descriptors
+ * added to fds
+ */
+ return maxfd;
+ }
+ for ( QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+ if (i.key()->type() == type) {
+ FD_SET(i.key()->socket(), fds);
+ maxfd = qMax(maxfd, i.key()->socket());
+ } else if(type == QSocketNotifier::Exception) {
+ /*
+ * We are registering existing sockets
+ * always to exception set
+ *
+ * Doing double FD_SET shouldn't
+ * matter
+ */
+ FD_SET(i.key()->socket(), fds);
+ maxfd = qMax(maxfd, i.key()->socket());
+ }
+ }
+
+ return maxfd;
+}
+
+void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set *fds)
+{
+ Q_D(QThread);
+ if(m_AOStatuses.isEmpty()) {
+ return;
+ }
+ QList<QSocketNotifier *> toRemove;
+ for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+ if (i.key()->type() == type && FD_ISSET(i.key()->socket(), fds)) {
+ toRemove.append(i.key());
+ TRequestStatus *status = i.value();
+ // Thread data is still owned by the main thread.
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ } else if(type == QSocketNotifier::Exception && FD_ISSET(i.key()->socket(), fds)) {
+ /*
+ * check if socket is in exception set
+ * then signal RequestComplete for it
+ */
+ qWarning("exception on %d", i.key()->socket());
+ toRemove.append(i.key());
+ TRequestStatus *status = i.value();
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ }
+ }
+
+ for (int c = 0; c < toRemove.size(); ++c) {
+ m_AOStatuses.remove(toRemove[c]);
+ }
+}
+
+void QSelectThread::stop()
+{
+ m_quit = true;
+ restart();
+ wait();
+}
+
+QSocketActiveObject::QSocketActiveObject(QEventDispatcherSymbian *dispatcher, QSocketNotifier *notifier)
+ : QActiveObject(CActive::EPriorityStandard, dispatcher),
+ m_notifier(notifier),
+ m_inSocketEvent(false),
+ m_deleteLater(false)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QSocketActiveObject::~QSocketActiveObject()
+{
+ Cancel();
+}
+
+void QSocketActiveObject::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QSocketActiveObject::RunL()
+{
+ if (!okToRun())
+ return;
+
+ m_dispatcher->socketFired(this);
+}
+
+void QSocketActiveObject::deleteLater()
+{
+ if (m_inSocketEvent) {
+ m_deleteLater = true;
+ } else {
+ delete this;
+ }
+}
+
+QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent)
+ : QAbstractEventDispatcher(parent),
+ m_activeScheduler(0),
+ m_wakeUpAO(0),
+ m_completeDeferredAOs(0),
+ m_interrupt(false),
+ m_wakeUpDone(0),
+ m_iterationCount(0),
+ m_noSocketEvents(false)
+{
+}
+
+QEventDispatcherSymbian::~QEventDispatcherSymbian()
+{
+ m_processHandle.Close();
+}
+
+void QEventDispatcherSymbian::startingUp()
+{
+ if( !CActiveScheduler::Current() ) {
+ m_activeScheduler = new(ELeave)CActiveScheduler();
+ CActiveScheduler::Install(m_activeScheduler);
+ }
+ m_wakeUpAO = new(ELeave) QWakeUpActiveObject(this);
+ m_completeDeferredAOs = new(ELeave) QCompleteDeferredAOs(this);
+ // We already might have posted events, wakeup once to process them
+ wakeUp();
+}
+
+void QEventDispatcherSymbian::closingDown()
+{
+ if (m_selectThread.isRunning()) {
+ m_selectThread.stop();
+ }
+
+ delete m_completeDeferredAOs;
+ delete m_wakeUpAO;
+ if (m_activeScheduler) {
+ delete m_activeScheduler;
+ }
+}
+
+bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags )
+{
+ Q_D(QAbstractEventDispatcher);
+
+ // It is safe if this counter overflows. The main importance is that each
+ // iteration count is different from the last.
+ m_iterationCount++;
+
+ RThread &thread = d->threadData->symbian_thread_handle;
+
+ bool block;
+ if (flags & QEventLoop::WaitForMoreEvents) {
+ block = true;
+ emit aboutToBlock();
+ } else {
+ block = false;
+ }
+
+ bool handledAnyEvent = false;
+
+ bool oldNoSocketEventsValue = m_noSocketEvents;
+ if (flags & QEventLoop::ExcludeSocketNotifiers) {
+ m_noSocketEvents = true;
+ } else {
+ m_noSocketEvents = false;
+ handledAnyEvent = sendDeferredSocketEvents();
+ }
+
+ bool handledSymbianEvent = false;
+ m_interrupt = false;
+
+ /*
+ * This QTime variable is used to measure the time it takes to finish
+ * the event loop. If we take too long in the loop, other processes
+ * may be starved and killed. After the first event has completed, we
+ * take the current time, and if the remaining events take longer than
+ * a preset time, we temporarily lower the priority to force a context
+ * switch. For applications that do not take unecessarily long in the
+ * event loop, the priority will not be altered.
+ */
+ QTime time;
+ enum {
+ FirstRun,
+ SubsequentRun,
+ TimeStarted
+ } timeState = FirstRun;
+
+ TProcessPriority priority;
+
+ while (1) {
+ if (block) {
+ // This is where Qt will spend most of its time.
+ CActiveScheduler::Current()->WaitForAnyRequest();
+ } else {
+ if (thread.RequestCount() == 0) {
+ break;
+ }
+ // This one should return without delay.
+ CActiveScheduler::Current()->WaitForAnyRequest();
+ }
+
+ if (timeState == SubsequentRun) {
+ time.start();
+ timeState = TimeStarted;
+ }
+
+ TInt error;
+ handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
+ if (error) {
+ qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
+ CActiveScheduler::Current()->Error(error);
+ }
+ if (!handledSymbianEvent) {
+ qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
+ }
+ handledAnyEvent = true;
+ if (m_interrupt) {
+ break;
+ }
+ block = false;
+ if (timeState == TimeStarted && time.elapsed() > 500) {
+ priority = m_processHandle.Priority();
+ m_processHandle.SetPriority(EPriorityLow);
+ time.start();
+ // Slight chance of race condition in the next lines, but nothing fatal
+ // will happen, just wrong priority.
+ if (m_processHandle.Priority() == EPriorityLow) {
+ m_processHandle.SetPriority(priority);
+ }
+ }
+ if (timeState == FirstRun)
+ timeState = SubsequentRun;
+ };
+
+ emit awake();
+
+ m_noSocketEvents = oldNoSocketEventsValue;
+
+ return handledAnyEvent;
+}
+
+void QEventDispatcherSymbian::timerFired(int timerId)
+{
+ QHash<int, SymbianTimerInfoPtr>::iterator i = m_timerList.find(timerId);
+ if (i == m_timerList.end()) {
+ // The timer has been deleted. Ignore this event.
+ return;
+ }
+
+ SymbianTimerInfoPtr timerInfo = *i;
+
+ // Prevent infinite timer recursion.
+ if (timerInfo->inTimerEvent) {
+ return;
+ }
+
+ timerInfo->inTimerEvent = true;
+
+ QTimerEvent event(timerInfo->timerId);
+ QCoreApplication::sendEvent(timerInfo->receiver, &event);
+
+ timerInfo->inTimerEvent = false;
+
+ return;
+}
+
+void QEventDispatcherSymbian::socketFired(QSocketActiveObject *socketAO)
+{
+ if (m_noSocketEvents) {
+ m_deferredSocketEvents.append(socketAO);
+ return;
+ }
+
+ QEvent e(QEvent::SockAct);
+ socketAO->m_inSocketEvent = true;
+ QCoreApplication::sendEvent(socketAO->m_notifier, &e);
+ socketAO->m_inSocketEvent = false;
+
+ if (socketAO->m_deleteLater) {
+ delete socketAO;
+ } else {
+ socketAO->iStatus = KRequestPending;
+ socketAO->SetActive();
+ reactivateSocketNotifier(socketAO->m_notifier);
+ }
+}
+
+void QEventDispatcherSymbian::wakeUpWasCalled()
+{
+ // The reactivation should happen in RunL, right before the call to this function.
+ // This is because m_wakeUpDone is the "signal" that the object can be completed
+ // once more.
+ // Also, by dispatching the posted events after resetting m_wakeUpDone, we guarantee
+ // that no posted event notification will be lost. If we did it the other way
+ // around, it would be possible for another thread to post an event right after
+ // the sendPostedEvents was done, but before the object was ready to be completed
+ // again. This could deadlock the application if there are no other posted events.
+ m_wakeUpDone.fetchAndStoreOrdered(0);
+ sendPostedEvents();
+}
+
+void QEventDispatcherSymbian::interrupt()
+{
+ m_interrupt = true;
+ wakeUp();
+}
+
+void QEventDispatcherSymbian::wakeUp()
+{
+ Q_D(QAbstractEventDispatcher);
+
+ if (m_wakeUpAO && m_wakeUpDone.testAndSetAcquire(0, 1)) {
+ TRequestStatus *status = &m_wakeUpAO->iStatus;
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ }
+}
+
+bool QEventDispatcherSymbian::sendPostedEvents()
+{
+ Q_D(QAbstractEventDispatcher);
+
+ // moveToThread calls this and canWait == true -> Events will never get processed
+ // if we check for d->threadData->canWait
+ //
+ // QCoreApplication::postEvent sets canWait = false, but after the object and events
+ // are moved to a new thread, the canWait in new thread is true i.e. not changed to reflect
+ // the flag on old thread. That's why events in a new thread will not get processed.
+ // This migth be actually bug in moveToThread functionality, but because other platforms
+ // do not check canWait in wakeUp (where we essentially are now) - decided to remove it from
+ // here as well.
+
+ //if (!d->threadData->canWait) {
+ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+ return true;
+ //}
+ //return false;
+}
+
+inline void QEventDispatcherSymbian::addDeferredActiveObject(QActiveObject *object)
+{
+ if (m_deferredActiveObjects.isEmpty()) {
+ m_completeDeferredAOs->complete();
+ }
+ m_deferredActiveObjects.append(object);
+}
+
+inline void QEventDispatcherSymbian::removeDeferredActiveObject(QActiveObject *object)
+{
+ m_deferredActiveObjects.removeAll(object);
+}
+
+void QEventDispatcherSymbian::reactivateDeferredActiveObjects()
+{
+ while (!m_deferredActiveObjects.isEmpty()) {
+ QActiveObject *object = m_deferredActiveObjects.takeFirst();
+ object->reactivateAndComplete();
+ }
+
+ // We do this because we want to return from processEvents. This is because
+ // each invocation of processEvents should only run each active object once.
+ // The active scheduler should run them continously, however.
+ m_interrupt = true;
+}
+
+bool QEventDispatcherSymbian::sendDeferredSocketEvents()
+{
+ bool sentAnyEvents = false;
+ while (!m_deferredSocketEvents.isEmpty()) {
+ sentAnyEvents = true;
+ socketFired(m_deferredSocketEvents.takeFirst());
+ }
+
+ return sentAnyEvents;
+}
+
+void QEventDispatcherSymbian::flush()
+{
+}
+
+bool QEventDispatcherSymbian::hasPendingEvents()
+{
+ Q_D(QAbstractEventDispatcher);
+ return (d->threadData->symbian_thread_handle.RequestCount() != 0
+ || !d->threadData->canWait || !m_deferredSocketEvents.isEmpty());
+}
+
+void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifier )
+{
+ QSocketActiveObject *socketAO = new (ELeave) QSocketActiveObject(this, notifier);
+ m_notifiers.insert(notifier, socketAO);
+ m_selectThread.requestSocketEvents(notifier, &socketAO->iStatus);
+}
+
+void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notifier )
+{
+ m_selectThread.cancelSocketEvents(notifier);
+ if (m_notifiers.contains(notifier)) {
+ QSocketActiveObject *sockObj = *m_notifiers.find(notifier);
+ m_deferredSocketEvents.removeAll(sockObj);
+ sockObj->deleteLater();
+ m_notifiers.remove(notifier);
+ }
+}
+
+void QEventDispatcherSymbian::reactivateSocketNotifier(QSocketNotifier *notifier)
+{
+ m_selectThread.requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus);
+}
+
+void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject * object )
+{
+ if (interval < 0) {
+ qWarning("Timer interval < 0");
+ interval = 0;
+ }
+
+ SymbianTimerInfoPtr timer(new SymbianTimerInfo);
+ timer->timerId = timerId;
+ timer->interval = interval;
+ timer->inTimerEvent = false;
+ timer->receiver = object;
+ timer->dispatcher = this;
+ timer->timerAO = new(ELeave) QTimerActiveObject(this, timer.data());
+ m_timerList.insert(timerId, timer);
+
+ timer->timerAO->Start();
+}
+
+bool QEventDispatcherSymbian::unregisterTimer ( int timerId )
+{
+ if (!m_timerList.contains(timerId)) {
+ return false;
+ }
+
+ SymbianTimerInfoPtr timerInfo = m_timerList.take(timerId);
+
+ return true;
+}
+
+bool QEventDispatcherSymbian::unregisterTimers ( QObject * object )
+{
+ QList<TimerInfo> idsToRemove = registeredTimers(object);
+
+ if (idsToRemove.isEmpty())
+ return false;
+
+ for (int c = 0; c < idsToRemove.size(); ++c) {
+ unregisterTimer(idsToRemove[c].first);
+ }
+
+ return true;
+}
+
+QList<QEventDispatcherSymbian::TimerInfo> QEventDispatcherSymbian::registeredTimers ( QObject * object ) const
+{
+ QList<TimerInfo> list;
+ for (QHash<int, SymbianTimerInfoPtr>::const_iterator i = m_timerList.begin(); i != m_timerList.end(); ++i) {
+ if ((*i)->receiver == object) {
+ list.push_back(TimerInfo((*i)->timerId, (*i)->interval));
+ }
+ }
+
+ return list;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
new file mode 100644
index 0000000000..393749fb60
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -0,0 +1,272 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QEVENTDISPATCHER_SYMBIAN_P_H
+#define QEVENTDISPATCHER_SYMBIAN_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qhash.h>
+#include <qset.h>
+#include <qshareddata.h>
+#include <qabstracteventdispatcher.h>
+#include <private/qabstracteventdispatcher_p.h>
+#include <qthread.h>
+#include <qmutex.h>
+#include <qwaitcondition.h>
+#include <qsocketnotifier.h>
+
+#include <e32base.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+
+QT_BEGIN_NAMESPACE
+
+
+class QEventDispatcherSymbian;
+class QTimerActiveObject;
+
+class QActiveObject : public CActive
+{
+public:
+ QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher);
+ ~QActiveObject();
+
+ bool okToRun();
+
+ void reactivateAndComplete();
+
+protected:
+ QEventDispatcherSymbian *m_dispatcher;
+
+private:
+ bool m_hasAlreadyRun : 1;
+ bool m_hasRunAgain : 1;
+ int m_iterationCount;
+};
+
+class QWakeUpActiveObject : public CActive
+{
+public:
+ QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher);
+ ~QWakeUpActiveObject();
+
+ void Complete();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QEventDispatcherSymbian *m_dispatcher;
+};
+
+struct SymbianTimerInfo : public QSharedData
+{
+ ~SymbianTimerInfo();
+
+ int timerId;
+ int interval;
+ bool inTimerEvent;
+ QObject *receiver;
+ QTimerActiveObject *timerAO;
+ QEventDispatcherSymbian *dispatcher;
+};
+
+typedef QExplicitlySharedDataPointer<SymbianTimerInfo> SymbianTimerInfoPtr;
+
+// This is a bit of a proxy class. See comments in SetActive and Start for details.
+class QTimerActiveObject : public QActiveObject
+{
+public:
+ QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo);
+ ~QTimerActiveObject();
+
+ void Start();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ SymbianTimerInfo *m_timerInfo;
+ RTimer m_rTimer;
+};
+
+class QCompleteDeferredAOs : public CActive
+{
+public:
+ QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher);
+ ~QCompleteDeferredAOs();
+
+ void complete();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QEventDispatcherSymbian *m_dispatcher;
+};
+
+class QSocketActiveObject : public QActiveObject
+{
+public:
+ QSocketActiveObject(QEventDispatcherSymbian *dispatcher, QSocketNotifier *notifier);
+ ~QSocketActiveObject();
+
+ void deleteLater();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QSocketNotifier *m_notifier;
+ bool m_inSocketEvent;
+ bool m_deleteLater;
+
+ friend class QEventDispatcherSymbian;
+};
+
+class QSelectThread : public QThread
+{
+ Q_DECLARE_PRIVATE(QThread)
+
+public:
+ QSelectThread();
+ ~QSelectThread();
+
+ void requestSocketEvents ( QSocketNotifier *notifier, TRequestStatus *status );
+ void cancelSocketEvents ( QSocketNotifier *notifier );
+ void restart();
+ void stop();
+
+protected:
+ void run();
+
+private:
+ int updateSocketSet(QSocketNotifier::Type type, fd_set *fds);
+ void updateActivatedNotifiers(QSocketNotifier::Type type, fd_set *fds);
+
+private:
+ int m_pipeEnds[2];
+ QHash<QSocketNotifier *, TRequestStatus *> m_AOStatuses;
+ QMutex m_mutex;
+ QWaitCondition m_waitCond;
+ bool m_quit;
+};
+
+class Q_CORE_EXPORT QEventDispatcherSymbian : public QAbstractEventDispatcher
+{
+ Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
+
+public:
+ QEventDispatcherSymbian(QObject *parent = 0);
+ ~QEventDispatcherSymbian();
+
+ void flush();
+ bool hasPendingEvents();
+ void interrupt();
+ bool processEvents ( QEventLoop::ProcessEventsFlags flags );
+ void registerSocketNotifier ( QSocketNotifier * notifier );
+ void registerTimer ( int timerId, int interval, QObject * object );
+ QList<TimerInfo> registeredTimers ( QObject * object ) const;
+ void unregisterSocketNotifier ( QSocketNotifier * notifier );
+ bool unregisterTimer ( int timerId );
+ bool unregisterTimers ( QObject * object );
+ void wakeUp();
+
+ void startingUp();
+ void closingDown();
+
+ void timerFired(int timerId);
+ void socketFired(QSocketActiveObject *socketAO);
+ void wakeUpWasCalled();
+ void reactivateSocketNotifier(QSocketNotifier *notifier);
+
+ void addDeferredActiveObject(QActiveObject *object);
+ void removeDeferredActiveObject(QActiveObject *object);
+ void reactivateDeferredActiveObjects();
+
+ inline int iterationCount() const { return m_iterationCount; }
+
+ static void RequestComplete(TRequestStatus *&status, TInt reason);
+ static void RequestComplete(RThread &threadHandle, TRequestStatus *&status, TInt reason);
+
+private:
+ bool sendPostedEvents();
+ bool sendDeferredSocketEvents();
+
+private:
+ QSelectThread m_selectThread;
+
+ CActiveScheduler *m_activeScheduler;
+
+ QHash<int, SymbianTimerInfoPtr> m_timerList;
+ QHash<QSocketNotifier *, QSocketActiveObject *> m_notifiers;
+
+ QWakeUpActiveObject *m_wakeUpAO;
+ QCompleteDeferredAOs *m_completeDeferredAOs;
+
+ volatile bool m_interrupt;
+ QAtomicInt m_wakeUpDone;
+
+ unsigned char m_iterationCount;
+ bool m_noSocketEvents;
+ QList<QSocketActiveObject *> m_deferredSocketEvents;
+
+ QList<QActiveObject *> m_deferredActiveObjects;
+
+ RProcess m_processHandle;
+};
+
+#ifdef QT_DEBUG
+// EActive is defined to 1 and ERequestPending to 2, but they are both private.
+// A little dangerous to rely on, but it is only for debugging.
+# define REQUEST_STATUS_ACTIVE_AND_PENDING 3
+# define VERIFY_PENDING_REQUEST_STATUS \
+ Q_ASSERT(status->Int() & REQUEST_STATUS_ACTIVE_AND_PENDING == REQUEST_STATUS_ACTIVE_AND_PENDING);
+#else
+# define REQUEST_STATUS_ACTIVE_AND_PENDING
+# define VERIFY_PENDING_REQUEST_STATUS
+#endif
+
+// Convenience functions for doing some sanity checking on our own complete code.
+// Unless QT_DEBUG is defined, it is exactly equivalent to the Symbian version.
+inline void QEventDispatcherSymbian::RequestComplete(TRequestStatus *&status, TInt reason)
+{
+ VERIFY_PENDING_REQUEST_STATUS
+ User::RequestComplete(status, reason);
+}
+inline void QEventDispatcherSymbian::RequestComplete(RThread &threadHandle, TRequestStatus *&status, TInt reason)
+{
+ VERIFY_PENDING_REQUEST_STATUS
+ threadHandle.RequestComplete(status, reason);
+}
+
+#undef REQUEST_STATUS_ACTIVE_AND_PENDING
+#undef VERIFY_PENDING_REQUEST_STATUS
+
+QT_END_NAMESPACE
+
+#endif // QEVENTDISPATCHER_SYMBIAN_P_H
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 6aa3b56fa7..ce38b7325a 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -54,7 +54,7 @@
#include <stdio.h>
#include <stdlib.h>
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) && !defined(Q_OS_SYMBIAN)
# include <sys/times.h>
#endif
@@ -65,7 +65,7 @@ Q_CORE_EXPORT bool qt_disable_lowpriority_timers=false;
/*****************************************************************************
UNIX signal handling
*****************************************************************************/
-
+#if !defined(Q_OS_SYMBIAN)
static sig_atomic_t signal_received;
static sig_atomic_t signals_fired[NSIG];
@@ -74,7 +74,7 @@ static void signalHandler(int sig)
signals_fired[sig] = 1;
signal_received = 1;
}
-
+#endif
static void initThreadPipeFD(int fd)
{
@@ -134,6 +134,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
int nsel;
do {
+#if !defined(Q_OS_SYMBIAN)
if (mainThread) {
while (signal_received) {
signal_received = 0;
@@ -145,7 +146,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
}
}
}
-
+#endif
// Process timers and socket notifiers - the common UNIX stuff
int highest = 0;
if (! (flags & QEventLoop::ExcludeSocketNotifiers) && (sn_highest >= 0)) {
@@ -257,7 +258,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
QTimerInfoList::QTimerInfoList()
{
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_SYMBIAN)
useMonotonicTimers = false;
# if (_POSIX_MONOTONIC_CLOCK == 0)
@@ -298,7 +299,7 @@ timeval QTimerInfoList::updateCurrentTime()
return currentTime;
}
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)
+#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)) && !defined(Q_OS_SYMBIAN)
/*
Returns true if the real time clock has changed by more than 10%
@@ -374,7 +375,11 @@ void QTimerInfoList::repairTimersIfNeeded()
void QTimerInfoList::getTime(timeval &t)
{
timespec ts;
+#if !defined(Q_OS_SYMBIAN)
clock_gettime(CLOCK_MONOTONIC, &ts);
+#else
+ clock_gettime(CLOCK_REALTIME, &ts);
+#endif
t.tv_sec = ts.tv_sec;
t.tv_usec = ts.tv_nsec / 1000;
}
@@ -939,7 +944,7 @@ void QEventDispatcherUNIX::flush()
-
+#if !defined(Q_OS_SYMBIAN)
void QCoreApplication::watchUnixSignal(int sig, bool watch)
{
if (sig < NSIG) {
@@ -953,5 +958,10 @@ void QCoreApplication::watchUnixSignal(int sig, bool watch)
sigaction(sig, &sa, 0);
}
}
+#else
+void QCoreApplication::watchUnixSignal(int, bool)
+{
+}
+#endif
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index f1a1eb5e50..6ea2d9f90c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1394,8 +1394,10 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
++eventsMoved;
}
}
- if (eventsMoved > 0 && targetData->eventDispatcher)
+ if (eventsMoved > 0 && targetData->eventDispatcher) {
+ targetData->canWait = false;
targetData->eventDispatcher->wakeUp();
+ }
// the current emitting thread shouldn't restore currentSender after calling moveToThread()
if (currentSender)
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 87e154f25f..dc9cabf846 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -44,7 +44,9 @@
#include "qsystemsemaphore.h"
#include <qdir.h>
#include <qcryptographichash.h>
-
+#ifdef Q_OS_SYMBIAN
+#include <e32const.h>
+#endif
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -57,6 +59,7 @@ QT_BEGIN_NAMESPACE
the subset that the win/unix kernel allows.
On Unix this will be a file name
+ On Symbian key will be truncated to 80 characters
*/
QString
QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
@@ -70,10 +73,12 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
QString part1 = key;
part1.replace(QRegExp(QLatin1String("[^A-Za-z]")), QString());
result.append(part1);
+#ifdef Q_OS_SYMBIAN
+ return result.left(KMaxKernelName);
+#endif
QByteArray hex = QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1).toHex();
result.append(QLatin1String(hex));
-
#ifdef Q_OS_WIN
return result;
#else
@@ -118,6 +123,14 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
process. This means that QSharedMemory should not be used across
multiple threads in the same process in HP-UX.
+ \o Symbian: QSharedMemory does not "own" the shared memory segment.
+ When all threads or processes that have an instance of QSharedMemory
+ attached to a particular shared memory segment have either destroyed
+ their instance of QSharedMemory or exited, the Symbian kernel
+ releases the shared memory segment automatically.
+ Also, access to a shared memory segment cannot be limited to read-only
+ in Symbian.
+
\endlist
Remember to lock the shared memory with lock() before reading from
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index 08f0321ad8..a7524d9b12 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -71,6 +71,9 @@ namespace QSharedMemoryPrivate
#ifdef Q_OS_WIN
#include <qt_windows.h>
+#elif defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#include <sys/types.h>
#else
#include <sys/sem.h>
#endif
@@ -140,7 +143,11 @@ public:
bool attach(QSharedMemory::AccessMode mode);
bool detach();
+#ifdef Q_OS_SYMBIAN
+ void setErrorString(const QString &function, TInt errorCode);
+#else
void setErrorString(const QString &function);
+#endif
#ifndef QT_NO_SYSTEMSEMAPHORE
bool tryLocker(QSharedMemoryLocker *locker, const QString function) {
@@ -156,6 +163,8 @@ public:
private:
#ifdef Q_OS_WIN
HANDLE hand;
+#elif defined(Q_OS_SYMBIAN)
+ RChunk chunk;
#else
key_t unix_key;
#endif
diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp
new file mode 100644
index 0000000000..afb161ce15
--- /dev/null
+++ b/src/corelib/kernel/qsharedmemory_symbian.cpp
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qsharedmemory.h"
+#include "qsharedmemory_p.h"
+#include "qsystemsemaphore.h"
+#include "qcore_symbian_p.h"
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_SHAREDMEMORY
+
+#define QSHAREDMEMORY_DEBUG
+
+QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(),
+ memory(0), size(0), error(QSharedMemory::NoError),
+ systemSemaphore(QString()), lockedByMe(false)
+{
+}
+
+void QSharedMemoryPrivate::setErrorString(const QString &function, TInt errorCode)
+{
+ if (errorCode == KErrNone)
+ return;
+ switch (errorCode) {
+ case KErrAlreadyExists:
+ error = QSharedMemory::AlreadyExists;
+ errorString = QSharedMemory::tr("%1: already exists").arg(function);
+ break;
+ case KErrNotFound:
+ error = QSharedMemory::NotFound;
+ errorString = QSharedMemory::tr("%1: doesn't exists").arg(function);
+ break;
+ case KErrArgument:
+ error = QSharedMemory::InvalidSize;
+ errorString = QSharedMemory::tr("%1: invalid size").arg(function);
+ break;
+ case KErrNoMemory:
+ error = QSharedMemory::OutOfResources;
+ errorString = QSharedMemory::tr("%1: out of resources").arg(function);
+ break;
+ case KErrPermissionDenied:
+ error = QSharedMemory::PermissionDenied;
+ errorString = QSharedMemory::tr("%1: permission denied").arg(function);
+ break;
+ default:
+ errorString = QSharedMemory::tr("%1: unknown error %2").arg(function).arg(errorCode);
+ error = QSharedMemory::UnknownError;
+#if defined QSHAREDMEMORY_DEBUG
+ qDebug() << errorString << "key" << key;
+#endif
+ }
+}
+
+key_t QSharedMemoryPrivate::handle()
+{
+ // Not really cost effective to check here if shared memory is attachable, as it requires
+ // exactly the same call as attaching, so always assume handle is valid and return failure
+ // from attach.
+ return 1;
+}
+
+bool QSharedMemoryPrivate::cleanHandle()
+{
+ chunk.Close();
+ return true;
+}
+
+bool QSharedMemoryPrivate::create(int size)
+{
+ // Get a windows acceptable key
+ QString safeKey = makePlatformSafeKey(key);
+ QString function = QLatin1String("QSharedMemory::create");
+ if (safeKey.isEmpty()) {
+ error = QSharedMemory::KeyError;
+ errorString = QSharedMemory::tr("%1: key error").arg(function);
+ return false;
+ }
+
+ HBufC* buffer = qt_QString2HBufCNewL(safeKey);
+
+ TInt err = chunk.CreateGlobal(*buffer, size, size);
+
+ delete buffer;
+
+ setErrorString(function, err);
+
+ if (err != KErrNone)
+ return false;
+
+ // Zero out the created chunk
+ Mem::FillZ(chunk.Base(), chunk.Size());
+
+ return true;
+}
+
+bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
+{
+ // Grab a pointer to the memory block
+ TBool readOnly = (mode == QSharedMemory::ReadOnly ? true : false);
+
+ if (!chunk.Handle()) {
+ QString function = QLatin1String("QSharedMemory::handle");
+ QString safeKey = makePlatformSafeKey(key);
+ if (safeKey.isEmpty()) {
+ error = QSharedMemory::KeyError;
+ errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
+ return false;
+ }
+
+ HBufC* buffer = qt_QString2HBufCNewL(safeKey);
+
+ TInt err = KErrNoMemory;
+
+ if (buffer) {
+ err = chunk.OpenGlobal(*buffer, false);
+ }
+
+ delete buffer;
+
+ if (err != KErrNone) {
+ setErrorString(function, err);
+ return false;
+ }
+ }
+
+ size = chunk.Size();
+ memory = chunk.Base();
+
+ return true;
+}
+
+bool QSharedMemoryPrivate::detach()
+{
+ chunk.Close();
+
+ memory = 0;
+ size = 0;
+
+ return true;
+}
+
+#endif //QT_NO_SHAREDMEMORY
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index 487c6530dd..c4395d90cf 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -48,11 +48,6 @@
#include <qdebug.h>
#include <errno.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_SHAREDMEMORY
-
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -61,6 +56,10 @@ QT_BEGIN_NAMESPACE
#include <fcntl.h>
#include <unistd.h>
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_SHAREDMEMORY
+
QSharedMemoryPrivate::QSharedMemoryPrivate()
: QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError),
#ifndef QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp
index e8426b3698..7e09a6ede4 100644
--- a/src/corelib/kernel/qsystemsemaphore.cpp
+++ b/src/corelib/kernel/qsystemsemaphore.cpp
@@ -123,6 +123,11 @@ QT_BEGIN_NAMESPACE
operations that were not released. Thus if the process acquires a
resource and then exits without releasing it, Unix will release that
resource.
+
+ \o Symbian: QSystemSemaphore behaves the same as Windows semaphores.
+ In other words, the operating system owns the semaphore and ignores
+ QSystemSemaphore::AccessMode.
+
\endlist
\sa QSharedMemory, QSemaphore
@@ -147,7 +152,7 @@ QT_BEGIN_NAMESPACE
creates a new semaphore for that key and sets its resource count to
\a initialValue.
- In Windows, \a mode is ignored, and the system always tries to
+ In Windows and in Symbian, \a mode is ignored, and the system always tries to
create a semaphore for the specified \a key. If the system does not
already have a semaphore identified as \a key, it creates the
semaphore and sets its resource count to \a initialValue. But if the
@@ -198,7 +203,7 @@ QSystemSemaphore::~QSystemSemaphore()
enable handling the problem in Unix implementations of semaphores
that survive a crash. In Unix, when a semaphore survives a crash, we
need a way to force it to reset its resource count, when the system
- reuses the semaphore. In Windows, where semaphores can't survive a
+ reuses the semaphore. In Windows and in Symbian, where semaphores can't survive a
crash, this enum has no effect.
\value Open If the semaphore already exists, its initial resource
@@ -211,7 +216,7 @@ QSystemSemaphore::~QSystemSemaphore()
This value should be passed to the constructor, when the first
semaphore for a particular key is constructed and you know that if
the semaphore already exists it could only be because of a crash. In
- Windows, where a semaphore can't survive a crash, Create and Open
+ Windows and in Symbian, where a semaphore can't survive a crash, Create and Open
have the same behavior.
*/
@@ -231,7 +236,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
return;
d->error = NoError;
d->errorString = QString();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
// optimization to not destroy/create the file & semaphore
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
d->initialValue = initialValue;
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index 81d4f10d5e..05a93472a6 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -62,6 +62,10 @@
# include <sys/types.h>
#endif
+#ifdef Q_OS_SYMBIAN
+class RSemaphore;
+#endif
+
QT_BEGIN_NAMESPACE
class QSystemSemaphorePrivate
@@ -77,10 +81,14 @@ public:
#ifdef Q_OS_WIN
HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
+ void setErrorString(const QString &function);
+#elif defined(Q_OS_SYMBIAN)
+ int handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
+ void setErrorString(const QString &function,int err = 0);
#else
key_t handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
-#endif
void setErrorString(const QString &function);
+#endif
void cleanHandle();
bool modifySemaphore(int count);
@@ -90,13 +98,14 @@ public:
#ifdef Q_OS_WIN
HANDLE semaphore;
HANDLE semaphoreLock;
+#elif defined(Q_OS_SYMBIAN)
+ RSemaphore semaphore;
#else
int semaphore;
bool createdFile;
bool createdSemaphore;
key_t unix_key;
#endif
-
QString errorString;
QSystemSemaphore::SystemSemaphoreError error;
};
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
new file mode 100644
index 0000000000..0c138c4d11
--- /dev/null
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qsystemsemaphore.h"
+#include "qsystemsemaphore_p.h"
+#include "qcoreapplication.h"
+#include <qdebug.h>
+
+#include <qcore_symbian_p.h>
+#include <e32cmn.h>
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_SYSTEMSEMAPHORE
+
+QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
+ error(QSystemSemaphore::NoError)
+{
+}
+
+void QSystemSemaphorePrivate::setErrorString(const QString &function, int err)
+{
+ if (err == KErrNone){
+ return;
+ }
+ switch(err){
+ case KErrAlreadyExists:
+ errorString = QCoreApplication::tr("%1: already exists", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::AlreadyExists;
+ break;
+ case KErrNotFound:
+ errorString = QCoreApplication::tr("%1: doesn't exists", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::NotFound;
+ break;
+ case KErrNoMemory:
+ case KErrInUse:
+ errorString = QCoreApplication::tr("%1: out of resources", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::OutOfResources;
+ break;
+default:
+ errorString = QCoreApplication::tr("%1: unknown error %2", "QSystemSemaphore").arg(function).arg(err);
+ error = QSystemSemaphore::UnknownError;
+ }
+
+#if defined QSYSTEMSEMAPHORE_DEBUG
+ qDebug() << errorString << "key" << key;
+#endif
+}
+
+int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
+{
+ // don't allow making handles on empty keys
+ if (key.isEmpty())
+ return 0;
+ QString safeName = makeKeyFileName();
+ HBufC* name = qt_QString2HBufCNewL(safeName);
+ int err;
+ err = semaphore.OpenGlobal(*name,EOwnerProcess);
+ if (err == KErrNotFound){
+ err = semaphore.CreateGlobal(*name,initialValue, EOwnerProcess);
+ }
+ delete name;
+ if (err){
+ setErrorString(QLatin1String("QSystemSemaphore::handle"),err);
+ return 0;
+ }
+ return semaphore.Handle();
+}
+
+void QSystemSemaphorePrivate::cleanHandle()
+{
+ semaphore.Close();
+}
+
+bool QSystemSemaphorePrivate::modifySemaphore(int count)
+{
+ if (0 == handle())
+ return false;
+
+ if (count > 0) {
+ semaphore.Signal(count);
+ } else {
+ semaphore.Wait();
+ }
+ return true;
+}
+
+#endif //QT_NO_SYSTEMSEMAPHORE
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 0a0500d660..0d85b93989 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -177,13 +177,40 @@ static void construct(QVariant::Private *x, const void *copy)
x->data.b = copy ? *static_cast<const bool *>(copy) : false;
break;
case QVariant::Double:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.d = *static_cast<const double*>(copy);
+ } else {
+ x->data.d = 0.0;
+ }
+#else
x->data.d = copy ? *static_cast<const double*>(copy) : 0.0;
+#endif
break;
case QVariant::LongLong:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.ll = *static_cast<const qlonglong *>(copy);
+ } else {
+ x->data.ll = Q_INT64_C(0);
+ }
+#else
x->data.ll = copy ? *static_cast<const qlonglong *>(copy) : Q_INT64_C(0);
+#endif
break;
case QVariant::ULongLong:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.ull = *static_cast<const qulonglong *>(copy);
+ } else {
+ x->data.ull = Q_UINT64_C(0);
+ }
+#else
x->data.ull = copy ? *static_cast<const qulonglong *>(copy) : Q_UINT64_C(0);
+#endif
break;
case QVariant::Invalid:
case QVariant::UserType:
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 79400a8396..420dd1d9f4 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -98,10 +98,10 @@ Q_GLOBAL_STATIC(QMutex, qt_library_mutex)
Unix), unless the file name has an absolute path. If the file
cannot be found, QLibrary tries the name with different
platform-specific file suffixes, like ".so" on Unix, ".dylib" on
- the Mac, or ".dll" on Windows. This makes it possible to specify
- shared libraries that are only identified by their basename (i.e.
- without their suffix), so the same code will work on different
- operating systems.
+ the Mac, or ".dll" on Windows and Symbian. This makes it possible
+ to specify shared libraries that are only identified by their
+ basename (i.e. without their suffix), so the same code will work
+ on different operating systems.
The most important functions are load() to dynamically load the
library file, isLoaded() to check whether loading was successful,
@@ -120,6 +120,11 @@ Q_GLOBAL_STATIC(QMutex, qt_library_mutex)
linking", which is done by the link step in the build process when
linking an executable against a library.
+ Note: In Symbian resolving symbols using their names is supported
+ only if the library is built as STDDLL. Otherwise ordinals must
+ be used. Also, in Symbian the path of the library is ignored and
+ system default library location is always used.
+
The following code snippet loads a library, resolves the symbol
"mysymbol", and calls the function if everything succeeded. If
something goes wrong, e.g. the library file does not exist or the
@@ -288,7 +293,7 @@ static bool qt_parse_pattern(const char *s, uint *version, bool *debug, QByteArr
}
#endif // QT_NO_PLUGIN_CHECK
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_PLUGIN_CHECK)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK)
#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX)
# define USE_MMAP
@@ -361,7 +366,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
char *filedata = 0;
ulong fdlen = 0;
-#ifdef USE_MMAP
+# ifdef USE_MMAP
char *mapaddr = 0;
size_t maplen = file.size();
mapaddr = (char *) mmap(mapaddr, maplen, PROT_READ, MAP_PRIVATE, file.handle(), 0);
@@ -378,14 +383,14 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
lib->errorString = QLibrary::tr("Could not mmap '%1': %2")
.arg(library)
.arg(qt_error_string());
-#endif // USE_MMAP
+# endif // USE_MMAP
// try reading the data into memory instead
data = file.readAll();
filedata = data.data();
fdlen = data.size();
-#ifdef USE_MMAP
+# ifdef USE_MMAP
}
-#endif // USE_MMAP
+# endif // USE_MMAP
// verify that the pattern is present in the plugin
const char pattern[] = "pattern=QT_PLUGIN_VERIFICATION_DATA";
@@ -398,7 +403,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
if (!ret && lib)
lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library);
-#ifdef USE_MMAP
+# ifdef USE_MMAP
if (mapaddr != MAP_FAILED && munmap(mapaddr, maplen) != 0) {
if (qt_debug_component())
qWarning("munmap: %s", qPrintable(qt_error_string(errno)));
@@ -407,13 +412,13 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
.arg(library)
.arg( qt_error_string() );
}
-#endif // USE_MMAP
+# endif // USE_MMAP
file.close();
return ret;
}
-#endif // Q_OS_UNIX && !Q_OS_MAC && !defined(QT_NO_PLUGIN_CHECK)
+#endif // Q_OS_UNIX && !Q_OS_MAC && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK)
typedef QMap<QString, QLibraryPrivate*> LibraryMap;
Q_GLOBAL_STATIC(LibraryMap, libraryMap)
@@ -493,6 +498,11 @@ bool QLibraryPrivate::loadPlugin()
}
if (load()) {
instance = (QtPluginInstanceFunction)resolve("qt_plugin_instance");
+#if defined(Q_OS_SYMBIAN)
+ // If resolving with function name failed (i.e. not STDDLL), try resolving using known ordinal
+ if (!instance)
+ instance = (QtPluginInstanceFunction)resolve("2");
+#endif
return instance;
}
return false;
@@ -517,6 +527,10 @@ bool QLibrary::isLibrary(const QString &fileName)
{
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
return fileName.endsWith(QLatin1String(".dll"));
+#elif defined(Q_OS_SYMBIAN)
+ // Plugin stubs are also considered libraries in Symbian.
+ return (fileName.endsWith(QLatin1String(".dll")) ||
+ fileName.endsWith(QLatin1String(".qtplugin")));
#else
QString completeSuffix = QFileInfo(fileName).completeSuffix();
if (completeSuffix.isEmpty())
@@ -610,7 +624,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
key = reg.at(2).toLatin1();
success = qt_version != 0;
} else {
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
if (!pHnd) {
// use unix shortcut to avoid loading the library
success = qt_unix_query(fileName, &qt_version, &debug, &key, this);
@@ -629,6 +643,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
temporary_load = load_sys();
});
#else
+# if defined(Q_OS_SYMBIAN)
+ //Guard against accidentally trying to load non-plugin libraries by making sure the stub exists
+ if (fileinfo.exists())
+# endif
temporary_load = load_sys();
#endif
}
@@ -647,8 +665,17 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#endif
: (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
#else
- QtPluginQueryVerificationDataFunction qtPluginQueryVerificationDataFunction =
- (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+ QtPluginQueryVerificationDataFunction qtPluginQueryVerificationDataFunction = NULL;
+# if defined(Q_OS_SYMBIAN)
+ if (temporary_load) {
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+ // If resolving with function name failed (i.e. not STDDLL), try resolving using known ordinal
+ if (!qtPluginQueryVerificationDataFunction)
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("1");
+ }
+# else
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+# endif
#endif
if (!qtPluginQueryVerificationDataFunction
@@ -819,6 +846,8 @@ QLibrary::QLibrary(QObject *parent)
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
QLibrary::QLibrary(const QString& fileName, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -830,13 +859,15 @@ QLibrary::QLibrary(const QString& fileName, QObject *parent)
/*!
Constructs a library object with the given \a parent that will
load the library specified by \a fileName and major version number \a verNum.
- Currently, the version number is ignored on Windows.
+ Currently, the version number is ignored on Windows and Symbian.
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
- */
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+*/
QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
:QObject(parent), d(0), did_load(false)
{
@@ -846,12 +877,14 @@ QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
/*!
Constructs a library object with the given \a parent that will
load the library specified by \a fileName and full version number \a version.
- Currently, the version number is ignored on Windows.
+ Currently, the version number is ignored on Windows and Symbian.
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -893,6 +926,8 @@ QLibrary::~QLibrary()
platforms, fileName() will return "libGL.so". If the file name was
originally passed as "/usr/lib/libGL", fileName() will return
"/usr/lib/libGL.so".
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
void QLibrary::setFileName(const QString &fileName)
@@ -920,7 +955,10 @@ QString QLibrary::fileName() const
Sets the fileName property and major version number to \a fileName
and \a versionNumber respectively.
- The \a versionNumber is ignored on Windows.
+ The \a versionNumber is ignored on Windows and Symbian.
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+
\sa setFileName()
*/
void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)
@@ -941,7 +979,10 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)
Sets the fileName property and full version number to \a fileName
and \a version respectively.
- The \a version parameter is ignored on Windows.
+ The \a version parameter is ignored on Windows and Symbian.
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+
\sa setFileName()
*/
void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &version)
@@ -977,6 +1018,8 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
\snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 4
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
*/
void *QLibrary::resolve(const char *symbol)
{
@@ -996,6 +1039,9 @@ void *QLibrary::resolve(const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, const char *symbol)
@@ -1016,6 +1062,9 @@ void *QLibrary::resolve(const QString &fileName, const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
@@ -1037,6 +1086,9 @@ void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, const QString &version, const char *symbol)
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 08bd2d0843..c868d4a001 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -77,18 +77,31 @@ static QString qdlerror()
bool QLibraryPrivate::load_sys()
{
QFileInfo fi(fileName);
+
+#if defined(Q_OS_SYMBIAN)
+ QString path; // In Symbian, always resolve with just the filename
+ QString name;
+
+ // Replace possible ".qtplugin" suffix with ".dll"
+ if (fi.suffix() == QLatin1String("qtplugin"))
+ name = fi.completeBaseName() + QLatin1String(".dll");
+ else
+ name = fi.fileName();
+#else
QString path = fi.path();
QString name = fi.fileName();
if (path == QLatin1String(".") && !fileName.startsWith(path))
path.clear();
else
path += QLatin1Char('/');
-
+#endif
// The first filename we want to attempt to load is the filename as the callee specified.
// Thus, the first attempt we do must be with an empty prefix and empty suffix.
QStringList suffixes(QLatin1String("")), prefixes(QLatin1String(""));
if (pluginState != IsAPlugin) {
+#if !defined(Q_OS_SYMBIAN)
prefixes << QLatin1String("lib");
+#endif
#if defined(Q_OS_HPUX)
// according to
// http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
@@ -116,6 +129,9 @@ bool QLibraryPrivate::load_sys()
}
#elif defined(Q_OS_AIX)
suffixes << ".a";
+
+#elif defined(Q_OS_SYMBIAN)
+ suffixes << QLatin1String(".dll");
#else
if (!fullVersion.isEmpty()) {
suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
@@ -153,7 +169,7 @@ bool QLibraryPrivate::load_sys()
else {
#if defined(Q_OS_MAC)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4)
-#endif
+#endif
dlFlags |= RTLD_LOCAL;
}
#endif
@@ -185,6 +201,12 @@ bool QLibraryPrivate::load_sys()
#else
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
#endif
+
+#if defined(Q_OS_SYMBIAN)
+ // Never try again in symbian, dlopen already handles the library search logic,
+ // and there is only one possible suffix.
+ retry = false;
+#else
if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
// We only want to continue if dlopen failed due to that the shared library did not exist.
// However, we are only able to apply this check for absolute filenames (since they are
@@ -192,6 +214,7 @@ bool QLibraryPrivate::load_sys()
// This is all because dlerror is flawed and cannot tell us the reason why it failed.
retry = false;
}
+#endif
}
}
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 15ebe3d792..a911f1d0e7 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -116,6 +116,16 @@ QT_BEGIN_NAMESPACE
link to plugins statically. You can use QLibrary if you need to
load dynamic libraries in a statically linked application.
+ \note In Symbian the plugin stub files must be used whenever a
+ path to plugin is needed. For the purposes of loading plugins,
+ the stubs can be considered to have the same name as the actual
+ plugin binary. In practice they have ".qtplugin" extension
+ instead of ".dll", but this difference is handled transparently
+ by QPluginLoader and QLibrary to avoid need for Symbian specific
+ plugin handling in most Qt applications. Plugin stubs are needed
+ because Symbian Platform Security denies all access to the directory
+ where the actual plugin binaries are located.
+
\sa QLibrary, {Plug & Paint Example}
*/
@@ -136,6 +146,8 @@ QPluginLoader::QPluginLoader(QObject *parent)
Unix, - \c .dylib on Mac OS X, and \c .dll on Windows. The suffix
can be verified with QLibrary::isLibrary().
+ Note: In Symbian the \a fileName must point to plugin stub file.
+
\sa setFileName()
*/
QPluginLoader::QPluginLoader(const QString &fileName, QObject *parent)
@@ -170,7 +182,7 @@ QPluginLoader::~QPluginLoader()
The root component, returned by this function, is not deleted when
the QPluginLoader is destroyed. If you want to ensure that the root
component is deleted, you should call unload() as soon you don't
- need to access the core component anymore. When the library is
+ need to access the core component anymore. When the library is
finally unloaded, the root component will automatically be deleted.
The component object is a QObject. Use qobject_cast() to access
@@ -221,9 +233,9 @@ bool QPluginLoader::load()
call will fail, and unloading will only happen when every instance
has called unload().
- Don't try to delete the root component. Instead rely on
+ Don't try to delete the root component. Instead rely on
that unload() will automatically delete it when needed.
-
+
\sa instance(), load()
*/
bool QPluginLoader::unload()
@@ -261,6 +273,8 @@ bool QPluginLoader::isLoaded() const
By default, this property contains an empty string.
+ Note: In Symbian the \a fileName must point to plugin stub file.
+
\sa load()
*/
void QPluginLoader::setFileName(const QString &fileName)
@@ -273,7 +287,24 @@ void QPluginLoader::setFileName(const QString &fileName)
d = 0;
did_load = false;
}
+
+#if defined(Q_OS_SYMBIAN)
+ // In Symbian we actually look for plugin stub, so modify the filename
+ // to make canonicalFilePath find the file, if .dll is specified.
+ QFileInfo fi(fileName);
+
+ if (fi.suffix() == QLatin1String("dll")) {
+ QString stubName = fileName;
+ stubName.chop(3);
+ stubName += QLatin1String("qtplugin");
+ fi = QFileInfo(stubName);
+ }
+
+ QString fn = fi.canonicalFilePath();
+#else
QString fn = QFileInfo(fileName).canonicalFilePath();
+#endif
+
d = QLibraryPrivate::findOrCreate(fn);
d->loadHints = lh;
if (fn.isEmpty())
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 3e05d28834..4365c9803f 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -558,7 +558,7 @@ bool QUuid::operator>(const QUuid &other) const
\sa variant(), version()
*/
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) && ! defined(Q_CC_MWERKS)
QT_BEGIN_INCLUDE_NAMESPACE
#include <objbase.h> // For CoCreateGuid
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 2fb6335644..cb44a256d0 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -135,35 +135,6 @@ void QThreadData::deref()
#endif
}
-
-#ifndef QT_NO_THREAD
-/*
- QThreadPrivate
-*/
-
-QThreadPrivate::QThreadPrivate(QThreadData *d)
- : QObjectPrivate(), running(false), finished(false), terminated(false),
- stackSize(0), priority(QThread::InheritPriority), data(d)
-{
-#if defined (Q_OS_UNIX)
- thread_id = 0;
-#elif defined (Q_WS_WIN)
- handle = 0;
- id = 0;
- waiters = 0;
- terminationEnabled = true;
- terminatePending = false;
-#endif
-
- if (!data)
- data = new QThreadData;
-}
-
-QThreadPrivate::~QThreadPrivate()
-{
- data->deref();
-}
-
/*
QAdoptedThread
*/
@@ -173,17 +144,20 @@ QAdoptedThread::QAdoptedThread(QThreadData *data)
{
// thread should be running and not finished for the lifetime
// of the application (even if QCoreApplication goes away)
+#ifndef QT_NO_THREAD
d_func()->running = true;
d_func()->finished = false;
init();
+#endif
// fprintf(stderr, "new QAdoptedThread = %p\n", this);
}
QAdoptedThread::~QAdoptedThread()
{
+#ifndef QT_NO_THREAD
QThreadPrivate::finish(this);
-
+#endif
// fprintf(stderr, "~QAdoptedThread = %p\n", this);
}
@@ -199,6 +173,35 @@ void QAdoptedThread::run()
// this function should never be called
qFatal("QAdoptedThread::run(): Internal error, this implementation should never be called.");
}
+#ifndef QT_NO_THREAD
+/*
+ QThreadPrivate
+*/
+
+QThreadPrivate::QThreadPrivate(QThreadData *d)
+ : QObjectPrivate(), running(false), finished(false), terminated(false),
+ stackSize(0), priority(QThread::InheritPriority), data(d)
+{
+#if defined (Q_OS_UNIX)
+ thread_id = 0;
+#elif defined (Q_WS_WIN)
+ handle = 0;
+ id = 0;
+ waiters = 0;
+#endif
+#if defined (Q_WS_WIN) || defined (Q_OS_SYMBIAN)
+ terminationEnabled = true;
+ terminatePending = false;
+#endif
+
+ if (!data)
+ data = new QThreadData;
+}
+
+QThreadPrivate::~QThreadPrivate()
+{
+ data->deref();
+}
/*!
\class QThread
@@ -716,25 +719,36 @@ QThread::Priority QThread::priority() const
#else // QT_NO_THREAD
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <private/qcoreapplication_p.h>
-QT_END_INCLUDE_NAMESPACE
-
-Q_GLOBAL_STATIC_WITH_ARGS(QThreadData, staticThreadData, (0));
-QThread* QThread::instance = 0;
-
-QThread::QThread() : QObject(*new QThreadPrivate, (QObject*)0)
-{
+QThread::QThread(QObject *parent)
+ : QObject(*(new QThreadPrivate), (QObject*)0){
Q_D(QThread);
d->data->thread = this;
- QCoreApplicationPrivate::theMainThread = this;
+}
+
+QThread *QThread::currentThread()
+{
+ return QThreadData::current()->thread;
}
QThreadData* QThreadData::current()
{
- if (QThread::instance)
- return QThread::instance->d_func()->data;
- return staticThreadData();
+ static QThreadData *data = 0; // reinterpret_cast<QThreadData *>(pthread_getspecific(current_thread_data_key));
+ if (!data) {
+ data = new QThreadData;
+ data->thread = new QAdoptedThread(data);
+ data->deref();
+ }
+ return data;
+}
+
+/*! \internal
+ */
+QThread::QThread(QThreadPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
+{
+ Q_D(QThread);
+ // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this);
+ d->data->thread = this;
}
#endif // QT_NO_THREAD
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index d9a6240b54..7cbb264eaa 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -142,15 +142,18 @@ class Q_CORE_EXPORT QThread : public QObject
{
public:
static Qt::HANDLE currentThreadId() { return Qt::HANDLE(currentThread()); }
- static QThread* currentThread()
- { if (!instance) instance = new QThread(); return instance; }
+ static QThread* currentThread();
+
+protected:
+ QThread(QThreadPrivate &dd, QObject *parent = 0);
private:
- QThread();
+ explicit QThread(QObject *parent = 0);
static QThread *instance;
friend class QCoreApplication;
friend class QThreadData;
+ friend class QAdoptedThread;
Q_DECLARE_PRIVATE(QThread)
};
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 75293cee83..0bf773cf7a 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -62,6 +62,10 @@
#include "QtCore/qmap.h"
#include "private/qobject_p.h"
+#ifdef Q_OS_SYMBIAN
+#include <e32base.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QAbstractEventDispatcher;
@@ -131,6 +135,25 @@ public:
QMap<int, void *> tls;
QMutex mutex;
+
+# ifdef Q_OS_SYMBIAN
+ RThread symbian_thread_handle;
+# endif
+};
+
+// thread wrapper for the main() thread
+class QAdoptedThread : public QThread
+{
+ Q_DECLARE_PRIVATE(QThread)
+
+public:
+ QAdoptedThread(QThreadData *data = 0);
+ ~QAdoptedThread();
+ void init();
+
+ static QThread *createThreadForAdoption();
+private:
+ void run();
};
#ifndef QT_NO_THREAD
@@ -158,46 +181,37 @@ public:
QWaitCondition thread_done;
static void *start(void *arg);
- static void finish(void *arg);
+#if defined(Q_OS_SYMBIAN)
+ static void finish(void *arg, bool lockAnyway=true, bool closeNativeHandle=true);
+#else
+ static void finish(void *);
#endif
+#endif // Q_OS_UNIX
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
HANDLE handle;
unsigned int id;
int waiters;
- bool terminationEnabled, terminatePending;
static unsigned int __stdcall start(void *);
static void finish(void *, bool lockAnyway=true);
#endif // Q_OS_WIN32
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
+ bool terminationEnabled, terminatePending;
+# endif
QThreadData *data;
static void createEventDispatcher(QThreadData *data);
};
-// thread wrapper for the main() thread
-class QAdoptedThread : public QThread
-{
- Q_DECLARE_PRIVATE(QThread)
-
-public:
- QAdoptedThread(QThreadData *data = 0);
- ~QAdoptedThread();
- void init();
-
- static QThread *createThreadForAdoption();
-private:
- void run();
-};
-
#else // QT_NO_THREAD
class QThreadPrivate : public QObjectPrivate
{
public:
- QThreadPrivate() : data(QThreadData::current()) {}
- ~QThreadPrivate() { }
+ QThreadPrivate(QThreadData *d = 0) : data(d ? d : new QThreadData) {}
+ ~QThreadPrivate() { delete data; }
QThreadData *data;
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 8f1c698752..567c936912 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -47,7 +47,12 @@
#if !defined(QT_NO_GLIB)
# include "../kernel/qeventdispatcher_glib_p.h"
#endif
+
+#ifdef Q_OS_SYMBIAN
+#include <private/qeventdispatcher_symbian_p.h>
+#else
#include <private/qeventdispatcher_unix_p.h>
+#endif
#include "qthreadstorage.h"
@@ -131,7 +136,13 @@ QThreadData *QThreadData::current()
void QAdoptedThread::init()
{
- d_func()->thread_id = pthread_self();
+ Q_D(QThread);
+ d->thread_id = pthread_self();
+#ifdef Q_OS_SYMBIAN
+ d->data->symbian_thread_handle = RThread();
+ TThreadId threadId = d->data->symbian_thread_handle.Id();
+ d->data->symbian_thread_handle.Open(threadId);
+#endif
}
/*
@@ -159,7 +170,11 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
data->eventDispatcher = new QEventDispatcherGlib;
else
#endif
+#ifdef Q_OS_SYMBIAN
+ data->eventDispatcher = new QEventDispatcherSymbian;
+#else
data->eventDispatcher = new QEventDispatcherUNIX;
+#endif
data->eventDispatcher->startingUp();
}
@@ -167,12 +182,24 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
void *QThreadPrivate::start(void *arg)
{
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_cleanup_push(QThreadPrivate::finish, arg);
-
+#endif
+
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadData *data = QThreadData::get2(thr);
+#ifdef Q_OS_SYMBIAN
+ // Because Symbian Open C does not provide a way to convert between
+ // RThread and pthread_t, we must delay initialization of the RThread
+ // handle when creating a thread, until we are running in the new thread.
+ // Here, we pick up the current thread and assign that to the handle.
+ data->symbian_thread_handle = RThread();
+ TThreadId threadId = data->symbian_thread_handle.Id();
+ data->symbian_thread_handle.Open(threadId);
+#endif
+
pthread_once(&current_thread_data_once, create_current_thread_data_key);
pthread_setspecific(current_thread_data_key, data);
@@ -183,19 +210,33 @@ void *QThreadPrivate::start(void *arg)
createEventDispatcher(data);
emit thr->started();
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
+#endif
thr->run();
+#ifndef Q_OS_SYMBIAN
pthread_cleanup_pop(1);
+#else
+ QThreadPrivate::finish(arg);
+#endif
+
return 0;
}
+#ifdef Q_OS_SYMBIAN
+void QThreadPrivate::finish(void *arg, bool lockAnyway, bool closeNativeHandle)
+#else
void QThreadPrivate::finish(void *arg)
+#endif
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadPrivate *d = thr->d_func();
- QMutexLocker locker(&d->mutex);
+#ifdef Q_OS_SYMBIAN
+ if (lockAnyway)
+#endif
+ d->mutex.lock();
d->priority = QThread::InheritPriority;
d->running = false;
@@ -216,7 +257,15 @@ void QThreadPrivate::finish(void *arg)
QThreadStorageData::finish((void **)data);
d->thread_id = 0;
+#ifdef Q_OS_SYMBIAN
+ if (closeNativeHandle)
+ d->data->symbian_thread_handle.Close();
+#endif
d->thread_done.wakeAll();
+#ifdef Q_OS_SYMBIAN
+ if (lockAnyway)
+#endif
+ d->mutex.unlock();
}
@@ -268,6 +317,9 @@ int QThread::idealThreadCount()
cores = (int)sysconf(_SC_NPROC_ONLN);
#elif defined(Q_OS_INTEGRITY)
// ### TODO - how to get the amound of CPUs on INTEGRITY?
+#elif defined(Q_OS_SYMBIAN)
+ // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
+ cores = 1;
#else
// the rest: Linux, Solaris, AIX, Tru64
cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
@@ -352,7 +404,8 @@ void QThread::start(Priority priority)
d->priority = priority;
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && !defined(Q_OS_SYMBIAN) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+// ### Need to implement thread sheduling and priorities for symbian os. Implementation removed for now
switch (priority) {
case InheritPriority:
{
@@ -434,7 +487,9 @@ void QThread::start(Priority priority)
if (code == EPERM) {
// caller does not have permission to set the scheduling
// parameters/policy
+#ifndef Q_OS_SYMBIAN
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
code =
pthread_create(&d->thread_id, &attr, QThreadPrivate::start, this);
}
@@ -447,6 +502,9 @@ void QThread::start(Priority priority)
d->running = false;
d->finished = false;
d->thread_id = 0;
+#ifdef Q_OS_SYMBIAN
+ d->data->symbian_thread_handle.Close();
+#endif
}
}
@@ -458,6 +516,7 @@ void QThread::terminate()
if (!d->thread_id)
return;
+#ifndef Q_OS_SYMBIAN
int code = pthread_cancel(d->thread_id);
if (code) {
qWarning("QThread::start: Thread termination error: %s",
@@ -465,6 +524,21 @@ void QThread::terminate()
} else {
d->terminated = true;
}
+#else
+ if (!d->running)
+ return;
+ if (!d->terminationEnabled) {
+ d->terminatePending = true;
+ return;
+ }
+
+ d->terminated = true;
+ QThreadPrivate::finish(this, false, false);
+ d->data->symbian_thread_handle.Terminate(KErrNone);
+ d->data->symbian_thread_handle.Close();
+#endif
+
+
}
bool QThread::wait(unsigned long time)
@@ -489,11 +563,24 @@ bool QThread::wait(unsigned long time)
void QThread::setTerminationEnabled(bool enabled)
{
- Q_ASSERT_X(currentThread() != 0, "QThread::setTerminationEnabled()",
+ QThread *thr = currentThread();
+ Q_ASSERT_X(thr != 0, "QThread::setTerminationEnabled()",
"Current thread was not started with QThread.");
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, NULL);
if (enabled)
pthread_testcancel();
+#else
+ QThreadPrivate *d = thr->d_func();
+ QMutexLocker locker(&d->mutex);
+ d->terminationEnabled = enabled;
+ if (enabled && d->terminatePending) {
+ d->terminated = true;
+ QThreadPrivate::finish(thr, false);
+ locker.unlock(); // don't leave the mutex locked!
+ pthread_exit(NULL);
+ }
+#endif
}
void QThread::setPriority(Priority priority)
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 3bfa6ad399..35da4cd540 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -142,7 +142,7 @@ inline void qCount(const Container &container, const T &value, Size &n)
}
-#if defined Q_CC_MSVC && _MSC_VER < 1300
+#if (defined Q_CC_MSVC && _MSC_VER < 1300) || defined(Q_CC_MWERKS)
template <typename T>
inline void qSwap(T &value1, T &value2)
{
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index f6422fbe52..55028f264b 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -122,6 +122,17 @@ template <typename T> class QList;
class Q_CORE_EXPORT QByteArray
{
+private:
+ struct Data {
+ QBasicAtomicInt ref;
+ int alloc, size;
+ // ### Qt 5.0: We need to add the missing capacity bit
+ // (like other tool classes have), to maintain the
+ // reserved memory on resize.
+ char *data;
+ char array[1];
+ };
+
public:
inline QByteArray();
QByteArray(const char *);
@@ -347,15 +358,6 @@ public:
private:
operator QNoImplicitBoolCast() const;
- struct Data {
- QBasicAtomicInt ref;
- int alloc, size;
- // ### Qt 5.0: We need to add the missing capacity bit
- // (like other tool classes have), to maintain the
- // reserved memory on resize.
- char *data;
- char array[1];
- };
static Data shared_null;
static Data shared_empty;
Data *d;
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 723262627b..9063ae456b 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -41,6 +41,10 @@
#include <qcryptographichash.h>
+#ifdef Q_OS_SYMBIAN
+#define _MD5_H_ // Needed to disable system header
+#endif
+
#include "../../3rdparty/md5/md5.h"
#include "../../3rdparty/md5/md5.cpp"
#include "../../3rdparty/md4/md4.h"
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index a18b531dd9..3328716f0b 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -914,7 +914,8 @@ public:
inline QMultiHash operator+(const QMultiHash &other) const
{ QMultiHash result = *this; result += other; return result; }
-#ifndef Q_NO_USING_KEYWORD
+#if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
+ // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
using QHash<Key, T>::contains;
using QHash<Key, T>::remove;
using QHash<Key, T>::count;
@@ -984,7 +985,12 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::remove(const Key &key, const T &value)
typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
while (i != end && i.key() == key) {
if (i.value() == value) {
+#if defined(Q_CC_RVCT)
+ // RVCT has problems with scoping, apparently.
+ i = QHash<Key, T>::erase(i);
+#else
i = erase(i);
+#endif
++n;
} else {
++i;
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index ab26945d62..ee3e5309dc 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -78,6 +78,11 @@ QT_END_NAMESPACE
#include <qdebug.h>
#include <time.h>
+#if defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#include "private/qcore_symbian_p.h"
+#endif
+
#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
# include <fenv.h>
#endif
@@ -123,6 +128,13 @@ Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
Q_CORE_EXPORT qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok);
static qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+inline bool isascii(int c)
+{
+ return (c >= 0 && c <=127);
+}
+#endif
+
/******************************************************************************
** Helpers for accessing Qt locale database
*/
@@ -1270,6 +1282,792 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
}
return QVariant();
}
+#elif defined(Q_OS_SYMBIAN)
+
+static TExtendedLocale _s60Locale;
+
+// Type definitions for runtime resolved function pointers
+typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&);
+typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&);
+
+// Runtime resolved functions
+static FormatFunc ptrTimeFormatL = NULL;
+static FormatSpecFunc ptrGetTimeFormatSpec = NULL;
+static FormatSpecFunc ptrGetLongDateFormatSpec = NULL;
+static FormatSpecFunc ptrGetShortDateFormatSpec = NULL;
+
+// Default functions if functions cannot be resolved
+static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
+{
+ des.Zero();
+}
+
+static TPtrC defaultFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
+
+/*!
+ Definition of struct for mapping Symbian to ISO locale
+*/
+struct symbianToISO {
+ int symbian_language;
+ char iso_name[8];
+};
+
+
+/*!
+ Mapping from Symbian to ISO locale
+*/
+static const symbianToISO symbian_to_iso_list[] = {
+ { ELangEnglish, "en_GB" },
+ { ELangFrench, "fr_FR" },
+ { ELangGerman, "de_DE" },
+ { ELangSpanish, "es_ES" },
+ { ELangItalian, "it_IT" },
+ { ELangSwedish, "sv_SE" },
+ { ELangDanish, "da_DK" },
+ { ELangNorwegian, "no_NO" },
+ { ELangFinnish, "fi_FI" },
+ { ELangAmerican, "en_US" },
+ { ELangPortuguese, "pt_PT" },
+ { ELangTurkish, "tr_TR" },
+ { ELangIcelandic, "is_IS" },
+ { ELangRussian, "ru_RU" },
+ { ELangHungarian, "hu_HU" },
+ { ELangDutch, "nl_NL" },
+ { ELangBelgianFlemish, "nl_BE" },
+ { ELangCzech, "cs_CZ" },
+ { ELangSlovak, "sk_SK" },
+ { ELangPolish, "pl_PL" },
+ { ELangSlovenian, "sl_SI" },
+ { ELangTaiwanChinese, "zh_TW" },
+ { ELangHongKongChinese, "zh_HK" },
+ { ELangPrcChinese, "zh_CN" },
+ { ELangJapanese, "ja_JP" },
+ { ELangThai, "th_TH" },
+ { ELangArabic, "ar_AE" },
+ { ELangTagalog, "tl_PH" },
+ { ELangBulgarian, "bg_BG" },
+ { ELangCatalan, "ca_ES" },
+ { ELangCroatian, "hr_HR" },
+ { ELangEstonian, "et_EE" },
+ { ELangFarsi, "fa_IR" },
+ { ELangCanadianFrench, "fr_CA" },
+ { ELangGreek, "el_GR" },
+ { ELangHebrew, "he_IL" },
+ { ELangHindi, "hi_IN" },
+ { ELangIndonesian, "id_ID" },
+ { ELangLatvian, "lv_LV" },
+ { ELangLithuanian, "lt_LT" },
+ { ELangMalay, "ms_MY" },
+ { ELangBrazilianPortuguese, "pt_BR" },
+ { ELangRomanian, "ro_RO" },
+ { ELangSerbian, "sr_YU" },
+ { ELangLatinAmericanSpanish, "es" },
+ { ELangUkrainian, "uk_UA" },
+ { ELangUrdu, "ur_PK" }, // India/Pakistan
+ { ELangVietnamese, "vi_VN" },
+#ifdef __E32LANG_H__
+// 5.0
+ { ELangBasque, "eu_ES" },
+ { ELangGalician, "gl_ES" },
+#endif
+#if !defined(__SERIES60_31__)
+ { ELangEnglish_Apac, "en" },
+ { ELangEnglish_Taiwan, "en_TW" },
+ { ELangEnglish_HongKong, "en_HK" },
+ { ELangEnglish_Prc, "en_CN" },
+ { ELangEnglish_Japan, "en_JP"},
+ { ELangEnglish_Thailand, "en_TH" },
+ { ELangMalay_Apac, "ms" }
+#endif
+};
+
+/*!
+ Returns ISO name corresponding to the Symbian locale code \a sys_fmt.
+*/
+static QByteArray symbianLocaleName(int code)
+{
+ //Number of Symbian to ISO locale mappings
+ static const int symbian_to_iso_count
+ = sizeof(symbian_to_iso_list)/sizeof(symbianToISO);
+
+ int cmp = code - symbian_to_iso_list[0].symbian_language;
+ if (cmp < 0)
+ return 0;
+
+ if (cmp == 0)
+ return symbian_to_iso_list[0].iso_name;
+
+ int begin = 0;
+ int end = symbian_to_iso_count;
+
+ while (end - begin > 1) {
+ uint mid = (begin + end)/2;
+
+ const symbianToISO *elt = symbian_to_iso_list + mid;
+ int cmp = code - elt->symbian_language;
+ if (cmp < 0)
+ end = mid;
+ else if (cmp > 0)
+ begin = mid;
+ else
+ return elt->iso_name;
+ }
+
+ return 0;
+}
+
+
+// order is: normal, abbr, nmode, nmode+abbr
+static const char *us_locale_dep[] = {
+ "MM", "dd", "yyyy", "MM", "dd",
+ "M", "d", "yy", "M", "d",
+ "MMMM", "dd", "yyyy", "MMMM", "dd",
+ "MMM", "d", "yy", "MMM", "d" };
+
+static const char *eu_locale_dep[] = {
+ "dd", "MM", "yyyy", "dd", "MM",
+ "d", "M", "yy", "d", "M",
+ "dd", "MMMM", "yyyy", "dd", "MMMM",
+ "d", "MMM", "yy", "d", "MMM" };
+
+static const char *jp_locale_dep[] = {
+ "yyyy", "MM", "dd", "MM", "dd",
+ "yy", "M", "d", "M", "d",
+ "yyyy", "MMMM", "dd", "MMMM", "dd",
+ "yy", "MMM", "d", "MMM", "d" };
+
+/*!
+ Returns a Qt version of the given \a sys_fmt Symbian locale format string.
+*/
+static QString s60ToQtFormat(const QString &sys_fmt)
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ QString result;
+ QString other;
+ QString qtformatchars = QString::fromLatin1("adhmsyzAHM");
+
+ QChar c;
+ int i = 0;
+ bool open_escape = false;
+ bool abbrev_next = false;
+ bool locale_indep_ordering = false;
+ bool minus_mode = false;
+ bool plus_mode = false;
+ bool n_mode = false;
+ TTimeFormat tf = locale->TimeFormat();
+
+ while (i < sys_fmt.size()) {
+
+ c = sys_fmt.at(i);
+
+ // let formatting thru
+ if (c.unicode() == '%') {
+ // if we have gathered string, concat it
+ if (!other.isEmpty()) {
+ result += other;
+ other.clear();
+ }
+ // if we have open escape, end it
+ if (open_escape) {
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ // process specials
+ abbrev_next = c.unicode() == '*';
+ plus_mode = c.unicode() == '+';
+ minus_mode = c.unicode() == '-';
+
+ if (abbrev_next || plus_mode || minus_mode) {
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (plus_mode || minus_mode) {
+ // break on undefined plus/minus mode
+ if (c.unicode() != 'A' && c.unicode() != 'B')
+ break;
+ }
+ }
+
+ switch (c.unicode()) {
+ case 'F':
+ // locale indep mode on
+ locale_indep_ordering = true;
+ break;
+
+ case '/':
+ // date sep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->DateSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+
+ case 'D':
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("dd");
+ else
+ result += QLatin1Char('d');
+
+ break;
+
+ case 'M':
+ if (!locale_indep_ordering)
+ break;
+
+ if (!n_mode) {
+ if (!abbrev_next)
+ result += QLatin1String("MM");
+ else
+ result += QLatin1String("M");
+ } else {
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+ }
+
+ break;
+
+ case 'N':
+ n_mode = true;
+
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+
+ break;
+
+ case 'Y':
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("yyyy");
+ else
+ result += QLatin1String("yy");
+
+ break;
+
+ case 'E':
+ if (!abbrev_next)
+ result += QLatin1String("dddd");
+ else
+ result += QLatin1String("ddd");
+
+ break;
+
+ case ':':
+ // timesep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->TimeSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+
+ break;
+
+ case 'J':
+ if (tf == ETime24 && !abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+
+ case 'H':
+ if (!abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+
+ case 'I':
+ result += QLatin1Char('h');
+ break;
+
+ case 'T':
+ if (!abbrev_next)
+ result += QLatin1String("mm");
+ else
+ result += QLatin1Char('m');
+
+ break;
+
+ case 'S':
+ if (!abbrev_next)
+ result += QLatin1String("ss");
+ else
+ result += QLatin1Char('s');
+
+ break;
+
+ case 'B':
+ // only done for 12h clock
+ if (tf == ETime24)
+ break;
+
+ // fallthru to A
+ case 'A': {
+ // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic
+ TAmPmName ampm = TAmPmName();
+ TChar first(ampm[0]);
+ QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap");
+
+ int pos = locale->AmPmSymbolPosition();
+
+ if ((minus_mode && pos != ELocaleBefore) ||
+ (plus_mode && pos != ELocaleAfter))
+ break;
+
+ if (!abbrev_next && locale->AmPmSpaceBetween()) {
+ if (pos == ELocaleBefore)
+ qtampm.append(QLatin1Char(' '));
+ else
+ qtampm.prepend(QLatin1Char(' '));
+ }
+
+ result += qtampm;
+ }
+ break;
+
+ case '.': {
+ // decimal sep
+ TChar s = locale->DecimalSeparator();
+ TUint val = s;
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+
+ case 'C':
+ // six digits in s60, three digits in qt
+ if (!abbrev_next) {
+ result += QLatin1String("zzz");
+ } else {
+ // next char is number from 0-6, how many digits to display
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (c.isDigit()) {
+ // try to match wanted digits
+ QChar val(c.digitValue());
+
+ if (val >= 3) {
+ result += QLatin1String("zzz");
+ } else if (val > 0) {
+ result += QLatin1Char('z');
+ }
+ }
+ }
+ break;
+
+ // these cases fallthru
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+
+ // shouldn't parse these with %F
+ if (locale_indep_ordering)
+ break;
+
+ TDateFormat df = locale->DateFormat();
+
+ const char **locale_dep;
+ switch (df) {
+ default: // fallthru to american
+ case EDateAmerican:
+ locale_dep = us_locale_dep;
+ break;
+ case EDateEuropean:
+ locale_dep = eu_locale_dep;
+ break;
+ case EDateJapanese:
+ locale_dep = jp_locale_dep;
+ break;
+ }
+ int offset = 0;
+ if (abbrev_next)
+ offset += 5;
+ if (n_mode)
+ offset += 10;
+
+ result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]);
+ break;
+
+ case '%': // fallthru percent
+ // any junk gets copied as is
+ default:
+ result += c;
+ break;
+
+ case 'Z': // Qt doesn't support these :(
+ case 'X':
+ case 'W':
+ break;
+ }
+ } else {
+ // double any single quotes, don't begin escape
+ if (c.unicode() == '\'') {
+ // end open escape
+ if (open_escape) {
+ result += other;
+ other.clear();
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ other += c;
+ }
+
+ // gather chars and escape them in one go if any format chars are found
+ if (!open_escape && qtformatchars.indexOf(c) != -1) {
+ result += QLatin1Char('\'');
+ open_escape = true;
+ }
+ other += c;
+ }
+
+ ++i;
+ }
+
+ if (!other.isEmpty())
+ result += other;
+ if (open_escape)
+ result += QLatin1Char('\'');
+
+ return result;
+}
+
+/*!
+ Retrieves Symbian locale decimal separator.
+*/
+static QString symbianDecimalPoint()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar decPoint = locale->DecimalSeparator();
+ int val = decPoint;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale group separator.
+*/
+static QString symbianGroupSeparator()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar grpSep = locale->ThousandsSeparator();
+ int val = grpSep;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale zero digit.
+*/
+static QString symbianZeroDigit()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ // TDigitType enumeration value returned by TLocale
+ // will always correspond to zero digit unicode value.
+ TDigitType digit = locale->DigitType();
+ return QChar(digit);
+}
+
+/*!
+ Retrieves a day name from Symbian locale. The \a day is an integer
+ from 1 to 7. When \a short_format is true the method returns
+ the day in short format. Otherwise it returns the day in a long format.
+*/
+static QString symbianDayName(int day, bool short_format)
+{
+ day -= 1;
+
+ if (day < 0 || day > 6)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TDayNameAbb(TDay(day)));
+ } else {
+ return qt_TDes2QStringL(TDayName(TDay(day)));
+ }
+}
+
+/*!
+ Retrieves a month name from Symbian locale. The \a month is an integer
+ from 1 to 12. When \a short_format is true the method returns
+ the month in short format. Otherwise it returns the month in a long format.
+*/
+static QString symbianMonthName(int month, bool short_format)
+{
+ month -= 1;
+ if (month < 0 || month > 11)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TMonthNameAbb(TMonth(month)));
+ } else {
+ return qt_TDes2QStringL(TMonthName(TMonth(month)));
+ }
+}
+
+/*!
+ Retrieves date format from Symbian locale and
+ transforms it to Qt format.
+
+ When \a short_format is true the method returns
+ short date format. Otherwise it returns the long format.
+*/
+static QString symbianDateFormat(bool short_format)
+{
+ TPtrC dateFormat;
+
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ return s60ToQtFormat(qt_TDesC2QStringL(dateFormat));
+}
+
+/*!
+ Retrieves time format from Symbian locale and
+ transforms it to Qt format.
+*/
+static QString symbianTimeFormat()
+{
+ return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale)));
+}
+
+/*!
+ Returns localized string representation of given \a date
+ formatted with Symbian locale date format.
+
+ If \a short_format is true the format will be a short version.
+ Otherwise it uses a longer version.
+*/
+static QString symbianDateToString(const QDate &date, bool short_format)
+{
+ int month = date.month() - 1;
+ int day = date.day() - 1;
+ int year = date.year();
+
+ TDateTime dateTime;
+ dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxLongDateFormatSpec*2> buffer;
+
+ TPtrC dateFormat;
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());)
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns localized string representation of given \a time
+ formatted with Symbian locale time format.
+*/
+static QString symbianTimeToString(const QTime &time)
+{
+ int hour = time.hour();
+ int minute = time.minute();
+ int second = time.second();
+ int milliseconds = 0;
+
+ TDateTime dateTime;
+ dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxTimeFormatSpec*2> buffer;
+
+ TRAPD(err, ptrTimeFormatL(
+ timeStr,
+ buffer,
+ ptrGetTimeFormatSpec(_s60Locale),
+ *_s60Locale.GetLocale());
+ )
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns the measurement system stored in Symbian locale
+
+ \sa QLocale::MeasurementSystem
+*/
+static QLocale::MeasurementSystem symbianMeasurementSystem()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TUnitsFormat unitFormat = locale->UnitsGeneral();
+ if (unitFormat == EUnitsImperial)
+ return QLocale::ImperialSystem;
+ else
+ return QLocale::MetricSystem;
+}
+
+QLocale QSystemLocale::fallbackLocale() const
+{
+ // load system data before query calls
+ static bool initDone = false;
+ if (!initDone) {
+ _s60Locale.LoadSystemSettings();
+
+ // Initialize platform version dependent function pointers
+ ptrTimeFormatL = reinterpret_cast<FormatFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
+ ptrGetTimeFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec));
+ ptrGetLongDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec));
+ ptrGetShortDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec));
+ if (!ptrTimeFormatL)
+ ptrTimeFormatL = &defaultTimeFormatL;
+ if (!ptrGetTimeFormatSpec)
+ ptrGetTimeFormatSpec = &defaultFormatSpec;
+ if (!ptrGetLongDateFormatSpec)
+ ptrGetLongDateFormatSpec = &defaultFormatSpec;
+ if (!ptrGetShortDateFormatSpec)
+ ptrGetShortDateFormatSpec = &defaultFormatSpec;
+ }
+
+ TLanguage lang = User::Language();
+ QString locale = symbianLocaleName(lang);
+ return QLocale(locale);
+}
+
+/*!
+ Generic query method for locale data. Provides indirection.
+ Denotes the \a type of the query
+ with \a in as input data depending on the query.
+
+ \sa QSystemLocale::QueryType
+*/
+QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
+{
+ switch(type) {
+ case DecimalPoint:
+ return symbianDecimalPoint();
+ case GroupSeparator:
+ return symbianGroupSeparator();
+
+ case ZeroDigit:
+ return symbianZeroDigit();
+
+ case DayNameLong:
+ case DayNameShort:
+ return symbianDayName(in.toInt(), (type == DayNameShort) );
+
+ case MonthNameLong:
+ case MonthNameShort:
+ return symbianMonthName(in.toInt(), (type == MonthNameShort) );
+
+ case DateFormatLong:
+ case DateFormatShort:
+ return symbianDateFormat( (type == DateFormatShort) );
+ case TimeFormatLong:
+ case TimeFormatShort:
+ return symbianTimeFormat();
+ case DateTimeFormatLong:
+ case DateTimeFormatShort:
+ return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat();
+ case DateToStringShort:
+ case DateToStringLong:
+ return symbianDateToString(in.toDate(), (type == DateToStringShort) );
+ case TimeToStringShort:
+ case TimeToStringLong:
+ return symbianTimeToString(in.toTime());
+ case DateTimeToStringShort:
+ case DateTimeToStringLong: {
+ const QDateTime dt = in.toDateTime();
+ return symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
+ + QLatin1Char(' ') + symbianTimeToString(dt.time());
+ }
+ case MeasurementSystem:
+ return static_cast<int>(symbianMeasurementSystem());
+ case LanguageId:
+ case CountryId: {
+ TLanguage language = User::Language();
+ QString locale = symbianLocaleName(language);
+ QLocale::Language lang;
+ QLocale::Country cntry;
+ getLangAndCountry(locale, lang, cntry);
+ if (type == LanguageId)
+ return lang;
+ // few iso codes have no country and will use this
+ if (cntry == QLocale::AnyCountry)
+ return fallbackLocale().country();
+
+ return cntry;
+ }
+ case NegativeSign:
+ case PositiveSign:
+ case AMText:
+ case PMText:
+ break;
+ default:
+ break;
+ }
+ return QVariant();
+}
#elif defined(Q_OS_UNIX)
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 5f13e5a7b7..0215a78b21 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -923,7 +923,8 @@ public:
inline QMultiMap operator+(const QMultiMap &other) const
{ QMultiMap result = *this; result += other; return result; }
-#ifndef Q_NO_USING_KEYWORD
+#if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
+ // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
using QMap<Key, T>::contains;
using QMap<Key, T>::remove;
using QMap<Key, T>::count;
@@ -993,7 +994,12 @@ Q_INLINE_TEMPLATE int QMultiMap<Key, T>::remove(const Key &key, const T &value)
typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
if (i.value() == value) {
+#if defined(Q_CC_RVCT)
+ // RVCT has problems with scoping, apparently.
+ i = QMap<Key, T>::erase(i);
+#else
i = erase(i);
+#endif
++n;
} else {
++i;
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index ad2d9f2c4b..88b8b8cfcd 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -109,13 +109,19 @@ namespace QtSharedPointer {
template <class T>
class Basic
{
+#ifndef Q_CC_NOKIAX86
typedef T *Basic:: *RestrictedBool;
+#endif
public:
typedef T Type;
inline T *data() const { return value; }
inline bool isNull() const { return !data(); }
+#ifndef Q_CC_NOKIAX86
inline operator RestrictedBool() const { return isNull() ? 0 : &Basic::value; }
+#else
+ inline operator bool() const { return isNull() ? 0 : &Basic::value; }
+#endif
inline bool operator !() const { return isNull(); }
inline T &operator*() const { return *data(); }
inline T *operator->() const { return data(); }
@@ -249,7 +255,7 @@ namespace QtSharedPointer {
if (o && !o->strongref)
o = 0;
if (o) {
- verifyReconstruction(actual);
+ Basic<T>::verifyReconstruction(actual);
o->weakref.ref();
o->strongref.ref();
}
@@ -277,15 +283,15 @@ public:
inline QSharedPointer() { }
// inline ~QSharedPointer() { }
- inline explicit QSharedPointer(T *ptr) { internalConstruct(ptr); }
+ inline explicit QSharedPointer(T *ptr) { BaseClass::internalConstruct(ptr); }
template <typename Deleter>
- inline QSharedPointer(T *ptr, Deleter d) { internalConstruct(ptr, d); }
+ inline QSharedPointer(T *ptr, Deleter d) { BaseClass::internalConstruct(ptr, d); }
inline QSharedPointer(const QSharedPointer<T> &other) : BaseClass(other) { }
inline QSharedPointer<T> &operator=(const QSharedPointer<T> &other)
{
- internalCopy(other);
+ BaseClass::internalCopy(other);
return *this;
}
@@ -301,7 +307,7 @@ public:
inline QSharedPointer<T> &operator=(const QSharedPointer<X> &other)
{
QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid
- internalCopy(other);
+ BaseClass::internalCopy(other);
return *this;
}
@@ -339,12 +345,18 @@ public:
template <class T>
class QWeakPointer
{
+#ifndef Q_CC_NOKIAX86
typedef T *QWeakPointer:: *RestrictedBool;
+#endif
typedef QtSharedPointer::ExternalRefCountData Data;
public:
inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; }
+#ifndef Q_CC_NOKIAX86
inline operator RestrictedBool() const { return isNull() ? 0 : &QWeakPointer::value; }
+#else
+ inline operator bool() const { return isNull() ? 0 : &QWeakPointer::value; }
+#endif
inline bool operator !() const { return isNull(); }
inline QWeakPointer() : d(0), value(0) { }
diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp
index bc9b675324..8a8e95b59d 100644
--- a/src/corelib/tools/qtextboundaryfinder.cpp
+++ b/src/corelib/tools/qtextboundaryfinder.cpp
@@ -38,11 +38,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "private/qharfbuzz_p.h"
#include <QtCore/qtextboundaryfinder.h>
#include <QtCore/qvarlengtharray.h>
#include <private/qunicodetables_p.h>
#include <qdebug.h>
+#include "private/qharfbuzz_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index e5bf7e4a2f..45e92bfe5d 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -101,4 +101,7 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
tools/qharfbuzz.cpp
HEADERS += tools/qharfbuzz_p.h
-!macx-icc:unix:LIBS += -lm
+INCLUDEPATH += ../3rdparty/md5 \
+ ../3rdparty/md4
+
+!macx-icc:unix:!symbian:LIBS += -lm
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index f1ec8588bd..92347a7b7a 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -45,7 +45,7 @@ win32 {
!win32-borland:!wince*: LIBS += -lshell32 # the filedialog needs this library
}
-!mac:!embedded:unix {
+!mac:!embedded:!symbian:unix {
HEADERS += dialogs/qpagesetupdialog_unix_p.h
SOURCES += dialogs/qprintdialog_unix.cpp \
dialogs/qpagesetupdialog_unix.cpp
@@ -70,7 +70,7 @@ embedded {
}
}
-wince*: FORMS += dialogs/qfiledialog_wince.ui
+wince*|symbian: FORMS += dialogs/qfiledialog_embedded.ui
else: FORMS += dialogs/qfiledialog.ui
INCLUDEPATH += $$PWD
@@ -94,4 +94,4 @@ SOURCES += \
FORMS += dialogs/qpagesetupwidget.ui
RESOURCES += dialogs/qprintdialog.qrc
-RESOURCES += dialogs/qmessagebox.qrc \ No newline at end of file
+RESOURCES += dialogs/qmessagebox.qrc
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 14d8162efd..ef562f4153 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -64,8 +64,12 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
#elif defined(Q_WS_X11)
# include "../kernel/qt_x11_p.h"
+#elif defined(Q_WS_S60)
+# include "qfiledialog.h"
+#endif
+#if defined(Q_OS_SYMBIAN)
+#include "qmenubar.h"
#endif
-
#ifndef SPI_GETSNAPTODEFBUTTON
# define SPI_GETSNAPTODEFBUTTON 95
#endif
@@ -486,7 +490,22 @@ int QDialog::exec()
#endif //QT_NO_MENUBAR
#endif //Q_OS_WINCE_WM
+#ifdef Q_OS_SYMBIAN
+#ifndef QT_NO_MENUBAR
+ QMenuBar *menuBar = 0;
+ if (!findChild<QMenuBar *>())
+ menuBar = new QMenuBar(this);
+#endif
+#endif
+
+#if !defined(Q_WS_S60)
show();
+#else
+ if (qobject_cast<QFileDialog *>(this))
+ showFullScreen();
+ else
+ show();
+#endif
#ifdef Q_WS_MAC
d->mac_nativeDialogModalHelp();
@@ -511,6 +530,13 @@ int QDialog::exec()
delete menuBar;
#endif //QT_NO_MENUBAR
#endif //Q_OS_WINCE_WM
+#ifdef Q_OS_SYMBIAN
+#ifndef QT_NO_MENUBAR
+ else if (menuBar)
+ delete menuBar;
+#endif //QT_NO_MENUBAR
+#endif //Q_OS_SYMBIAN
+
return res;
}
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index eeb274315d..789b364dfd 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -58,12 +58,15 @@
#include <qdebug.h>
#include <qapplication.h>
#include <qstylepainter.h>
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_WS_S60)
#include "ui_qfiledialog.h"
#else
-#include "ui_qfiledialog_wince.h"
+#define Q_EMBEDDED_SMALLSCREEN
+#include "ui_qfiledialog_embedded.h"
+#if defined(Q_OS_WINCE)
extern bool qt_priv_ptr_valid;
#endif
+#endif
QT_BEGIN_NAMESPACE
@@ -2075,7 +2078,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte
q->restoreState(settings.value(QLatin1String("filedialog")).toByteArray());
#endif
-#ifdef Q_OS_WINCE
+#if defined(Q_EMBEDDED_SMALLSCREEN)
qFileDialogUi->lookInLabel->setVisible(false);
qFileDialogUi->fileNameLabel->setVisible(false);
qFileDialogUi->fileTypeLabel->setVisible(false);
@@ -3187,7 +3190,10 @@ QStringList QFSCompletor::splitPath(const QString &path) const
QString pathCopy = QDir::toNativeSeparators(path);
QString sep = QDir::separator();
-#ifdef Q_OS_WIN
+#if defined(Q_OS_SYMBIAN)
+ if (pathCopy == QLatin1String("\\"))
+ return QStringList(pathCopy);
+#elif defined(Q_OS_WIN)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
return QStringList(pathCopy);
QString doubleSlash(QLatin1String("\\\\"));
@@ -3199,7 +3205,11 @@ QStringList QFSCompletor::splitPath(const QString &path) const
QRegExp re(QLatin1String("[") + QRegExp::escape(sep) + QLatin1String("]"));
-#ifdef Q_OS_WIN
+#if defined(Q_OS_SYMBIAN)
+ QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
+ if (pathCopy.endsWith(sep))
+ parts.append(QString());
+#elif defined(Q_OS_WIN)
QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
if (!doubleSlash.isEmpty() && !parts.isEmpty())
parts[0].prepend(doubleSlash);
@@ -3211,7 +3221,7 @@ QStringList QFSCompletor::splitPath(const QString &path) const
parts[0] = sep[0];
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':'));
#else
bool startsFromRoot = path[0] == sep[0];
diff --git a/src/gui/dialogs/qfiledialog_wince.ui b/src/gui/dialogs/qfiledialog_embedded.ui
index 8aa9e1b30f..8aa9e1b30f 100644
--- a/src/gui/dialogs/qfiledialog_wince.ui
+++ b/src/gui/dialogs/qfiledialog_embedded.ui
diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h
index ab4199e2d5..de7e33242f 100644
--- a/src/gui/dialogs/qfiledialog_p.h
+++ b/src/gui/dialogs/qfiledialog_p.h
@@ -99,7 +99,7 @@ class QFSCompletor : public QCompleter {
public:
QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model)
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
setCaseSensitivity(Qt::CaseInsensitive);
#endif
}
@@ -224,7 +224,7 @@ public:
static inline QString toInternal(const QString &path)
{
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
QString n(path);
for (int i = 0; i < (int)n.length(); ++i)
if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/');
@@ -295,7 +295,7 @@ public:
bool defaultFileTypes;
bool fileNameLabelExplicitlySat;
QStringList nameFilters;
-
+
// Members for using native dialogs:
bool nativeDialogInUse;
// setVisible_sys returns true if it ends up showing a native
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 23a2cbc1c6..a2abe5479c 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -287,6 +287,8 @@ QString QFileInfoGatherer::translateDriveName(const QFileInfo &drive) const
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (driveName.startsWith(QLatin1Char('/'))) // UNC host
return drive.fileName();
+#endif
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
if (driveName.endsWith(QLatin1Char('/')))
driveName.chop(1);
#endif
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 012d3a1c79..49a3f2e089 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -355,7 +355,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
if ((pathElements.isEmpty())
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN)
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
#endif
)
@@ -384,9 +384,21 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
r = translateVisibleLocation(rootNode, r);
index = q->index(r, 0, QModelIndex());
pathElements.pop_front();
- } else {
+ } else
+#endif
+
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+ {
if (!pathElements.at(0).contains(QLatin1String(":")))
+#if defined(Q_CC_NOKIAX86)
+ {
+ // Workaround for bizarre compiler crash.
+ QString rootPath = QDir(longPath).rootPath();
+ pathElements.prepend(rootPath);
+ }
+#else
pathElements.prepend(QDir(longPath).rootPath());
+#endif
if (pathElements.at(0).endsWith(QLatin1Char('/')))
pathElements[0].chop(1);
}
@@ -1585,12 +1597,25 @@ void QFileSystemModelPrivate::_q_directoryChanged(const QString &directory, cons
if (parentNode->children.count() == 0)
return;
QStringList toRemove;
+#if defined(Q_OS_SYMBIAN)
+ // Filename case must be exact in qBinaryFind below, so create a list of all lowercase names.
+ QStringList newFiles;
+ for(int i = 0; i < files.size(); i++) {
+ newFiles << files.at(i).toLower();
+ }
+#else
QStringList newFiles = files;
+#endif
qSort(newFiles.begin(), newFiles.end());
QHash<QString, QFileSystemNode*>::const_iterator i = parentNode->children.constBegin();
while (i != parentNode->children.constEnd()) {
QStringList::iterator iterator;
- iterator = qBinaryFind(newFiles.begin(), newFiles.end(), i.value()->fileName);
+ iterator = qBinaryFind(newFiles.begin(), newFiles.end(),
+#if defined(Q_OS_SYMBIAN)
+ i.value()->fileName.toLower());
+#else
+ i.value()->fileName);
+#endif
if (iterator == newFiles.end()) {
toRemove.append(i.value()->fileName);
}
@@ -1913,8 +1938,8 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
return true;
}
-#include "moc_qfilesystemmodel.cpp"
+QT_END_NAMESPACE
-#endif // QT_NO_FILESYSTEMMODEL
+#include "moc_qfilesystemmodel.cpp"
-QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMMODEL \ No newline at end of file
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index fb3bcb8ac6..220faa3767 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -275,7 +275,7 @@ void QMessageBoxPrivate::updateSize()
#ifdef Q_WS_QWS
// the width of the screen, less the window border.
int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
// the width of the screen, less the window border.
int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
#else
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index f224e67d05..d3b73885ab 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -4,7 +4,7 @@ QT = core
DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
-!win32:!embedded:!mac:CONFIG += x11
+!win32:!embedded:!mac:!symbian:CONFIG += x11
unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
@@ -42,3 +42,4 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
DEFINES += Q_INTERNAL_QAPP_SRC
+symbian:TARGET.UID3=0x2001B2DD \ No newline at end of file
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index ca529743f5..b5e3ee5d94 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -61,6 +61,9 @@ mac {
HEADERS += image/qpixmap_mac_p.h
SOURCES += image/qpixmap_mac.cpp
}
+symbian {
+ SOURCES += image/qpixmap_s60.cpp
+}
# Built-in image format support
HEADERS += \
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 0f6b6497b6..3ef5be35c4 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -76,6 +76,10 @@
# include <private/qpixmap_x11_p.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+# include <private/qt_s60_p.h>
+#endif
+
#include "qpixmap_raster_p.h"
QT_BEGIN_NAMESPACE
@@ -1859,7 +1863,10 @@ int QPixmap::defaultDepth()
return 32; // XXX
#elif defined(Q_WS_MAC)
return 32;
+#elif defined(Q_OS_SYMBIAN)
+ return S60->screenDepth;
#endif
+
}
typedef void (*_qt_pixmap_cleanup_hook_64)(qint64);
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
new file mode 100644
index 0000000000..625988a977
--- /dev/null
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+#include <w32std.h>
+#include <fbs.h>
+
+#include <private/qt_s60_p.h>
+#include "qpixmap.h"
+#include "qpixmap_raster_p.h"
+#include <qwidget.h>
+
+QT_BEGIN_NAMESPACE
+
+QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
+{
+ CWsScreenDevice* screenDevice = S60->screenDevice();
+ TSize screenSize = screenDevice->SizeInPixels();
+
+ TSize srcSize;
+ // Find out if this is one of our windows.
+ QSymbianControl *sControl;
+ sControl = winId->MopGetObject(sControl);
+ if (sControl && sControl->widget()->windowType() == Qt::Desktop) {
+ // Grabbing desktop widget
+ srcSize = screenSize;
+ } else {
+ TPoint relativePos = winId->PositionRelativeToScreen();
+ x += relativePos.iX;
+ y += relativePos.iY;
+ srcSize = winId->Size();
+ }
+
+ TRect srcRect(TPoint(x, y), srcSize);
+ // Clip to the screen
+ srcRect.Intersection(TRect(screenSize));
+
+ if (w > 0 && h > 0) {
+ TRect subRect(TPoint(x, y), TSize(w, h));
+ // Clip to the subRect
+ srcRect.Intersection(subRect);
+ }
+
+ if (srcRect.IsEmpty())
+ return QPixmap();
+
+ TDisplayMode displayMode = screenDevice->DisplayMode();
+ CFbsBitmap* temporary = new (ELeave) CFbsBitmap();
+ TInt error = temporary->Create(srcRect.Size(), displayMode);
+ if (error == KErrNone)
+ error = screenDevice->CopyScreenToBitmap(temporary, srcRect);
+
+ if (error != KErrNone) {
+ CBase::Delete(temporary);
+ return QPixmap();
+ }
+
+ QImage::Format format = qt_TDisplayMode2Format( displayMode );
+ int bytesPerLine = CFbsBitmap::ScanLineLength(temporary->SizeInPixels().iWidth,displayMode);
+ temporary->LockHeap();
+ QImage image = QImage((uchar*)temporary->DataAddress(), srcRect.Width(), srcRect.Height(), bytesPerLine, format);
+ QPixmap pixmap = QPixmap::fromImage(image.copy());
+ temporary->UnlockHeap();
+ CBase::Delete(temporary);
+ return pixmap;
+
+}
+QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 458d6b96cc..c9973d0f6a 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -86,7 +86,9 @@ QT_BEGIN_NAMESPACE
\sa QCache, QPixmap
*/
-#if defined(Q_WS_QWS) || defined(Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+static int cache_limit = 1024; // 1048 KB cache limit for symbian
+#elif defined(Q_WS_QWS) || defined(Q_OS_WINCE)
static int cache_limit = 2048; // 2048 KB cache limit for embedded
#else
static int cache_limit = 10240; // 10 MB cache limit for desktop
diff --git a/src/gui/image/qpixmapdatafactory.cpp b/src/gui/image/qpixmapdatafactory.cpp
index 699489d5fc..03d62d3afe 100644
--- a/src/gui/image/qpixmapdatafactory.cpp
+++ b/src/gui/image/qpixmapdatafactory.cpp
@@ -47,7 +47,7 @@
#ifdef Q_WS_X11
# include <private/qpixmap_x11_p.h>
#endif
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN) || defined(Q_WS_S60)
# include <private/qpixmap_raster_p.h>
#endif
#ifdef Q_WS_MAC
@@ -75,7 +75,7 @@ QPixmapData* QSimplePixmapDataFactory::create(QPixmapData::PixelType type)
#if defined(Q_WS_X11)
return new QX11PixmapData(type);
-#elif defined(Q_WS_WIN)
+#elif defined(Q_WS_WIN) || defined(Q_WS_S60)
return new QRasterPixmapData(type);
#elif defined(Q_WS_MAC)
return new QMacPixmapData(type);
diff --git a/src/gui/inputmethod/inputmethod.pri b/src/gui/inputmethod/inputmethod.pri
index d321cd4e0b..f6883642e6 100644
--- a/src/gui/inputmethod/inputmethod.pri
+++ b/src/gui/inputmethod/inputmethod.pri
@@ -23,4 +23,9 @@ mac:!embedded {
HEADERS += inputmethod/qmacinputcontext_p.h
SOURCES += inputmethod/qmacinputcontext_mac.cpp
}
+symbian {
+ HEADERS += inputmethod/qcoefepinputcontext_p.h
+ SOURCES += inputmethod/qcoefepinputcontext_s60.cpp
+ LIBS += -lfepbase
+}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
new file mode 100644
index 0000000000..50f8a12ae9
--- /dev/null
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOEFEPINPUTCONTEXT_P_H
+#define QCOEFEPINPUTCONTEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QT_NO_IM
+
+#include "qinputcontext.h"
+#include <qhash.h>
+#include <private/qcore_symbian_p.h>
+#include <private/qt_s60_p.h>
+
+#include <fepbase.h>
+#include <aknedsts.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_GUI_EXPORT QCoeFepInputContext : public QInputContext,
+ public MCoeFepAwareTextEditor,
+ public MCoeFepAwareTextEditor_Extension1,
+ public MObjectProvider
+{
+ Q_OBJECT
+
+public:
+ QCoeFepInputContext(QObject *parent = 0);
+ ~QCoeFepInputContext();
+
+ QString identifierName() { return QLatin1String("coefep"); }
+ QString language();
+
+ void reset();
+ void update();
+
+ bool filterEvent(const QEvent *event);
+ void mouseHandler( int x, QMouseEvent *event);
+ bool isComposing() const { return m_isEditing; }
+
+ void setFocusWidget(QWidget * w);
+ void widgetDestroyed(QWidget *w);
+
+ TCoeInputCapabilities inputCapabilities();
+
+private:
+ void commitCurrentString();
+ void updateHints();
+ void applyHints(Qt::InputMethodHints hints);
+ void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
+
+ // From MCoeFepAwareTextEditor
+public:
+ void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText,
+ TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw,
+ MFepInlineTextFormatRetriever& aInlineTextFormatRetriever,
+ MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit);
+ void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText);
+ void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility);
+ void CancelFepInlineEdit();
+ TInt DocumentLengthForFep() const;
+ TInt DocumentMaximumLengthForFep() const;
+ void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection);
+ void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const;
+ void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const;
+ void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const;
+ void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent,
+ TInt aDocumentPosition) const;
+private:
+ void DoCommitFepInlineEditL();
+ MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue);
+
+ // From MCoeFepAwareTextEditor_Extension1
+public:
+ void SetStateTransferingOwnershipL(MCoeFepAwareTextEditor_Extension1::CState* aState, TUid aTypeSafetyUid);
+ MCoeFepAwareTextEditor_Extension1::CState* State(TUid aTypeSafetyUid);
+
+ // From MObjectProvider
+public:
+ TTypeUid::Ptr MopSupplyObject(TTypeUid id);
+
+private:
+ QSymbianControl *m_parent;
+ CAknEdwinState *m_fepState;
+ QString m_preeditString;
+ Qt::InputMethodHints m_lastImHints;
+ TUint m_textCapabilities;
+ bool m_isEditing;
+ bool m_inDestruction;
+ int m_cursorVisibility;
+ int m_inlinePosition;
+ MFepInlineTextFormatRetriever *m_formatRetriever;
+ MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_IM
+
+#endif // QCOEFEPINPUTCONTEXT_P_H
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
new file mode 100644
index 0000000000..8612e55b31
--- /dev/null
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -0,0 +1,734 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_NO_IM
+
+#include "qcoefepinputcontext_p.h"
+#include <qapplication.h>
+#include <qtextformat.h>
+
+#include <fepitfr.h>
+
+#include <limits.h>
+// You only find these enumerations on SDK 5 onwards, so we need to provide our own
+// to remain compatible with older releases. They won't be called by pre-5.0 SDKs.
+
+// MAknEdStateObserver::EAknCursorPositionChanged
+#define QT_EAknCursorPositionChanged MAknEdStateObserver::EAknEdwinStateEvent(6)
+// MAknEdStateObserver::EAknActivatePenInputRequest
+#define QT_EAknActivatePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(7)
+
+QT_BEGIN_NAMESPACE
+
+QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
+ : QInputContext(parent),
+ m_fepState(new (ELeave) CAknEdwinState),
+ m_lastImHints(Qt::ImhNone),
+ m_textCapabilities(TCoeInputCapabilities::EAllText),
+ m_isEditing(false),
+ m_inDestruction(false),
+ m_cursorVisibility(1),
+ m_inlinePosition(0),
+ m_formatRetriever(0),
+ m_pointerHandler(0)
+{
+ m_fepState->SetObjectProvider(this);
+ m_fepState->SetFlags(EAknEditorFlagDefault);
+ m_fepState->SetDefaultInputMode( EAknEditorTextInputMode );
+ m_fepState->SetPermittedInputModes( EAknEditorAllInputModes );
+ m_fepState->SetLocalLanguage(ELangEnglish);
+ m_fepState->SetDefaultLanguage(ELangEnglish);
+ m_fepState->SetDefaultCase( EAknEditorLowerCase );
+ m_fepState->SetPermittedCases( EAknEditorLowerCase|EAknEditorUpperCase );
+ m_fepState->SetSpecialCharacterTableResourceId( 0 );
+ m_fepState->SetNumericKeymap( EAknEditorStandardNumberModeKeymap );
+}
+
+QCoeFepInputContext::~QCoeFepInputContext()
+{
+ m_inDestruction = true;
+
+ // This is to make sure that the FEP manager "forgets" about us,
+ // otherwise we may get callbacks even after we're destroyed.
+ // The call is asynchronous though, so we must spin the event loop
+ // to make sure it gets detected.
+ CCoeEnv::Static()->InputCapabilitiesChanged();
+ QApplication::processEvents();
+
+ if (m_fepState)
+ delete m_fepState;
+}
+
+void QCoeFepInputContext::reset()
+{
+ CCoeEnv::Static()->Fep()->CancelTransaction();
+}
+
+void QCoeFepInputContext::update()
+{
+ updateHints();
+
+ // For pre-5.0 SDKs, we don't do text updates on S60 side.
+ if (QSysInfo::s60Version() != QSysInfo::SV_S60_5_0) {
+ return;
+ }
+
+ // Don't be fooled (as I was) by the name of this enumeration.
+ // What it really does is tell the virtual keyboard UI that the text has been
+ // updated and it should be reflected in the internal display of the VK.
+ m_fepState->ReportAknEdStateEventL(QT_EAknCursorPositionChanged);
+}
+
+void QCoeFepInputContext::setFocusWidget(QWidget *w)
+{
+ commitCurrentString();
+
+ CCoeEnv::Static()->Fep()->CancelTransaction();
+
+ QInputContext::setFocusWidget(w);
+
+ updateHints();
+}
+
+void QCoeFepInputContext::widgetDestroyed(QWidget *w)
+{
+ // Make sure that the input capabilities of whatever new widget got focused are queried.
+ CCoeControl *ctrl = w->effectiveWinId();
+ if (ctrl->IsFocused()) {
+ ctrl->SetFocus(false);
+ ctrl->SetFocus(true);
+ }
+}
+
+/*!
+ Definition of struct for mapping Symbian to ISO locale
+ ### REMOVE
+ See below.
+*/
+struct symbianToISO {
+ int symbian_language;
+ char iso_name[8];
+};
+
+/*!
+ Mapping from Symbian to ISO locale
+ ### REMOVE
+ This was taken from the preliminary QLocale port to S60, and should be
+ removed once that is finished.
+*/
+static const symbianToISO symbian_to_iso_list[] = {
+ { ELangEnglish, "en_GB" },
+ { ELangFrench, "fr_FR" },
+ { ELangGerman, "de_DE" },
+ { ELangSpanish, "es_ES" },
+ { ELangItalian, "it_IT" },
+ { ELangSwedish, "sv_SE" },
+ { ELangDanish, "da_DK" },
+ { ELangNorwegian, "no_NO" },
+ { ELangFinnish, "fi_FI" },
+ { ELangAmerican, "en_US" },
+ { ELangPortuguese, "pt_PT" },
+ { ELangTurkish, "tr_TR" },
+ { ELangIcelandic, "is_IS" },
+ { ELangRussian, "ru_RU" },
+ { ELangHungarian, "hu_HU" },
+ { ELangDutch, "nl_NL" },
+ { ELangBelgianFlemish, "nl_BE" },
+ { ELangCzech, "cs_CZ" },
+ { ELangSlovak, "sk_SK" },
+ { ELangPolish, "pl_PL" },
+ { ELangSlovenian, "sl_SI" },
+ { ELangTaiwanChinese, "zh_TW" },
+ { ELangHongKongChinese, "zh_HK" },
+ { ELangPrcChinese, "zh_CN" },
+ { ELangJapanese, "ja_JP" },
+ { ELangThai, "th_TH" },
+ { ELangArabic, "ar_AE" },
+ { ELangTagalog, "tl_PH" },
+ { ELangBulgarian, "bg_BG" },
+ { ELangCatalan, "ca_ES" },
+ { ELangCroatian, "hr_HR" },
+ { ELangEstonian, "et_EE" },
+ { ELangFarsi, "fa_IR" },
+ { ELangCanadianFrench, "fr_CA" },
+ { ELangGreek, "el_GR" },
+ { ELangHebrew, "he_IL" },
+ { ELangHindi, "hi_IN" },
+ { ELangIndonesian, "id_ID" },
+ { ELangLatvian, "lv_LV" },
+ { ELangLithuanian, "lt_LT" },
+ { ELangMalay, "ms_MY" },
+ { ELangBrazilianPortuguese, "pt_BR" },
+ { ELangRomanian, "ro_RO" },
+ { ELangSerbian, "sr_YU" },
+ { ELangLatinAmericanSpanish, "es" },
+ { ELangUkrainian, "uk_UA" },
+ { ELangUrdu, "ur_PK" }, // India/Pakistan
+ { ELangVietnamese, "vi_VN" },
+#ifdef __E32LANG_H__
+// 5.0
+ { ELangBasque, "eu_ES" },
+ { ELangGalician, "gl_ES" },
+#endif
+ //{ ELangEnglish_Apac, "en" },
+ //{ ELangEnglish_Taiwan, "en_TW" },
+ //{ ELangEnglish_HongKong, "en_HK" },
+ //{ ELangEnglish_Prc, "en_CN" },
+ //{ ELangEnglish_Japan, "en_JP"},
+ //{ ELangEnglish_Thailand, "en_TH" },
+ //{ ELangMalay_Apac, "ms" }
+};
+
+/*!
+ Number of Symbian to ISO locale mappings
+ ### Remove.
+ See comment for array above.
+*/
+static const int symbian_to_iso_count
+ = sizeof(symbian_to_iso_list)/sizeof(symbianToISO);
+
+QString QCoeFepInputContext::language()
+{
+ TLanguage lang = m_fepState->LocalLanguage();
+ if (lang < symbian_to_iso_count) {
+ return QLatin1String(symbian_to_iso_list[lang].iso_name);
+ } else {
+ return QLatin1String("C");
+ }
+}
+
+bool QCoeFepInputContext::filterEvent(const QEvent *event)
+{
+ // The CloseSoftwareInputPanel event is not handled here, because the VK will automatically
+ // close when it discovers that the underlying widget does not have input capabilities.
+
+ if (!focusWidget())
+ return false;
+
+ if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
+ const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
+ Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints());
+ if (keyEvent->key() == Qt::Key_F20 && m_lastImHints & Qt::ImhHiddenText) {
+ // Special case in Symbian. On editors with secret text, F20 is for some reason
+ // considered to be a backspace.
+ QKeyEvent modifiedEvent(keyEvent->type(), Qt::Key_Backspace, keyEvent->modifiers(),
+ keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count());
+ QApplication::sendEvent(focusWidget(), &modifiedEvent);
+ return true;
+ }
+ }
+
+ // For pre-5.0 SDKs, we don't launch the keyboard.
+ if (QSysInfo::s60Version() != QSysInfo::SV_S60_5_0) {
+ return false;
+ }
+
+ if (event->type() == QEvent::RequestSoftwareInputPanel) {
+ // Notify S60 that we want the virtual keyboard to show up.
+ QSymbianControl *sControl;
+ sControl = focusWidget()->effectiveWinId()->MopGetObject(sControl);
+ Q_ASSERT(sControl);
+
+ // The FEP UI temporarily steals focus when it shows up the first time, causing
+ // all sorts of weird effects on the focused widgets. Since it will immediately give
+ // back focus to us, we temporarily disable focus handling until the job's done.
+ if (sControl) {
+ sControl->setIgnoreFocusChanged(true);
+ }
+
+ m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::QT_EAknActivatePenInputRequest);
+
+ if (sControl) {
+ sControl->setIgnoreFocusChanged(false);
+ }
+ return true;
+ }
+
+ return false;
+}
+
+void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
+{
+ Q_ASSERT(m_isEditing);
+
+ if (!m_pointerHandler) {
+ QInputContext::mouseHandler(x, event);
+ }
+
+ TPointerEvent::TType type;
+ TUint modifiers = 0;
+
+ if (event->type() == QEvent::MouseButtonPress) {
+ if (event->button() == Qt::LeftButton) {
+ type = TPointerEvent::EButton1Down;
+ } else if (event->button() == Qt::RightButton) {
+ type = TPointerEvent::EButton3Down;
+ } else if (event->button() == Qt::MidButton) {
+ type = TPointerEvent::EButton2Down;
+ } else {
+ return;
+ }
+ } else if (event->type() == QEvent::MouseButtonRelease) {
+ if (event->button() == Qt::LeftButton) {
+ type = TPointerEvent::EButton1Up;
+ } else if (event->button() == Qt::RightButton) {
+ type = TPointerEvent::EButton3Up;
+ } else if (event->button() == Qt::MidButton) {
+ type = TPointerEvent::EButton2Up;
+ } else {
+ return;
+ }
+ } else if (event->type() == QEvent::MouseMove) {
+ type = TPointerEvent::EMove;
+ } else if (event->type() == QEvent::DragMove) {
+ type = TPointerEvent::EDrag;
+ } else {
+ return;
+ }
+
+ if (event->modifiers() & Qt::ShiftModifier) {
+ modifiers |= EModifierShift;
+ }
+ if (event->modifiers() & Qt::AltModifier) {
+ modifiers |= EModifierAlt;
+ }
+ if (event->modifiers() & Qt::ControlModifier) {
+ modifiers |= EModifierCtrl;
+ }
+ if (event->modifiers() & Qt::KeypadModifier) {
+ modifiers |= EModifierKeypad;
+ }
+
+ m_pointerHandler->HandlePointerEventInInlineTextL(type, modifiers, x);
+}
+
+TCoeInputCapabilities QCoeFepInputContext::inputCapabilities()
+{
+ if (m_inDestruction) {
+ return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0);
+ }
+
+ return TCoeInputCapabilities(m_textCapabilities, this, 0);
+}
+
+static QTextCharFormat qt_TCharFormat2QTextCharFormat(const TCharFormat &cFormat)
+{
+ QTextCharFormat qFormat;
+
+ QBrush foreground(QColor(cFormat.iFontPresentation.iTextColor.Internal()));
+ qFormat.setForeground(foreground);
+
+ qFormat.setFontStrikeOut(cFormat.iFontPresentation.iStrikethrough == EStrikethroughOn);
+ qFormat.setFontUnderline(cFormat.iFontPresentation.iUnderline == EUnderlineOn);
+
+ return qFormat;
+}
+
+void QCoeFepInputContext::updateHints()
+{
+ QWidget *w = focusWidget();
+ if (w) {
+ Qt::InputMethodHints hints = w->inputMethodHints();
+ if (hints != m_lastImHints) {
+ m_lastImHints = hints;
+ applyHints(hints);
+ }
+ }
+}
+
+void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
+{
+ using namespace Qt;
+
+ bool numbersOnly = hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly
+ || hints & ImhDialableCharactersOnly;
+ bool noOnlys = !(numbersOnly || hints & ImhUppercaseOnly
+ || hints & ImhLowercaseOnly);
+ TInt flags;
+ Qt::InputMethodHints oldHints = hints;
+
+ // Some sanity checking. Make sure that only one preference is set.
+ InputMethodHints prefs = ImhPreferNumbers | ImhPreferUppercase | ImhPreferLowercase;
+ prefs &= hints;
+ if (prefs != ImhPreferNumbers && prefs != ImhPreferUppercase && prefs != ImhPreferLowercase) {
+ hints &= ~prefs;
+ }
+ if (!noOnlys) {
+ // Make sure that the preference is within the permitted set.
+ if (hints & ImhPreferNumbers && !(hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly
+ || hints & ImhDialableCharactersOnly)) {
+ hints &= ~ImhPreferNumbers;
+ } else if (hints & ImhPreferUppercase && !(hints & ImhUppercaseOnly)) {
+ hints &= ~ImhPreferUppercase;
+ } else if (hints & ImhPreferLowercase && !(hints & ImhLowercaseOnly)) {
+ hints &= ~ImhPreferLowercase;
+ }
+ // If there is no preference, set it to something within the permitted set.
+ if (!(hints & ImhPreferNumbers || hints & ImhPreferUppercase || hints & ImhPreferLowercase)) {
+ if (hints & ImhLowercaseOnly) {
+ hints |= ImhPreferLowercase;
+ } else if (hints & ImhUppercaseOnly) {
+ hints |= ImhPreferUppercase;
+ } else if (hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly
+ || hints & ImhDialableCharactersOnly) {
+ hints |= ImhPreferNumbers;
+ }
+ }
+ }
+
+ if (hints & ImhPreferNumbers) {
+ m_fepState->SetDefaultInputMode(EAknEditorNumericInputMode);
+ m_fepState->SetCurrentInputMode(EAknEditorNumericInputMode);
+ } else {
+ m_fepState->SetDefaultInputMode(EAknEditorTextInputMode);
+ m_fepState->SetCurrentInputMode(EAknEditorTextInputMode);
+ }
+ flags = 0;
+ if (numbersOnly) {
+ flags |= EAknEditorNumericInputMode;
+ }
+ if (hints & ImhUppercaseOnly || hints & ImhLowercaseOnly) {
+ flags |= EAknEditorTextInputMode;
+ }
+ if (flags == 0) {
+ flags = EAknEditorAllInputModes;
+ }
+ m_fepState->SetPermittedInputModes(flags);
+ m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateInputModeUpdate);
+
+ if (hints & ImhPreferLowercase) {
+ m_fepState->SetDefaultCase(EAknEditorLowerCase);
+ m_fepState->SetCurrentCase(EAknEditorLowerCase);
+ } else if (hints & ImhPreferUppercase) {
+ m_fepState->SetDefaultCase(EAknEditorUpperCase);
+ m_fepState->SetCurrentCase(EAknEditorUpperCase);
+ } else if (hints & ImhNoAutoUppercase) {
+ m_fepState->SetDefaultCase(EAknEditorLowerCase);
+ m_fepState->SetCurrentCase(EAknEditorLowerCase);
+ } else {
+ m_fepState->SetDefaultCase(EAknEditorTextCase);
+ m_fepState->SetCurrentCase(EAknEditorTextCase);
+ }
+ flags = 0;
+ if (hints & ImhUppercaseOnly) {
+ flags |= EAknEditorUpperCase;
+ }
+ if (hints & ImhLowercaseOnly) {
+ flags |= EAknEditorLowerCase;
+ }
+ if (flags == 0) {
+ flags = EAknEditorAllCaseModes;
+ if (hints & ImhNoAutoUppercase) {
+ flags &= ~EAknEditorTextCase;
+ }
+ }
+ m_fepState->SetPermittedCases(flags);
+ m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateCaseModeUpdate);
+
+ flags = 0;
+ if (hints & ImhUppercaseOnly && !(hints & ImhLowercaseOnly)
+ || hints & ImhLowercaseOnly && !(hints & ImhUppercaseOnly)) {
+ flags |= EAknEditorFlagFixedCase;
+ }
+ // Using T9 and hidden text together may actually crash the FEP, so check for hidden text too.
+ if (hints & ImhNoPredictiveText || hints & ImhHiddenText) {
+ flags |= EAknEditorFlagNoT9;
+ }
+ m_fepState->SetFlags(flags);
+ m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateFlagsUpdate);
+
+ if (hints & ImhFormattedNumbersOnly) {
+ flags = EAknEditorCalculatorNumberModeKeymap;
+ } else if (hints & ImhDigitsOnly) {
+ flags = EAknEditorPlainNumberModeKeymap;
+ } else {
+ // ImhDialableCharactersOnly is the fallback as well, so we don't need to check for
+ // that flag.
+ flags = EAknEditorStandardNumberModeKeymap;
+ }
+ m_fepState->SetNumericKeymap(static_cast<TAknEditorNumericKeymap>(flags));
+
+ if (hints & ImhHiddenText) {
+ m_textCapabilities = TCoeInputCapabilities::EAllText | TCoeInputCapabilities::ESecretText;
+ } else {
+ m_textCapabilities = TCoeInputCapabilities::EAllText;
+ }
+
+ CCoeEnv::Static()->InputCapabilitiesChanged();
+}
+
+void QCoeFepInputContext::applyFormat(QList<QInputMethodEvent::Attribute> *attributes)
+{
+ TCharFormat cFormat;
+ TInt numChars = 0;
+ TInt charPos = 0;
+ int oldSize = attributes->size();
+ while (m_formatRetriever) {
+ m_formatRetriever->GetFormatOfFepInlineText(cFormat, numChars, charPos);
+ if (numChars <= 0) {
+ // This shouldn't happen according to S60 docs, but apparently does sometimes.
+ break;
+ }
+ attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat,
+ charPos,
+ numChars,
+ QVariant(qt_TCharFormat2QTextCharFormat(cFormat))));
+ charPos += numChars;
+ if (charPos >= m_preeditString.size()) {
+ break;
+ }
+ }
+
+ if (attributes->size() == oldSize) {
+ // S60 didn't provide any format, so let's give our own instead.
+ attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat,
+ 0,
+ m_preeditString.size(),
+ standardFormat(PreeditFormat)));
+ }
+}
+
+void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
+ TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* /*aCustomDraw*/,
+ MFepInlineTextFormatRetriever& aInlineTextFormatRetriever,
+ MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit)
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ m_isEditing = true;
+
+ QList<QInputMethodEvent::Attribute> attributes;
+
+ m_cursorVisibility = aCursorVisibility ? 1 : 0;
+ m_inlinePosition = aPositionOfInsertionPointInInlineText;
+ m_preeditString = qt_TDesC2QStringL(aInitialInlineText);
+
+ m_formatRetriever = &aInlineTextFormatRetriever;
+ m_pointerHandler = &aPointerEventHandlerDuringInlineEdit;
+
+ applyFormat(&attributes);
+
+ attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor,
+ m_inlinePosition,
+ m_cursorVisibility,
+ QVariant()));
+ QInputMethodEvent event(m_preeditString, attributes);
+ sendEvent(event);
+}
+
+void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText,
+ TInt aPositionOfInsertionPointInInlineText)
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ m_inlinePosition = aPositionOfInsertionPointInInlineText;
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ applyFormat(&attributes);
+ attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor,
+ m_inlinePosition,
+ m_cursorVisibility,
+ QVariant()));
+ m_preeditString = qt_TDesC2QStringL(aNewInlineText);
+ QInputMethodEvent event(m_preeditString, attributes);
+ sendEvent(event);
+}
+
+void QCoeFepInputContext::SetInlineEditingCursorVisibilityL(TBool aCursorVisibility)
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ m_cursorVisibility = aCursorVisibility ? 1 : 0;
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor,
+ m_inlinePosition,
+ m_cursorVisibility,
+ QVariant()));
+ QInputMethodEvent event(m_preeditString, attributes);
+ sendEvent(event);
+}
+
+void QCoeFepInputContext::CancelFepInlineEdit()
+{
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("", 0, 0);
+ m_preeditString.clear();
+ sendEvent(event);
+
+ m_isEditing = false;
+}
+
+TInt QCoeFepInputContext::DocumentLengthForFep() const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return 0;
+
+ QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
+ return variant.value<QString>().size() + m_preeditString.size();
+}
+
+TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return 0;
+
+ QVariant variant = w->inputMethodQuery(Qt::ImMaximumTextLength);
+ int size;
+ if (variant.isValid()) {
+ size = variant.toInt();
+ } else {
+ size = INT_MAX; // Sensible default for S60.
+ }
+ return size;
+}
+
+void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection)
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ int pos = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + aCursorSelection.iCursorPos + 1;
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, pos, 1, QVariant());
+ QInputMethodEvent event(m_preeditString, attributes);
+ // ### FIXME Sets preeditcursor and not cursor. Probably needs new API.
+ //sendEvent(event);
+}
+
+void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ QVariant cursorVar = w->inputMethodQuery(Qt::ImCursorPosition);
+ int cursor = cursorVar.toInt() + m_preeditString.size();
+ int anchor = cursor - w->inputMethodQuery(Qt::ImCurrentSelection).toString().size();
+ aCursorSelection.iAnchorPos = anchor;
+ aCursorSelection.iCursorPos = cursor;
+}
+
+void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition,
+ TInt aLengthToRetrieve) const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
+ // FEP expects the preedit string to be part of the editor content, so let's mix it in.
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ text.insert(cursor, m_preeditString);
+ aEditorContent.Copy(qt_QString2TPtrC(text.mid(aDocumentPosition, aLengthToRetrieve)));
+}
+
+void QCoeFepInputContext::GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ QFont font = w->inputMethodQuery(Qt::ImFont).value<QFont>();
+ QFontMetrics metrics(font);
+ //QString name = font.rawName();
+ QString name = font.defaultFamily(); // TODO! FIXME! Should be the above.
+ QHBufC hBufC(name);
+ aFormat = TCharFormat(hBufC->Des(), metrics.height());
+
+ aDocumentPosition = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+}
+
+void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
+ TInt& aAscent, TInt aDocumentPosition) const
+{
+ QWidget *w = focusWidget();
+ if (!w)
+ return;
+
+ QRect rect = w->inputMethodQuery(Qt::ImMicroFocus).value<QRect>();
+ aLeftSideOfBaseLine.iX = rect.left();
+ aLeftSideOfBaseLine.iY = rect.bottom();
+
+ QFont font = w->inputMethodQuery(Qt::ImFont).value<QFont>();
+ QFontMetrics metrics(font);
+ aHeight = metrics.height();
+ aAscent = metrics.ascent();
+
+ aDocumentPosition = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+}
+
+void QCoeFepInputContext::DoCommitFepInlineEditL()
+{
+ commitCurrentString();
+
+ m_isEditing = false;
+}
+
+void QCoeFepInputContext::commitCurrentString()
+{
+ if (m_preeditString.size() == 0) {
+ return;
+ }
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString(m_preeditString, 0, 0);//m_preeditString.size());
+ m_preeditString.clear();
+ sendEvent(event);
+}
+
+MCoeFepAwareTextEditor_Extension1* QCoeFepInputContext::Extension1(TBool& aSetToTrue)
+{
+ aSetToTrue = ETrue;
+ return this;
+}
+
+void QCoeFepInputContext::SetStateTransferingOwnershipL(MCoeFepAwareTextEditor_Extension1::CState* aState,
+ TUid /*aTypeSafetyUid*/)
+{
+ // Note: The S60 docs are wrong! See the State() function.
+ if (m_fepState)
+ delete m_fepState;
+ m_fepState = static_cast<CAknEdwinState *>(aState);
+}
+
+MCoeFepAwareTextEditor_Extension1::CState* QCoeFepInputContext::State(TUid /*aTypeSafetyUid*/)
+{
+ // Note: The S60 docs are horribly wrong when describing the
+ // SetStateTransferingOwnershipL function and this function. They say that the former
+ // sets a CState object identified by the TUid, and the latter retrieves it.
+ // In reality, the CState is expected to always be a CAknEdwinState (even if it was not
+ // previously set), and the TUid is ignored. All in all, there is a single CAknEdwinState
+ // per QCoeFepInputContext, which should be deleted if the SetStateTransferingOwnershipL
+ // function is used to set a new one.
+ return m_fepState;
+}
+
+TTypeUid::Ptr QCoeFepInputContext::MopSupplyObject(TTypeUid /*id*/)
+{
+ return TTypeUid::Null();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_IM
diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp
index f78b86ad66..00a92254fe 100644
--- a/src/gui/inputmethod/qinputcontext.cpp
+++ b/src/gui/inputmethod/qinputcontext.cpp
@@ -209,9 +209,21 @@ void QInputContext::setFocusWidget(QWidget *widget)
way. Although the input events have accept() and ignore()
methods, leave it untouched.
- \a event is currently restricted to QKeyEvent. But some input
- method related events such as QWheelEvent or QTabletEvent may be
- added in future.
+ \a event is currently restricted to events of these types:
+
+ \list
+ \i CloseSoftwareInputPanel
+ \i KeyPress
+ \i KeyRelease
+ \i MouseButtonDblClick
+ \i MouseButtonPress
+ \i MouseButtonRelease
+ \i MouseMove
+ \i RequestSoftwareInputPanel
+ \endlist
+
+ But some input method related events such as QWheelEvent or
+ QTabletEvent may be added in future.
The filtering opportunity is always given to the input context as
soon as possible. It has to be taken place before any other key
@@ -415,13 +427,6 @@ QTextFormat QInputContext::standardFormat(StandardFormat s) const
switch (s) {
case QInputContext::PreeditFormat: {
fmt.setUnderlineStyle(QTextCharFormat::DashUnderline);
-#ifndef Q_WS_WIN
- int h1, s1, v1, h2, s2, v2;
- pal.color(QPalette::Base).getHsv(&h1, &s1, &v1);
- pal.color(QPalette::Background).getHsv(&h2, &s2, &v2);
- bg.setHsv(h1, s1, (v1 + v2) / 2);
- fmt.setBackground(QBrush(bg));
-#endif
break;
}
case QInputContext::SelectionFormat: {
@@ -459,6 +464,31 @@ bool QInputContext::x11FilterEvent(QWidget * /*keywidget*/, XEvent * /*event*/)
}
#endif // Q_WS_X11
+#ifdef Q_WS_S60
+/*!
+ This function may be overridden only if input method is depending
+ on Symbian and you need raw TWsEvent. Otherwise, this function must not.
+
+ This function is designed to filter raw key events on S60, but
+ other input methods may use this to implement some special
+ features.
+
+ Return true if the \a event has been consumed. Otherwise, the
+ unfiltered \a event will be translated into QEvent and forwarded
+ to filterEvent(). Filtering at both s60FilterEvent() and
+ filterEvent() in single input method is allowed.
+
+ \a keywidget is a client widget into which a text is inputted. \a
+ event is inputted TWsEvent.
+
+ \sa filterEvent()
+*/
+bool QInputContext::s60FilterEvent(QWidget * /*keywidget*/, TWsEvent * /*event*/)
+{
+ return false;
+}
+#endif // Q_WS_S60
+
QT_END_NAMESPACE
#endif //Q_NO_IM
diff --git a/src/gui/inputmethod/qinputcontext.h b/src/gui/inputmethod/qinputcontext.h
index bcaa7fe0aa..bc4c63c9ab 100644
--- a/src/gui/inputmethod/qinputcontext.h
+++ b/src/gui/inputmethod/qinputcontext.h
@@ -67,6 +67,10 @@
QT_BEGIN_HEADER
+#ifdef Q_WS_S60
+class TWsEvent;
+#endif
+
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
@@ -76,7 +80,6 @@ class QFont;
class QPopupMenu;
class QInputContextPrivate;
-
class Q_GUI_EXPORT QInputContext : public QObject
{
Q_OBJECT
@@ -105,6 +108,9 @@ public:
#if defined(Q_WS_X11)
virtual bool x11FilterEvent( QWidget *keywidget, XEvent *event );
#endif // Q_WS_X11
+#if defined(Q_WS_S60)
+ virtual bool s60FilterEvent( QWidget *keywidget, TWsEvent *event );
+#endif // Q_WS_S60
virtual bool filterEvent( const QEvent *event );
void sendEvent(const QInputMethodEvent &event);
diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp
index 06625f9938..188b13a283 100644
--- a/src/gui/inputmethod/qinputcontextfactory.cpp
+++ b/src/gui/inputmethod/qinputcontextfactory.cpp
@@ -71,6 +71,9 @@
#ifdef Q_WS_MAC
#include "qmacinputcontext_p.h"
#endif
+#ifdef Q_WS_S60
+#include "qcoefepinputcontext_p.h"
+#endif
#include "private/qfactoryloader_p.h"
#include "qmutex.h"
@@ -145,6 +148,11 @@ QInputContext *QInputContextFactory::create( const QString& key, QObject *parent
result = new QMacInputContext;
}
#endif
+#if defined(Q_WS_S60)
+ if (key == QLatin1String("coefep")) {
+ result = new QCoeFepInputContext;
+ }
+#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
@@ -182,6 +190,9 @@ QStringList QInputContextFactory::keys()
#if defined(Q_WS_MAC)
result << QLatin1String("mac");
#endif
+#if defined(Q_WS_S60)
+ result << QLatin1String("coefep");
+#endif
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
result += loader()->keys();
#endif // QT_NO_LIBRARY
@@ -217,6 +228,10 @@ QStringList QInputContextFactory::languages( const QString &key )
if (key == QLatin1String("mac"))
return QStringList(QString());
#endif
+#if defined(Q_WS_S60)
+ if (key == QLatin1String("coefep"))
+ return QStringList(QString());
+#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
@@ -241,6 +256,10 @@ QString QInputContextFactory::displayName( const QString &key )
if (key == QLatin1String("xim"))
return QInputContext::tr( "XIM" );
#endif
+#ifdef Q_WS_S60
+ if (key == QLatin1String("coefep"))
+ return QInputContext::tr( "FEP" );
+#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
@@ -272,6 +291,10 @@ QString QInputContextFactory::description( const QString &key )
if (key == QLatin1String("mac"))
return QInputContext::tr( "Mac OS X input method" );
#endif
+#if defined(Q_WS_S60)
+ if (key == QLatin1String("coefep"))
+ return QInputContext::tr( "S60 FEP input method" );
+#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index c77395a305..159a9979f0 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2008,6 +2008,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
}
break;
case Qt::Key_Back:
+ case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there
if (QApplication::keypadNavigationEnabled() && hasEditFocus())
setEditFocus(false);
else
diff --git a/src/gui/itemviews/qcolumnview_p.h b/src/gui/itemviews/qcolumnview_p.h
index 8f75becda9..432e5e89db 100644
--- a/src/gui/itemviews/qcolumnview_p.h
+++ b/src/gui/itemviews/qcolumnview_p.h
@@ -55,7 +55,7 @@
#include "qcolumnview.h"
-#ifndef QT_NO_QCOlUMNVIEW
+#ifndef QT_NO_QCOLUMNVIEW
#include <private/qabstractitemview_p.h>
diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp
index 7da7c7a88f..a82ffd9a58 100644
--- a/src/gui/itemviews/qdirmodel.cpp
+++ b/src/gui/itemviews/qdirmodel.cpp
@@ -868,8 +868,10 @@ QModelIndex QDirModel::index(const QString &path, int column) const
return QModelIndex();
QString absolutePath = QDir(path).absolutePath();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
absolutePath = absolutePath.toLower();
+#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// On Windows, "filename......." and "filename" are equivalent
if (absolutePath.endsWith(QLatin1Char('.'))) {
int i;
@@ -909,7 +911,10 @@ QModelIndex QDirModel::index(const QString &path, int column) const
pathElements.pop_front();
if (childAppended)
emit const_cast<QDirModel*>(this)->layoutChanged();
- } else if (pathElements.at(0).endsWith(QLatin1Char(':'))) {
+ } else
+#endif
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+ if (pathElements.at(0).endsWith(QLatin1Char(':'))) {
pathElements[0] += QLatin1Char('/');
}
#else
@@ -931,11 +936,9 @@ QModelIndex QDirModel::index(const QString &path, int column) const
for (int j = parent->children.count() - 1; j >= 0; --j) {
const QFileInfo& fi = parent->children.at(j).info;
QString childFileName;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
childFileName = idx.isValid() ? fi.fileName() : fi.absoluteFilePath();
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
childFileName = childFileName.toLower();
-#else
- childFileName = idx.isValid() ? fi.fileName() : fi.absoluteFilePath();
#endif
if (childFileName == element) {
if (i == pathElements.count() - 1)
@@ -952,7 +955,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
if (parent->info.isRoot())
newPath = parent->info.absoluteFilePath() + element;
else
- newPath= parent->info.absoluteFilePath() + QLatin1Char('/') + element;
+ newPath = parent->info.absoluteFilePath() + QLatin1Char('/') + element;
#else
QString newPath = parent->info.absoluteFilePath() + QLatin1Char('/') + element;
#endif
@@ -1304,6 +1307,8 @@ QString QDirModelPrivate::name(const QModelIndex &index) const
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (name.startsWith(QLatin1Char('/'))) // UNC host
return info.fileName();
+#endif
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
if (name.endsWith(QLatin1Char('/')))
name.chop(1);
#endif
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index dc63b25d3d..d37316387a 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -3558,7 +3558,7 @@ bool QHeaderViewPrivate::read(QDataStream &in)
in >> minimumSectionSize;
in >> align;
- defaultAlignment = (Qt::Alignment)align;
+ defaultAlignment = Qt::Alignment(align);
in >> global;
globalResizeMode = (QHeaderView::ResizeMode)global;
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 3b7eb2dcdb..8469c88937 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -1320,7 +1320,7 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index,
// set text alignment
value = index.data(Qt::TextAlignmentRole);
if (value.isValid())
- opt.displayAlignment = (Qt::Alignment)value.toInt();
+ opt.displayAlignment = Qt::Alignment(value.toInt());
// set foreground brush
value = index.data(Qt::ForegroundRole);
diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp
index 10aac9ab14..61e410db96 100644
--- a/src/gui/itemviews/qstandarditemmodel.cpp
+++ b/src/gui/itemviews/qstandarditemmodel.cpp
@@ -899,7 +899,7 @@ Qt::ItemFlags QStandardItem::flags() const
if (!v.isValid())
return (Qt::ItemIsSelectable|Qt::ItemIsEnabled|Qt::ItemIsEditable
|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled);
- return ((Qt::ItemFlags)(v.toInt()));
+ return Qt::ItemFlags(v.toInt());
}
/*!
@@ -1890,7 +1890,7 @@ void QStandardItem::read(QDataStream &in)
in >> d->values;
qint32 flags;
in >> flags;
- setFlags((Qt::ItemFlags)flags);
+ setFlags(Qt::ItemFlags(flags));
}
/*!
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index be0971b016..4dc54a1dbb 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -321,7 +321,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
value = index.data(Qt::TextAlignmentRole);
if (value.isValid() && !value.isNull())
- option->displayAlignment = (Qt::Alignment)value.toInt();
+ option->displayAlignment = Qt::Alignment(value.toInt());
value = index.data(Qt::ForegroundRole);
if (qVariantCanConvert<QBrush>(value))
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index cb2b0148ec..8f0692b6ec 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -90,6 +90,27 @@ win32 {
!contains(DEFINES, QT_NO_DIRECTDRAW):LIBS += ddraw.lib
}
+symbian {
+ SOURCES += \
+ kernel/qapplication_s60.cpp \
+ kernel/qeventdispatcher_s60.cpp \
+ kernel/qwidget_s60.cpp \
+ kernel/qcursor_s60.cpp \
+ kernel/qdesktopwidget_s60.cpp \
+ kernel/qkeymapper_s60.cpp\
+ kernel/qclipboard_s60.cpp\
+ kernel/qdnd_s60.cpp \
+ kernel/qsound_s60.cpp
+
+ HEADERS += \
+ kernel/qt_s60_p.h \
+ kernel/qeventdispatcher_s60_p.h
+ LIBS += -lbafl -lestor
+
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+}
+
+
unix:x11 {
INCLUDEPATH += ../3rdparty/xorg
HEADERS += \
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 4cf0ad71ba..fb002a3a8a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -74,6 +74,9 @@
#ifdef Q_WS_X11
#include <private/qt_x11_p.h>
+#endif
+
+#if defined(Q_WS_X11) || defined(Q_WS_S60)
#include "qinputcontextfactory.h"
#endif
@@ -133,6 +136,8 @@ bool QApplicationPrivate::quitOnLastWindowClosed = true;
#ifdef Q_OS_WINCE
int QApplicationPrivate::autoMaximizeThreshold = -1;
bool QApplicationPrivate::autoSipEnabled = false;
+#else
+bool QApplicationPrivate::autoSipEnabled = true;
#endif
QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type)
@@ -430,7 +435,12 @@ bool Q_GUI_EXPORT qt_tab_all_widgets = true;
bool qt_in_tab_key_event = false;
int qt_antialiasing_threshold = -1;
static int drag_time = 500;
+#ifdef Q_WS_S60
+// The screens are a bit too small to for your thumb when using only 4 pixels drag distance.
+static int drag_distance = 8;
+#else
static int drag_distance = 4;
+#endif
static Qt::LayoutDirection layout_direction = Qt::LeftToRight;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
bool QApplicationPrivate::animate_ui = true;
@@ -441,12 +451,17 @@ bool QApplicationPrivate::animate_tooltip = false;
bool QApplicationPrivate::fade_tooltip = false;
bool QApplicationPrivate::animate_toolbox = false;
bool QApplicationPrivate::widgetCount = false;
+bool QApplicationPrivate::auto_sip_on_mouse_focus = false;
QString* QApplicationPrivate::styleOverride = 0;
#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
bool QApplicationPrivate::inSizeMove = false;
#endif
#ifdef QT_KEYPAD_NAVIGATION
+# if defined(Q_WS_S60)
+bool QApplicationPrivate::keypadNavigation = true;
+# else
bool QApplicationPrivate::keypadNavigation = false;
+# endif
QWidget *QApplicationPrivate::oldEditFocus = 0;
#endif
@@ -1068,6 +1083,7 @@ QApplication::~QApplication()
QApplicationPrivate::animate_tooltip = false;
QApplicationPrivate::fade_tooltip = false;
QApplicationPrivate::widgetCount = false;
+ QApplicationPrivate::auto_sip_on_mouse_focus = false;
// trigger unregistering of QVariant's GUI types
extern int qUnregisterGuiVariant();
@@ -1220,11 +1236,15 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
\since 4.5
\brief toggles automatic SIP (software input panel) visibility
- The auto SIP property is only available as part of Qt for Windows CE.
-
Set this property to true to automatically display the SIP when entering
widgets that accept keyboard input. This property only affects widgets with
- the WA_InputMethodEnabled attribute set.
+ the WA_InputMethodEnabled attribute set, and is typically used to launch
+ a virtual keyboard on devices which have very few or no keys.
+
+ The property only has an effect on platforms which use software input
+ panels, such as Windows CE and Symbian.
+
+ The default is platform dependent.
*/
#ifdef Q_OS_WINCE
@@ -1237,6 +1257,7 @@ int QApplication::autoMaximizeThreshold() const
{
return QApplicationPrivate::autoMaximizeThreshold;
}
+#endif
void QApplication::setAutoSipEnabled(const bool enabled)
{
@@ -1247,7 +1268,6 @@ bool QApplication::autoSipEnabled() const
{
return QApplicationPrivate::autoSipEnabled;
}
-#endif
#ifndef QT_NO_STYLE_STYLESHEET
@@ -1319,6 +1339,8 @@ QStyle *QApplication::style()
style = QLatin1String("Windows"); // default styles for Windows
#elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS)
style = QLatin1String("CDE"); // default style for X11 on Solaris
+#elif defined(Q_WS_S60)
+ style = QLatin1String("S60"); // default style for S60
#elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
style = QLatin1String("SGI"); // default style for X11 on IRIX
#elif defined(Q_WS_X11) || defined(Q_WS_QWS)
@@ -2080,6 +2102,16 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
prev->setEditFocus(false);
}
#endif
+#ifndef QT_NO_IM
+ if (focus) {
+ QInputContext *prevIc;
+ prevIc = prev->inputContext();
+ if (prevIc && prevIc != focus->inputContext()) {
+ QEvent closeSIPEvent(QEvent::CloseSoftwareInputPanel);
+ QApplication::sendEvent(prev, &closeSIPEvent);
+ }
+ }
+#endif
QFocusEvent out(QEvent::FocusOut, reason);
QPointer<QWidget> that = prev;
QApplication::sendEvent(prev, &out);
@@ -3431,6 +3463,39 @@ Qt::LayoutDirection QApplication::layoutDirection()
return layout_direction;
}
+/*!
+ \property autoSipOnMouseFocus
+ \since 4.6
+ \brief toggles SIP (software input panel) launch policy
+
+ This property holds whether widgets should request a software input
+ panel when it is focused with the mouse. This is typically used to
+ launch a virtual keyboard on devices which have very few or no keys.
+
+ If the property is set to true, the widget asks for an input panel
+ on the mouse click which causes the widget to be focused. If the
+ property is set to false, the user must click a second time before
+ the widget asks for an input panel.
+
+ \note If the widget is focused by other means than a mouse click,
+ the next click is will trigger an input panel request,
+ regardless of the value of this property.
+
+ The default is platform dependent.
+
+ \sa QEvent::RequestSoftwareInputPanel, QInputContext
+*/
+
+void QApplication::setAutoSipOnMouseFocus(bool enable)
+{
+ QApplicationPrivate::auto_sip_on_mouse_focus = enable;
+}
+
+bool QApplication::autoSipOnMouseFocus()
+{
+ return QApplicationPrivate::auto_sip_on_mouse_focus;
+}
+
/*!
\obsolete
@@ -3707,6 +3772,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QPoint relpos = mouse->pos();
if (e->spontaneous()) {
+#ifndef QT_NO_IM
+ QInputContext *ic = w->inputContext();
+ if (ic
+ && w->testAttribute(Qt::WA_InputMethodEnabled)
+ && ic->filterEvent(mouse))
+ return true;
+#endif
if (e->type() == QEvent::MouseButtonPress) {
QWidget *fw = w;
@@ -4017,6 +4089,20 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
#endif
+ case QEvent::RequestSoftwareInputPanel:
+ case QEvent::CloseSoftwareInputPanel:
+#ifndef QT_NO_IM
+ if (receiver->isWidgetType()) {
+ QWidget *w = static_cast<QWidget *>(receiver);
+ QInputContext *ic = w->inputContext();
+ if (ic && ic->filterEvent(e)) {
+ break;
+ }
+ }
+#endif
+ res = d->notify_helper(receiver, e);
+ break;
+
default:
res = d->notify_helper(receiver, e);
break;
@@ -4748,8 +4834,8 @@ bool QApplication::keypadNavigationEnabled()
The default value on X11 is 400 milliseconds. On Windows and Mac OS X, the
operating system's value is used.
- On Microsoft Windows, calling this function sets the double click interval
- for all applications.
+ On Microsoft Windows and Symbian, calling this function sets the
+ double click interval for all applications.
*/
/*!
@@ -4932,6 +5018,11 @@ QInputContext *QApplication::inputContext() const
qic = QInputContextFactory::create(QLatin1String("xim"), that);
that->d_func()->inputContext = qic;
}
+#elif defined(Q_WS_S60)
+ if (!d->inputContext) {
+ QApplication *that = const_cast<QApplication *>(this);
+ that->d_func()->inputContext = QInputContextFactory::create(QString::fromLatin1("coefep"), that);
+ }
#endif
return d->inputContext;
}
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index 1d6941d5fc..ca0eb981e7 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -61,6 +61,10 @@
QT_BEGIN_HEADER
+#if defined(Q_WS_S60)
+class TWsEvent;
+#endif
+
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
@@ -84,6 +88,7 @@ class QApplicationPrivate;
#endif
#define qApp (static_cast<QApplication *>(QCoreApplication::instance()))
+
class Q_GUI_EXPORT QApplication : public QCoreApplication
{
Q_OBJECT
@@ -92,6 +97,8 @@ class Q_GUI_EXPORT QApplication : public QCoreApplication
Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime)
Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval)
Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval)
+ Q_PROPERTY(bool autoSipOnMouseFocus READ autoSipOnMouseFocus
+ WRITE setAutoSipOnMouseFocus)
#ifndef QT_NO_WHEELEVENT
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
#endif
@@ -104,8 +111,8 @@ class Q_GUI_EXPORT QApplication : public QCoreApplication
#endif
#ifdef Q_OS_WINCE
Q_PROPERTY(int autoMaximizeThreshold READ autoMaximizeThreshold WRITE setAutoMaximizeThreshold)
- Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled)
#endif
+ Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled)
public:
enum Type { Tty, GuiClient, GuiServer };
@@ -223,6 +230,11 @@ public:
virtual int x11ClientMessage(QWidget*, XEvent*, bool passive_only);
int x11ProcessEvent(XEvent*);
#endif
+#if defined(Q_WS_S60)
+ int s60ProcessEvent(TWsEvent *event);
+ virtual bool s60EventFilter(TWsEvent *aEvent);
+ void s60HandleCommandL(int command);
+#endif
#if defined(Q_WS_QWS)
virtual bool qwsEventFilter(QWSEvent *);
int qwsProcessEvent(QWSEvent*);
@@ -239,7 +251,6 @@ public:
void winFocus(QWidget *, bool);
static void winMouseButtonUp();
#endif
-
#ifndef QT_NO_SESSIONMANAGER
// session management
bool isSessionRestored() const;
@@ -284,9 +295,11 @@ public Q_SLOTS:
#ifdef Q_OS_WINCE
void setAutoMaximizeThreshold(const int threshold);
int autoMaximizeThreshold() const;
+#endif
void setAutoSipEnabled(const bool enabled);
bool autoSipEnabled() const;
-#endif
+ void setAutoSipOnMouseFocus(bool);
+ bool autoSipOnMouseFocus();
static void closeAllWindows();
static void aboutQt();
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 7487f0a919..a6fc602f54 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -221,8 +221,8 @@ public:
static void emitLastWindowClosed();
#ifdef Q_OS_WINCE
static int autoMaximizeThreshold;
- static bool autoSipEnabled;
#endif
+ static bool autoSipEnabled;
static QGraphicsSystem *graphicsSystem()
#if !defined(Q_WS_QWS)
@@ -233,7 +233,6 @@ public:
void createEventDispatcher();
QString appName() const;
-
static void dispatchEnterLeave(QWidget *enter, QWidget *leave);
//modality
@@ -355,6 +354,7 @@ public:
static bool fade_tooltip;
static bool animate_toolbox;
static bool widgetCount; // Coupled with -widgetcount switch
+ static bool auto_sip_on_mouse_focus;
#ifdef Q_WS_MAC
static bool native_modal_dialog_active;
#endif
@@ -420,6 +420,9 @@ public:
QWidget *buttonDown, QWidget *alienWidget);
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget,
QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver);
+#ifdef Q_WS_S60
+ static TUint resolveS60ScanCode(TInt scanCode, TUint keysym);
+#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11)
void sendSyntheticEnterLeave(QWidget *widget);
#endif
@@ -429,6 +432,10 @@ private:
QMap<const QScreen*, QRect> maxWindowRects;
#endif
+#ifdef Q_WS_S60
+ static QHash<TInt, TUint> scanCodeCache;
+#endif
+
static QApplicationPrivate *self;
static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy);
};
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
new file mode 100644
index 0000000000..dd51fcd0e7
--- /dev/null
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -0,0 +1,1096 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qapplication_p.h"
+#include "qsessionmanager.h"
+#include "qevent.h"
+#include "qeventdispatcher_s60_p.h"
+#include "qwidget.h"
+#include "private/qbackingstore_p.h"
+#include "qt_s60_p.h"
+#include "private/qevent_p.h"
+#include "qstring.h"
+#include "qdebug.h"
+#include "qimage.h"
+#include "private/qkeymapper_p.h"
+#include "private/qfont_p.h"
+#ifndef QT_NO_STYLE_S60
+#include "private/qs60style_p.h"
+#endif
+#include "private/qwindowsurface_s60_p.h"
+#include "qpaintengine.h"
+#include "qmenubar.h"
+
+#include "apgwgnam.h" // For CApaWindowGroupName
+#include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility
+
+#ifndef QT_NO_IM
+#include "qinputcontext.h"
+#include <private/qcoefepinputcontext_p.h>
+#endif // QT_NO_IM
+
+#include "private/qstylesheetstyle_p.h"
+
+QT_BEGIN_NAMESPACE
+
+static WId autoGrabWindow = 0; // Not the same as QWidget::grab*()
+#if defined(QT_DEBUG)
+static bool appNoGrab = false; // Grabbing enabled
+#endif
+
+Q_GUI_EXPORT QS60Data *qt_s60Data = 0;
+extern bool qt_sendSpontaneousEvent(QObject*,QEvent*);
+
+QWidget *qt_button_down = 0; // widget got last button-down
+
+bool qt_nograb() // application no-grab option
+{
+#if defined(QT_DEBUG)
+ return appNoGrab;
+#else
+ return false;
+#endif
+}
+
+// Modified from http://www3.symbian.com/faq.nsf/0/0F1464EE96E737E780256D5E00503DD1?OpenDocument
+class QS60Beep : public CBase, public MMdaAudioToneObserver
+{
+public:
+ static QS60Beep* NewL(TInt aFrequency, TTimeIntervalMicroSeconds iDuration);
+ void Play();
+ ~QS60Beep();
+private:
+ void ConstructL(TInt aFrequency, TTimeIntervalMicroSeconds iDuration);
+ void MatoPrepareComplete(TInt aError);
+ void MatoPlayComplete(TInt aError);
+private:
+ typedef enum TBeepState
+ {
+ EBeepNotPrepared,
+ EBeepPrepared,
+ EBeepPlaying
+ };
+private:
+ CMdaAudioToneUtility* iToneUtil;
+ TBeepState iState;
+ TInt iFrequency;
+ TTimeIntervalMicroSeconds iDuration;
+};
+
+QS60Beep::~QS60Beep()
+{
+ delete iToneUtil;
+}
+
+QS60Beep* QS60Beep::NewL(TInt aFrequency, TTimeIntervalMicroSeconds aDuration)
+{
+ QS60Beep* self=new (ELeave) QS60Beep();
+ CleanupStack::PushL(self);
+ self->ConstructL(aFrequency, aDuration);
+ CleanupStack::Pop();
+ return self;
+};
+
+void QS60Beep::ConstructL(TInt aFrequency, TTimeIntervalMicroSeconds aDuration)
+{
+ iToneUtil=CMdaAudioToneUtility::NewL(*this);
+ iState=EBeepNotPrepared;
+ iFrequency=aFrequency;
+ iDuration=aDuration;
+ iToneUtil->PrepareToPlayTone(iFrequency,iDuration);
+}
+
+void QS60Beep::Play()
+{
+ if(iState!=EBeepNotPrepared){
+ if(iState==EBeepPlaying) {
+ iToneUtil->CancelPlay();
+ iState=EBeepPrepared;
+ }
+ }
+
+ iToneUtil->Play();
+ iState=EBeepPlaying;
+}
+
+void QS60Beep::MatoPrepareComplete(TInt aError)
+{
+ if(aError==KErrNone) {
+ iState=EBeepPrepared;
+ }
+}
+
+void QS60Beep::MatoPlayComplete(TInt aError)
+{
+ Q_UNUSED(aError);
+ iState=EBeepPrepared;
+}
+
+
+QHash<TInt, TUint> QApplicationPrivate::scanCodeCache;
+
+static Qt::KeyboardModifiers mapToQtModifiers(TUint s60Modifiers)
+{
+ Qt::KeyboardModifiers result = Qt::NoModifier;
+
+ if (s60Modifiers & EModifierKeypad)
+ result |= Qt::KeypadModifier;
+ if (s60Modifiers & EModifierShift || s60Modifiers & EModifierLeftShift
+ || s60Modifiers & EModifierRightShift)
+ result |= Qt::ShiftModifier;
+ if (s60Modifiers & EModifierCtrl || s60Modifiers & EModifierLeftCtrl
+ || s60Modifiers & EModifierRightCtrl)
+ result |= Qt::ControlModifier;
+ if (s60Modifiers & EModifierAlt || s60Modifiers & EModifierLeftAlt
+ || s60Modifiers & EModifierRightAlt)
+ result |= Qt::AltModifier;
+
+ return result;
+}
+
+static void mapS60MouseEventTypeToQt(QEvent::Type *type, Qt::MouseButton *button, const TPointerEvent *pEvent)
+{
+ switch (pEvent->iType) {
+ case TPointerEvent::EButton1Down:
+ *type = QEvent::MouseButtonPress;
+ *button = Qt::LeftButton;
+ break;
+ case TPointerEvent::EButton1Up:
+ *type = QEvent::MouseButtonRelease;
+ *button = Qt::LeftButton;
+ break;
+ case TPointerEvent::EButton2Down:
+ *type = QEvent::MouseButtonPress;
+ *button = Qt::MidButton;
+ break;
+ case TPointerEvent::EButton2Up:
+ *type = QEvent::MouseButtonRelease;
+ *button = Qt::MidButton;
+ break;
+ case TPointerEvent::EButton3Down:
+ *type = QEvent::MouseButtonPress;
+ *button = Qt::RightButton;
+ break;
+ case TPointerEvent::EButton3Up:
+ *type = QEvent::MouseButtonRelease;
+ *button = Qt::RightButton;
+ break;
+ case TPointerEvent::EDrag:
+ *type = QEvent::MouseMove;
+ *button = Qt::NoButton;
+ break;
+ case TPointerEvent::EMove:
+ // Qt makes no distinction between move and drag
+ *type = QEvent::MouseMove;
+ *button = Qt::NoButton;
+ break;
+ default:
+ *type = QEvent::None;
+ *button = Qt::NoButton;
+ break;
+ }
+ if (pEvent->iModifiers & EModifierDoubleClick){
+ *type = QEvent::MouseButtonDblClick;
+ }
+
+ if (*type == QEvent::MouseButtonPress)
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | (*button);
+ else if (*type == QEvent::MouseButtonRelease)
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~(*button));
+
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & Qt::MouseButtonMask;
+}
+
+//### Can be replaced with CAknLongTapDetector if animation is required.
+//NOTE: if CAknLongTapDetector is used make sure it gets variated out of 3.1 and 3.2,.
+//also MLongTapObserver needs to be changed to MAknLongTapDetectorCallBack if CAknLongTapDetector is used.
+class QLongTapTimer : public CTimer
+{
+public:
+ static QLongTapTimer* NewL(QAbstractLongTapObserver *observer);
+ QLongTapTimer(QAbstractLongTapObserver *observer);
+ void ConstructL();
+public:
+ void PointerEventL(const TPointerEvent &event);
+ void RunL();
+protected:
+private:
+ QAbstractLongTapObserver *m_observer;
+ TPointerEvent m_event;
+ QPoint m_pressedCoordinates;
+ int m_dragDistance;
+};
+
+QLongTapTimer* QLongTapTimer::NewL(QAbstractLongTapObserver *observer)
+{
+ QLongTapTimer* self = new QLongTapTimer(observer);
+ self->ConstructL();
+ return self;
+}
+void QLongTapTimer::ConstructL()
+{
+ CTimer::ConstructL();
+}
+
+QLongTapTimer::QLongTapTimer(QAbstractLongTapObserver *observer):CTimer(CActive::EPriorityHigh)
+{
+ m_observer = observer;
+ m_dragDistance = qApp->startDragDistance();
+ CActiveScheduler::Add(this);
+}
+
+void QLongTapTimer::PointerEventL(const TPointerEvent& event)
+{
+ if ( event.iType == TPointerEvent::EDrag || event.iType == TPointerEvent::EButtonRepeat)
+ {
+ QPoint diff(QPoint(event.iPosition.iX,event.iPosition.iY) - m_pressedCoordinates);
+ if (diff.manhattanLength() < m_dragDistance)
+ return;
+ }
+ Cancel();
+ m_event = event;
+ if (event.iType == TPointerEvent::EButton1Down)
+ {
+ m_pressedCoordinates = QPoint(event.iPosition.iX,event.iPosition.iY);
+ // must be same as KLongTapDelay in aknlongtapdetector.h
+ After(800000);
+ }
+}
+void QLongTapTimer::RunL()
+{
+ if (m_observer)
+ m_observer->HandleLongTapEventL(m_event.iPosition, m_event.iParentPosition);
+}
+
+QSymbianControl::QSymbianControl(QWidget *w)
+ : CCoeControl(), qwidget(w), m_ignoreFocusChanged(false)
+{
+}
+
+void QSymbianControl::ConstructL(bool topLevel, bool desktop)
+{
+ if (!desktop)
+ {
+ if (topLevel)
+ CreateWindowL(S60->windowGroup());
+
+ SetFocusing(true);
+ m_longTapDetector = QLongTapTimer::NewL(this);
+ }
+}
+
+QSymbianControl::~QSymbianControl()
+{
+ S60->appUi()->RemoveFromStack(this);
+ delete m_longTapDetector;
+}
+
+void QSymbianControl::setWidget(QWidget *w)
+{
+ qwidget = w;
+}
+void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation )
+{
+ QWidget *alienWidget;
+ QPoint widgetPos = QPoint(aPenEventLocation.iX, aPenEventLocation.iY);
+ QPoint globalPos = QPoint(aPenEventScreenLocation.iX,aPenEventScreenLocation.iY);
+ alienWidget = qwidget->childAt(widgetPos);
+ if (!alienWidget)
+ alienWidget = qwidget;
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~Qt::LeftButton);
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | Qt::RightButton;
+ QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos,
+ Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
+ sendMouseEvent(alienWidget, &mEvent);
+ m_previousEventLongTap = true;
+}
+
+void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
+{
+ //### refactor me, getting too complex
+ m_longTapDetector->PointerEventL(pEvent);
+ QMouseEvent::Type type;
+ Qt::MouseButton button;
+ mapS60MouseEventTypeToQt(&type, &button, &pEvent);
+
+ if (m_previousEventLongTap)
+ if (type == QEvent::MouseButtonRelease){
+ button = Qt::RightButton;
+ QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton;
+ m_previousEventLongTap = false;
+ }
+ if (type == QMouseEvent::None)
+ return;
+
+ // store events for later sending/saving
+ QWidget *alienWidget;
+ typedef QPair<QWidget*,QMouseEvent> Event;
+ QList<Event > events;
+
+ QPoint widgetPos = QPoint(pEvent.iPosition.iX, pEvent.iPosition.iY);
+ TPoint controlScreenPos = PositionRelativeToScreen();
+ QPoint globalPos = QPoint(controlScreenPos.iX, controlScreenPos.iY) + widgetPos;
+
+ if (type == QEvent::MouseButtonPress)
+ {
+ // get the button press target
+ alienWidget = qwidget->childAt(widgetPos);
+ if (!alienWidget)
+ alienWidget = qwidget;
+ S60->mousePressTarget = alienWidget;
+ //pointer grab
+ SetGloballyCapturing(ETrue);
+ SetPointerCapture(ETrue);
+ }
+ else if (type == QEvent::MouseButtonRelease)
+ {
+ //release pointer grab
+ SetGloballyCapturing(EFalse);
+ SetPointerCapture(EFalse);
+ }
+ alienWidget = S60->mousePressTarget;
+
+ if (alienWidget != S60->lastPointerEventTarget)
+ if (type == QEvent::MouseButtonPress || type == QEvent::MouseMove)
+ {
+ //moved to another widget, create enter and leave events
+ if (S60->lastPointerEventTarget)
+ {
+ QMouseEvent mEventLeave(QEvent::Leave, S60->lastPointerEventTarget->mapFromGlobal(S60->lastCursorPos), S60->lastCursorPos,
+ button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers));
+ events.append(Event(S60->lastPointerEventTarget,mEventLeave));
+ }
+ QMouseEvent mEventEnter(QEvent::Enter, alienWidget->mapFromGlobal(globalPos), globalPos,
+ button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers));
+
+ events.append(Event(alienWidget,mEventEnter));
+ }
+ S60->lastCursorPos = globalPos;
+ S60->lastPointerEventPos = widgetPos;
+ S60->lastPointerEventTarget = alienWidget;
+ if (alienWidget)
+ {
+ QMouseEvent mEvent(type, alienWidget->mapFromGlobal(globalPos), globalPos,
+ button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers));
+ events.append(Event(alienWidget,mEvent));
+ QEventDispatcherS60 *dispatcher;
+ // It is theoretically possible for someone to install a different event dispatcher.
+ if (dispatcher = qobject_cast<QEventDispatcherS60 *>(alienWidget->d_func()->threadData->eventDispatcher)) {
+ if (dispatcher->excludeUserInputEvents()) {
+ for (int i=0;i < events.count();++i)
+ {
+ Event next = events[i];
+ dispatcher->saveInputEvent(this, next.first, new QMouseEvent(next.second));
+ }
+ return;
+ }
+ }
+ }
+ for (int i=0;i < events.count();++i)
+ {
+ Event next = events[i];
+ sendMouseEvent(next.first, &(next.second));
+ }
+}
+
+void QSymbianControl::sendMouseEvent(QWidget *widget, QMouseEvent *mEvent)
+{
+ qt_sendSpontaneousEvent(widget, mEvent);
+}
+
+TKeyResponse QSymbianControl::OfferKeyEventL(const TKeyEvent& keyEvent, TEventCode type)
+{
+ switch (type) {
+ //case EEventKeyDown: // <-- Intentionally left out. See below.
+ case EEventKeyUp:
+ case EEventKey:
+ {
+ // S60 has a confusing way of delivering key events. There are three types of
+ // events: EKeyEvent, EKeyEventDown and EKeyEventUp. When a key is pressed, the
+ // two first events are generated. When releasing the key, the last one is
+ // generated.
+ // Because S60 does not generate keysyms for EKeyEventDown and EKeyEventUp events,
+ // we need to do some special tricks to map it to the Qt way. First, we completely
+ // discard EKeyEventDown events, since they are redundant. Second, since
+ // EKeyEventUp does not give us a keysym, we need to cache the keysyms from
+ // the EKeyEvent events. This is what resolveS60ScanCode does.
+
+
+ // ### hackish way to send Qt application to background when pressing right softkey
+ /*
+ if( keyEvent.iScanCode == EStdKeyDevice1 ) {
+ S60->window_group->SetOrdinalPosition(-1);
+ qApp->setActiveWindow(0);
+ return EKeyWasNotConsumed;
+ }
+ */
+
+ TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode,
+ keyEvent.iCode);
+ int keyCode;
+ if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) {
+ // Normal characters keys.
+ keyCode = s60Keysym;
+ } else {
+ // Special S60 keys.
+ keyCode = qt_keymapper_private()->mapS60KeyToQt(s60Keysym);
+ }
+ Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers);
+ QKeyEventEx qKeyEvent(type == EEventKeyUp ? QEvent::KeyRelease : QEvent::KeyPress, keyCode,
+ mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods),
+ false, 1, keyEvent.iScanCode, s60Keysym, mods);
+// WId wid = reinterpret_cast<RWindowGroup *>(keyEvent.Handle())->Child();
+// if (!wid)
+// Could happen if window isn't shown yet.
+// return EKeyWasNotConsumed;
+ QWidget *widget;
+ widget = QWidget::keyboardGrabber();
+ if (!widget) {
+ if (QApplicationPrivate::popupWidgets != 0) {
+ widget = QApplication::activePopupWidget()->focusWidget();
+ if (!widget) {
+ widget = QApplication::activePopupWidget();
+ }
+ } else {
+ widget = QApplicationPrivate::focus_widget;
+ if (!widget) {
+ widget = qwidget;
+ }
+ }
+ }
+
+ QEventDispatcherS60 *dispatcher;
+ // It is theoretically possible for someone to install a different event dispatcher.
+ if (dispatcher = qobject_cast<QEventDispatcherS60 *>(widget->d_func()->threadData->eventDispatcher)) {
+ if (dispatcher->excludeUserInputEvents()) {
+ dispatcher->saveInputEvent(this, widget, new QKeyEventEx(qKeyEvent));
+ return EKeyWasConsumed;
+ }
+ }
+ return sendKeyEvent(widget, &qKeyEvent);
+ }
+ }
+ return EKeyWasNotConsumed;
+}
+
+void QSymbianControl::sendInputEvent(QWidget *widget, QInputEvent *inputEvent)
+{
+ switch (inputEvent->type()) {
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ sendKeyEvent(widget, static_cast<QKeyEvent *>(inputEvent));
+ break;
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseMove:
+ sendMouseEvent(widget, static_cast<QMouseEvent *>(inputEvent));
+ break;
+ default:
+ // Shouldn't get here.
+ Q_ASSERT_X(0 == 1, "QSymbianControl::sendInputEvent()", "inputEvent->type() is unknown");
+ break;
+ }
+}
+
+TKeyResponse QSymbianControl::sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent)
+{
+#ifndef QT_NO_IM
+ if (widget && widget->isEnabled() && widget->testAttribute(Qt::WA_InputMethodEnabled)) {
+ QInputContext *qic = widget->inputContext();
+ if(qic && qic->filterEvent(keyEvent))
+ return EKeyWasConsumed;
+ }
+#endif // QT_NO_IM
+
+ if (widget && qt_sendSpontaneousEvent(widget, keyEvent))
+ if (keyEvent->isAccepted())
+ return EKeyWasConsumed;
+
+ return EKeyWasNotConsumed;
+}
+
+#ifndef QT_NO_IM
+TCoeInputCapabilities QSymbianControl::InputCapabilities() const
+{
+ QWidget *w = qwidget->focusWidget();
+ QCoeFepInputContext *ic;
+ if (w && w->isEnabled() && w->testAttribute(Qt::WA_InputMethodEnabled)
+ && (ic = qobject_cast<QCoeFepInputContext *>(w->inputContext()))) {
+ return ic->inputCapabilities();
+ } else {
+ return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0);
+ }
+}
+#endif
+
+void QSymbianControl::Draw(const TRect& r) const
+{
+ QWindowSurface *surface = qwidget->windowSurface();
+ if (!surface)
+ return;
+
+ QPaintEngine *engine = surface->paintDevice()->paintEngine();
+ if (!engine)
+ return;
+ if (engine->type() == QPaintEngine::Raster) {
+ QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface());
+ CFbsBitmap *bitmap = s60Surface->symbianBitmap();
+ CWindowGc &gc = SystemGc();
+ if (qwidget->d_func()->isOpaque)
+ gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+ gc.BitBlt(r.iTl, bitmap, r);
+ } else {
+ surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint());
+ }
+}
+
+void QSymbianControl::SizeChanged()
+{
+ CCoeControl::SizeChanged();
+
+ QSize oldSize = qwidget->size();
+ QSize newSize(Size().iWidth, Size().iHeight);
+
+ if (oldSize != newSize) {
+ QRect cr = qwidget->geometry();
+ cr.setSize(newSize);
+ qwidget->data->crect = cr;
+ if (qwidget->isVisible()) {
+ QTLWExtra *tlwExtra = qwidget->d_func()->maybeTopData();
+ bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
+ if (!slowResize && tlwExtra)
+ tlwExtra->inTopLevelResize = true;
+ QResizeEvent e(newSize, oldSize);
+ qt_sendSpontaneousEvent(qwidget, &e);
+ if (!qwidget->testAttribute(Qt::WA_StaticContents))
+ qwidget->d_func()->syncBackingStore();
+ if (!slowResize && tlwExtra)
+ tlwExtra->inTopLevelResize = false;
+ }
+ }
+}
+
+void QSymbianControl::PositionChanged()
+{
+ CCoeControl::PositionChanged();
+
+ QPoint oldPos = qwidget->geometry().topLeft();
+ QPoint newPos(Position().iX, Position().iY);
+
+ if (oldPos != newPos) {
+ QRect cr = qwidget->geometry();
+ cr.moveTopLeft(newPos);
+ qwidget->data->crect = cr;
+ QTLWExtra *top = qwidget->d_func()->maybeTopData();
+ if (top)
+ top->normalGeometry = cr;
+ if (qwidget->isVisible()) {
+ QMoveEvent e(newPos, oldPos);
+ qt_sendSpontaneousEvent(qwidget, &e);
+ } else {
+ QMoveEvent * e = new QMoveEvent(newPos, oldPos);
+ QApplication::postEvent(qwidget, e);
+ }
+ }
+}
+
+void QSymbianControl::FocusChanged(TDrawNow aDrawNow)
+{
+ if (m_ignoreFocusChanged)
+ return;
+
+ // Popups never get focused, but still receive the FocusChanged when they are hidden.
+ if (QApplicationPrivate::popupWidgets != 0
+ || (qwidget->windowType() & Qt::Popup) == Qt::Popup)
+ return;
+
+ if (IsFocused()) {
+ QApplication::setActiveWindow(qwidget);
+ // If widget is fullscreen, hide status pane and button container
+ // otherwise show them.
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
+ if (statusPane && (statusPane->IsVisible() == isFullscreen))
+ statusPane->MakeVisible(!isFullscreen);
+ if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
+ buttonGroup->MakeVisible(!isFullscreen);
+ } else {
+ QApplication::setActiveWindow(0);
+ }
+}
+
+void QSymbianControl::HandleResourceChange(int resourceType)
+{
+ switch (resourceType) {
+ case KInternalStatusPaneChange:
+ qwidget->d_func()->setWindowIcon_sys(true);
+ break;
+ case KUidValueCoeFontChangeEvent:
+ // font change event
+ break;
+ case KEikDynamicLayoutVariantSwitch:
+ {
+#ifndef QT_NO_STYLE_S60
+ QS60Style *s60Style = 0;
+
+#ifndef QT_NO_STYLE_STYLESHEET
+ QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplication::style());
+ if (proxy)
+ s60Style = qobject_cast<QS60Style*>(proxy->baseStyle());
+ else
+#endif
+ s60Style = qobject_cast<QS60Style*>(QApplication::style());
+
+ if (s60Style)
+ s60Style->handleDynamicLayoutVariantSwitch();
+#endif
+ if (qwidget->isFullScreen()) {
+ SetExtentToWholeScreen();
+ } else if (qwidget->isMaximized()) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ SetExtent(r.iTl, r.Size());
+ }
+ break;
+ }
+#ifndef QT_NO_STYLE_S60
+ case KAknsMessageSkinChange:
+ if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style()))
+ s60Style->handleSkinChange();
+ break;
+#endif
+ default:
+ break;
+ }
+
+ CCoeControl::HandleResourceChange(resourceType);
+
+}
+void QSymbianControl::CancelLongTapTimer()
+{
+ m_longTapDetector->Cancel();
+}
+
+TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id)
+{
+ if (id.iUid == ETypeId)
+ return id.MakePtr(this);
+
+ return CCoeControl::MopSupplyObject(id);
+}
+
+void qt_init(QApplicationPrivate *priv, int)
+{
+ S60 = new QS60Data;
+
+#ifdef QT_NO_DEBUG
+ if (!qgetenv("QT_S60_AUTO_FLUSH_WSERV").isEmpty())
+#endif
+ S60->wsSession().SetAutoFlush(ETrue);
+
+ S60->updateScreenSize();
+
+
+ TDisplayMode mode = S60->screenDevice()->DisplayMode();
+ S60->screenDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel(mode);
+
+ RProcess me;
+ TSecureId securId = me.SecureId();
+ S60->uid = securId.operator TUid();
+
+ // New code to configure the window group name such that window server knows the associated application's UID
+ CApaWindowGroupName *wgn = CApaWindowGroupName::NewL(S60->wsSession());
+ wgn->SetAppUid(S60->uid);
+ User::LeaveIfError(wgn->SetWindowGroupName((S60->windowGroup())));
+ delete wgn;
+
+/*
+ ### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag
+ int argc = priv->argc;
+ char **argv = priv->argv;
+
+ // Get command line params
+ int j = argc ? 1 : 0;
+ for (int i=1; i<argc; i++) {
+ if (argv[i] && *argv[i] != '-') {
+ argv[j++] = argv[i];
+ continue;
+ }
+
+#if defined(QT_DEBUG)
+ if (qstrcmp(argv[i], "-nograb") == 0)
+ appNoGrab = !appNoGrab;
+ else
+#endif // QT_DEBUG
+ ;
+ }
+*/
+}
+
+/*****************************************************************************
+ qt_cleanup() - cleans up when the application is finished
+ *****************************************************************************/
+void qt_cleanup()
+{
+ QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles
+// S60 structure and window server session are freed in eventdispatcher destructor as they are needed there
+
+ // It's important that this happens here, before the event dispatcher gets
+ // deleted, because the input context needs the event loop one last time before
+ // it dies.
+ delete QApplicationPrivate::inputContext;
+ QApplicationPrivate::inputContext = 0;
+}
+
+void QApplicationPrivate::initializeWidgetPaletteHash()
+{
+ // TODO: Implement QApplicationPrivate::initializeWidgetPaletteHash()
+ // Possibly a task fot the S60Style guys
+}
+
+void QApplicationPrivate::createEventDispatcher()
+{
+ Q_Q(QApplication);
+ eventDispatcher = new QEventDispatcherS60(q);
+}
+
+QString QApplicationPrivate::appName() const
+{
+ return QCoreApplicationPrivate::appName();
+}
+
+bool QApplicationPrivate::modalState()
+{
+ return false;
+}
+
+void QApplicationPrivate::enterModal_sys(QWidget *widget)
+{
+ // TODO: Implement QApplicationPrivate::enterModal_sys(QWidget *widget)
+}
+
+void QApplicationPrivate::leaveModal_sys(QWidget *widget)
+{
+ // TODO: Implement QApplicationPrivate::leaveModal_sys(QWidget *widget)
+}
+
+void QApplicationPrivate::openPopup(QWidget *popup)
+{
+ if (!QApplicationPrivate::popupWidgets)
+ QApplicationPrivate::popupWidgets = new QWidgetList;
+ QApplicationPrivate::popupWidgets->append(popup);
+
+ if (QApplicationPrivate::popupWidgets->count() == 1 && !qt_nograb()) {
+ Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created));
+ WId id = popup->effectiveWinId();
+ id->SetPointerCapture(true);
+ id->SetGloballyCapturing(true);
+
+ autoGrabWindow = id;
+ }
+
+ // popups are not focus-handled by the window system (the first
+ // popup grabbed the keyboard), so we have to do that manually: A
+ // new popup gets the focus
+ if (popup->focusWidget()) {
+ popup->focusWidget()->setFocus(Qt::PopupFocusReason);
+ } else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup
+ if (QWidget *fw = QApplication::focusWidget()) {
+ static_cast<QSymbianControl*>(fw->effectiveWinId())->CancelLongTapTimer();
+ QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason);
+ q_func()->sendEvent(fw, &e);
+ }
+ }
+}
+
+void QApplicationPrivate::closePopup(QWidget *popup)
+{
+ if (!QApplicationPrivate::popupWidgets)
+ return;
+ QApplicationPrivate::popupWidgets->removeAll(popup);
+
+ if (QApplicationPrivate::popupWidgets->isEmpty()) { // this was the last popup
+ delete QApplicationPrivate::popupWidgets;
+ QApplicationPrivate::popupWidgets = 0;
+ if (!qt_nograb()) { // grabbing not disabled
+ Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created));
+ WId id = popup->effectiveWinId();
+ id->SetPointerCapture(false);
+ id->SetGloballyCapturing(false);
+ if (QWidgetPrivate::mouseGrabber != 0)
+ QWidgetPrivate::mouseGrabber->grabMouse();
+
+ autoGrabWindow = 0;
+ if (QWidgetPrivate::keyboardGrabber != 0)
+ QWidgetPrivate::keyboardGrabber->grabKeyboard();
+
+ QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget()
+ : q_func()->focusWidget();
+ if (fw) {
+ if (fw != q_func()->focusWidget()) {
+ fw->setFocus(Qt::PopupFocusReason);
+ } else {
+ QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason);
+ q_func()->sendEvent(fw, &e);
+ }
+ }
+ }
+ } else {
+ // popups are not focus-handled by the window system (the
+ // first popup grabbed the keyboard), so we have to do that
+ // manually: A popup was closed, so the previous popup gets
+ // the focus.
+ QWidget* aw = QApplicationPrivate::popupWidgets->last();
+ if (QWidget *fw = QApplication::focusWidget()) {
+ QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason);
+ q_func()->sendEvent(fw, &e);
+ }
+ }
+}
+
+QWidget * QApplication::topLevelAt(QPoint const& point)
+{
+ QWidget *found = 0;
+ int lowestZ = INT_MAX;
+ QWidgetList list = QApplication::topLevelWidgets();
+ for (int i = 0; i < list.count(); ++i) {
+ QWidget *widget = list.at(i);
+ if (widget->isVisible() && !(widget->windowType() == Qt::Desktop)) {
+ Q_ASSERT(widget->testAttribute(Qt::WA_WState_Created));
+ if (widget->geometry().adjusted(0,0,1,1).contains(point)) {
+ // At this point we know there is a Qt widget under the point.
+ // Now we need to make sure it is the top most in the z-order.
+ RDrawableWindow* rw = widget->d_func()->topData()->rwindow;
+ int z = rw->OrdinalPosition();
+ if (z < lowestZ) {
+ lowestZ = z;
+ found = widget;
+ }
+ }
+ }
+ }
+ return found;
+}
+
+void QApplication::alert(QWidget *widget, int duration)
+{
+ // TODO: Implement QApplication::alert(QWidget *widget, int duration)
+}
+
+int QApplication::doubleClickInterval()
+{
+ TTimeIntervalMicroSeconds32 us;
+ TInt distance;
+ S60->wsSession().GetDoubleClickSettings(us, distance);
+ return (us.Int() / 1000);
+}
+
+void QApplication::setDoubleClickInterval(int ms)
+{
+ TTimeIntervalMicroSeconds32 newUs( ms * 1000);
+ TTimeIntervalMicroSeconds32 us;
+ TInt distance;
+ S60->wsSession().GetDoubleClickSettings(us, distance);
+ if (us != newUs)
+ S60->wsSession().SetDoubleClick(newUs, distance);
+}
+
+int QApplication::keyboardInputInterval()
+{
+ return QApplicationPrivate::keyboard_input_time;
+}
+
+void QApplication::setKeyboardInputInterval(int ms)
+{
+ QApplicationPrivate::keyboard_input_time = ms;
+}
+
+int QApplication::cursorFlashTime()
+{
+ return QApplicationPrivate::cursor_flash_time;
+}
+
+void QApplication::setCursorFlashTime(int msecs)
+{
+ QApplicationPrivate::cursor_flash_time = msecs;
+}
+
+void QApplication::beep()
+{
+ TInt frequency=440;
+ TTimeIntervalMicroSeconds duration(500000);
+ QS60Beep* beep=NULL;
+ TRAPD(err, beep=QS60Beep::NewL(frequency, duration));
+ if(!err) {
+ beep->Play();
+ }
+ delete beep;
+ beep=NULL;
+}
+
+int QApplication::s60ProcessEvent(TWsEvent *event)
+{
+ bool handled = s60EventFilter(event);
+ if (handled)
+ return 1;
+
+ // Qt event handling. Handle some events regardless of if the handle is in our
+ // widget map or not.
+ CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle());
+ const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control);
+ switch (event->Type()) {
+#ifndef QT_NO_IM
+ case EEventKey:
+ case EEventKeyUp:
+ case EEventKeyDown:
+ {
+ // The control doesn't seem to be any of our widgets, so rely on the focused
+ // widget instead. If the user needs the control, it can be found inside the
+ // event structure.
+ QWidget *w = qApp ? qApp->focusWidget() : 0;
+ if (w) {
+ QInputContext *ic = w->inputContext();
+ if (ic && ic->s60FilterEvent(w, event)) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ break;
+ }
+#endif
+ case EEventPointerEnter:
+ if (controlInMap)
+ return 1; // Qt::Enter will be generated in HandlePointerL
+ break;
+ case EEventPointerExit:
+ if (controlInMap) {
+ if (S60) {
+ // mouseEvent outside our window, send leave event to last focused widget
+ QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos,
+ Qt::NoButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
+ if (S60->lastPointerEventTarget)
+ qt_sendSpontaneousEvent(S60->lastPointerEventTarget,&mEvent);
+ S60->lastPointerEventTarget = 0;
+ }
+ return 1;
+ }
+ break;
+ case EEventScreenDeviceChanged:
+ if (S60)
+ S60->updateScreenSize();
+ return 0; // Propagate to CONE
+ case EEventWindowVisibilityChanged:
+ if (controlInMap) {
+ const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
+ QWidget *w = QWidgetPrivate::mapper->value(control);
+ if (!w->d_func()->maybeTopData())
+ break;
+ if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) {
+ delete w->d_func()->topData()->backingStore;
+ w->d_func()->topData()->backingStore = 0;
+ } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
+ && !w->d_func()->maybeBackingStore()) {
+ w->d_func()->topData()->backingStore = new QWidgetBackingStore(w);
+ }
+ return 1;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (!controlInMap)
+ return -1;
+
+ return 0;
+}
+
+bool QApplication::s60EventFilter(TWsEvent *aEvent)
+{
+ return false;
+}
+
+void QApplication::s60HandleCommandL(int command)
+{
+ switch (command) {
+ case EEikCmdExit:
+ case EAknSoftkeyBack:
+ case EAknSoftkeyExit:
+ qApp->exit();
+ break;
+ default:
+ // For now assume all unknown menu items are Qt menu items
+ QMenuBar::symbianCommands(command);
+ break;
+ }
+}
+
+#ifndef QT_NO_WHEELEVENT
+int QApplication::wheelScrollLines()
+{
+ return QApplicationPrivate::wheel_scroll_lines;
+}
+
+void QApplication::setWheelScrollLines(int n)
+{
+ QApplicationPrivate::wheel_scroll_lines = n;
+}
+#endif //QT_NO_WHEELEVENT
+
+bool QApplication::isEffectEnabled(Qt::UIEffect effect)
+{
+ // TODO: Implement QApplication::isEffectEnabled(Qt::UIEffect effect)
+ return false;
+}
+
+void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+{
+ // TODO: Implement QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+}
+
+TUint QApplicationPrivate::resolveS60ScanCode(TInt scanCode, TUint keysym)
+{
+ if (keysym) {
+ // If keysym is specified, cache it.
+ scanCodeCache.insert(scanCode, keysym);
+ return keysym;
+ } else {
+ // If not, retrieve the cached version.
+ return scanCodeCache[scanCode];
+ }
+}
+
+#ifndef QT_NO_SESSIONMANAGER
+QSessionManager::QSessionManager(QApplication * app, QString &id, QString& key)
+{
+
+}
+
+QSessionManager::~QSessionManager()
+{
+
+}
+
+bool QSessionManager::allowsInteraction()
+{
+ return false;
+}
+
+void QSessionManager::cancel()
+{
+
+}
+#endif //QT_NO_SESSIONMANAGER
+QT_END_NAMESPACE
+
+
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
new file mode 100644
index 0000000000..ec595b5fd9
--- /dev/null
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -0,0 +1,247 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qclipboard.h"
+
+#ifndef QT_NO_CLIPBOARD
+
+#include "qapplication.h"
+#include "qbitmap.h"
+#include "qdatetime.h"
+#include "qbuffer.h"
+#include "qwidget.h"
+#include "qevent.h"
+#include <QtDebug>
+
+// Symbian's clipboard
+#include <baclipb.h>
+QT_BEGIN_NAMESPACE
+
+//### Mime Type mapping to UIDs
+
+const TUid KQtCbDataStream = {0x666777};
+
+
+class QClipboardData
+{
+public:
+ QClipboardData();
+ ~QClipboardData();
+
+ void setSource(QMimeData* s)
+ {
+ if (s == src)
+ return;
+ delete src;
+ src = s;
+ }
+ QMimeData* source()
+ { return src; }
+ bool connected()
+ { return connection; }
+ void clear();
+ RFs fsSession();
+
+
+private:
+ QMimeData* src;
+ RFs iFs;
+ bool connection;
+};
+
+QClipboardData::QClipboardData():src(0),connection(true)
+{
+ clear();
+ if (KErrNone != iFs.Connect())
+ {
+ qWarning("QClipboardData::fileserver connnect failed");
+ connection = false;
+ }
+}
+
+QClipboardData::~QClipboardData()
+{
+ iFs.Close();
+ connection = false;
+ delete src;
+}
+
+void QClipboardData::clear()
+{
+ QMimeData* newSrc = new QMimeData;
+ delete src;
+ src = newSrc;
+}
+RFs QClipboardData::fsSession()
+{
+ return iFs;
+}
+
+static QClipboardData *internalCbData = 0;
+
+static void cleanupClipboardData()
+{
+ delete internalCbData;
+ internalCbData = 0;
+}
+
+static QClipboardData *clipboardData()
+{
+ if (internalCbData == 0) {
+ internalCbData = new QClipboardData;
+ if (internalCbData)
+ {
+ if (!internalCbData->connected())
+ {
+ delete internalCbData;
+ internalCbData = 0;
+ }
+ else
+ {
+ qAddPostRoutine(cleanupClipboardData);
+ }
+ }
+ }
+ return internalCbData;
+}
+
+void writeToStream(const QMimeData* aData, RWriteStream& aStream)
+{
+ QStringList headers = aData->formats();
+ aStream << TCardinality(headers.count());
+ for (QStringList::const_iterator iter= headers.constBegin();iter != headers.constEnd();iter++)
+ {
+ HBufC* stringData = TPtrC(reinterpret_cast<const TUint16*>((*iter).utf16())).AllocLC();
+ QByteArray ba = aData->data((*iter));
+ qDebug() << "copy to clipboard mime: " << *iter << " data: " << ba;
+ // mime type
+ aStream << TCardinality(stringData->Size());
+ aStream << *(stringData);
+ // mime data
+ aStream << TCardinality(ba.size());
+ aStream.WriteL(reinterpret_cast<const uchar*>(ba.constData()),ba.size());
+ CleanupStack::PopAndDestroy(stringData);
+ }
+}
+
+void readFromStream(QMimeData* aData,RReadStream& aStream)
+{
+ TCardinality mimeTypeCount;
+ aStream >> mimeTypeCount;
+ for (int i = 0; i< mimeTypeCount;i++)
+ {
+ // mime type
+ TCardinality mimeTypeSize;
+ aStream >> mimeTypeSize;
+ HBufC* mimeTypeBuf = HBufC::NewLC(aStream,mimeTypeSize);
+ QString mimeType = QString::fromUtf16(mimeTypeBuf->Des().Ptr(),mimeTypeBuf->Length());
+ // mime data
+ TCardinality dataSize;
+ aStream >> dataSize;
+ QByteArray ba;
+ ba.reserve(dataSize);
+ aStream.ReadL(reinterpret_cast<uchar*>(ba.data_ptr()->data),dataSize);
+ ba.data_ptr()->size = dataSize;
+ qDebug() << "paste from clipboard mime: " << mimeType << " data: " << ba;
+ aData->setData(mimeType,ba);
+ CleanupStack::PopAndDestroy(mimeTypeBuf);
+
+ }
+}
+
+
+/*****************************************************************************
+ QClipboard member functions
+ *****************************************************************************/
+
+void QClipboard::clear(Mode mode)
+{
+ setText(QString(), mode);
+}
+const QMimeData* QClipboard::mimeData(Mode mode) const
+{
+ if (mode != Clipboard) return 0;
+ QClipboardData *d = clipboardData();
+ if (d)
+ {
+ //###fixme when exceptions are added to Qt
+ TRAPD(err,{
+ RFs fs = d->fsSession();
+ CClipboard* cb = CClipboard::NewForReadingLC(fs);
+ Q_ASSERT(cb);
+ RStoreReadStream stream;
+ TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream);
+ stream.OpenLC(cb->Store(),stid);
+ readFromStream(d->source(),stream);
+ CleanupStack::PopAndDestroy(2,cb);
+ return d->source();
+ });
+ if (err != KErrNone){
+ qDebug()<< "clipboard is empty/err: " << err;
+ }
+
+ }
+ return 0;
+}
+
+
+void QClipboard::setMimeData(QMimeData* src, Mode mode)
+{
+ if (mode != Clipboard) return;
+ QClipboardData *d = clipboardData();
+ if (d)
+ {
+ //###fixme when exceptions are added to Qt
+ TRAPD(err,{
+ RFs fs = d->fsSession();
+ CClipboard* cb = CClipboard::NewForWritingLC(fs);
+ RStoreWriteStream stream;
+ TStreamId stid = stream.CreateLC(cb->Store());
+ writeToStream(src,stream);
+ d->setSource(src);
+ stream.CommitL();
+ (cb->StreamDictionary()).AssignL(KQtCbDataStream,stid);
+ cb->CommitL();
+ CleanupStack::PopAndDestroy(2,cb);
+ });
+ if (err != KErrNone){
+ qDebug()<< "clipboard write err :" << err;
+ }
+ }
+ emitChanged(QClipboard::Clipboard);
+}
+
+bool QClipboard::supportsMode(Mode mode) const
+{
+ return (mode == Clipboard);
+}
+
+bool QClipboard::ownsMode(Mode mode) const
+{
+ if (mode == Clipboard)
+ qWarning("QClipboard::ownsClipboard: UNIMPLEMENTED!");
+ return false;
+}
+
+bool QClipboard::event(QEvent *e)
+{
+ return true;
+}
+
+void QClipboard::connectNotify( const char * )
+{
+}
+
+void QClipboard::ownerDestroyed()
+{
+}
+QT_END_NAMESPACE
+#endif // QT_NO_CLIPBOARD \ No newline at end of file
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index ed7e020d23..c24abc4a9a 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -559,7 +559,6 @@ QCursor::operator QVariant() const
{
return QVariant(QVariant::Cursor, this);
}
-
+QT_END_NAMESPACE
#endif // QT_NO_CURSOR
-QT_END_NAMESPACE
diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp
new file mode 100644
index 0000000000..4d3f067380
--- /dev/null
+++ b/src/gui/kernel/qcursor_s60.cpp
@@ -0,0 +1,30 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qcursor_p.h>
+#include <qcursor.h>
+#include <qt_s60_p.h>
+
+#ifdef QT_NO_CURSOR
+QT_BEGIN_NAMESPACE
+
+QPoint QCursor::pos()
+{
+ return S60->lastCursorPos;
+}
+
+void QCursor::setPos(int x, int y)
+{
+ S60->lastCursorPos = QPoint(x, y);
+}
+
+QT_END_NAMESPACE
+#endif // QT_NO_CURSOR
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
new file mode 100644
index 0000000000..029892e87d
--- /dev/null
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qdesktopwidget.h"
+#include "qapplication_p.h"
+#include "qwidget_p.h"
+#include "qt_s60_p.h"
+#include <w32std.h>
+
+#include "hal.h"
+#include "hal_data.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDesktopWidgetPrivate : public QWidgetPrivate
+{
+
+public:
+ QDesktopWidgetPrivate();
+ ~QDesktopWidgetPrivate();
+
+ static void init(QDesktopWidget *that);
+ static void cleanup();
+
+ static int screenCount;
+ static int primaryScreen;
+};
+
+int QDesktopWidgetPrivate::screenCount = 1;
+int QDesktopWidgetPrivate::primaryScreen = 0;
+
+QDesktopWidgetPrivate::QDesktopWidgetPrivate()
+{
+}
+
+QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
+{
+}
+
+void QDesktopWidgetPrivate::init(QDesktopWidget *that)
+{
+ TInt screenCount=0;
+ TInt result=0;
+
+ result = HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount);
+ QDesktopWidgetPrivate::screenCount = screenCount;
+ if( result != KErrNone)
+ {
+ // ### What to do if no screens found?
+ }
+}
+
+void QDesktopWidgetPrivate::cleanup()
+{
+}
+
+
+QDesktopWidget::QDesktopWidget()
+ : QWidget(*new QDesktopWidgetPrivate, 0, Qt::Desktop)
+{
+ setObjectName(QLatin1String("desktop"));
+ QDesktopWidgetPrivate::init(this);
+}
+
+QDesktopWidget::~QDesktopWidget()
+{
+ QDesktopWidgetPrivate::cleanup();
+}
+
+bool QDesktopWidget::isVirtualDesktop() const
+{
+ return true;
+}
+
+int QDesktopWidget::primaryScreen() const
+{
+ return QDesktopWidgetPrivate::primaryScreen;
+}
+
+int QDesktopWidget::numScreens() const
+{
+ Q_D(const QDesktopWidget);
+ return QDesktopWidgetPrivate::screenCount;
+}
+
+QWidget *QDesktopWidget::screen(int /* screen */)
+{
+ return this;
+}
+
+const QRect QDesktopWidget::availableGeometry(int /* screen */) const
+{
+ TRect clientRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ return qt_TRect2QRect(clientRect);
+}
+
+const QRect QDesktopWidget::screenGeometry(int /* screen */) const
+{
+ Q_D(const QDesktopWidget);
+ return QRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
+ }
+
+int QDesktopWidget::screenNumber(const QWidget *widget) const
+{
+ return QDesktopWidgetPrivate::primaryScreen;
+}
+
+int QDesktopWidget::screenNumber(const QPoint &point) const
+{
+ return QDesktopWidgetPrivate::primaryScreen;
+}
+
+void QDesktopWidget::resizeEvent(QResizeEvent *)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp
new file mode 100644
index 0000000000..09605bec4d
--- /dev/null
+++ b/src/gui/kernel/qdnd_s60.cpp
@@ -0,0 +1,365 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qapplication.h"
+
+#ifndef QT_NO_DRAGANDDROP
+
+#include "qwidget.h"
+#include "qdatetime.h"
+#include "qbitmap.h"
+#include "qcursor.h"
+#include "qevent.h"
+#include "qpainter.h"
+#include "qdnd_p.h"
+
+#include <COECNTRL.H>
+// pointer cursor
+#include <w32std.h>
+#include <gdi.h>
+QT_BEGIN_NAMESPACE
+//### artistic impression of Symbians default DnD cursor ?
+
+static QPixmap *defaultPm = 0;
+static const int default_pm_hotx = -50;
+static const int default_pm_hoty = -50;
+static const char *const default_pm[] = {
+"13 9 3 1",
+". c None",
+" c #000000",
+"X c #FFFFFF",
+"X X X X X X X",
+" X X X X X X ",
+"X ......... X",
+" X.........X ",
+"X ......... X",
+" X.........X ",
+"X ......... X",
+" X X X X X X ",
+"X X X X X X X",
+};
+//### actions need to be redefined for S60
+// Shift/Ctrl handling, and final drop status
+static Qt::DropAction global_accepted_action = Qt::MoveAction;
+static Qt::DropActions possible_actions = Qt::IgnoreAction;
+
+
+// static variables in place of a proper cross-process solution
+static QDrag *drag_object;
+static bool qt_symbian_dnd_dragging = false;
+
+
+static Qt::KeyboardModifiers oldstate;
+
+class QShapedPixmapWidget
+{
+public:
+ QShapedPixmapWidget(RWsSession aWsSession,RWindowTreeNode* aNode)
+ {
+ sprite = RWsSprite(aWsSession);
+ cursorSprite.iBitmap = 0;
+ cursorSprite.iMaskBitmap = 0;
+ cursorSprite.iInvertMask = EFalse;
+ cursorSprite.iOffset = TPoint(0,0);
+ cursorSprite.iInterval = TTimeIntervalMicroSeconds32(0);
+ cursorSprite.iDrawMode = CGraphicsContext::EDrawModePEN;
+ sprite.Construct(*aNode,TPoint(0,0), ESpriteNoShadows | ESpriteNoChildClip);
+ sprite.AppendMember(cursorSprite);
+ sprite.Activate();
+ }
+ ~QShapedPixmapWidget()
+ {
+ sprite.Close();
+ cursorSprite.iBitmap = 0;
+ delete cursorBitmap;
+ cursorBitmap = 0; //redundant...
+ }
+ void disableCursor()
+ {
+ cursorSprite.iBitmap = 0;
+ sprite.UpdateMember(0,cursorSprite);
+ }
+ void enableCursor()
+ {
+ cursorSprite.iBitmap = cursorBitmap;
+ sprite.UpdateMember(0,cursorSprite);
+ }
+ void setPixmap(QPixmap pm)
+ {
+ //### heaplock centralized.
+ QImage temp = pm.toImage();
+ QSize size = pm.size();
+ temp.bits();
+ CFbsBitmap *curbm = new (ELeave) CFbsBitmap();
+ curbm->Create(TSize(size.width(),size.height()),EColor16MA);
+ curbm->LockHeap(ETrue);
+ memcpy((uchar*)curbm->DataAddress(),temp.bits(),temp.numBytes());
+ curbm->UnlockHeap(ETrue);
+ delete cursorSprite.iBitmap;
+ cursorSprite.iBitmap = curbm;
+ cursorBitmap = curbm;
+ sprite.UpdateMember(0,cursorSprite);
+ }
+ CFbsBitmap *cursorBitmap;
+ RWsPointerCursor pointerCursor;
+ RWsSprite sprite;
+ TSpriteMember cursorSprite;
+
+};
+
+
+static QShapedPixmapWidget *qt_symbian_dnd_deco = 0;
+
+void QDragManager::updatePixmap()
+{
+ if (qt_symbian_dnd_deco) {
+ QPixmap pm;
+ QPoint pm_hot(default_pm_hotx,default_pm_hoty);
+ if (drag_object) {
+ pm = drag_object->pixmap();
+ if (!pm.isNull())
+ pm_hot = drag_object->hotSpot();
+ }
+ if (pm.isNull()) {
+ if (!defaultPm)
+ defaultPm = new QPixmap(default_pm);
+ pm = *defaultPm;
+ }
+ qt_symbian_dnd_deco->setPixmap(pm);
+ }
+}
+
+void QDragManager::timerEvent(QTimerEvent *) { }
+
+void QDragManager::move(const QPoint&) {
+}
+
+void QDragManager::updateCursor()
+{
+}
+
+
+bool QDragManager::eventFilter(QObject *o, QEvent *e)
+{
+ if (beingCancelled) {
+ return false;
+ }
+ if (!o->isWidgetType())
+ return false;
+
+ switch(e->type()) {
+ case QEvent::MouseButtonPress:
+ {
+ }
+ case QEvent::MouseMove:
+ {
+ if (!object) { //#### this should not happen
+ qWarning("QDragManager::eventFilter: No object");
+ return true;
+ }
+ QDragManager *manager = QDragManager::self();
+ QMimeData *dropData = manager->object ? manager->dragPrivate()->data : manager->dropData;
+ if (manager->object)
+ possible_actions = manager->dragPrivate()->possible_actions;
+ else
+ possible_actions = Qt::IgnoreAction;
+
+ QMouseEvent *me = (QMouseEvent *)e;
+
+ if (me->buttons()) {
+ Qt::DropAction prevAction = global_accepted_action;
+ QWidget *cw = QApplication::widgetAt(me->globalPos());
+ // map the Coords relative to the window.
+ if (!cw)
+ return true;
+ TPoint windowPos = cw->effectiveWinId()->PositionRelativeToScreen();
+ qt_symbian_dnd_deco->sprite.SetPosition(TPoint(me->globalX()- windowPos.iX,me->globalY()- windowPos.iY));
+
+ while (cw && !cw->acceptDrops() && !cw->isWindow())
+ cw = cw->parentWidget();
+
+ if (object->target() != cw) {
+ if (object->target()) {
+ QDragLeaveEvent dle;
+ QApplication::sendEvent(object->target(), &dle);
+ willDrop = false;
+ global_accepted_action = Qt::IgnoreAction;
+ updateCursor();
+ restoreCursor = true;
+ object->d_func()->target = 0;
+ }
+ if (cw && cw->acceptDrops()) {
+ object->d_func()->target = cw;
+ QDragEnterEvent dee(cw->mapFromGlobal(me->globalPos()), possible_actions, dropData,
+ me->buttons(), me->modifiers());
+ QApplication::sendEvent(object->target(), &dee);
+ willDrop = dee.isAccepted() && dee.dropAction() != Qt::IgnoreAction;
+ global_accepted_action = willDrop ? dee.dropAction() : Qt::IgnoreAction;
+ updateCursor();
+ restoreCursor = true;
+ }
+ } else if (cw) {
+ QDragMoveEvent dme(cw->mapFromGlobal(me->globalPos()), possible_actions, dropData,
+ me->buttons(), me->modifiers());
+ if (global_accepted_action != Qt::IgnoreAction) {
+ dme.setDropAction(global_accepted_action);
+ dme.accept();
+ }
+ QApplication::sendEvent(cw, &dme);
+ willDrop = dme.isAccepted();
+ global_accepted_action = willDrop ? dme.dropAction() : Qt::IgnoreAction;
+ updatePixmap();
+ updateCursor();
+ }
+ if (global_accepted_action != prevAction)
+ emitActionChanged(global_accepted_action);
+ }
+ return true; // Eat all mouse events
+ }
+
+ case QEvent::MouseButtonRelease:
+ {
+ qApp->removeEventFilter(this);
+ if (restoreCursor) {
+ qt_symbian_dnd_deco->disableCursor();
+ willDrop = false;
+ restoreCursor = false;
+ }
+ if (object && object->target()) {
+
+ QMouseEvent *me = (QMouseEvent *)e;
+
+ QDragManager *manager = QDragManager::self();
+ QMimeData *dropData = manager->object ? manager->dragPrivate()->data : manager->dropData;
+
+ QDropEvent de(object->target()->mapFromGlobal(me->globalPos()), possible_actions, dropData,
+ me->buttons(), me->modifiers());
+ QApplication::sendEvent(object->target(), &de);
+ if (de.isAccepted())
+ global_accepted_action = de.dropAction();
+ else
+ global_accepted_action = Qt::IgnoreAction;
+
+ if (object)
+ object->deleteLater();
+ drag_object = object = 0;
+ }
+ eventLoop->exit();
+ return true; // Eat all mouse events
+ }
+
+ default:
+ break;
+ }
+ return false;
+}
+
+Qt::DropAction QDragManager::drag(QDrag *o)
+{
+ Q_ASSERT(!qt_symbian_dnd_dragging);
+ if (object == o || !o || !o->source())
+ return Qt::IgnoreAction;
+
+ if (object) {
+ cancel();
+ qApp->removeEventFilter(this);
+ beingCancelled = false;
+ }
+
+ object = drag_object = o;
+ RWsSession winSession = o->source()->effectiveWinId()->ControlEnv()->WsSession();
+ Q_ASSERT(!qt_symbian_dnd_deco);
+ qt_symbian_dnd_deco = new QShapedPixmapWidget(winSession, o->source()->effectiveWinId()->DrawableWindow());
+
+ oldstate = Qt::NoModifier; // #### Should use state that caused the drag
+ willDrop = false;
+ updatePixmap();
+ updateCursor();
+ restoreCursor = true;
+
+ object->d_func()->target = 0;
+ TPoint windowPos = source()->effectiveWinId()->PositionRelativeToScreen();
+ qt_symbian_dnd_deco->sprite.SetPosition(TPoint(QCursor::pos().x()- windowPos.iX ,QCursor::pos().y() - windowPos.iY));
+
+ QPoint hotspot = drag_object->hotSpot();
+ qt_symbian_dnd_deco->cursorSprite.iOffset = TPoint(- hotspot.x(),- hotspot.y());
+ qt_symbian_dnd_deco->sprite.UpdateMember(0,qt_symbian_dnd_deco->cursorSprite);
+
+ qApp->installEventFilter(this);
+
+ global_accepted_action = Qt::MoveAction;
+ qt_symbian_dnd_dragging = true;
+
+ eventLoop = new QEventLoop;
+ // block
+ (void) eventLoop->exec(QEventLoop::AllEvents);
+ delete eventLoop;
+ eventLoop = 0;
+
+ delete qt_symbian_dnd_deco;
+ qt_symbian_dnd_deco = 0;
+ qt_symbian_dnd_dragging = false;
+
+
+ return global_accepted_action;
+}
+
+
+void QDragManager::cancel(bool deleteSource)
+{
+ beingCancelled = true;
+
+ if (object->target()) {
+ QDragLeaveEvent dle;
+ QApplication::sendEvent(object->target(), &dle);
+ }
+
+ if (drag_object) {
+ if (deleteSource)
+ object->deleteLater();
+ drag_object = object = 0;
+ }
+
+ delete qt_symbian_dnd_deco;
+ qt_symbian_dnd_deco = 0;
+
+ global_accepted_action = Qt::IgnoreAction;
+}
+
+
+void QDragManager::drop()
+{
+}
+
+QVariant QDropData::retrieveData_sys(const QString &mimetype, QVariant::Type type) const
+{
+ if (!drag_object)
+ return QVariant();
+ QByteArray data = drag_object->mimeData()->data(mimetype);
+ if (type == QVariant::String)
+ return QString::fromUtf8(data);
+ return data;
+}
+
+bool QDropData::hasFormat_sys(const QString &format) const
+{
+ return formats().contains(format);
+}
+
+QStringList QDropData::formats_sys() const
+{
+ if (drag_object)
+ return drag_object->mimeData()->formats();
+ return QStringList();
+}
+
+QT_END_NAMESPACE
+#endif // QT_NO_DRAGANDDROP
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 449730da2d..272431589e 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -241,7 +241,7 @@ public:
inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/,
int modifiers, const QString& text = QString(),
bool autorep = false, ushort count = 1)
- : QInputEvent(type, (Qt::KeyboardModifiers)(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
+ : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
c(count), autor(autorep)
{
if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast)
diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp
new file mode 100644
index 0000000000..862f4efec6
--- /dev/null
+++ b/src/gui/kernel/qeventdispatcher_s60.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <qwidget.h>
+
+#include "qeventdispatcher_s60_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QEventDispatcherS60::QEventDispatcherS60(QObject *parent)
+ : QEventDispatcherSymbian(parent),
+ m_noInputEvents(false)
+{
+}
+
+QEventDispatcherS60::~QEventDispatcherS60()
+{
+ for (int c = 0; c < m_deferredInputEvents.size(); ++c) {
+ delete m_deferredInputEvents[c].event;
+ }
+}
+
+bool QEventDispatcherS60::processEvents ( QEventLoop::ProcessEventsFlags flags )
+{
+ bool ret = false;
+
+ bool oldNoInputEventsValue = m_noInputEvents;
+ if (flags & QEventLoop::ExcludeUserInputEvents) {
+ m_noInputEvents = true;
+ } else {
+ m_noInputEvents = false;
+ ret = sendDeferredInputEvents() || ret;
+ }
+
+ ret = QEventDispatcherSymbian::processEvents(flags) || ret;
+
+ m_noInputEvents = oldNoInputEventsValue;
+
+ return ret;
+}
+
+bool QEventDispatcherS60::hasPendingEvents()
+{
+ return !m_deferredInputEvents.isEmpty() || QEventDispatcherSymbian::hasPendingEvents();
+}
+
+void QEventDispatcherS60::saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event)
+{
+ DeferredInputEvent inputEvent = {control, widget, event};
+ m_deferredInputEvents.append(inputEvent);
+ connect(widget, SIGNAL(destroyed(QObject *)), SLOT(removeInputEventsForWidget(QObject *)));
+}
+
+bool QEventDispatcherS60::sendDeferredInputEvents()
+{
+ bool eventsSent = false;
+ while (!m_deferredInputEvents.isEmpty()) {
+ DeferredInputEvent inputEvent = m_deferredInputEvents.takeFirst();
+#ifndef QT_NO_EXCEPTIONS
+ try {
+#endif
+ inputEvent.control->sendInputEvent(inputEvent.widget, inputEvent.event);
+#ifndef QT_NO_EXCEPTIONS
+ } catch (...) {
+ delete inputEvent.event;
+ throw;
+ }
+#endif
+ delete inputEvent.event;
+ eventsSent = true;
+ }
+
+ return eventsSent;
+}
+
+void QEventDispatcherS60::removeInputEventsForWidget(QObject *object)
+{
+ for (int c = 0; c < m_deferredInputEvents.size(); ++c) {
+ if (m_deferredInputEvents[c].widget == object) {
+ delete m_deferredInputEvents[c].event;
+ m_deferredInputEvents.removeAt(c--);
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h
new file mode 100644
index 0000000000..fec8773055
--- /dev/null
+++ b/src/gui/kernel/qeventdispatcher_s60_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QEVENTDISPATCHER_S60_P_H
+#define QEVENTDISPATCHER_S60_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qeventdispatcher_symbian_p.h>
+#include "qt_s60_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class Q_GUI_EXPORT QEventDispatcherS60 : public QEventDispatcherSymbian
+{
+ Q_OBJECT
+
+public:
+ QEventDispatcherS60(QObject *parent = 0);
+ ~QEventDispatcherS60();
+
+ bool processEvents ( QEventLoop::ProcessEventsFlags flags );
+ bool hasPendingEvents();
+
+ bool excludeUserInputEvents() { return m_noInputEvents; }
+
+ void saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event);
+
+private:
+ bool sendDeferredInputEvents();
+
+private Q_SLOTS:
+ void removeInputEventsForWidget(QObject *object);
+
+private:
+ bool m_noInputEvents;
+
+ struct DeferredInputEvent
+ {
+ QSymbianControl *control;
+ QWidget *widget;
+ QInputEvent *event;
+ };
+ QList<DeferredInputEvent> m_deferredInputEvents;
+};
+
+QT_END_NAMESPACE
+
+#endif // QEVENTDISPATCHER_S60_P_H
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index f1d938c170..8937aafeca 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -58,6 +58,7 @@
#include <qlist.h>
#include <qlocale.h>
#include <qevent.h>
+#include <qhash.h>
#if defined (Q_WS_MAC64)
# include <private/qt_mac_p.h>
@@ -203,6 +204,13 @@ public:
UInt32 keyboard_dead;
KeyboardLayoutItem *keyLayout[256];
#elif defined(Q_WS_QWS)
+#elif defined(Q_WS_S60)
+private:
+ QHash<TUint, int> s60ToQtKeyMap;
+ void fillKeyMap();
+public:
+ QString translateKeyEvent(int keySym, Qt::KeyboardModifiers modifiers);
+ int mapS60KeyToQt(TUint s60key);
#endif
};
diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp
new file mode 100644
index 0000000000..29195513f6
--- /dev/null
+++ b/src/gui/kernel/qkeymapper_s60.cpp
@@ -0,0 +1,217 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qkeymapper_p.h"
+#include <e32keys.h>
+
+QT_BEGIN_NAMESPACE
+
+QKeyMapperPrivate::QKeyMapperPrivate()
+{
+ fillKeyMap();
+}
+
+QKeyMapperPrivate::~QKeyMapperPrivate()
+{
+}
+
+QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
+{
+ QList<int> result;
+ return result;
+}
+
+void QKeyMapperPrivate::clearMappings()
+{
+ // stub
+}
+
+QString QKeyMapperPrivate::translateKeyEvent(int keySym, Qt::KeyboardModifiers modifiers)
+{
+ if (keySym >= Qt::Key_Escape)
+ return QString();
+
+ // Symbian doesn't actually use modifiers, but gives us the character code directly.
+
+ return QString(QChar(keySym));
+}
+
+void QKeyMapperPrivate::fillKeyMap()
+{
+ using namespace Qt;
+ static const struct {
+ TUint s60Key;
+ int qtKey;
+ } map[] = {
+ {EKeyBell, Key_unknown},
+ {EKeyBackspace, Key_Backspace},
+ {EKeyTab, Key_Tab},
+ {EKeyLineFeed, Key_unknown},
+ {EKeyVerticalTab, Key_unknown},
+ {EKeyFormFeed, Key_unknown},
+ {EKeyEnter, Key_Enter},
+ {EKeyEscape, Key_Escape},
+ {EKeySpace, Key_Space},
+ {EKeyDelete, Key_Delete},
+ {EKeyPrintScreen, Key_SysReq},
+ {EKeyPause, Key_Pause},
+ {EKeyHome, Key_Home},
+ {EKeyEnd, Key_End},
+ {EKeyPageUp, Key_PageUp},
+ {EKeyPageDown, Key_PageDown},
+ {EKeyInsert, Key_Insert},
+ {EKeyLeftArrow, Key_Left},
+ {EKeyRightArrow, Key_Right},
+ {EKeyUpArrow, Key_Up},
+ {EKeyDownArrow, Key_Down},
+ {EKeyLeftShift, Key_Shift},
+ {EKeyRightShift, Key_Shift},
+ {EKeyLeftAlt, Key_Alt},
+ {EKeyRightAlt, Key_AltGr},
+ {EKeyLeftCtrl, Key_Control},
+ {EKeyRightCtrl, Key_Control},
+ {EKeyLeftFunc, Key_Super_L},
+ {EKeyRightFunc, Key_Super_R},
+ {EKeyCapsLock, Key_CapsLock},
+ {EKeyNumLock, Key_NumLock},
+ {EKeyScrollLock, Key_ScrollLock},
+ {EKeyF1, Key_F1},
+ {EKeyF2, Key_F2},
+ {EKeyF3, Key_F3},
+ {EKeyF4, Key_F4},
+ {EKeyF5, Key_F5},
+ {EKeyF6, Key_F6},
+ {EKeyF7, Key_F7},
+ {EKeyF8, Key_F8},
+ {EKeyF9, Key_F9},
+ {EKeyF10, Key_F10},
+ {EKeyF11, Key_F11},
+ {EKeyF12, Key_F12},
+ {EKeyF13, Key_F13},
+ {EKeyF14, Key_F14},
+ {EKeyF15, Key_F15},
+ {EKeyF16, Key_F16},
+ {EKeyF17, Key_F17},
+ {EKeyF18, Key_F18},
+ {EKeyF19, Key_F19},
+ {EKeyF20, Key_F20},
+ {EKeyF21, Key_F21},
+ {EKeyF22, Key_F22},
+ {EKeyF23, Key_F23},
+ {EKeyF24, Key_F24},
+ {EKeyOff, Key_unknown},
+ {EKeyIncContrast, Key_unknown},
+ {EKeyDecContrast, Key_unknown},
+ {EKeyBacklightOn, Key_unknown},
+ {EKeyBacklightOff, Key_unknown},
+ {EKeyBacklightToggle, Key_unknown},
+ {EKeySliderDown, Key_unknown},
+ {EKeySliderUp, Key_unknown},
+ {EKeyMenu, Key_Menu},
+ {EKeyDictaphonePlay, Key_unknown},
+ {EKeyDictaphoneStop, Key_unknown},
+ {EKeyDictaphoneRecord, Key_unknown},
+ {EKeyHelp, Key_unknown},
+ {EKeyDial, Key_Call},
+ {EKeyScreenDimension0, Key_unknown},
+ {EKeyScreenDimension1, Key_unknown},
+ {EKeyScreenDimension2, Key_unknown},
+ {EKeyScreenDimension3, Key_unknown},
+ {EKeyIncVolume, Key_unknown},
+ {EKeyDecVolume, Key_unknown},
+ {EKeyDevice0, Key_Context1}, // Found by manual testing, left softkey.
+ {EKeyDevice1, Key_Context2}, // Found by manual testing.
+ {EKeyDevice2, Key_unknown},
+ {EKeyDevice3, Key_Select}, // Found by manual testing.
+ {EKeyDevice4, Key_unknown},
+ {EKeyDevice5, Key_unknown},
+ {EKeyDevice6, Key_unknown},
+ {EKeyDevice7, Key_unknown},
+ {EKeyDevice8, Key_unknown},
+ {EKeyDevice9, Key_unknown},
+ {EKeyDeviceA, Key_unknown},
+ {EKeyDeviceB, Key_unknown},
+ {EKeyDeviceC, Key_unknown},
+ {EKeyDeviceD, Key_unknown},
+ {EKeyDeviceE, Key_unknown},
+ {EKeyDeviceF, Key_unknown},
+ {EKeyApplication0, Key_Launch0},
+ {EKeyApplication1, Key_Launch1},
+ {EKeyApplication2, Key_Launch2},
+ {EKeyApplication3, Key_Launch3},
+ {EKeyApplication4, Key_Launch4},
+ {EKeyApplication5, Key_Launch5},
+ {EKeyApplication6, Key_Launch6},
+ {EKeyApplication7, Key_Launch7},
+ {EKeyApplication8, Key_Launch8},
+ {EKeyApplication9, Key_Launch9},
+ {EKeyApplicationA, Key_LaunchA},
+ {EKeyApplicationB, Key_LaunchB},
+ {EKeyApplicationC, Key_LaunchC},
+ {EKeyApplicationD, Key_LaunchD},
+ {EKeyApplicationE, Key_LaunchE},
+ {EKeyApplicationF, Key_LaunchF},
+ {EKeyYes, Key_Yes},
+ {EKeyNo, Key_No},
+ {EKeyIncBrightness, Key_unknown},
+ {EKeyDecBrightness, Key_unknown},
+ {EKeyKeyboardExtend, Key_unknown},
+ {EKeyDevice10, Key_unknown},
+ {EKeyDevice11, Key_unknown},
+ {EKeyDevice12, Key_unknown},
+ {EKeyDevice13, Key_unknown},
+ {EKeyDevice14, Key_unknown},
+ {EKeyDevice15, Key_unknown},
+ {EKeyDevice16, Key_unknown},
+ {EKeyDevice17, Key_unknown},
+ {EKeyDevice18, Key_unknown},
+ {EKeyDevice19, Key_unknown},
+ {EKeyDevice1A, Key_unknown},
+ {EKeyDevice1B, Key_unknown},
+ {EKeyDevice1C, Key_unknown},
+ {EKeyDevice1D, Key_unknown},
+ {EKeyDevice1E, Key_unknown},
+ {EKeyDevice1F, Key_unknown},
+ {EKeyApplication10, Key_unknown},
+ {EKeyApplication11, Key_unknown},
+ {EKeyApplication12, Key_unknown},
+ {EKeyApplication13, Key_unknown},
+ {EKeyApplication14, Key_unknown},
+ {EKeyApplication15, Key_unknown},
+ {EKeyApplication16, Key_unknown},
+ {EKeyApplication17, Key_unknown},
+ {EKeyApplication18, Key_unknown},
+ {EKeyApplication19, Key_unknown},
+ {EKeyApplication1A, Key_unknown},
+ {EKeyApplication1B, Key_unknown},
+ {EKeyApplication1C, Key_unknown},
+ {EKeyApplication1D, Key_unknown},
+ {EKeyApplication1E, Key_unknown},
+ {EKeyApplication1F, Key_unknown}
+ };
+ const int mapSize = int(sizeof(map)/sizeof(map[0]));
+ s60ToQtKeyMap.reserve(mapSize + 5); // +5? docs: Ideally, slightly more than number of items
+ for (int i = 0; i < mapSize; ++i)
+ s60ToQtKeyMap.insert(map[i].s60Key, map[i].qtKey);
+}
+
+int QKeyMapperPrivate::mapS60KeyToQt(TUint s60key)
+{
+ QHash<TUint, int>::const_iterator mapping;
+ mapping = s60ToQtKeyMap.find(s60key);
+ if (mapping != s60ToQtKeyMap.end()) {
+ return *mapping;
+ } else {
+ return Qt::Key_unknown;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qsound.cpp b/src/gui/kernel/qsound.cpp
index fb152cfa40..8246ee3c9c 100644
--- a/src/gui/kernel/qsound.cpp
+++ b/src/gui/kernel/qsound.cpp
@@ -153,6 +153,9 @@ public:
\o Qt for Embedded Linux
\o A built-in mixing sound server is used, accessing \c /dev/dsp
directly. Only the WAVE format is supported.
+ \o Symbian
+ \o CMdaAudioPlayerUtility is used. All formats that Symbian OS or devices support
+ are supported also by Qt.
\endtable
Note that QSound does not support \l{resources.html}{resources}.
diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp
new file mode 100644
index 0000000000..2ac7e269dc
--- /dev/null
+++ b/src/gui/kernel/qsound_s60.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+
+
+#ifndef QT_NO_SOUND
+
+#include "qdir.h"
+#include "qapplication.h"
+#include "qsound.h"
+#include "qsound_p.h"
+#include "qfileinfo.h"
+#include <private/qcore_symbian_p.h>
+
+#include <e32std.h>
+#include <MdaAudioSamplePlayer.h>
+
+QT_BEGIN_NAMESPACE
+
+class QAuServerS60;
+
+class QAuBucketS60 : public QAuBucket, public MMdaAudioPlayerCallback
+{
+public:
+ QAuBucketS60( QAuServerS60 *server, QSound *sound);
+ ~QAuBucketS60();
+
+ void play();
+ void stop();
+
+ inline QSound* sound() const { return m_sound; }
+
+public: // from MMdaAudioPlayerCallback
+ void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
+ void MapcPlayComplete(TInt aError);
+
+private:
+ QSound *m_sound;
+ QAuServerS60 *m_server;
+ bool m_prepared;
+ bool m_playCalled;
+ CMdaAudioPlayerUtility* m_playUtility;
+};
+
+
+class QAuServerS60 : public QAuServer
+{
+public:
+ QAuServerS60( QObject* parent );
+
+ void init( QSound* s )
+ {
+ QAuBucketS60 *bucket = new QAuBucketS60( this, s );
+ setBucket( s, bucket );
+ }
+
+ void play( QSound* s )
+ {
+ bucket( s )->play();
+ }
+
+ void stop( QSound* s )
+ {
+ bucket( s )->stop();
+ }
+
+ bool okay() { return true; }
+
+protected:
+ void playCompleted(QAuBucketS60* bucket, int error)
+ {
+ QSound *sound = bucket->sound();
+ if(!error) {
+ // We need to handle repeats by ourselves, since with Symbian API we don't
+ // know how many loops have been played when user asks it
+ if( decLoop( sound ) ) {
+ play( sound );
+ }
+ } else {
+ // We don't have a way to inform about errors -> just decrement loops
+ // in order that QSound::isFinished will return true;
+ while(decLoop(sound));
+ }
+ }
+
+protected:
+ QAuBucketS60* bucket( QSound *s )
+ {
+ return (QAuBucketS60*)QAuServer::bucket( s );
+ }
+
+ friend class QAuBucketS60;
+
+};
+
+QAuServerS60::QAuServerS60(QObject* parent) :
+ QAuServer(parent)
+{
+ setObjectName(QLatin1String("QAuServerS60"));
+}
+
+
+QAuServer* qt_new_audio_server()
+{
+ return new QAuServerS60(qApp);
+}
+
+QAuBucketS60::QAuBucketS60( QAuServerS60 *server, QSound *sound )
+ : m_sound( sound ), m_server( server ), m_prepared(false), m_playCalled(false)
+{
+ TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
+ QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ filepath = QDir::toNativeSeparators(filepath);
+ m_playUtility->OpenFileL(qt_QString2TPtrC(filepath)));
+ if(err){
+ m_server->playCompleted(this, err);
+ }
+}
+
+void QAuBucketS60::play()
+{
+ if(m_prepared) {
+ // OpenFileL call is completed we can start playing immediately
+ m_playUtility->Play();
+ } else {
+ m_playCalled = true;
+ }
+
+}
+
+void QAuBucketS60::stop()
+{
+ m_playCalled = false;
+ m_playUtility->Stop();
+}
+
+void QAuBucketS60::MapcPlayComplete(TInt aError)
+{
+ m_server->playCompleted(this, aError);
+}
+
+void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
+{
+ if(aError) {
+ m_server->playCompleted(this, aError);
+ } else {
+ m_prepared = true;
+ if(m_playCalled){
+ play();
+ }
+ }
+}
+
+QAuBucketS60::~QAuBucketS60()
+{
+ if(m_playUtility){
+ m_playUtility->Stop();
+ m_playUtility->Close();
+ }
+
+ delete m_playUtility;
+}
+
+
+#endif // QT_NO_SOUND
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
new file mode 100644
index 0000000000..4eac35e6d3
--- /dev/null
+++ b/src/gui/kernel/qt_s60_p.h
@@ -0,0 +1,251 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_S60_P_H
+#define QT_S60_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "QtGui/qwindowdefs.h"
+#include "private/qcore_symbian_p.h"
+#include "qhash.h"
+#include "qpoint.h"
+#include "QtGui/qfont.h"
+#include "QtGui/qimage.h"
+#include "QtGui/qevent.h"
+#include "qpointer.h"
+#include <w32std.h>
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknutils.h> // AknLayoutUtils
+#include <avkon.hrh> // EEikStatusPaneUidTitle
+#include <akntitle.h> // CAknTitlePane
+#include <akncontext.h> // CAknContextPane
+#include <eikspane.h> // CEikStatusPane
+
+QT_BEGIN_NAMESPACE
+
+// Application internal HandleResourceChangeL events,
+// system evens seems to start with 0x10
+const TInt KInternalStatusPaneChange = 0x50000000;
+
+struct QS60Data;
+extern QS60Data *qt_s60Data;
+
+#define S60 qt_s60Data
+
+class QS60Data
+{
+public:
+ TUid uid;
+ int screenDepth;
+ QPoint lastCursorPos;
+ QPoint lastPointerEventPos;
+ QPointer<QWidget> lastPointerEventTarget;
+ QPointer<QWidget> mousePressTarget;
+ int screenWidthInPixels;
+ int screenHeightInPixels;
+ int screenWidthInTwips;
+ int screenHeightInTwips;
+ int defaultDpiX;
+ int defaultDpiY;
+ static inline void updateScreenSize();
+ static inline RWsSession& wsSession();
+ static inline RWindowGroup& windowGroup();
+ static inline CWsScreenDevice* screenDevice();
+ static inline CCoeAppUi* appUi();
+ static inline CEikStatusPane* statusPane();
+ static inline CCoeControl* statusPaneSubPane(TInt aPaneId);
+ static inline CAknTitlePane* titlePane();
+ static inline CAknContextPane* contextPane();
+ static inline CEikButtonGroupContainer* buttonGroupContainer();
+};
+
+class QAbstractLongTapObserver
+{
+public:
+ virtual void HandleLongTapEventL( const TPoint& aPenEventLocation,
+ const TPoint& aPenEventScreenLocation ) = 0;
+};
+class QLongTapTimer;
+
+class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver
+{
+public:
+ DECLARE_TYPE_ID(0x51740000) // Fun fact: the two first values are "Qt" in ASCII.
+
+public:
+ QSymbianControl(QWidget *w);
+ void ConstructL(bool topLevel = false, bool desktop = false);
+ ~QSymbianControl();
+ void HandleResourceChange(int resourceType);
+ void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+#ifndef QT_NO_IM
+ TCoeInputCapabilities InputCapabilities() const;
+#endif
+ TTypeUid::Ptr MopSupplyObject(TTypeUid id);
+
+ inline QWidget* widget() const { return qwidget; };
+ void setWidget(QWidget *w);
+ void sendInputEvent(QWidget *widget, QInputEvent *inputEvent);
+ void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; }
+ void CancelLongTapTimer();
+
+protected:
+ void Draw(const TRect& aRect) const;
+ void SizeChanged();
+ void PositionChanged();
+ void FocusChanged(TDrawNow aDrawNow);
+
+private:
+ TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent);
+ void sendMouseEvent(QWidget *widget, QMouseEvent *mEvent);
+ void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
+
+private:
+ QWidget *qwidget;
+ bool m_ignoreFocusChanged;
+ QLongTapTimer* m_longTapDetector;
+ bool m_previousEventLongTap;
+};
+
+inline void QS60Data::updateScreenSize()
+{
+ TPixelsTwipsAndRotation params;
+ int mode = S60->screenDevice()->CurrentScreenMode();
+ S60->screenDevice()->GetScreenModeSizeAndRotation(mode, params);
+ S60->screenWidthInPixels = params.iPixelSize.iWidth;
+ S60->screenHeightInPixels = params.iPixelSize.iHeight;
+ S60->screenWidthInTwips = params.iTwipsSize.iWidth;
+ S60->screenHeightInTwips = params.iTwipsSize.iHeight;
+
+ TReal inches = S60->screenHeightInTwips / (TReal)KTwipsPerInch;
+ S60->defaultDpiY = S60->screenHeightInPixels / inches;
+ inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
+ S60->defaultDpiX = S60->screenWidthInPixels / inches;
+}
+
+inline RWsSession& QS60Data::wsSession()
+{
+ return CCoeEnv::Static()->WsSession();
+}
+
+inline RWindowGroup& QS60Data::windowGroup()
+{
+ return CCoeEnv::Static()->RootWin();
+}
+
+inline CWsScreenDevice* QS60Data::screenDevice()
+{
+ return CCoeEnv::Static()->ScreenDevice();
+}
+
+inline CCoeAppUi* QS60Data::appUi()
+{
+ return CCoeEnv::Static()-> AppUi();
+}
+
+inline CEikStatusPane* QS60Data::statusPane()
+{
+ return CEikonEnv::Static()->AppUiFactory()->StatusPane();
+}
+
+// Returns the application's status pane control, if not present returns NULL.
+inline CCoeControl* QS60Data::statusPaneSubPane( TInt aPaneId )
+{
+ const TUid paneUid = { aPaneId };
+ CEikStatusPane* statusPane = S60->statusPane();
+ if (statusPane && statusPane->PaneCapabilities(paneUid).IsPresent()) {
+ CCoeControl* control = NULL;
+ // ControlL shouldn't leave because the pane is present
+ TRAPD(err, control = statusPane->ControlL(paneUid));
+ return err != KErrNone ? NULL : control;
+ }
+ return NULL;
+}
+
+// Returns the application's title pane, if not present returns NULL.
+inline CAknTitlePane* QS60Data::titlePane()
+{
+ return static_cast<CAknTitlePane*>(S60->statusPaneSubPane(EEikStatusPaneUidTitle));
+}
+
+// Returns the application's title pane, if not present returns NULL.
+inline CAknContextPane* QS60Data::contextPane()
+{
+ return static_cast<CAknContextPane*>(S60->statusPaneSubPane(EEikStatusPaneUidContext));
+}
+
+inline CEikButtonGroupContainer* QS60Data::buttonGroupContainer()
+{
+ return CEikonEnv::Static()->AppUiFactory()->Cba();
+}
+
+static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec)
+{
+ return QFont(
+ qt_TDesC2QStringL(fontSpec.iTypeface.iName),
+ fontSpec.iHeight / KTwipsPerPoint,
+ fontSpec.iFontStyle.StrokeWeight() == EStrokeWeightNormal ? QFont::Normal : QFont::Bold,
+ fontSpec.iFontStyle.Posture() == EPostureItalic
+ );
+}
+
+static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode)
+{
+ QImage::Format format;
+ switch(mode) {
+ case EColor256:
+ // TODO: is the correct?
+ format = QImage::Format_Indexed8;
+ break;
+ case EColor4K:
+ format = QImage::Format_RGB444;
+ break;
+ case EColor64K:
+ format = QImage::Format_RGB16;
+ break;
+ case EColor16M:
+ format = QImage::Format_RGB666;
+ break;
+ case EColor16MU:
+ format = QImage::Format_RGB32;
+ break;
+ case EColor16MA:
+ format = QImage::Format_ARGB32;
+ break;
+#ifdef __S60_50__
+ case EColor16MAP:
+ format = QImage::Format_ARGB32_Premultiplied;
+ break;
+#endif
+ default:
+ qFatal("Screen format not supported");
+ break;
+ }
+ return format;
+}
+
+
+QT_END_NAMESPACE
+
+#endif // QT_S60_P_H
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index bbf675858c..dae4179fc9 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -99,6 +99,10 @@
#endif
#include <private/qpaintengine_raster_p.h>
+#if defined(Q_WS_S60)
+#include "private/qt_s60_p.h"
+#endif
+
#include "qwidget_p.h"
#include "qaction_p.h"
#include "qlayout_p.h"
@@ -196,6 +200,7 @@ QWidgetPrivate::QWidgetPrivate(int version) :
,needWindowChange(0)
,isGLWidget(0)
#endif
+ ,imHints(Qt::ImhNone)
,polished(0)
, size_policy(QSizePolicy::Preferred, QSizePolicy::Preferred)
@@ -390,6 +395,7 @@ void QWidget::setEditFocus(bool on)
QApplication::sendEvent(f, &event);
QApplication::sendEvent(f->style(), &event);
}
+ f->repaint(); // Widget might want to repaint a focus indicator
}
#endif
@@ -1253,7 +1259,7 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
d->create_sys(window, initializeWindow, destroyOldWindow);
// a real toplevel window needs a backing store
- if (isWindow()) {
+ if (isWindow() && windowType() != Qt::Desktop) {
delete d->topData()->backingStore;
// QWidgetBackingStore will check this variable, hence it must be 0
d->topData()->backingStore = 0;
@@ -1987,6 +1993,9 @@ void QWidgetPrivate::setOpaque(bool opaque)
#ifdef Q_WS_WIN
winUpdateIsOpaque();
#endif
+#ifdef Q_WS_S60
+ s60UpdateIsOpaque();
+#endif
}
void QWidgetPrivate::updateIsTranslucent()
@@ -2000,6 +2009,9 @@ void QWidgetPrivate::updateIsTranslucent()
#ifdef Q_WS_WIN
winUpdateIsOpaque();
#endif
+#ifdef Q_WS_S60
+ s60UpdateIsOpaque();
+#endif
}
/*!
@@ -2034,6 +2046,11 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QPoin
// Defined in qmacstyle_mac.cpp
extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, const QBrush &brush);
qt_mac_fill_background(painter, rgn, offset, brush);
+#elif defined(Q_WS_S60)
+ // Defined in qs60style_symbian.cpp
+ extern void qt_s60_fill_background(QPainter *painter, const QRegion &rgn,
+ const QPoint &offset, const QBrush &brush);
+ qt_s60_fill_background(painter, rgn, offset, brush);
#else
const QRegion translated = rgn.translated(offset);
const QRect rect(translated.boundingRect());
@@ -2061,6 +2078,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, cons
painter->setCompositionMode(QPainter::CompositionMode_Source); //copy alpha straight in
#endif
fillRegion(painter, rgn, offset, bg);
+
}
if (q->autoFillBackground())
@@ -2612,7 +2630,7 @@ bool QWidget::isMaximized() const
*/
Qt::WindowStates QWidget::windowState() const
{
- return (Qt::WindowStates)data->window_state;
+ return Qt::WindowStates(data->window_state);
}
/*!\internal
@@ -2624,7 +2642,7 @@ Qt::WindowStates QWidget::windowState() const
*/
void QWidget::overrideWindowState(Qt::WindowStates newstate)
{
- QWindowStateChangeEvent e((Qt::WindowStates)data->window_state, true);
+ QWindowStateChangeEvent e(Qt::WindowStates(data->window_state), true);
data->window_state = newstate;
QApplication::sendEvent(this, &e);
}
@@ -6745,7 +6763,7 @@ void QWidgetPrivate::show_helper()
// On Windows, show the popup now so that our own focus handling
// stores the correct old focus widget even if it's stolen in the
// showevent
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_S60)
if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q);
#endif
@@ -6762,7 +6780,7 @@ void QWidgetPrivate::show_helper()
show_sys();
-#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_WS_S60)
if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q);
#endif
@@ -7332,7 +7350,7 @@ QSize QWidgetPrivate::adjustedSize() const
#else // all others
QRect screen = QApplication::desktop()->screenGeometry(q->pos());
#endif
-#if defined (Q_OS_WINCE)
+#if defined (Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
s.setWidth(qMin(s.width(), screen.width()));
s.setHeight(qMin(s.height(), screen.height()));
#else
@@ -8470,7 +8488,7 @@ void QWidget::inputMethodEvent(QInputMethodEvent *event)
\a query specifies which property is queried.
- \sa inputMethodEvent(), QInputMethodEvent, QInputContext
+ \sa inputMethodEvent(), QInputMethodEvent, QInputContext, inputMethodHints
*/
QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const
{
@@ -8484,6 +8502,46 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const
}
}
+/*!
+ \property QWidget::inputMethodHints
+ \brief What input method specific hints the widget has.
+
+ This is only relevant for input widgets. It is used by
+ the input method to retrieve hints as to how the input method
+ should operate. For example, if the Qt::ImhFormattedNumbersOnly flag
+ is set, the input method may change its visual components to reflect
+ that only numbers can be entered.
+
+ \note The flags are only hints, so the particular input method
+ implementation is free to ignore them. If you want to be
+ sure that a certain type of characters are entered,
+ you should also set a QValidator on the widget.
+
+ The default value is Qt::ImhNone.
+
+ \since 4.6
+
+ \sa inputMethodQuery(), QInputContext
+*/
+Qt::InputMethodHints QWidget::inputMethodHints() const
+{
+ Q_D(const QWidget);
+ return d->imHints;
+}
+
+void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
+{
+ Q_D(QWidget);
+ d->imHints = hints;
+ // Optimisation to update input context only it has already been created.
+ if (d->ic || qApp->d_func()->inputContext) {
+ QInputContext *ic = inputContext();
+ if (ic)
+ ic->update();
+ }
+}
+
+
#ifndef QT_NO_DRAGANDDROP
/*!
@@ -10311,7 +10369,7 @@ void QWidget::setShortcutAutoRepeat(int id, bool enable)
*/
void QWidget::updateMicroFocus()
{
-#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS))
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_S60))
Q_D(QWidget);
// and optimisation to update input context only it has already been created.
if (d->ic || qApp->d_func()->inputContext) {
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index f54ebf9e09..0dd470de6d 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -212,6 +212,7 @@ class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice
#endif
Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale)
Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath DESIGNABLE isWindow)
+ Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
public:
enum RenderFlag {
@@ -673,6 +674,10 @@ protected:
virtual void inputMethodEvent(QInputMethodEvent *);
public:
virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;
+
+ Qt::InputMethodHints inputMethodHints() const;
+ void setInputMethodHints(Qt::InputMethodHints hints);
+
protected:
void resetInputContext();
protected Q_SLOTS:
@@ -744,6 +749,10 @@ private:
friend bool isWidgetOpaque(const QWidget *);
friend class QGLWidgetPrivate;
#endif
+#ifdef Q_WS_S60
+ friend class QSymbianControl;
+ friend class QS60WindowSurface;
+#endif
#ifdef Q_WS_X11
friend void qt_net_update_user_time(QWidget *tlw, unsigned long timestamp);
friend void qt_net_remove_user_time(QWidget *tlw);
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 2461820e74..d5f1b982b5 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -79,6 +79,13 @@
#include "QtGui/qscreen_qws.h"
#endif
+#if defined(Q_WS_S60)
+class RDrawableWindow;
+class CCoeControl;
+class CAknTitlePane;
+class CAknContextPane;
+#endif
+
QT_BEGIN_NAMESPACE
// Extra QWidget data
@@ -142,6 +149,10 @@ struct QTLWExtra {
uint isMove : 1;
uint embedded : 1;
#endif
+#if defined(Q_WS_S60)
+ uint activated : 1; // RWindowBase::Activated has been called
+ RDrawableWindow *rwindow;
+#endif
#if defined(Q_WS_QWS) && !defined (QT_NO_QWS_MANAGER)
QWSManager *qwsManager;
#endif
@@ -261,6 +272,10 @@ public:
void applyMaxAndMinSizeOnWindow();
#endif
+#ifdef Q_WS_S60
+ void s60UpdateIsOpaque();
+#endif
+
void raise_sys();
void lower_sys();
void stackUnder_sys(QWidget *);
@@ -365,7 +380,7 @@ public:
void x11UpdateIsOpaque();
#endif
-#if defined (Q_WS_WIN)
+#if defined (Q_WS_WIN) || defined (Q_WS_S60)
void reparentChildren();
#endif
@@ -596,7 +611,9 @@ public:
uint isGLWidget : 1;
#endif
-#if defined(Q_WS_X11) || defined (Q_WS_WIN) || defined(Q_WS_MAC)
+ Qt::InputMethodHints imHints;
+
+#if defined(Q_WS_X11) || defined (Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_S60)
#ifdef Q_WS_MAC
void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect());
#else
@@ -624,7 +641,7 @@ public:
QSizePolicy size_policy;
QLocale locale;
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) || defined(Q_WS_S60)
static QWidget *mouseGrabber;
static QWidget *keyboardGrabber;
#endif
@@ -669,6 +686,7 @@ public:
}
QSize adjustedSize() const;
+
};
inline QWExtra *QWidgetPrivate::extraData() const
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
new file mode 100644
index 0000000000..5c3055df08
--- /dev/null
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -0,0 +1,977 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidget_p.h"
+#include "qdesktopwidget.h"
+#include "qapplication.h"
+#include "qapplication_p.h"
+#include "private/qbackingstore_p.h"
+#include "qevent.h"
+#include "qt_s60_p.h"
+
+#include "qbitmap.h"
+#include "private/qwindowsurface_s60_p.h"
+
+#include <qinputcontext.h>
+
+QT_BEGIN_NAMESPACE
+
+extern bool qt_nograb();
+
+QWidget *QWidgetPrivate::mouseGrabber = 0;
+QWidget *QWidgetPrivate::keyboardGrabber = 0;
+
+void QWidgetPrivate::setWSGeometry(bool dontShow)
+{
+
+}
+
+void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
+{
+ Q_Q(QWidget);
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+
+ if ((q->windowType() == Qt::Desktop))
+ return;
+ if (extra) { // any size restrictions?
+ w = qMin(w,extra->maxw);
+ h = qMin(h,extra->maxh);
+ w = qMax(w,extra->minw);
+ h = qMax(h,extra->minh);
+ }
+
+ if (q->isWindow())
+ topData()->normalGeometry = QRect(0, 0, -1, -1);
+ else {
+ uint s = data.window_state;
+ s &= ~(Qt::WindowMaximized | Qt::WindowFullScreen);
+ data.window_state = s;
+ }
+
+ QPoint oldPos(q->pos());
+ QSize oldSize(q->size());
+ QRect oldGeom(data.crect);
+
+ bool isResize = w != oldSize.width() || h != oldSize.height();
+ if (!isMove && !isResize)
+ return;
+
+ if (isResize)
+ data.window_state &= ~Qt::WindowMaximized;
+
+ if(q->isWindow()) {
+ if (w == 0 || h == 0) {
+ q->setAttribute(Qt::WA_OutsideWSRange, true);
+ if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
+ hide_sys();
+ data.crect = QRect(x, y, w, h);
+ data.window_state &= ~Qt::WindowFullScreen;
+ } else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) {
+ q->setAttribute(Qt::WA_OutsideWSRange, false);
+
+ // put the window in its place and show it
+ q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+ data.crect.setRect(x, y, w, h);
+
+ show_sys();
+ } else {
+ QRect r = QRect(x, y, w, h);
+ data.crect = r;
+ q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+ topData()->normalGeometry = data.crect;
+ }
+ } else {
+ data.crect.setRect(x, y, w, h);
+
+ QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
+ const bool inTopLevelResize = tlwExtra ? tlwExtra->inTopLevelResize : false;
+
+ if (q->isVisible() && (!inTopLevelResize || q->internalWinId())) {
+ // Top-level resize optimization does not work for native child widgets;
+ // disable it for this particular widget.
+ if (inTopLevelResize)
+ tlwExtra->inTopLevelResize = false;
+ if (!isResize && maybeBackingStore())
+ moveRect(QRect(oldPos, oldSize), x - oldPos.x(), y - oldPos.y());
+ else
+ invalidateBuffer_resizeHelper(oldPos, oldSize);
+
+ if (inTopLevelResize)
+ tlwExtra->inTopLevelResize = true;
+ }
+ if (q->testAttribute(Qt::WA_WState_Created))
+ setWSGeometry();
+ }
+
+ if (q->isVisible()) {
+ if (isMove && q->pos() != oldPos) {
+ QMoveEvent e(q->pos(), oldPos);
+ QApplication::sendEvent(q, &e);
+ }
+ if (isResize) {
+ bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
+ const bool setTopLevelResize = !slowResize && q->isWindow() && extra && extra->topextra
+ && !extra->topextra->inTopLevelResize;
+ if (setTopLevelResize)
+ extra->topextra->inTopLevelResize = true;
+ QResizeEvent e(q->size(), oldSize);
+ QApplication::sendEvent(q, &e);
+ if (!q->testAttribute(Qt::WA_StaticContents) && q->internalWinId())
+ q->internalWinId()->DrawDeferred();
+ if (setTopLevelResize)
+ extra->topextra->inTopLevelResize = false;
+ }
+ } else {
+ if (isMove && q->pos() != oldPos)
+ q->setAttribute(Qt::WA_PendingMoveEvent, true);
+ if (isResize)
+ q->setAttribute(Qt::WA_PendingResizeEvent, true);
+ }
+}
+
+void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)
+{
+ Q_Q(QWidget);
+
+ Qt::WindowType type = q->windowType();
+ Qt::WindowFlags &flags = data.window_flags;
+ QWidget *parentWidget = q->parentWidget();
+
+ bool topLevel = (flags & Qt::Window);
+ bool popup = (type == Qt::Popup);
+ bool dialog = (type == Qt::Dialog
+ || type == Qt::Sheet
+ || (flags & Qt::MSWindowsFixedSizeDialogHint));
+ bool desktop = (type == Qt::Desktop);
+ bool tool = (type == Qt::Tool || type == Qt::Drawer);
+
+ WId id = 0;
+
+ if (popup)
+ flags |= Qt::WindowStaysOnTopHint; // a popup stays on top
+
+ // always initialize
+ if (!window)
+ initializeWindow = true;
+
+ TRect clientRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ int sw = clientRect.Width();
+ int sh = clientRect.Height();
+
+ if (desktop) {
+ TSize screenSize = S60->screenDevice()->SizeInPixels();
+ data.crect.setRect(0, 0, screenSize.iWidth, screenSize.iHeight);
+ q->setAttribute(Qt::WA_DontShowOnScreen);
+ } else if(topLevel && !q->testAttribute(Qt::WA_Resized)){
+ int width = sw;
+ int height = sh;
+ if (extra) {
+ width = qMax(qMin(width, extra->maxw), extra->minw);
+ height = qMax(qMin(height, extra->maxh), extra->minh);
+ }
+ data.crect.setSize(QSize(width, height));
+ }
+
+ CCoeControl *destroyw = 0;
+
+ if(window) {
+ if (destroyOldWindow)
+ destroyw = data.winid;
+ id = window;
+ setWinId(window);
+ TRect tr = window->Rect();
+ data.crect.setRect(tr.iTl.iX, tr.iTl.iY, tr.Width(), tr.Height());
+
+ } else if (topLevel) {
+ if (!q->testAttribute(Qt::WA_Moved) && !q->testAttribute(Qt::WA_DontShowOnScreen))
+ data.crect.moveTopLeft(QPoint(clientRect.iTl.iX, clientRect.iTl.iY));
+ QSymbianControl *control= new QSymbianControl(q);
+ control->ConstructL(true,desktop);
+ if (!desktop) {
+ QTLWExtra *topExtra = topData();
+ topExtra->rwindow = control->DrawableWindow();
+ // Request mouse move events.
+ topExtra->rwindow->PointerFilter(EPointerFilterEnterExit
+ | EPointerFilterMove | EPointerFilterDrag, 0);
+ topExtra->rwindow->EnableVisibilityChangeEvents();
+
+ if (!isOpaque) {
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA);
+ if (rwindow->SetTransparencyAlphaChannel() == KErrNone)
+ rwindow->SetBackgroundColor(TRgb(255, 255, 255, 0));
+ }
+ }
+
+
+ id = (WId)control;
+
+ setWinId(id);
+
+ q->setAttribute(Qt::WA_WState_Created);
+
+ int x, y, w, h;
+ data.crect.getRect(&x, &y, &w, &h);
+ control->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+ } else if (q->testAttribute(Qt::WA_NativeWindow) || paintOnScreen()) { // create native child widget
+ QSymbianControl *control = new QSymbianControl(q);
+ control->ConstructL(!parentWidget);
+ setWinId(control);
+ WId parentw = parentWidget->effectiveWinId();
+ control->SetContainerWindowL(*parentw);
+
+ q->setAttribute(Qt::WA_WState_Created);
+ int x, y, w, h;
+ data.crect.getRect(&x, &y, &w, &h);
+ control->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+ }
+
+ if (destroyw) {
+ destroyw->ControlEnv()->AppUi()->RemoveFromStack(destroyw);
+ CBase::Delete(destroyw);
+ }
+}
+
+
+void QWidgetPrivate::show_sys()
+{
+ Q_Q(QWidget);
+
+ if (q->testAttribute(Qt::WA_OutsideWSRange))
+ return;
+
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+
+ q->setAttribute(Qt::WA_Mapped);
+
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ invalidateBuffer(q->rect());
+ return;
+ }
+
+ if (q->isWindow() && q->internalWinId()) {
+
+ WId id = q->internalWinId();
+ if (!extra->topextra->activated) {
+ id->ActivateL();
+ extra->topextra->activated = 1;
+ }
+ TInt stackingFlags;
+ if ((q->windowType() & Qt::Popup) == Qt::Popup) {
+ stackingFlags = ECoeStackFlagRefusesAllKeys | ECoeStackFlagRefusesFocus;
+ } else {
+ stackingFlags = ECoeStackFlagStandard;
+ }
+ id->ControlEnv()->AppUi()->AddToStackL(id, ECoeStackPriorityDefault, stackingFlags);
+ id->MakeVisible(true);
+
+ // Force setting of the icon after window is made visible,
+ // this is needed even WA_SetWindowIcon is not set, as in that case we need
+ // to reset to the application level window icon
+ setWindowIcon_sys(true);
+ }
+
+ invalidateBuffer(q->rect());
+}
+
+void QWidgetPrivate::hide_sys()
+{
+ Q_Q(QWidget);
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ deactivateWidgetCleanup();
+ WId id = q->internalWinId();
+ if (q->isWindow() && id) {
+ id->SetFocus(false);
+ id->MakeVisible(false);
+ id->ControlEnv()->AppUi()->RemoveFromStack(id);
+ if (QWidgetBackingStore *bs = maybeBackingStore())
+ bs->releaseBuffer();
+ } else {
+ invalidateBuffer(q->rect());
+ }
+
+ q->setAttribute(Qt::WA_Mapped, false);
+}
+
+void QWidgetPrivate::setFocus_sys()
+{
+ Q_Q(QWidget);
+ if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup)
+ q->effectiveWinId()->SetFocus(true);
+}
+
+void QWidgetPrivate::raise_sys()
+{
+ Q_Q(QWidget);
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ QTLWExtra *tlwExtra = maybeTopData();
+ if (q->internalWinId() && tlwExtra) {
+ tlwExtra->rwindow->SetOrdinalPosition(0);
+ }
+}
+
+void QWidgetPrivate::lower_sys()
+{
+ Q_Q(QWidget);
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ QTLWExtra *tlwExtra = maybeTopData();
+ if (q->internalWinId() && tlwExtra) {
+ tlwExtra->rwindow->SetOrdinalPosition(-1);
+ }
+ if(!q->isWindow())
+ invalidateBuffer(q->rect());
+}
+
+void QWidgetPrivate::setModal_sys()
+{
+
+}
+
+void QWidgetPrivate::stackUnder_sys(QWidget* w)
+{
+ Q_Q(QWidget);
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ QTLWExtra *tlwExtra = maybeTopData();
+ QTLWExtra *tlwExtraSibling = w->d_func()->maybeTopData();
+ if (q->internalWinId() && tlwExtra && w->internalWinId() && tlwExtraSibling)
+ tlwExtra->rwindow->SetOrdinalPosition(tlwExtraSibling->rwindow->OrdinalPosition() + 1);
+ if(!q->isWindow() || !w->internalWinId())
+ invalidateBuffer(q->rect());
+}
+
+void QWidgetPrivate::reparentChildren()
+{
+ Q_Q(QWidget);
+ QObjectList chlist = q->children();
+ for (int i = 0; i < chlist.size(); ++i) { // reparent children
+ QObject *obj = chlist.at(i);
+ if (obj->isWidgetType()) {
+ QWidget *w = (QWidget *)obj;
+ if (!w->testAttribute(Qt::WA_WState_Created))
+ continue;
+ if (!w->isWindow()) {
+ w->d_func()->invalidateBuffer(w->rect());
+ WId parent = q->effectiveWinId();
+ WId child = w->effectiveWinId();
+ if (parent != child)
+ child->SetParent(parent);
+ // ### TODO: We probably also need to update the component array here
+ w->d_func()->reparentChildren();
+ } else {
+ bool showIt = w->isVisible();
+ QPoint old_pos = w->pos();
+ w->setParent(q, w->windowFlags());
+ w->move(old_pos);
+ if (showIt)
+ w->show();
+ }
+ }
+ }
+}
+
+void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
+{
+ Q_Q(QWidget);
+ bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
+
+ if (q->isVisible() && q->parentWidget() && parent != q->parentWidget())
+ q->parentWidget()->d_func()->invalidateBuffer(q->geometry());
+
+ if (q->testAttribute(Qt::WA_DropSiteRegistered))
+ q->setAttribute(Qt::WA_DropSiteRegistered, false);
+
+ WId old_winid = wasCreated ? data.winid : 0;
+ if ((q->windowType() == Qt::Desktop))
+ old_winid = 0;
+ setWinId(0);
+
+ // hide and reparent our own window away. Otherwise we might get
+ // destroyed when emitting the child remove event below. See QWorkspace.
+ if (wasCreated && old_winid) {
+ old_winid->MakeVisible(false);
+ old_winid->ControlEnv()->AppUi()->RemoveFromStack(old_winid);
+ old_winid->SetParent(0);
+ }
+
+ QObjectPrivate::setParent_helper(parent);
+ bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden) && q->testAttribute(Qt::WA_WState_ExplicitShowHide);
+
+ data.window_flags = f;
+ data.fstrut_dirty = true;
+ q->setAttribute(Qt::WA_WState_Created, false);
+ q->setAttribute(Qt::WA_WState_Visible, false);
+ q->setAttribute(Qt::WA_WState_Hidden, false);
+ adjustFlags(data.window_flags, q);
+ // keep compatibility with previous versions, we need to preserve the created state
+ // (but we recreate the winId for the widget being reparented, again for compatibility)
+ if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created)))
+ createWinId();
+ if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
+ q->setAttribute(Qt::WA_WState_Hidden);
+ q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
+
+ if (wasCreated)
+ reparentChildren();
+
+ if (old_winid) {
+ CBase::Delete(old_winid);
+ }
+
+ if (q->testAttribute(Qt::WA_AcceptDrops)
+ || (!q->isWindow() && q->parentWidget() && q->parentWidget()->testAttribute(Qt::WA_DropSiteRegistered)))
+ q->setAttribute(Qt::WA_DropSiteRegistered, true);
+
+ invalidateBuffer(q->rect());
+}
+
+void QWidgetPrivate::setConstraints_sys()
+{
+
+}
+
+
+void QWidgetPrivate::s60UpdateIsOpaque()
+{
+ Q_Q(QWidget);
+
+ if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
+ return;
+
+ if ((data.window_flags & Qt::FramelessWindowHint) == 0)
+ return;
+
+ if (!isOpaque) {
+ QTLWExtra *topExtra = topData();
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA);
+ if (rwindow->SetTransparencyAlphaChannel() == KErrNone)
+ rwindow->SetBackgroundColor(TRgb(255, 255, 255, 0));
+ } else {
+ QTLWExtra *topExtra = topData();
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ rwindow->SetTransparentRegion(TRegionFix<1>());
+ }
+}
+
+CFbsBitmap* qt_pixmapToNativeBitmapL(QPixmap pixmap, bool invert)
+{
+ CFbsBitmap* fbsBitmap = new(ELeave)CFbsBitmap;
+ TSize size(pixmap.size().width(), pixmap.size().height());
+ TDisplayMode mode(EColor16MU);
+
+ bool isNull = pixmap.isNull();
+ int depth = pixmap.depth();
+
+ // TODO: dummy assumptions from bit amounts for each color
+ // Will fix later on when native pixmap is implemented
+ switch(pixmap.depth()) {
+ case 1:
+ mode = EGray2;
+ break;
+ case 4:
+ mode = EColor16;
+ break;
+ case 8:
+ mode = EColor256;
+ break;
+ case 12:
+ mode = EColor4K;
+ break;
+ case 16:
+ mode = EColor64K;
+ break;
+ case 24:
+ mode = EColor16M;
+ break;
+ case 32:
+ case EColor16MU:
+ break;
+ default:
+ qFatal("Unsupported pixmap depth");
+ break;
+ }
+
+ User::LeaveIfError(fbsBitmap->Create(size, mode));
+ fbsBitmap->LockHeap();
+ QImage image = pixmap.toImage();
+
+ if(invert)
+ image.invertPixels();
+
+ int height = pixmap.size().height();
+ for(int i=0;i<height;i++ )
+ {
+ TPtr8 scanline(image.scanLine(i), image.bytesPerLine(), image.bytesPerLine());
+ fbsBitmap->SetScanLine( scanline, i );
+ }
+
+ fbsBitmap->UnlockHeap();
+ return fbsBitmap;
+}
+
+void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
+{
+ Q_Q(QWidget);
+
+ if (!q->testAttribute(Qt::WA_WState_Created) || !q->isWindow() )
+ return;
+
+ QTLWExtra* topData = this->topData();
+ if (topData->iconPixmap && !forceReset)
+ // already been set
+ return;
+
+ TRect cPaneRect;
+ TBool found = AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EContextPane, cPaneRect );
+ CAknContextPane* contextPane = S60->contextPane();
+ if( found && contextPane ) { // We have context pane with valid metrics
+ QIcon icon = q->windowIcon();
+ if (!icon.isNull()) {
+ // Valid icon -> set it as an context pane picture
+ QSize size = icon.actualSize(QSize(cPaneRect.Size().iWidth, cPaneRect.Size().iHeight));
+ QPixmap pm = icon.pixmap(size);
+ QBitmap mask = pm.mask();
+ if (mask.isNull()) {
+ mask = QBitmap(pm.size());
+ mask.fill(Qt::color1);
+ }
+
+ // Convert to CFbsBitmp
+ // TODO: When QPixmap is adapted to use native CFbsBitmap,
+ // it could be set directly to context pane
+ CFbsBitmap* nBitmap = qt_pixmapToNativeBitmapL(pm, false);
+ CFbsBitmap* nMask = qt_pixmapToNativeBitmapL(mask, true);
+
+ contextPane->SetPicture(nBitmap,nMask);
+ } else {
+ // Icon set to null -> set context pane picture to default
+ contextPane->SetPictureToDefaultL();
+ }
+ }
+}
+
+void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
+{
+ Q_Q(QWidget);
+ if(q->isWindow()) {
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ CAknTitlePane* titlePane = S60->titlePane();
+ if(titlePane)
+ titlePane->SetTextL(qt_QString2TPtrC(caption));
+ }
+}
+
+void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
+{
+
+}
+
+void QWidgetPrivate::scroll_sys(int dx, int dy)
+{
+ Q_Q(QWidget);
+
+ scrollChildren(dx, dy);
+ if (!paintOnScreen() || !q->internalWinId() || !q->internalWinId()->OwnsWindow()) {
+ scrollRect(q->rect(), dx, dy);
+ } else {
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ RDrawableWindow* rw = topData()->rwindow;
+ rw->Scroll(TPoint(dx, dy));
+ }
+}
+
+void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
+{
+ Q_Q(QWidget);
+
+ if (!paintOnScreen() || !q->internalWinId() || !q->internalWinId()->OwnsWindow()) {
+ scrollRect(r, dx, dy);
+ } else {
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ RDrawableWindow* rw = topData()->rwindow;
+ rw->Scroll(TPoint(dx, dy), qt_QRect2TRect(r));
+ }
+}
+
+/*!
+ For this function to work in the emulator, you must add:
+ TRANSPARENCY
+ To a line in the wsini.ini file.
+*/
+void QWidgetPrivate::setWindowOpacity_sys(qreal)
+{
+ // ### TODO: Implement uniform window transparency
+}
+
+void QWidgetPrivate::updateFrameStrut()
+{
+
+}
+
+void QWidgetPrivate::updateSystemBackground()
+{
+
+}
+
+void QWidgetPrivate::registerDropSite(bool on)
+{
+
+}
+
+void QWidgetPrivate::createTLSysExtra()
+{
+ extra->topextra->backingStore = 0;
+ extra->topextra->activated = 0;
+ extra->topextra->rwindow = 0;
+}
+
+void QWidgetPrivate::deleteTLSysExtra()
+{
+ delete extra->topextra->backingStore;
+ extra->topextra->backingStore = 0;
+}
+
+void QWidgetPrivate::createSysExtra()
+{
+
+}
+
+void QWidgetPrivate::deleteSysExtra()
+{
+
+}
+
+QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys()
+{
+ return new QS60WindowSurface(q_func());
+}
+
+void QWidgetPrivate::setMask_sys(const QRegion& region)
+{
+
+}
+
+int QWidget::metric(PaintDeviceMetric m) const
+{
+ Q_D(const QWidget);
+ int val;
+ if (m == PdmWidth) {
+ val = data->crect.width();
+ } else if (m == PdmHeight) {
+ val = data->crect.height();
+ } else {
+ CWsScreenDevice *scr = S60->screenDevice();
+ switch(m) {
+ case PdmDpiX:
+ case PdmPhysicalDpiX:
+ if (d->extra && d->extra->customDpiX) {
+ val = d->extra->customDpiX;
+ } else {
+ const QWidgetPrivate *p = d;
+ while (p->parent) {
+ p = static_cast<const QWidget *>(p->parent)->d_func();
+ if (p->extra && p->extra->customDpiX) {
+ val = p->extra->customDpiX;
+ break;
+ }
+ }
+ if (p == d || !(p->extra && p->extra->customDpiX))
+ val = S60->defaultDpiX;
+ }
+ break;
+ case PdmDpiY:
+ case PdmPhysicalDpiY:
+ if (d->extra && d->extra->customDpiY) {
+ val = d->extra->customDpiY;
+ } else {
+ const QWidgetPrivate *p = d;
+ while (p->parent) {
+ p = static_cast<const QWidget *>(p->parent)->d_func();
+ if (p->extra && p->extra->customDpiY) {
+ val = p->extra->customDpiY;
+ break;
+ }
+ }
+ if (p == d || !(p->extra && p->extra->customDpiY))
+ val = S60->defaultDpiY;
+ }
+ break;
+ case PdmWidthMM:
+ {
+ TInt twips = scr->HorizontalPixelsToTwips(data->crect.width());
+ val = (int)(twips * (25.4/KTwipsPerInch));
+ break;
+ }
+ case PdmHeightMM:
+ {
+ TInt twips = scr->VerticalPixelsToTwips(data->crect.height());
+ val = (int)(twips * (25.4/KTwipsPerInch));
+ break;
+ }
+ case PdmNumColors:
+ val = TDisplayModeUtils::NumDisplayModeColors(scr->DisplayMode());
+ break;
+ case PdmDepth:
+ val = TDisplayModeUtils::NumDisplayModeBitsPerPixel(scr->DisplayMode());
+ break;
+ default:
+ val = 0;
+ qWarning("QWidget::metric: Invalid metric command");
+ }
+ }
+ return val;
+}
+
+QPaintEngine *QWidget::paintEngine() const
+{
+ return 0;
+}
+
+QPoint QWidget::mapToGlobal(const QPoint &pos) const
+{
+ Q_D(const QWidget);
+ if (!testAttribute(Qt::WA_WState_Created) || !internalWinId()) {
+
+ QPoint p = pos + data->crect.topLeft();
+ return (isWindow() || !parentWidget()) ? p : parentWidget()->mapToGlobal(p);
+
+ } else if ((d->data.window_flags & Qt::Window) && internalWinId()) { //toplevel
+ QPoint tp = geometry().topLeft();
+ return pos + tp;
+ }
+
+ // This is the native window case. Consider using CCoeControl::PositionRelativeToScreen()
+ // if we decide to go with CCoeControl
+ return QPoint();
+}
+
+QPoint QWidget::mapFromGlobal(const QPoint &pos) const
+{
+ Q_D(const QWidget);
+ if (!testAttribute(Qt::WA_WState_Created) || !internalWinId()) {
+ QPoint p = (isWindow() || !parentWidget()) ? pos : parentWidget()->mapFromGlobal(pos);
+ return p - data->crect.topLeft();
+ } else if ((d->data.window_flags & Qt::Window) && internalWinId()) { //toplevel
+ QPoint tp = geometry().topLeft();
+ return pos - tp;
+ }
+
+ // ### TODO native window
+ return QPoint();
+}
+
+void QWidget::setWindowState(Qt::WindowStates newstate)
+{
+ Q_D(QWidget);
+ Qt::WindowStates oldstate = windowState();
+ if (oldstate == newstate)
+ return;
+
+ if (isWindow()) {
+ createWinId();
+ Q_ASSERT(testAttribute(Qt::WA_WState_Created));
+ QTLWExtra *top = d->topData();
+
+ // Ensure the initial size is valid, since we store it as normalGeometry below.
+ if (!testAttribute(Qt::WA_Resized) && !isVisible())
+ adjustSize();
+
+ if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) {
+ if ((newstate & Qt::WindowMaximized)) {
+ const QRect normalGeometry = geometry();
+
+ const QRect r = top->normalGeometry;
+ setGeometry(qApp->desktop()->availableGeometry(this));
+ top->normalGeometry = r;
+
+ if (top->normalGeometry.width() < 0)
+ top->normalGeometry = normalGeometry;
+ } else {
+ // restore original geometry
+ setGeometry(top->normalGeometry);
+ }
+ }
+ if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) {
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ if (newstate & Qt::WindowFullScreen) {
+ const QRect normalGeometry = geometry();
+ const QRect r = top->normalGeometry;
+ setGeometry(qApp->desktop()->screenGeometry(this));
+ if (statusPane)
+ statusPane->MakeVisible(false);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(false);
+ top->normalGeometry = r;
+ if (top->normalGeometry.width() < 0)
+ top->normalGeometry = normalGeometry;
+ } else {
+ if (statusPane)
+ statusPane->MakeVisible(true);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(true);
+ if (newstate & Qt::WindowMaximized) {
+ const QRect r = top->normalGeometry;
+ setGeometry(qApp->desktop()->availableGeometry(this));
+ top->normalGeometry = r;
+ } else {
+ setGeometry(top->normalGeometry);
+ }
+ }
+ }
+ if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) {
+ if (newstate & Qt::WindowMinimized) {
+ if (isVisible()) {
+ WId id = effectiveWinId();
+ id->MakeVisible(false);
+ id->ControlEnv()->AppUi()->RemoveFromStack(id);
+ }
+ } else {
+ if (isVisible()) {
+ WId id = effectiveWinId();
+ id->MakeVisible(true);
+ id->ControlEnv()->AppUi()->AddToStackL(id);
+ }
+ const QRect normalGeometry = geometry();
+ const QRect r = top->normalGeometry;
+ top->normalGeometry = r;
+ if (top->normalGeometry.width() < 0)
+ top->normalGeometry = normalGeometry;
+ }
+ }
+ }
+
+ data->window_state = newstate;
+
+ if (newstate & Qt::WindowActive)
+ activateWindow();
+
+ QWindowStateChangeEvent e(oldstate);
+ QApplication::sendEvent(this, &e);
+}
+
+
+void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
+{
+ Q_D(QWidget);
+ if (!isWindow() && parentWidget())
+ parentWidget()->d_func()->invalidateBuffer(geometry());
+ d->deactivateWidgetCleanup();
+ if (testAttribute(Qt::WA_WState_Created)) {
+
+#ifndef QT_NO_IM
+ if (d->ic) {
+ delete d->ic;
+ } else {
+ QInputContext *ic = inputContext();
+ if (ic) {
+ ic->widgetDestroyed(this);
+ }
+ }
+#endif
+
+ setAttribute(Qt::WA_WState_Created, false);
+ QObjectList childList = children();
+ for (int i = 0; i < childList.size(); ++i) { // destroy all widget children
+ register QObject *obj = childList.at(i);
+ if (obj->isWidgetType())
+ static_cast<QWidget*>(obj)->destroy(destroySubWindows,
+ destroySubWindows);
+ }
+ if (QWidgetPrivate::mouseGrabber == this)
+ releaseMouse();
+ if (QWidgetPrivate::keyboardGrabber == this)
+ releaseKeyboard();
+ if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) {
+ WId id = internalWinId();
+ id->SetFocus(false);
+ id->ControlEnv()->AppUi()->RemoveFromStack(id);
+ CBase::Delete(id);
+
+ // Hack to activate window under destroyed one. With this activation
+ // the next visible window will get keyboard focus
+ WId wid = CEikonEnv::Static()->AppUi()->TopFocusedControl();
+ if (wid) {
+ QWidget *widget = QWidget::find(wid);
+ QApplication::setActiveWindow(widget);
+ }
+
+ }
+
+ d->setWinId(0);
+ }
+}
+
+QWidget *QWidget::mouseGrabber()
+{
+ return QWidgetPrivate::mouseGrabber;
+}
+
+QWidget *QWidget::keyboardGrabber()
+{
+ return QWidgetPrivate::keyboardGrabber;
+}
+
+void QWidget::grabKeyboard()
+{
+ if (!qt_nograb()) {
+ if (QWidgetPrivate::keyboardGrabber && QWidgetPrivate::keyboardGrabber != this)
+ QWidgetPrivate::keyboardGrabber->releaseKeyboard();
+
+ // ### TODO: Native keyboard grab
+
+ QWidgetPrivate::keyboardGrabber = this;
+ }
+}
+
+void QWidget::releaseKeyboard()
+{
+ if (!qt_nograb() && QWidgetPrivate::keyboardGrabber == this) {
+ // ### TODO: Native keyboard release
+ QWidgetPrivate::keyboardGrabber = 0;
+ }
+}
+
+void QWidget::grabMouse()
+{
+ if (!qt_nograb()) {
+ if (QWidgetPrivate::mouseGrabber && QWidgetPrivate::mouseGrabber != this)
+ QWidgetPrivate::mouseGrabber->releaseMouse();
+ Q_ASSERT(testAttribute(Qt::WA_WState_Created));
+ WId id = effectiveWinId();
+ id->SetPointerCapture(true);
+ QWidgetPrivate::mouseGrabber = this;
+ }
+}
+
+void QWidget::releaseMouse()
+{
+ if (!qt_nograb() && QWidgetPrivate::mouseGrabber == this) {
+ Q_ASSERT(testAttribute(Qt::WA_WState_Created));
+ WId id = effectiveWinId();
+ id->SetPointerCapture(false);
+ QWidgetPrivate::mouseGrabber = 0;
+ }
+}
+
+void QWidget::activateWindow()
+{
+ Q_D(QWidget);
+ QWidget *tlw = window();
+ if (tlw->isVisible()) {
+ S60->windowGroup().SetOrdinalPosition(0);
+ window()->createWinId();
+ RDrawableWindow* rw = tlw->d_func()->topData()->rwindow;
+ rw->SetOrdinalPosition(0);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h
index 85980300d4..0fe8e1aecc 100644
--- a/src/gui/kernel/qwindowdefs.h
+++ b/src/gui/kernel/qwindowdefs.h
@@ -131,6 +131,11 @@ QT_END_HEADER
#endif // Q_WS_QWS
+#if defined(Q_WS_S60)
+class CCoeControl;
+typedef CCoeControl * WId;
+#endif // Q_WS_S60
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 528559c532..33d53e4d5b 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -82,6 +82,7 @@ SOURCES += \
DEFINES += QT_RASTER_IMAGEENGINE
win32:DEFINES += QT_RASTER_PAINTENGINE
embedded:DEFINES += QT_RASTER_PAINTENGINE
+ symbian:DEFINES += QT_RASTER_PAINTENGINE
SOURCES += \
painting/qpaintengine_raster.cpp \
painting/qdrawhelper.cpp \
@@ -162,14 +163,14 @@ unix:x11 {
painting/qprintengine_mac.mm \
}
-unix:!mac {
+unix:!mac:!symbian {
HEADERS += \
painting/qprinterinfo_unix_p.h
SOURCES += \
painting/qprinterinfo_unix.cpp
}
-win32|x11|mac|embedded {
+win32|x11|mac|embedded|symbian {
SOURCES += painting/qbackingstore.cpp
HEADERS += painting/qbackingstore_p.h
}
@@ -186,6 +187,12 @@ embedded {
painting/qpaintdevice_qws.cpp
}
+symbian {
+ SOURCES += \
+ painting/qpaintdevice_s60.cpp \
+ painting/qregion_s60.cpp
+}
+
x11|embedded {
contains(QT_CONFIG,qtopia) {
DEFINES += QT_NO_CUPS QT_NO_LPR
@@ -367,3 +374,18 @@ win32:contains(QT_CONFIG, direct3d) {
SOURCES += painting/qwindowsurface_d3d.cpp
}
+symbian {
+ HEADERS += painting/qwindowsurface_s60_p.h
+ SOURCES += painting/qwindowsurface_s60.cpp
+ armccIfdefBlock = \
+ "$${LITERAL_HASH}if defined(ARMV6)" \
+ "MACRO QT_HAVE_ARMV6" \
+ "SOURCEPATH painting" \
+ "SOURCE qblendfunctions_armv6_rvct.s" \
+ "SOURCE qdrawhelper_armv6_rvct.s" \
+ "$${LITERAL_HASH}endif"
+
+ MMP_RULES += armccIfdefBlock
+ QMAKE_CXXFLAGS.ARMCC *= -O3
+}
+
diff --git a/src/gui/painting/qblendfunctions_armv6_rvct.s b/src/gui/painting/qblendfunctions_armv6_rvct.s
new file mode 100644
index 0000000000..312bd074c7
--- /dev/null
+++ b/src/gui/painting/qblendfunctions_armv6_rvct.s
@@ -0,0 +1,223 @@
+;/****************************************************************************
+;**
+;** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+;** Contact: Qt Software Information (qt-info@nokia.com)
+;**
+;** This file is part of the QtGui module of the Qt Toolkit.
+;**
+;** $QT_BEGIN_LICENSE:LGPL$
+;** No Commercial Usage
+;** This file contains pre-release code and may not be distributed.
+;** You may use this file in accordance with the terms and conditions
+;** contained in the either Technology Preview License Agreement or the
+;** Beta Release License Agreement.
+;**
+;** 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.0, included in the file LGPL_EXCEPTION.txt in this
+;** package.
+;**
+;** GNU General Public License Usage
+;** Alternatively, this file may be used under the terms of the GNU
+;** General Public License version 3.0 as published by the Free Software
+;** Foundation and appearing in the file LICENSE.GPL included in the
+;** packaging of this file. Please review the following information to
+;** ensure the GNU General Public License version 3.0 requirements will be
+;** met: http://www.gnu.org/copyleft/gpl.html.
+;**
+;** If you are unsure which license is appropriate for your use, please
+;** contact the sales department at qt-sales@nokia.com.
+;** $QT_END_LICENSE$
+;**
+;****************************************************************************/
+
+;
+; W A R N I N G
+; -------------
+;
+; This file is not part of the Qt API. It exists purely as an
+; implementation detail. This header file may change from version to
+; version without notice, or even be removed.
+;
+; We mean it.
+;
+
+
+ ARM
+ PRESERVE8
+
+ INCLUDE qdrawhelper_armv6_rvct.inc
+
+
+;-----------------------------------------------------------------------------
+; qt_blend_rgb32_on_rgb32_arm
+;
+; @brief
+;
+; @param dest Destination pixels (r0)
+; @param dbpl Destination bytes per line (r1)
+; @param src Source pixels (r2)
+; @param sbpl Source bytes per line (r3)
+; @param w Width (s0 -> r4)
+; @param h Height (s1 -> r5)
+; @param const_alpha Constant alpha (s2 -> r6)
+;
+;---------------------------------------------------------------------------
+qt_blend_rgb32_on_rgb32_armv6 Function
+ stmfd sp!, {r4-r12, r14}
+
+ ; read arguments off the stack
+ add r8, sp, #10 * 4
+ ldmia r8, {r9-r11}
+
+ ; Reorganize registers
+
+ mov r4, r10
+ mov r5, r1
+ mov r6, r3
+
+ mov r1, r2
+ mov r2, r9
+ mov r3, r11
+
+ ; Now we have registers
+ ; @param dest Destination pixels (r0)
+ ; @param src Source pixels (r1)
+ ; @param w Width (r2)
+ ; @param const_alpha Constant alpha (r3)
+ ; @param h Height (r4)
+ ; @param dbpl Destination bytes per line (r5)
+ ; @param sbpl Source bytes per line (r6)
+
+ cmp r3, #256 ; test if we have fully opaque constant alpha value
+ bne rgb32_blend_const_alpha ; branch if not
+
+rgb32_blend_loop
+
+ subs r4, r4, #1
+ bmi rgb32_blend_exit ; while(h--)
+
+rgb321 PixCpySafe r0, r1, r2
+
+ add r0, r0, r5 ; dest = dest + dbpl
+ add r1, r1, r6 ; src = src + sbpl
+
+ b rgb32_blend_loop
+
+
+rgb32_blend_const_alpha
+
+ ;ldr r14, =ComponentHalf ; load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+ sub r3, r3, #1 ; const_alpha -= 1;
+
+rgb32_blend_loop_const_alpha
+
+ subs r4, r4, #1
+ bmi rgb32_blend_exit ; while(h--)
+
+rgb322 BlendRowSafe PixelSourceOverConstAlpha
+
+ add r0, r0, r5 ; dest = dest + dbpl
+ add r1, r1, r6 ; src = src + sbpl
+
+ b rgb32_blend_loop_const_alpha
+
+rgb32_blend_exit
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+
+
+;-----------------------------------------------------------------------------
+; qt_blend_argb32_on_argb32_arm
+;
+; @brief
+;
+; @param dest Destination pixels (r0)
+; @param dbpl Destination bytes per line (r1)
+; @param src Source pixels (r2)
+; @param sbpl Source bytes per line (r3)
+; @param w Width (s0 -> r4)
+; @param h Height (s1 -> r5)
+; @param const_alpha Constant alpha (s2 -> r6)
+;
+;---------------------------------------------------------------------------
+qt_blend_argb32_on_argb32_armv6 Function
+ stmfd sp!, {r4-r12, r14}
+
+ ; read arguments off the stack
+ add r8, sp, #10 * 4
+ ldmia r8, {r9-r11}
+
+ ; Reorganize registers
+
+ mov r4, r10
+ mov r5, r1
+ mov r6, r3
+
+ mov r1, r2
+ mov r2, r9
+ mov r3, r11
+
+ ; Now we have registers
+ ; @param dest Destination pixels (r0)
+ ; @param src Source pixels (r1)
+ ; @param w Width (r2)
+ ; @param const_alpha Constant alpha (r3)
+ ; @param h Height (r4)
+ ; @param dbpl Destination bytes per line (r5)
+ ; @param sbpl Source bytes per line (r6)
+
+ ;ldr r14, =ComponentHalf ; load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+ cmp r3, #256 ; test if we have fully opaque constant alpha value
+ bne argb32_blend_const_alpha ; branch if not
+
+argb32_blend_loop
+
+ subs r4, r4, #1
+ bmi argb32_blend_exit ; while(h--)
+
+argb321 BlendRowSafe PixelSourceOver
+
+ add r0, r0, r5 ; dest = dest + dbpl
+ add r1, r1, r6 ; src = src + sbpl
+
+ b argb32_blend_loop
+
+argb32_blend_const_alpha
+
+ sub r3, r3, #1 ; const_alpha -= 1;
+
+argb32_blend_loop_const_alpha
+
+ subs r4, r4, #1
+ bmi argb32_blend_exit ; while(h--)
+
+argb322 BlendRowSafe PixelSourceOverConstAlpha
+
+ add r0, r0, r5 ; dest = dest + dbpl
+ add r1, r1, r6 ; src = src + sbpl
+
+ b argb32_blend_loop_const_alpha
+
+argb32_blend_exit
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+
+ END ; File end
+
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 9f2831dfd0..ed4dd579b9 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -38,15 +38,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <private/qdrawhelper_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qpainter_p.h>
#include <private/qdrawhelper_x86_p.h>
+#include <private/qdrawhelper_armv6_p.h>
#include <private/qmath_p.h>
#include <qmath.h>
QT_BEGIN_NAMESPACE
+
#define MASK(src, a) src = BYTE_MUL(src, a)
#if defined(Q_OS_IRIX) && defined(Q_CC_GNU) && __GNUC__ == 3 && __GNUC__ < 4 && QT_POINTER_SIZE == 8
@@ -1497,7 +1500,35 @@ static const uint * QT_FASTCALL fetchConicalGradient(uint *buffer, const Operato
return b;
}
-
+#if defined(Q_CC_RVCT)
+// Force ARM code generation for comp_func_* -methods
+# pragma push
+# pragma arm
+# if defined(QT_HAVE_ARMV6)
+static __forceinline void preload(const uint *start)
+{
+ asm( "pld [start]" );
+}
+static const uint L2CacheLineLength = 32;
+static const uint L2CacheLineLengthInInts = L2CacheLineLength/sizeof(uint);
+# define PRELOAD_INIT(x) preload(x);
+# define PRELOAD_INIT2(x,y) PRELOAD_INIT(x) PRELOAD_INIT(y)
+# define PRELOAD_COND(x) if (((uint)&x[i])%L2CacheLineLength == 0) preload(&x[i] + L2CacheLineLengthInInts);
+// Two consecutive preloads stall, so space them out a bit by using different modulus.
+# define PRELOAD_COND2(x,y) if (((uint)&x[i])%L2CacheLineLength == 0) preload(&x[i] + L2CacheLineLengthInInts); \
+ if (((uint)&y[i])%L2CacheLineLength == 16) preload(&y[i] + L2CacheLineLengthInInts);
+# else
+# define PRELOAD_INIT(x)
+# define PRELOAD_INIT2(x,y)
+# define PRELOAD_COND(x)
+# define PRELOAD_COND2(x,y)
+# endif
+#else
+# define PRELOAD_INIT(x)
+# define PRELOAD_INIT2(x,y)
+# define PRELOAD_COND(x)
+# define PRELOAD_COND2(x,y)
+#endif
/* The constant alpha factor describes an alpha factor that gets applied
to the result of the composition operation combining it with the destination.
@@ -1530,8 +1561,11 @@ static void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint
QT_MEMFILL_UINT(dest, length, 0);
} else {
int ialpha = 255 - const_alpha;
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], ialpha);
+ }
}
}
@@ -1541,8 +1575,11 @@ static void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, ui
QT_MEMFILL_UINT(dest, length, 0);
} else {
int ialpha = 255 - const_alpha;
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], ialpha);
+ }
}
}
@@ -1557,8 +1594,11 @@ static void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint colo
} else {
int ialpha = 255 - const_alpha;
color = BYTE_MUL(color, const_alpha);
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = color + BYTE_MUL(dest[i], ialpha);
+ }
}
}
@@ -1568,8 +1608,11 @@ static void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length
::memcpy(dest, src, length * sizeof(uint));
} else {
int ialpha = 255 - const_alpha;
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha);
+ }
}
}
@@ -1594,20 +1637,26 @@ static void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint
} else {
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color));
+ }
}
}
static void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = src[i];
dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
}
} else {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
}
@@ -1623,7 +1672,9 @@ static void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length,
{
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = d + BYTE_MUL(color, qAlpha(~d));
}
@@ -1631,13 +1682,16 @@ static void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length,
static void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
dest[i] = d + BYTE_MUL(src[i], qAlpha(~d));
}
} else {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = d + BYTE_MUL(s, qAlpha(~d));
@@ -1651,13 +1705,17 @@ static void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, i
*/
static void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
{
+ PRELOAD_INIT(dest)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(color, qAlpha(dest[i]));
+ }
} else {
color = BYTE_MUL(color, const_alpha);
uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia);
}
@@ -1666,12 +1724,16 @@ static void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint co
static void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(src[i], qAlpha(dest[i]));
+ }
} else {
uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia);
@@ -1690,19 +1752,25 @@ static void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, ui
if (const_alpha != 255) {
a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
}
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], a);
}
}
static void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(dest[i], qAlpha(src[i]));
+ }
} else {
int cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia;
dest[i] = BYTE_MUL(dest[i], a);
}
@@ -1716,13 +1784,17 @@ static void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int
static void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
{
+ PRELOAD_INIT(dest)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(color, qAlpha(~dest[i]));
+ }
} else {
color = BYTE_MUL(color, const_alpha);
int cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia);
}
@@ -1731,12 +1803,16 @@ static void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint c
static void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i]));
+ }
} else {
int cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia);
@@ -1754,18 +1830,25 @@ static void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, u
uint a = qAlpha(~color);
if (const_alpha != 255)
a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], a);
+ }
}
static void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
- for (int i = 0; i < length; ++i)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i]));
+ }
} else {
int cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia;
dest[i] = BYTE_MUL(dest[i], sia);
}
@@ -1784,20 +1867,26 @@ static void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint
color = BYTE_MUL(color, const_alpha);
}
uint sia = qAlpha(~color);
- for (int i = 0; i < length; ++i)
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia);
+ }
}
static void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = src[i];
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
}
} else {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
@@ -1817,7 +1906,9 @@ static void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length,
color = BYTE_MUL(color, const_alpha);
a = qAlpha(color) + 255 - const_alpha;
}
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d));
}
@@ -1825,8 +1916,10 @@ static void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length,
static void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = src[i];
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d));
@@ -1834,6 +1927,7 @@ static void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, i
} else {
int cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
uint a = qAlpha(s) + cia;
@@ -1854,7 +1948,9 @@ static void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color,
color = BYTE_MUL(color, const_alpha);
uint sia = qAlpha(~color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia);
}
@@ -1862,14 +1958,17 @@ static void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color,
static void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint const_alpha)
{
+ PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
}
} else {
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
@@ -1920,7 +2019,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int
{
uint s = color;
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
#define MIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
d = (MIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
@@ -1940,7 +2041,9 @@ static void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color,
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1976,7 +2079,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2002,7 +2107,9 @@ static void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint co
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2040,7 +2147,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, i
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2066,7 +2175,9 @@ static void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint colo
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2115,7 +2226,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2141,7 +2254,9 @@ static void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint col
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2184,7 +2299,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, i
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2210,7 +2327,9 @@ static void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint colo
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2253,7 +2372,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2279,7 +2400,9 @@ static void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint col
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2332,7 +2455,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *des
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2358,7 +2483,9 @@ static void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2411,7 +2538,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2437,7 +2566,9 @@ static void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint c
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2487,7 +2618,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2513,7 +2646,9 @@ static void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint c
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2572,7 +2707,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2598,7 +2735,9 @@ static void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint c
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2641,7 +2780,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *des
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2667,7 +2808,9 @@ static void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2704,7 +2847,9 @@ Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_imp
int sg = qGreen(color);
int sb = qBlue(color);
+ PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2730,7 +2875,9 @@ static void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint c
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *dest, const uint *src, int length, const T &coverage)
{
+ PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2756,6 +2903,11 @@ static void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int len
comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#if defined(Q_CC_RVCT)
+// Restore pragma state from previous #pragma arm
+# pragma pop
+#endif
+
static void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
int length,
uint color,
@@ -7404,7 +7556,7 @@ static void qt_alphamapblit_quint32(QRasterBuffer *rasterBuffer,
#endif
{
int ialpha = 255 - coverage;
- dest[i] = BYTE_MUL(c, uint(coverage)) + BYTE_MUL(dest[i], ialpha);
+ dest[i] = INTERPOLATE_PIXEL_255(c, coverage, dest[i], ialpha);
}
}
}
@@ -7445,7 +7597,7 @@ static void qt_alphamapblit_quint32(QRasterBuffer *rasterBuffer,
#endif
{
int ialpha = 255 - coverage;
- dest[xp] = BYTE_MUL(c, uint(coverage)) + BYTE_MUL(dest[xp], ialpha);
+ dest[xp] = INTERPOLATE_PIXEL_255(c, coverage, dest[xp], ialpha);
}
}
@@ -8031,6 +8183,96 @@ static uint detectCPUFeatures()
#endif
}
+#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
+// Move these to qdrawhelper_arm.c when all
+// functions are implemented using arm assembly.
+static CompositionFunctionSolid qt_functionForModeSolid_ARMv6[numCompositionFunctions] = {
+ comp_func_solid_SourceOver,
+ comp_func_solid_DestinationOver,
+ comp_func_solid_Clear,
+ comp_func_solid_Source,
+ comp_func_solid_Destination,
+ comp_func_solid_SourceIn,
+ comp_func_solid_DestinationIn,
+ comp_func_solid_SourceOut,
+ comp_func_solid_DestinationOut,
+ comp_func_solid_SourceAtop,
+ comp_func_solid_DestinationAtop,
+ comp_func_solid_XOR,
+ comp_func_solid_Plus,
+ comp_func_solid_Multiply,
+ comp_func_solid_Screen,
+ comp_func_solid_Overlay,
+ comp_func_solid_Darken,
+ comp_func_solid_Lighten,
+ comp_func_solid_ColorDodge,
+ comp_func_solid_ColorBurn,
+ comp_func_solid_HardLight,
+ comp_func_solid_SoftLight,
+ comp_func_solid_Difference,
+ comp_func_solid_Exclusion,
+ rasterop_solid_SourceOrDestination,
+ rasterop_solid_SourceAndDestination,
+ rasterop_solid_SourceXorDestination,
+ rasterop_solid_NotSourceAndNotDestination,
+ rasterop_solid_NotSourceOrNotDestination,
+ rasterop_solid_NotSourceXorDestination,
+ rasterop_solid_NotSource,
+ rasterop_solid_NotSourceAndDestination,
+ rasterop_solid_SourceAndNotDestination
+};
+
+static CompositionFunction qt_functionForMode_ARMv6[numCompositionFunctions] = {
+ comp_func_SourceOver_armv6,
+ comp_func_DestinationOver,
+ comp_func_Clear,
+ comp_func_Source_armv6,
+ comp_func_Destination,
+ comp_func_SourceIn,
+ comp_func_DestinationIn,
+ comp_func_SourceOut,
+ comp_func_DestinationOut,
+ comp_func_SourceAtop,
+ comp_func_DestinationAtop,
+ comp_func_XOR,
+ comp_func_Plus,
+ comp_func_Multiply,
+ comp_func_Screen,
+ comp_func_Overlay,
+ comp_func_Darken,
+ comp_func_Lighten,
+ comp_func_ColorDodge,
+ comp_func_ColorBurn,
+ comp_func_HardLight,
+ comp_func_SoftLight,
+ comp_func_Difference,
+ comp_func_Exclusion,
+ rasterop_SourceOrDestination,
+ rasterop_SourceAndDestination,
+ rasterop_SourceXorDestination,
+ rasterop_NotSourceAndNotDestination,
+ rasterop_NotSourceOrNotDestination,
+ rasterop_NotSourceXorDestination,
+ rasterop_NotSource,
+ rasterop_NotSourceAndDestination,
+ rasterop_SourceAndNotDestination
+};
+
+static void qt_blend_color_argb_armv6(int count, const QSpan *spans, void *userData)
+{
+ QSpanData *data = reinterpret_cast<QSpanData *>(userData);
+
+ CompositionFunctionSolid func = qt_functionForModeSolid_ARMv6[data->rasterBuffer->compositionMode];
+ while (count--) {
+ uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
+ func(target, spans->len, data->solid.color, spans->coverage);
+ ++spans;
+ }
+}
+
+#endif // Q_CC_RVCT && QT_HAVE_ARMV6
+
+
void qInitDrawhelperAsm()
{
static uint features = 0xffffffff;
@@ -8146,6 +8388,20 @@ void qInitDrawhelperAsm()
#endif // QT_NO_DEBUG
+#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
+ functionForModeAsm = qt_functionForMode_ARMv6;
+ functionForModeSolidAsm = qt_functionForModeSolid_ARMv6;
+
+ qt_memfill32 = qt_memfill32_armv6;
+
+ qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_armv6;
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
+#endif // Q_CC_RVCT && QT_HAVE_ARMV6
+
if (functionForModeSolidAsm) {
const int destinationMode = QPainter::CompositionMode_Destination;
functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode];
diff --git a/src/gui/painting/qdrawhelper_armv6_p.h b/src/gui/painting/qdrawhelper_armv6_p.h
new file mode 100644
index 0000000000..a4c1df2835
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_armv6_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDRAWHELPER_ARMV6_P_H
+#define QDRAWHELPER_ARMV6_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qdrawhelper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
+
+extern "C" void qt_blend_rgb32_on_rgb32_armv6(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+extern "C" void qt_blend_argb32_on_argb32_armv6(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+extern "C" void qt_memfill32_armv6(quint32 *dest, quint32 value, int count);
+
+extern "C" void comp_func_Source_armv6(uint *dest, const uint *src, int length, uint const_alpha);
+extern "C" void comp_func_SourceOver_armv6(uint *dest, const uint *src, int length, uint const_alpha);
+
+#endif // QT_HAVE_ARMV6
+
+QT_END_NAMESPACE
+
+#endif // QDRAWHELPER_ARMV6_P_H
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.inc b/src/gui/painting/qdrawhelper_armv6_rvct.inc
new file mode 100644
index 0000000000..b3e0605ddc
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_armv6_rvct.inc
@@ -0,0 +1,496 @@
+;/****************************************************************************
+;**
+;** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+;** Contact: Qt Software Information (qt-info@nokia.com)
+;**
+;** This file is part of the QtGui module of the Qt Toolkit.
+;**
+;** $QT_BEGIN_LICENSE:LGPL$
+;** No Commercial Usage
+;** This file contains pre-release code and may not be distributed.
+;** You may use this file in accordance with the terms and conditions
+;** contained in the either Technology Preview License Agreement or the
+;** Beta Release License Agreement.
+;**
+;** 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.0, included in the file LGPL_EXCEPTION.txt in this
+;** package.
+;**
+;** GNU General Public License Usage
+;** Alternatively, this file may be used under the terms of the GNU
+;** General Public License version 3.0 as published by the Free Software
+;** Foundation and appearing in the file LICENSE.GPL included in the
+;** packaging of this file. Please review the following information to
+;** ensure the GNU General Public License version 3.0 requirements will be
+;** met: http://www.gnu.org/copyleft/gpl.html.
+;**
+;** If you are unsure which license is appropriate for your use, please
+;** contact the sales department at qt-sales@nokia.com.
+;** $QT_END_LICENSE$
+;**
+;****************************************************************************/
+
+;
+; W A R N I N G
+; -------------
+;
+; This file is not part of the Qt API. It exists purely as an
+; implementation detail. This header file may change from version to
+; version without notice, or even be removed.
+;
+; We mean it.
+;
+
+;-----------------------------------------------------------------------------
+; Globals.
+; Earch marcro expects that caller has loaded 0x800080 to r14.
+;-----------------------------------------------------------------------------
+
+ComponentHalf EQU 0x800080
+
+;-----------------------------------------------------------------------------
+; ARM assembly implementations of accelerated graphics operations.
+;
+; Conventions:
+;
+; - r0 = Target buffer pointer
+; - r1 = Source buffer pointer
+; - r2 = Length of the buffer to blend
+; - r3 = Constant alpha for source buffer
+;
+;-----------------------------------------------------------------------------
+
+; A macro for transparently defining ARM functions
+ MACRO
+$func Function
+ AREA Function_$func, CODE
+ GLOBAL $func
+ ALIGN 4
+ CODE32
+$func
+ MEND
+
+
+;-----------------------------------------------------------------------------
+; Armv6 boosted implementation of BYTE_MUL(...) function found in qdrawhelper_p.h.
+;
+; @param dst Destination register where to store the result
+; @param x Value to multiply
+; @param a Multiplicator byte
+; @param r14 Component half 0x800080
+;
+; @note Trashes x, r8
+;-----------------------------------------------------------------------------
+ MACRO
+ ByteMul $dst, $x, $a
+
+ ; static inline uint BYTE_MUL(uint x, uint a)
+
+ ; uint r8 = (x & 0xff00ff) * a + 0x800080
+ uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
+ mla r8, r8, $a, r14
+
+ ; x = ((r >> 8) & 0xff00ff) * a + 0x800080
+ uxtb16 $x, $x, ror #8
+ mla $x, $x, $a, r14
+
+
+ ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
+ ; r8 &= 0xff00ff
+ uxtab16 r8, r8, r8, ror #8
+ uxtb16 r8, r8, ror #8
+
+ ; x = x + ((x >>8) & 0xff00ff)
+ uxtab16 $x, $x, $x, ror #8
+
+ ; x &= 0xff00ff00
+ ; x |= r8
+ uxtb16 $x, $x, ror #8
+ orr $dst, r8, $x, lsl #8
+
+ MEND
+
+;-----------------------------------------------------------------------------
+; Armv6 boosted implementation of INTERPOLATE_PIXEL_255(...) function found in
+; qdrawhelper_p.h.
+;
+; @param dst Destination register where to store the result
+; @param x First value to multiply
+; @param a Multiplicator byte for first value
+; @param y Second value to multiply
+; @param b Multiplicator byte for second value
+; @param r14 Component half 0x800080
+;
+;
+; @note Trashes x, r8, r14
+;-----------------------------------------------------------------------------
+ MACRO
+ InterpolatePixel255 $dst, $x, $a, $y, $b
+
+ ; static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b)
+
+ ; First calculate the parts where we need 0x800080
+
+ ; uint r8 = (((x & 0xff00ff) * a) + 0x800080)
+ uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
+ mla r8, r8, $a, r14
+
+ ; x = ((((x >> 8) & 0xff00ff) * a) + 0x800080)
+ uxtb16 $x, $x, ror #8
+ mla $x, $x, $a, r14
+
+ ; Now we are trashing r14 to free it for other purposes
+
+ ; uint r14 = (y & 0xff00ff) * b
+ uxtb16 r14, $y ; r14 = y & 0x00FF00FF
+ mul r14, r14, $b
+
+ ; r8 = r8 + r14
+ add r8, r8, r14
+
+ ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
+ ; r8 &= 0xff00ff
+ uxtab16 r8, r8, r8, ror #8
+ uxtb16 r8, r8, ror #8
+
+ ; r14 = ((y >> 8) & 0xff00ff) * b
+ uxtb16 r14, $y, ror #8 ; r14 = ((y >> 8) & 0xFF00FF)
+ mul r14, r14, $b
+
+ ; x = x + r14
+ add $x, $x, r14
+
+ ; x = x + ((x >>8) & 0xff00ff)
+ uxtab16 $x, $x, $x, ror #8
+
+ ; x &= 0xff00ff00
+ ; x |= r8
+ uxtb16 $x, $x, ror #8
+ orr $dst, r8, $x, lsl #8
+
+ MEND
+
+;-----------------------------------------------------------------------------
+;
+;-----------------------------------------------------------------------------
+ MACRO
+$label Blend4Pixels $BlendPixel
+
+ ; Blend first 4 pixels
+
+ ldmia r1!, {r4-r7}
+ ldm r0, {r9-r12}
+
+b4p1_$label $BlendPixel r9, r4, r3
+b4p2_$label $BlendPixel r10, r5, r3
+b4p3_$label $BlendPixel r11, r6, r3
+b4p4_$label $BlendPixel r12, r7, r3
+
+ stmia r0!, {r9-r12}
+
+ MEND
+
+;-----------------------------------------------------------------------------
+;
+;-----------------------------------------------------------------------------
+ MACRO
+$label Blend8Pixels $BlendPixel
+
+b8p1_$label Blend4Pixels $BlendPixel
+b8p2_$label Blend4Pixels $BlendPixel
+
+ MEND
+
+;-----------------------------------------------------------------------------
+;
+;-----------------------------------------------------------------------------
+ MACRO
+$label Blend16Pixels $BlendPixel
+
+b16p1_$label Blend8Pixels $BlendPixel
+b16p2_$label Blend8Pixels $BlendPixel
+
+ MEND
+
+;-----------------------------------------------------------------------------
+;
+;-----------------------------------------------------------------------------
+ MACRO
+$label Blend32Pixels $BlendPixel
+
+b32p1_$label Blend16Pixels $BlendPixel
+b32p2_$label Blend16Pixels $BlendPixel
+
+ MEND
+
+;-----------------------------------------------------------------------------
+; A macro for source over compositing one row of pixels and saving the results
+; to destination buffer.
+;
+; @param dest Destination buffer (r0)
+; @param src Source buffer (r1)
+; @param length Length (r2)
+; @param const_alpha Constant alpha (r3)
+; @param r14 Component Half (0x800080) (r14)
+;
+; @note Advances r0, r1
+; @note Trashes r2, r4-r12
+;-----------------------------------------------------------------------------
+ MACRO
+$label BlendRow $BlendPixel
+
+ pld [r1]
+
+bloop_$label
+ ; Blend 32 pixels per loop iteration
+ subs r2, r2, #32
+ bmi b_remaining_$label
+
+brp1_$label Blend32Pixels $BlendPixel
+
+ b bloop_$label
+
+b_remaining_$label
+
+ ; Remaining 31 pixels
+
+ addmi r2, r2, #32
+
+ ; Blend 16 pixels
+ tst r2, #16
+ beq b_remaining8_$label
+
+brp2_$label Blend16Pixels $BlendPixel
+
+b_remaining8_$label
+
+ ; Blend 8 pixels
+ tst r2, #8
+ beq b_remaining4_$label
+
+brp3_$label Blend8Pixels $BlendPixel
+
+b_remaining4_$label
+
+ ; Blend 4 pixels
+ tst r2, #4
+ beq b_remaining3_$label
+
+brp4_$label Blend4Pixels $BlendPixel
+
+b_remaining3_$label
+
+ ; Remaining 3 pixels
+
+ tst r2, #2
+ beq b_last_$label
+
+ ldmia r1!, {r4-r5}
+ ldm r0, {r9-r10}
+
+brp5_$label $BlendPixel r9, r4, r3
+brp6_$label $BlendPixel r10, r5, r3
+
+ stmia r0!, {r9-r10}
+
+b_last_$label
+
+ tst r2, #1
+ beq bexit_$label
+
+ ldr r4, [r1]
+ ldr r9, [r0]
+
+bpl_$label $BlendPixel r9, r4, r3
+
+ str r9, [r0]
+
+bexit_$label
+
+ MEND
+
+;-----------------------------------------------------------------------------
+; A macro for source over compositing one row of pixels and saving the results
+; to destination buffer. Restores all registers.
+;
+; @param dest Destination buffer (r0)
+; @param src Source buffer (r1)
+; @param length Length (r2)
+; @param const_alpha Constant alpha (r3)
+; @param r14 Component Half (0x800080) (r14)
+;
+; @note Advances r0, r1
+; @note Trashes r2, r4-r12
+;-----------------------------------------------------------------------------
+ MACRO
+$label BlendRowSafe $BlendPixel
+
+ stmfd sp!, {r0-r6} ; Preserves registers only up to r6
+
+brs_$label BlendRow $BlendPixel
+
+ ldmfd sp!, {r0-r6}
+
+ MEND
+
+
+;-----------------------------------------------------------------------------
+; Pix Copy.
+; NOTE! Cache line size of ARM1136JF-S and ARM1136J-S is 32 bytes (8 pixels).
+;
+; @param dst Destination pixels (r0)
+; @param src Source pixels (r1)
+; @param len Length (r2)
+;
+; @note Trashes r3-r10
+;-----------------------------------------------------------------------------
+ MACRO
+$label PixCpy $dst, $src, $len
+
+ pld [$src]
+
+pcpy_loop_$label
+ ; Copy 8 pixels per loop iteration
+ pld [$src, #96]
+ subs $len, $len, #8
+ ldmgeia $src!, {r3-r10}
+ stmgeia $dst!, {r3-r10}
+ bgt pcpy_loop_$label
+
+pcpy_remaining_$label
+
+ ; Copy up to 7 remaining pixels
+
+ ; Copy 4 pixels
+ tst $len, #4
+ ldmneia $src!, {r3-r6}
+ stmneia $dst!, {r3-r6}
+
+ tst $len, #2
+ ldmneia $src!, {r3-r4}
+ stmneia $dst!, {r3-r4}
+
+ tst $len, #1
+ ldrne r3, [$src]
+ strne r3, [$dst]
+
+ MEND
+
+;-----------------------------------------------------------------------------
+; General Pix Copy. Maximum 8 pixels at time. Restores all registers.
+;
+; @param dst Destination pixels (r0)
+; @param src Source pixels (r1)
+; @param len Length (r2)
+;
+; @note Trashes r3-r10
+;-----------------------------------------------------------------------------
+ MACRO
+$label PixCpySafe $dst, $src, $len
+
+ stmfd sp!, {r0-r6} ; Preserves registers only up to r6
+
+pcs_$label PixCpy $dst, $src, $len
+
+ ldmfd sp!, {r0-r6} ; pop
+
+ MEND
+
+
+;-----------------------------------------------------------------------------
+; A macro for source over compositing one pixel and saving the result to
+; dst register.
+;
+; @param dst Destination register, must contain destination pixel upon entry
+; @param src Source register, must contain source pixel upon entry
+; @param const_alpha Constant source alpha
+; @param r14 Component half 0x800080
+;
+; @note Trashes const_alpha, r8
+;-----------------------------------------------------------------------------
+ MACRO
+$label PixelSourceOver $dst, $src, $const_alpha
+
+ ; Negate src and extract alpha
+ mvn $const_alpha, $src ; bitwise not
+ uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
+
+ ;cmp $const_alpha, #255 ; test for full transparency ( negated )
+ ;beq exit_$label
+ cmp $const_alpha, #0 ; test for full opacity ( negated )
+ moveq $dst, $src
+ beq exit_$label
+
+ ByteMul $dst, $dst, $const_alpha
+ add $dst, $src, $dst
+
+exit_$label
+ MEND
+
+;-----------------------------------------------------------------------------
+; A macro for source over compositing one pixel and saving the result to
+; dst register.
+;
+; @param dst Destination register, must contain destination pixel upon entry
+; @param src Source register, must contain source pixel upon entry
+; @param const_alpha Constant source alpha
+; @param r14 Component half 0x800080
+;
+; @note Trashes src, const_alpha, r8
+;-----------------------------------------------------------------------------
+ MACRO
+$label PixelSourceOverConstAlpha $dst, $src, $const_alpha
+
+ ; store alpha because we are going to trash it
+ stmfd sp!, {$const_alpha}
+
+ ByteMul $src, $src, $const_alpha
+
+ ; Negate src and extract alpha
+ mvn $const_alpha, $src ; bitwise not
+ uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
+
+ ByteMul $dst, $dst, $const_alpha
+
+ add $dst, $src, $dst
+
+ ; recover alpha
+ ldmfd sp!, {$const_alpha}
+
+ MEND
+
+;-----------------------------------------------------------------------------
+; A macro for source over compositing one pixel and saving the result to
+; a register.
+;
+; @param dst Destination register, must contain destination pixel upon entry
+; @param src Source register, must contain source pixel upon entry
+; @param const_alpha Constant source alpha
+; @param r14 Component half 0x800080
+;
+; @note Trashes src, r8
+;-----------------------------------------------------------------------------
+ MACRO
+$label PixelSourceConstAlpha $dst, $src, $const_alpha
+
+ ; store r2 and r14 because we are going to trash them
+ stmfd sp!, {r2, r14}
+
+ rsb r2, $const_alpha, #255
+ InterpolatePixel255 $dst, $src, $const_alpha, $dst, r2
+
+ ; recover r2 and r14
+ ldmfd sp!, {r2, r14}
+
+ MEND
+
+ END ; File end
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.s b/src/gui/painting/qdrawhelper_armv6_rvct.s
new file mode 100644
index 0000000000..3ffe48b3e3
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_armv6_rvct.s
@@ -0,0 +1,178 @@
+;/****************************************************************************
+;**
+;** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+;** Contact: Qt Software Information (qt-info@nokia.com)
+;**
+;** This file is part of the QtGui module of the Qt Toolkit.
+;**
+;** $QT_BEGIN_LICENSE:LGPL$
+;** No Commercial Usage
+;** This file contains pre-release code and may not be distributed.
+;** You may use this file in accordance with the terms and conditions
+;** contained in the either Technology Preview License Agreement or the
+;** Beta Release License Agreement.
+;**
+;** 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.0, included in the file LGPL_EXCEPTION.txt in this
+;** package.
+;**
+;** GNU General Public License Usage
+;** Alternatively, this file may be used under the terms of the GNU
+;** General Public License version 3.0 as published by the Free Software
+;** Foundation and appearing in the file LICENSE.GPL included in the
+;** packaging of this file. Please review the following information to
+;** ensure the GNU General Public License version 3.0 requirements will be
+;** met: http://www.gnu.org/copyleft/gpl.html.
+;**
+;** If you are unsure which license is appropriate for your use, please
+;** contact the sales department at qt-sales@nokia.com.
+;** $QT_END_LICENSE$
+;**
+;****************************************************************************/
+
+;
+; W A R N I N G
+; -------------
+;
+; This file is not part of the Qt API. It exists purely as an
+; implementation detail. This header file may change from version to
+; version without notice, or even be removed.
+;
+; We mean it.
+;
+
+ ARM
+ PRESERVE8
+
+ INCLUDE qdrawhelper_armv6_rvct.inc
+
+;-----------------------------------------------------------------------------
+; qt_memfill32_armv6
+;
+; @brief Not yet in use!
+;
+; @param dest Destination buffer (r0)
+; @param value Value (r1)
+; @param count Count (r2)
+;
+;---------------------------------------------------------------------------
+qt_memfill32_armv6 Function
+ stmfd sp!, {r4-r12, r14}
+
+ mov r3, r1
+ mov r4, r1
+ mov r5, r1
+ mov r6, r1
+ mov r7, r1
+ mov r8, r1
+ mov r9, r1
+
+mfill_loop
+ ; Fill 32 pixels per loop iteration
+ subs r2, r2, #32
+ stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+ stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+ stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+ stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+ bgt mfill_loop
+
+mfill_remaining
+
+ ; Fill up to 31 remaining pixels
+
+ ; Fill 16 pixels
+ tst r2, #16
+ stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+ stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+
+ ; Fill 8 pixels
+ tst r2, #8
+ stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
+
+ ; Fill 4 pixels
+ tst r2, #4
+ stmneia r0!, {r1, r3, r4, r5}
+
+ ; Fill 2 pixels
+ tst r2, #2
+ stmneia r0!, {r1, r3}
+
+ ; Fill last one
+ tst r2, #1
+ strne r1, [r0]
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+;-----------------------------------------------------------------------------
+; comp_func_Source_arm
+;
+; @brief
+;
+; @param dest Destination buffer (r0)
+; @param src Source buffer (r1)
+; @param length Length (r2)
+; @param const_alpha Constant alpha (r3)
+;
+;---------------------------------------------------------------------------
+comp_func_Source_armv6 Function
+ stmfd sp!, {r4-r12, r14}
+
+ cmp r3, #255 ; if(r3 == 255)
+ bne src2 ; branch if not
+
+src1 PixCpy r0, r1, r2
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+src2
+ ;ldr r14, =ComponentHalf ; load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+src22 BlendRow PixelSourceConstAlpha
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+;-----------------------------------------------------------------------------
+; comp_func_SourceOver_arm
+;
+; @brief
+;
+; @param dest Destination buffer (r0)
+; @param src Source buffer (r1)
+; @param length Length (r2)
+; @param const_alpha Constant alpha (r3)
+;
+;---------------------------------------------------------------------------
+comp_func_SourceOver_armv6 Function
+ stmfd sp!, {r4-r12, r14}
+
+ ;ldr r14, =ComponentHalf ; load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+ cmp r3, #255 ; if(r3 == 255)
+ bne srcovr2 ; branch if not
+
+srcovr1 BlendRow PixelSourceOver
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+srcovr2
+
+srcovr22 BlendRow PixelSourceOverConstAlpha
+
+ ldmfd sp!, {r4-r12, pc} ; pop and return
+
+
+ END ; File end
+
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index de97683c29..ddda7f782f 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
#if defined(Q_CC_RVCT)
// RVCT doesn't like static template functions
# define Q_STATIC_TEMPLATE_FUNCTION
-# define Q_STATIC_INLINE_FUNCTION inline
+# define Q_STATIC_INLINE_FUNCTION static __forceinline
#else
# define Q_STATIC_TEMPLATE_FUNCTION static
# define Q_STATIC_INLINE_FUNCTION static inline
@@ -300,19 +300,23 @@ struct QSpanData
};
-static inline uint BYTE_MUL_RGB16(uint x, uint a) {
+Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a) {
a += 1;
uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0;
t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f;
return t;
}
-static inline uint BYTE_MUL_RGB16_32(uint x, uint a) {
+Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16_32(uint x, uint a) {
uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0;
t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f;
return t;
}
+#if defined(Q_CC_RVCT)
+# pragma push
+# pragma arm
+#endif
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) {
uint t = (x & 0xff00ff) * a;
t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
@@ -324,8 +328,11 @@ Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) {
x |= t;
return x;
}
+#if defined(Q_CC_RVCT)
+# pragma pop
+#endif
-static inline uint PREMUL(uint x) {
+Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) {
uint a = x >> 24;
uint t = (x & 0xff00ff) * a;
t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
@@ -390,7 +397,7 @@ public:
return qt_colorConvert<quint16, quint32>(data, 0);
}
- static inline quint32p fromRawData(quint32 v)
+ Q_STATIC_INLINE_FUNCTION quint32p fromRawData(quint32 v)
{
quint32p p;
p.data = v;
@@ -421,7 +428,7 @@ class qrgb565;
class qargb8565
{
public:
- static inline bool hasAlpha() { return true; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return true; }
inline qargb8565() {}
inline qargb8565(quint32 v);
@@ -438,8 +445,8 @@ public:
data[1] &= 0xdf;
return *this;
}
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 3; }
- static inline quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 3; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
inline qargb8565 byte_mul(quint8 a) const;
inline qargb8565 operator+(qargb8565 v) const;
@@ -456,7 +463,7 @@ private:
class qrgb565
{
public:
- static inline bool hasAlpha() { return false; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return false; }
qrgb565(int v = 0) : data(v) {}
@@ -471,8 +478,8 @@ public:
inline quint8 alpha() const { return 0xff; }
inline qrgb565 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 3; }
- static inline quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 3; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
inline qrgb565 byte_mul(quint8 a) const;
@@ -647,7 +654,7 @@ class qrgb555;
class qargb8555
{
public:
- static inline bool hasAlpha() { return true; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return true; }
qargb8555() {}
inline qargb8555(quint32 v);
@@ -659,8 +666,8 @@ public:
inline quint8 alpha() const { return data[0]; }
inline qargb8555 truncedAlpha() { data[0] &= 0xf8; return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 3; }
- static inline quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 3; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
inline qargb8555 operator+(qargb8555 v) const;
inline qargb8555 byte_mul(quint8 a) const;
@@ -677,7 +684,7 @@ private:
class qrgb555
{
public:
- static inline bool hasAlpha() { return false; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return false; }
inline qrgb555(int v = 0) : data(v) {}
@@ -726,8 +733,8 @@ public:
inline quint8 alpha() const { return 0xff; }
inline qrgb555 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 3; }
- static inline quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 3; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x20 - alpha(a); }
inline bool operator==(const qrgb555 &v) const { return v.data == data; }
inline bool operator!=(const qrgb555 &v) const { return v.data != data; }
@@ -875,7 +882,7 @@ class qrgb666;
class qargb6666
{
public:
- static inline bool hasAlpha() { return true; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return true; }
inline qargb6666() {}
inline qargb6666(quint32 v) { *this = qargb6666(quint32p(v)); }
@@ -887,8 +894,8 @@ public:
inline quint8 alpha() const;
inline qargb6666 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 2; }
- static inline quint8 ialpha(quint8 a) { return (255 - a + 1) >> 2; }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 2; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return (255 - a + 1) >> 2; }
inline qargb6666 byte_mul(quint8 a) const;
inline qargb6666 operator+(qargb6666 v) const;
@@ -905,7 +912,7 @@ private:
class qrgb666
{
public:
- static inline bool hasAlpha() { return false; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return false; }
inline qrgb666() {}
inline qrgb666(quint32 v);
@@ -915,8 +922,8 @@ public:
inline quint8 alpha() const { return 0xff; }
inline qrgb666 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 2; }
- static inline quint8 ialpha(quint8 a) { return (255 - a + 1) >> 2; }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 2; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return (255 - a + 1) >> 2; }
inline qrgb666 operator+(qrgb666 v) const;
inline qrgb666 byte_mul(quint8 a) const;
@@ -1073,7 +1080,7 @@ quint32 qargb6666::rawValue() const
class qrgb888
{
public:
- static inline bool hasAlpha() { return false; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return false; }
inline qrgb888() {}
inline qrgb888(quint32 v);
@@ -1082,8 +1089,8 @@ public:
inline quint8 alpha() const { return 0xff; }
inline qrgb888 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return a; }
- static inline quint8 ialpha(quint8 a) { return 255 - a; }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return a; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 255 - a; }
inline qrgb888 byte_mul(quint8 a) const;
inline qrgb888 operator+(qrgb888 v) const;
@@ -1262,7 +1269,7 @@ class qrgb444;
class qargb4444
{
public:
- static inline bool hasAlpha() { return true; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return true; }
inline qargb4444() {}
inline qargb4444(quint32 v) { *this = qargb4444(quint32p(v)); }
@@ -1276,8 +1283,8 @@ public:
inline quint8 alpha() const { return ((data & 0xf000) >> 8) | ((data & 0xf000) >> 12); }
inline qargb4444 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 4; }
- static inline quint8 ialpha(quint8 a) { return 0x10 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 4; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x10 - alpha(a); }
inline qargb4444 byte_mul(quint8 a) const;
inline bool operator==(const qargb4444 &v) const { return data == v.data; }
@@ -1293,7 +1300,7 @@ private:
class qrgb444
{
public:
- static inline bool hasAlpha() { return false; }
+ Q_STATIC_INLINE_FUNCTION bool hasAlpha() { return false; }
inline qrgb444() {}
inline qrgb444(quint32 v);
@@ -1305,8 +1312,8 @@ public:
inline qrgb444 operator+(qrgb444 v) const;
inline quint8 alpha() const { return 0xff; }
inline qrgb444 truncedAlpha() { return *this; }
- static inline quint8 alpha(quint8 a) { return (a + 1) >> 4; }
- static inline quint8 ialpha(quint8 a) { return 0x10 - alpha(a); }
+ Q_STATIC_INLINE_FUNCTION quint8 alpha(quint8 a) { return (a + 1) >> 4; }
+ Q_STATIC_INLINE_FUNCTION quint8 ialpha(quint8 a) { return 0x10 - alpha(a); }
inline qrgb444 byte_mul(quint8 a) const;
inline bool operator==(const qrgb444 &v) const { return data == v.data; }
@@ -1767,7 +1774,14 @@ do { \
} \
} while (0)
+#if defined(Q_CC_RVCT)
+# pragma push
+# pragma arm
+#endif
Q_STATIC_INLINE_FUNCTION int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; }
+#if defined(Q_CC_RVCT)
+# pragma pop
+#endif
inline ushort qConvertRgb32To16(uint c)
{
@@ -1810,7 +1824,7 @@ inline int qBlue565(quint16 rgb) {
}
#if 1
-static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
+Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;
t >>= 8;
t &= 0xff00ff;
@@ -1821,7 +1835,11 @@ static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
return x;
}
-static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) {
+#if defined(Q_CC_RVCT)
+# pragma push
+# pragma arm
+#endif
+Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) {
uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;
t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
t &= 0xff00ff;
@@ -1832,9 +1850,12 @@ static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) {
x |= t;
return x;
}
+#if defined(Q_CC_RVCT)
+# pragma pop
+#endif
#else
// possible implementation for 64 bit
-static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
+Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a;
t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b;
t >>= 8;
@@ -1842,7 +1863,7 @@ static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
return (uint(t)) | (uint(t >> 24));
}
-static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) {
+Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) {
ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a;
t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b;
t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080);
@@ -1857,7 +1878,7 @@ Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) {
return (uint(t)) | (uint(t >> 24));
}
-static inline uint PREMUL(uint x) {
+Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) {
uint a = x >> 24;
ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a;
t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080);
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 7b1f637f8b..7248d27f3e 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -44,7 +44,7 @@
#ifdef Q_WS_X11
# include <private/qpixmap_x11_p.h>
#endif
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN) || defined(Q_WS_S60)
# include <private/qpixmap_raster_p.h>
#endif
#ifdef Q_WS_MAC
@@ -64,7 +64,7 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ
#endif
#if defined(Q_WS_X11)
return new QX11PixmapData(type);
-#elif defined(Q_WS_WIN)
+#elif defined(Q_WS_WIN) || defined(Q_WS_S60)
return new QRasterPixmapData(type);
#elif defined(Q_WS_MAC)
return new QMacPixmapData(type);
diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp
index d6afa53f46..99158c8cee 100644
--- a/src/gui/painting/qgraphicssystemfactory.cpp
+++ b/src/gui/painting/qgraphicssystemfactory.cpp
@@ -64,7 +64,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key)
if (system.isEmpty()) {
system = QLatin1String("opengl");
}
-#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN)
+#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_WS_S60)
if (system.isEmpty()) {
system = QLatin1String("raster");
}
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 73e50dabb9..b057b5f445 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -158,7 +158,12 @@
#include <private/qrasterdefs_p.h>
#include <private/qgrayraster_p.h>
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#include <stdio.h>
/* This macro is used to indicate that a function parameter is unused. */
diff --git a/src/gui/painting/qpaintdevice_s60.cpp b/src/gui/painting/qpaintdevice_s60.cpp
new file mode 100644
index 0000000000..ec1b765bfc
--- /dev/null
+++ b/src/gui/painting/qpaintdevice_s60.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qpaintdevice.h"
+#include "qpainter.h"
+#include "qwidget.h"
+#include "qbitmap.h"
+#include "qapplication.h"
+#include <private/qapplication_p.h>
+#include "qprinter.h"
+
+QT_BEGIN_NAMESPACE
+
+QPaintDevice::QPaintDevice()
+{
+ painters = 0;
+}
+
+
+QPaintDevice::~QPaintDevice()
+{
+ if (paintingActive())
+ qWarning("QPaintDevice: Cannot destroy paint device that is being "
+ "painted. Be sure to QPainter::end() painters!");
+}
+
+int QPaintDevice::metric(PaintDeviceMetric) const
+{
+ qWarning("QPaintDevice::metrics: Device has no metric information");
+ return 0;
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 847904bc30..1192a58525 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -91,6 +91,8 @@
# include <private/qfontengine_qpf_p.h>
# endif
# include <private/qabstractfontengine_p.h>
+#elif defined(Q_WS_S60) && defined(QT_NO_FREETYPE)
+# include <private/qfontengine_s60_p.h>
#endif
#if defined(Q_WS_WIN64)
@@ -3186,7 +3188,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
ensurePen();
ensureState();
-#if defined (Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined (Q_WS_WIN) || defined(Q_WS_MAC) || (defined(Q_WS_S60) && defined(QT_NO_FREETYPE))
bool drawCached = true;
@@ -3219,7 +3221,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
return;
}
-#else // Q_WS_WIN || Q_WS_MAC
+#else // Q_WS_WIN || Q_WS_MAC || Q_WS_S60 && QT_NO_FREETYPE
QFontEngine *fontEngine = ti.fontEngine;
@@ -3239,7 +3241,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
}
#endif // Q_WS_QWS
-#if (defined(Q_WS_X11) || defined(Q_WS_QWS)) && !defined(QT_NO_FREETYPE)
+#if (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_S60)) && !defined(QT_NO_FREETYPE)
#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_QPF2)
if (fontEngine->type() == QFontEngine::QPF2) {
@@ -4195,8 +4197,14 @@ int QCustomRasterPaintDevice::bytesPerLine() const
{
return (width() * depth() + 7) / 8;
}
-#endif // Q_WS_QWS
+#elif defined(Q_WS_S60)
+
+void QRasterBuffer::prepareBuffer(int width, int height)
+{
+}
+
+#endif // Q_WS_S60
/*!
\class QCustomRasterPaintDevice
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index 981ca845de..8e14eb5687 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -160,8 +160,6 @@ public:
Direction directionTo(int vertex) const;
int vertex(Direction direction) const;
- bool isBezier() const;
-
private:
int m_next[2][2];
};
@@ -347,11 +345,6 @@ inline int QPathEdge::vertex(Direction direction) const
return direction == Backward ? first : second;
}
-inline bool QPathEdge::isBezier() const
-{
- return bezier >= 0;
-}
-
inline QPathVertex::QPathVertex(const QPointF &p, int e)
: edge(e)
, x(p.x())
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index c09087761e..f67b2b74aa 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -59,7 +59,7 @@ QT_MODULE(Gui)
template <class T> class QVector;
class QVariant;
-#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE) || defined(Q_WS_S60)
struct QRegionPrivate;
#endif
@@ -199,7 +199,7 @@ private:
#elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
mutable RgnHandle unused; // Here for binary compatability reasons. ### Qt 5 remove.
#endif
-#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE) || defined(Q_WS_S60)
QRegionPrivate *qt_rgn;
#endif
};
diff --git a/src/gui/painting/qregion_s60.cpp b/src/gui/painting/qregion_s60.cpp
new file mode 100644
index 0000000000..4504118291
--- /dev/null
+++ b/src/gui/painting/qregion_s60.cpp
@@ -0,0 +1,22 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qbitmap.h"
+#include "qbuffer.h"
+#include "qimage.h"
+#include "qpolygon.h"
+#include "qregion.h"
+
+QT_BEGIN_NAMESPACE
+
+QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1), 0 };
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qtessellator.cpp b/src/gui/painting/qtessellator.cpp
index e02f02d2d4..a3f00e2a49 100644
--- a/src/gui/painting/qtessellator.cpp
+++ b/src/gui/painting/qtessellator.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
#ifdef DEBUG
#define QDEBUG qDebug
#else
-#define QDEBUG if (1); else qDebug
+#define QDEBUG if (1){} else qDebug
#endif
static const bool emit_clever = true;
@@ -703,7 +703,6 @@ struct QCoincidingEdge {
}
};
-
static void cancelEdges(QCoincidingEdge &e1, QCoincidingEdge &e2)
{
if (e1.before) {
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
new file mode 100644
index 0000000000..2618ce2d21
--- /dev/null
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <qglobal.h> // for Q_WS_WIN define (non-PCH)
+
+#include <QtGui/qpaintdevice.h>
+#include <private/qwidget_p.h>
+#include "qwindowsurface_s60_p.h"
+#include "qt_s60_p.h"
+#include "private/qdrawhelper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+struct QS60WindowSurfacePrivate
+{
+ QImage device;
+ CFbsBitmap *bitmap;
+ uchar* bytes;
+
+ // Since only one CFbsBitmap is allowed to be locked at a time, this is static.
+ static QS60WindowSurface* lockedSurface;
+};
+QS60WindowSurface* QS60WindowSurfacePrivate::lockedSurface = NULL;
+
+QS60WindowSurface::QS60WindowSurface(QWidget* widget)
+ : QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate)
+{
+ d_ptr->bytes = 0;
+ d_ptr->bitmap = 0;
+
+ TDisplayMode mode = S60->screenDevice()->DisplayMode();
+ bool isOpaque = qt_widget_private(widget)->isOpaque;
+ if (mode == EColor16MA && isOpaque)
+ mode = EColor16MU; // Faster since 16MU -> 16MA is typically accelerated
+ else if (mode == EColor16MU && !isOpaque)
+ mode = EColor16MA; // Try for transparency anyway
+
+
+ // We create empty CFbsBitmap here -> it will be resized in setGeometry
+ d_ptr->bitmap = new (ELeave) CFbsBitmap;
+ User::LeaveIfError( d_ptr->bitmap->Create(TSize(0, 0), mode ) );
+
+ updatePaintDeviceOnBitmap();
+
+ setStaticContentsSupport(true);
+}
+
+QS60WindowSurface::~QS60WindowSurface()
+{
+ // Ensure that locking and unlocking of this surface were symmetrical
+ Q_ASSERT(QS60WindowSurfacePrivate::lockedSurface != this);
+
+ delete d_ptr->bitmap;
+ delete d_ptr;
+}
+
+void QS60WindowSurface::beginPaint(const QRegion &rgn)
+{
+ if(!d_ptr->bitmap)
+ return;
+
+ Q_ASSERT(!QS60WindowSurfacePrivate::lockedSurface);
+ QS60WindowSurfacePrivate::lockedSurface = this;
+ lockBitmapHeap();
+
+ if (!qt_widget_private(window())->isOpaque) {
+ QRgb *data = reinterpret_cast<QRgb *>(d_ptr->device.bits());
+ const int row_stride = d_ptr->device.bytesPerLine() / 4;
+
+ const QVector<QRect> rects = rgn.rects();
+ for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
+ const int x_start = it->x();
+ const int width = it->width();
+
+ const int y_start = it->y();
+ const int height = it->height();
+
+ QRgb *row = data + row_stride * y_start;
+ for (int y = 0; y < height; ++y) {
+ qt_memfill(row + x_start, 0U, width);
+ row += row_stride;
+ }
+ }
+ }
+}
+
+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]);
+ widget->winId()->DrawNow(tr);
+ }
+}
+
+bool QS60WindowSurface::scroll(const QRegion &area, int dx, int dy)
+{
+ QRect rect = area.boundingRect();
+
+ if (dx == 0 && dy == 0)
+ return false;
+
+ if (d_ptr->device.isNull())
+ return false;
+
+ CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(d_ptr->bitmap);
+ CBitmapContext *bitmapContext;
+ TInt err = bitmapDevice->CreateBitmapContext(bitmapContext);
+ if (err != KErrNone) {
+ CBase::Delete(bitmapDevice);
+ return false;
+ }
+ bitmapContext->CopyRect(TPoint(dx, dy), qt_QRect2TRect(rect));
+ CBase::Delete(bitmapContext);
+ CBase::Delete(bitmapDevice);
+ return true;
+}
+
+void QS60WindowSurface::endPaint(const QRegion &rgn)
+{
+ if(!d_ptr->bitmap)
+ return;
+
+ Q_ASSERT(QS60WindowSurfacePrivate::lockedSurface);
+ unlockBitmapHeap();
+ QS60WindowSurfacePrivate::lockedSurface = NULL;
+}
+
+QPaintDevice* QS60WindowSurface::paintDevice()
+{
+ return &d_ptr->device;
+}
+
+void QS60WindowSurface::setGeometry(const QRect& rect)
+{
+ if (rect == geometry())
+ return;
+
+ QWindowSurface::setGeometry(rect);
+
+ TRect nativeRect(qt_QRect2TRect(rect));
+ User::LeaveIfError(d_ptr->bitmap->Resize(nativeRect.Size()));
+
+ if (!rect.isNull())
+ updatePaintDeviceOnBitmap();
+}
+
+void QS60WindowSurface::lockBitmapHeap()
+{
+ if (!QS60WindowSurfacePrivate::lockedSurface)
+ return;
+
+ // Get some local variables to make later code lines more clear to read
+ CFbsBitmap*& bitmap = QS60WindowSurfacePrivate::lockedSurface->d_ptr->bitmap;
+ QImage& device = QS60WindowSurfacePrivate::lockedSurface->d_ptr->device;
+ uchar*& bytes = QS60WindowSurfacePrivate::lockedSurface->d_ptr->bytes;
+
+ bitmap->LockHeap();
+ uchar *newBytes = (uchar*)bitmap->DataAddress();
+ if (newBytes != bytes) {
+ bytes = newBytes;
+
+ // Get some values for QImage creation
+ TDisplayMode mode = bitmap->DisplayMode();
+ if (mode == EColor16MA
+ && qt_widget_private(QS60WindowSurfacePrivate::lockedSurface->window())->isOpaque)
+ mode = EColor16MU;
+ QImage::Format format = qt_TDisplayMode2Format( mode );
+ TSize bitmapSize = bitmap->SizeInPixels();
+ int bytesPerLine = CFbsBitmap::ScanLineLength( bitmapSize.iWidth, mode);
+
+ device = QImage( bytes, bitmapSize.iWidth, bitmapSize.iHeight, bytesPerLine, format );
+ }
+}
+
+void QS60WindowSurface::unlockBitmapHeap()
+{
+ if (!QS60WindowSurfacePrivate::lockedSurface)
+ return;
+
+ QS60WindowSurfacePrivate::lockedSurface->d_ptr->bitmap->UnlockHeap();
+}
+
+void QS60WindowSurface::updatePaintDeviceOnBitmap()
+{
+ // This forces the actual device to be updated based on CFbsBitmap
+ beginPaint(QRegion());
+ endPaint(QRegion());
+}
+
+CFbsBitmap *QS60WindowSurface::symbianBitmap() const
+{
+ return d_ptr->bitmap;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h
new file mode 100644
index 0000000000..7b70fd5d03
--- /dev/null
+++ b/src/gui/painting/qwindowsurface_s60_p.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSURFACE_S60_P_H
+#define QWINDOWSURFACE_S60_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qglobal.h>
+#include "private/qwindowsurface_p.h"
+
+class CFbsBitmap;
+
+QT_BEGIN_NAMESPACE
+
+struct QS60WindowSurfacePrivate;
+
+class QS60WindowSurface : public QWindowSurface
+{
+public:
+ QS60WindowSurface(QWidget *widget);
+ ~QS60WindowSurface();
+
+ QPaintDevice *paintDevice();
+ void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
+ bool scroll(const QRegion &area, int dx, int dy);
+
+ void beginPaint(const QRegion &);
+ void endPaint(const QRegion &);
+
+ void setGeometry(const QRect &rect);
+
+ static void lockBitmapHeap();
+ static void unlockBitmapHeap();
+
+ CFbsBitmap *symbianBitmap() const;
+
+private:
+ void updatePaintDeviceOnBitmap();
+
+private:
+ QS60WindowSurfacePrivate* d_ptr;
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSURFACE_S60_P_H
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
new file mode 100644
index 0000000000..5e05dd4dad
--- /dev/null
+++ b/src/gui/styles/qs60style.cpp
@@ -0,0 +1,2786 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qs60style_p.h"
+
+#include "qapplication.h"
+#include "qpainter.h"
+#include "qstyleoption.h"
+#include "qresizeevent"
+#include "qpixmapcache"
+
+#include "qcalendarwidget.h"
+#include "qdial.h"
+#include "qdialog.h"
+#include "qerrormessage.h"
+#include "qgroupbox.h"
+#include "qheaderview.h"
+#include "qlist.h"
+#include "qlistwidget.h"
+#include "qlistview.h"
+#include "qmenu.h"
+#include "qmenubar.h"
+#include "qmessagebox.h"
+#include "qpushbutton.h"
+#include "qscrollbar.h"
+#include "qtabbar.h"
+#include "qtablewidget.h"
+#include "qtableview.h"
+#include "qtoolbar.h"
+#include "qtoolbutton.h"
+#include "qtreeview.h"
+
+#include "private/qtoolbarextension_p.h"
+#include "private/qcombobox_p.h"
+#include "private/qwidget_p.h"
+
+#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
+
+QT_BEGIN_NAMESPACE
+
+// from text/qfont.cpp
+extern Q_GUI_EXPORT int qt_defaultDpiY();
+
+const QS60StylePrivate::SkinElementFlags QS60StylePrivate::KDefaultSkinElementFlags =
+ SkinElementFlags(SF_PointNorth | SF_StateEnabled);
+
+static const QByteArray propertyKeyLayouts = "layouts";
+static const QByteArray propertyKeyCurrentlayout = "currentlayout";
+
+#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
+// *** generated layout data ***
+{240,320,1,14,true,QLatin1String("QVGA Landscape Mirrored")},
+{240,320,1,14,false,QLatin1String("QVGA Landscape")},
+{320,240,1,14,true,QLatin1String("QVGA Portrait Mirrored")},
+{320,240,1,14,false,QLatin1String("QVGA Portrait")},
+{360,640,1,14,true,QLatin1String("NHD Landscape Mirrored")},
+{360,640,1,14,false,QLatin1String("NHD Landscape")},
+{640,360,1,14,true,QLatin1String("NHD Portrait Mirrored")},
+{640,360,1,14,false,QLatin1String("NHD Portrait")},
+{352,800,1,12,true,QLatin1String("E90 Landscape Mirrored")},
+{352,800,1,12,false,QLatin1String("E90 Landscape")}
+// *** End of generated data ***
+};
+const int QS60StylePrivate::m_numberOfLayouts =
+ (int)sizeof(QS60StylePrivate::m_layoutHeaders)/sizeof(QS60StylePrivate::m_layoutHeaders[0]);
+
+const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
+// *** generated pixel metrics ***
+{5,0,-909,0,0,1,0,0,-1,8,15,22,15,15,7,198,-909,-909,-909,19,15,2,0,0,21,-909,21,-909,4,4,1,-909,-909,0,2,0,0,13,23,17,17,21,21,2,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,51,27,51,4,4,5,10,15,-909,5,58,12,5,0,7,4,4,9,4,4,-909,1,-909,-909,-909,-909,4,4,3,1},
+{5,0,-909,0,0,1,0,0,-1,8,15,22,15,15,7,198,-909,-909,-909,19,15,2,0,0,21,-909,21,-909,4,4,1,-909,-909,0,2,0,0,13,23,17,17,21,21,2,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,51,27,51,4,4,5,10,15,-909,5,58,12,5,0,4,4,7,9,4,4,-909,1,-909,-909,-909,-909,4,4,3,1},
+{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,-909,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,4,4,5,10,15,-909,5,58,13,5,0,7,4,4,9,4,4,-909,1,-909,-909,-909,-909,4,4,3,1},
+{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,-909,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,4,4,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,1,-909,-909,-909,-909,4,4,3,1},
+{7,0,-909,0,0,2,0,0,-1,20,53,28,19,19,9,258,-909,-909,-909,29,19,26,0,0,32,-909,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,5,5,6,8,19,-909,7,74,19,7,0,8,5,5,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,20,53,28,19,19,9,258,-909,-909,-909,29,19,26,0,0,32,-909,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,5,5,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,20,52,28,19,19,9,258,-909,-909,-909,29,19,6,0,0,32,-909,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,98,35,98,5,5,6,8,19,-909,7,74,22,7,0,8,5,5,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,20,52,28,19,19,9,258,-909,-909,-909,29,19,6,0,0,32,-909,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,98,35,98,5,5,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,5,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,8,6,5,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1},
+{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
+
+
+// *** End of generated data ***
+};
+
+const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0];
+#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+
+bool QS60StylePrivate::m_backgroundValid = false;
+
+const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = {
+ {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter},
+ {SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed},
+ {SE_FrameLineEdit, QS60StyleEnums::SP_QsnFrInputCenter},
+ {SE_ListHighlight, QS60StyleEnums::SP_QsnFrListCenter},
+ {SE_OptionsMenu, QS60StyleEnums::SP_QsnFrPopupCenter},
+ {SE_SettingsList, QS60StyleEnums::SP_QsnFrSetOptCenter},
+ {SE_TableItem, QS60StyleEnums::SP_QsnFrCaleCenter},
+ {SE_TableHeaderItem, QS60StyleEnums::SP_QsnFrCaleHeadingCenter},
+ {SE_ToolTip, QS60StyleEnums::SP_QsnFrPopupPreviewCenter},
+ {SE_ToolBar, QS60StyleEnums::SP_QsnFrPopupSubCenter},
+ {SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter},
+ {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed},
+ {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter},
+ {SE_ButtonInactive, QS60StyleEnums::SP_QsnFrButtonCenterInactive},
+};
+static const int frameElementsCount =
+ int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0]));
+
+const int KNotFound = -1;
+
+void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart,
+ QPainter *painter, const QRect &rect, SkinElementFlags flags)
+{
+ static const bool doCache =
+#if defined(Q_WS_S60)
+ // Freezes on 3.1. Anyways, caching is only really needed on touch UI
+ !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+#else
+ true;
+#endif
+ const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), flags));
+ if (!skinPartPixMap.isNull())
+ painter->drawPixmap(rect.topLeft(), skinPartPixMap);
+}
+
+void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags)
+{
+ static const bool doCache =
+#if defined(Q_WS_S60)
+ // Freezes on 3.1. Anyways, caching is only really needed on touch UI
+ !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+#else
+ true;
+#endif
+ const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags));
+ if (!frameElementPixMap.isNull())
+ painter->drawPixmap(rect.topLeft(), frameElementPixMap);
+}
+
+void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
+ QS60StyleEnums::SkinParts middle, QS60StyleEnums::SkinParts end,
+ Qt::Orientation orientation, QPainter *painter, const QRect &rect,
+ SkinElementFlags flags)
+{
+ QSize startEndSize(partSize(start, flags));
+ startEndSize.scale(rect.size(), Qt::KeepAspectRatio);
+
+ QRect startRect = QRect(rect.topLeft(), startEndSize);
+ QRect middleRect = rect;
+ QRect endRect;
+
+ if (orientation == Qt::Horizontal) {
+ startRect.setWidth(qMin(rect.width() / 2 - 1, startRect.width()));
+ endRect = startRect.translated(rect.width() - startRect.width(), 0);
+ middleRect.adjust(startRect.width(), 0, -startRect.width(), 0);
+ } else {
+ startRect.setHeight(qMin(rect.height() / 2 - 1, startRect.height()));
+ endRect = startRect.translated(0, rect.height() - startRect.height());
+ middleRect.adjust(0, startRect.height(), 0, -startRect.height());
+ }
+
+#if 0
+ painter->save();
+ painter->setOpacity(.3);
+ painter->fillRect(startRect, Qt::red);
+ painter->fillRect(middleRect, Qt::green);
+ painter->fillRect(endRect, Qt::blue);
+ painter->restore();
+#else
+ drawPart(start, painter, startRect, flags);
+ if (middleRect.isValid())
+ drawPart(middle, painter, middleRect, flags);
+ drawPart(end, painter, endRect, flags);
+#endif
+}
+
+QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part,
+ const QSize &size, SkinElementFlags flags)
+{
+ QPixmap result;
+ const QString cacheKey =
+ QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinElementFlags=%4")
+ .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
+ if (!QPixmapCache::find(cacheKey, result)) {
+ result = QS60StylePrivate::part(part, size, flags);
+ QPixmapCache::insert(cacheKey, result);
+ }
+ return result;
+}
+
+QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags)
+{
+ QPixmap result;
+ const QString cacheKey =
+ QString::fromLatin1("S60Style: SkinFrameElements=%1 QSize=%2|%3 SkinElementFlags=%4")
+ .arg((int)frame).arg(size.width()).arg(size.height()).arg((int)flags);
+ if (!QPixmapCache::find(cacheKey, result)) {
+ result = QS60StylePrivate::frame(frame, size, flags);
+ QPixmapCache::insert(cacheKey, result);
+ }
+ return result;
+}
+
+void QS60StylePrivate::refreshUI()
+{
+ foreach (QWidget *topLevelWidget, QApplication::allWidgets()) {
+ topLevelWidget->updateGeometry();
+ QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size()));
+ }
+}
+
+void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags)
+{
+ switch (element) {
+ case SE_ButtonNormal:
+ drawFrame(SF_ButtonNormal, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ButtonPressed:
+ drawFrame(SF_ButtonPressed, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_FrameLineEdit:
+ drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ProgressBarGrooveHorizontal:
+ drawRow(QS60StyleEnums::SP_QgnGrafBarFrameSideL, QS60StyleEnums::SP_QgnGrafBarFrameCenter,
+ QS60StyleEnums::SP_QgnGrafBarFrameSideR, Qt::Horizontal, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ProgressBarGrooveVertical:
+ drawRow(QS60StyleEnums::SP_QgnGrafBarFrameSideL, QS60StyleEnums::SP_QgnGrafBarFrameCenter,
+ QS60StyleEnums::SP_QgnGrafBarFrameSideR, Qt::Vertical, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_ProgressBarIndicatorHorizontal:
+ drawPart(QS60StyleEnums::SP_QgnGrafBarProgress, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ProgressBarIndicatorVertical:
+ drawPart(QS60StyleEnums::SP_QgnGrafBarProgress, painter, rect, flags | SF_PointWest);
+ break;
+ case SE_ScrollBarGrooveHorizontal:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollBgBottom, QS60StyleEnums::SP_QsnCpScrollBgMiddle,
+ QS60StyleEnums::SP_QsnCpScrollBgTop, Qt::Horizontal, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_ScrollBarGrooveVertical:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollBgTop, QS60StyleEnums::SP_QsnCpScrollBgMiddle,
+ QS60StyleEnums::SP_QsnCpScrollBgBottom, Qt::Vertical, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ScrollBarHandleHorizontal:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollHandleBottom, QS60StyleEnums::SP_QsnCpScrollHandleMiddle,
+ QS60StyleEnums::SP_QsnCpScrollHandleTop, Qt::Horizontal, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_ScrollBarHandleVertical:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollHandleTop, QS60StyleEnums::SP_QsnCpScrollHandleMiddle,
+ QS60StyleEnums::SP_QsnCpScrollHandleBottom, Qt::Vertical, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_SliderHandleHorizontal:
+ drawPart(QS60StyleEnums::SP_QgnIndiSliderEdit, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_SliderHandleVertical:
+ drawPart(QS60StyleEnums::SP_QgnIndiSliderEdit, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_TabBarTabEastActive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabActiveL, QS60StyleEnums::SP_QgnGrafTabActiveM,
+ QS60StyleEnums::SP_QgnGrafTabActiveR, Qt::Vertical, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_TabBarTabEastInactive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabPassiveL, QS60StyleEnums::SP_QgnGrafTabPassiveM,
+ QS60StyleEnums::SP_QgnGrafTabPassiveR, Qt::Vertical, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_TabBarTabNorthActive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabActiveL, QS60StyleEnums::SP_QgnGrafTabActiveM,
+ QS60StyleEnums::SP_QgnGrafTabActiveR, Qt::Horizontal, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_TabBarTabNorthInactive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabPassiveL, QS60StyleEnums::SP_QgnGrafTabPassiveM,
+ QS60StyleEnums::SP_QgnGrafTabPassiveR, Qt::Horizontal, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_TabBarTabSouthActive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabActiveR, QS60StyleEnums::SP_QgnGrafTabActiveM,
+ QS60StyleEnums::SP_QgnGrafTabActiveL, Qt::Horizontal, painter, rect, flags | SF_PointSouth);
+ break;
+ case SE_TabBarTabSouthInactive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabPassiveR, QS60StyleEnums::SP_QgnGrafTabPassiveM,
+ QS60StyleEnums::SP_QgnGrafTabPassiveL, Qt::Horizontal, painter, rect, flags | SF_PointSouth);
+ break;
+ case SE_TabBarTabWestActive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabActiveR, QS60StyleEnums::SP_QgnGrafTabActiveM,
+ QS60StyleEnums::SP_QgnGrafTabActiveL, Qt::Vertical, painter, rect, flags | SF_PointWest);
+ break;
+ case SE_TabBarTabWestInactive:
+ drawRow(QS60StyleEnums::SP_QgnGrafTabPassiveR, QS60StyleEnums::SP_QgnGrafTabPassiveM,
+ QS60StyleEnums::SP_QgnGrafTabPassiveL, Qt::Vertical, painter, rect, flags | SF_PointWest);
+ break;
+ case SE_ListHighlight:
+ drawFrame(SF_ListHighlight, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_OptionsMenu:
+ drawFrame(SF_OptionsMenu, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_SettingsList:
+ drawFrame(SF_SettingsList, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_TableItem:
+ drawFrame(SF_TableItem, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_TableHeaderItem:
+ drawFrame(SF_TableHeaderItem, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ToolTip:
+ drawFrame(SF_ToolTip, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ToolBar:
+ drawFrame(SF_ToolBar, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ToolBarButton:
+ drawFrame(SF_ToolBarButton, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ToolBarButtonPressed:
+ drawFrame(SF_ToolBarButtonPressed, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_PanelBackground:
+ drawFrame(SF_PanelBackground, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ScrollBarHandlePressedHorizontal:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed,
+ QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, Qt::Horizontal, painter, rect, flags | SF_PointEast);
+ break;
+ case SE_ScrollBarHandlePressedVertical:
+ drawRow(QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed,
+ QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, Qt::Vertical, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_ButtonInactive:
+ drawFrame(SF_ButtonInactive, painter, rect, flags | SF_PointNorth);
+ break;
+ default:
+ break;
+ }
+}
+
+QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags)
+{
+ QSize result(20, 20);
+ switch (part)
+ {
+ case QS60StyleEnums::SP_QgnGrafBarProgress:
+ result.setWidth(pixelMetric(QStyle::PM_ProgressBarChunkWidth));
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabActiveM:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveM:
+ case QS60StyleEnums::SP_QgnGrafTabActiveR:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveR:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveL:
+ case QS60StyleEnums::SP_QgnGrafTabActiveL:
+ break;
+ case QS60StyleEnums::SP_QgnIndiSliderEdit:
+ result.scale(pixelMetric(QStyle::PM_SliderLength),
+ pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio);
+ break;
+
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
+ case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
+ case QS60StyleEnums::SP_QsnCpScrollBgBottom:
+ case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
+ case QS60StyleEnums::SP_QsnCpScrollBgTop:
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottom:
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
+ case QS60StyleEnums::SP_QsnCpScrollHandleTop:
+ result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
+ result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent));
+ break;
+ default:
+ // Generic frame part size gathering.
+ for (int i = 0; i < frameElementsCount; ++i)
+ {
+ switch (m_frameElementsData[i].center - part) {
+ case 8: /* CornerTl */
+ case 7: /* CornerTr */
+ case 6: /* CornerBl */
+ case 5: /* CornerBr */
+ result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ // Falltrough intended...
+ case 4: /* SideT */
+ case 3: /* SideB */
+ result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight));
+ break;
+ case 2: /* SideL */
+ case 1: /* SideR */
+ result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ break;
+ case 0: /* center */
+ default:
+ break;
+ }
+ }
+ break;
+ }
+ if (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)) {
+ const int temp = result.width();
+ result.setWidth(result.height());
+ result.setHeight(temp);
+ }
+ return result;
+}
+
+
+void QS60StylePrivate::drawSkinPart(QS60StyleEnums::SkinParts part,
+ QPainter *painter, const QRect &rect, SkinElementFlags flags)
+{
+ drawPart(part, painter, rect, flags);
+}
+
+void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value)
+{
+ if (name == propertyKeyCurrentlayout) {
+#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+ static const QStringList layouts = styleProperty(propertyKeyLayouts).toStringList();
+ const QString layout = value.toString();
+ Q_ASSERT(layouts.contains(layout));
+ const int layoutIndex = layouts.indexOf(layout);
+ setCurrentLayout(layoutIndex);
+ QApplication::setLayoutDirection(m_layoutHeaders[layoutIndex].mirroring ? Qt::RightToLeft : Qt::LeftToRight);
+ clearCaches();
+ refreshUI();
+ return;
+#else
+ qFatal("Cannot set static layout. Dynamic layouts are used!");
+#endif
+ }
+}
+
+// Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use
+// for QPalette::Button and QPalette::ToolTipBase. Therefore we need to guesstimate
+// this by calculating average rgb values for button pixels.
+// Returns Qt::black if there is an issue with the graphics (image is NULL, or no bits() found).
+QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const
+{
+ const bool cachedColorExists = m_colorCache.contains(frame);
+ if (!cachedColorExists) {
+ const int frameCornerWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
+ const int frameCornerHeight = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
+ Q_ASSERT(2*frameCornerWidth<32);
+ Q_ASSERT(2*frameCornerHeight<32);
+
+ const QImage frameImage = QS60StylePrivate::frame(frame, QSize(32,32)).toImage();
+ if (frameImage.isNull())
+ return Qt::black;
+
+ const QRgb *pixelRgb = (const QRgb*)frameImage.bits();
+ const int pixels = frameImage.numBytes()/sizeof(QRgb);
+ const int bytesPerLine = frameImage.bytesPerLine();
+ Q_ASSERT(bytesPerLine);
+ const int rows = frameImage.numBytes()/(sizeof(QRgb)*bytesPerLine);
+
+ int estimatedRed = 0;
+ int estimatedGreen = 0;
+ int estimatedBlue = 0;
+
+ int skips = 0;
+ int estimations = 0;
+
+ const int topBorderLastPixel = frameCornerHeight*frameImage.width()-1;
+ const int bottomBorderFirstPixel = frameImage.width()*frameImage.height()-frameCornerHeight*frameImage.width()-1;
+ const int rightBorderFirstPixel = frameImage.width()-frameCornerWidth;
+ const int leftBorderLastPixel = frameCornerWidth;
+
+ while ((skips + estimations) < pixels) {
+ if ((skips+estimations) > topBorderLastPixel &&
+ (skips+estimations) < bottomBorderFirstPixel) {
+ for (int rowIndex = 0; rowIndex < frameImage.width(); rowIndex++) {
+ if (rowIndex > leftBorderLastPixel &&
+ rowIndex < rightBorderFirstPixel) {
+ estimatedRed += qRed(*pixelRgb);
+ estimatedGreen += qGreen(*pixelRgb);
+ estimatedBlue += qBlue(*pixelRgb);
+ }
+ pixelRgb++;
+ estimations++;
+ }
+ } else {
+ pixelRgb++;
+ skips++;
+ }
+ }
+ QColor frameColor(estimatedRed/estimations, estimatedGreen/estimations, estimatedBlue/estimations);
+ m_colorCache.insert(frame, frameColor);
+ return !estimations ? Qt::black : frameColor;
+ } else {
+ return m_colorCache.value(frame);
+ }
+
+}
+
+int QS60StylePrivate::focusRectPenWidth()
+{
+ return pixelMetric(QS60Style::PM_DefaultFrameWidth);
+}
+
+void QS60StylePrivate::setThemePalette(QApplication *app) const
+{
+ if (!app)
+ return;
+
+ QPalette widgetPalette = QPalette(Qt::white);
+
+ // basic colors
+ widgetPalette.setColor(QPalette::WindowText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::Text,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::ToolTipText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0));
+ widgetPalette.setColor(QPalette::BrightText, widgetPalette.color(QPalette::WindowText).lighter());
+ widgetPalette.setColor(QPalette::HighlightedText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
+ widgetPalette.setColor(QPalette::Link,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0));
+ widgetPalette.setColor(QPalette::LinkVisited, widgetPalette.color(QPalette::Link).darker());
+ widgetPalette.setColor(QPalette::Highlight,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0));
+ // set these as transparent so that styled full screen theme background is visible
+ widgetPalette.setColor(QPalette::AlternateBase, Qt::transparent);
+ widgetPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture());
+ widgetPalette.setColor(QPalette::Base, Qt::transparent);
+ // set button and tooltipbase based on pixel colors
+ const QColor buttonColor = colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal);
+ widgetPalette.setColor(QPalette::Button, buttonColor );
+ widgetPalette.setColor(QPalette::Light, widgetPalette.color(QPalette::Button).lighter());
+ widgetPalette.setColor(QPalette::Dark, widgetPalette.color(QPalette::Button).darker());
+ widgetPalette.setColor(QPalette::Midlight, widgetPalette.color(QPalette::Button).lighter(125));
+ widgetPalette.setColor(QPalette::Mid, widgetPalette.color(QPalette::Button).darker(150));
+ widgetPalette.setColor(QPalette::Shadow, Qt::black);
+ QColor toolTipColor = colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip);
+ widgetPalette.setColor(QPalette::ToolTipBase, toolTipColor );
+
+ app->setPalette(widgetPalette);
+}
+
+void QS60StylePrivate::setThemePalette(QWidget *widget) const
+{
+ if(!widget)
+ return;
+ QPalette widgetPalette = widget->palette();
+
+ // widget specific colors and fonts
+ if (qobject_cast<QSlider *>(widget)){
+ widgetPalette.setColor(QPalette::All, QPalette::WindowText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0));
+ QApplication::setPalette(widgetPalette, "QSlider");
+ } else if (qobject_cast<QPushButton *>(widget)){
+ const QFont suggestedFont = s60Font(
+ QS60StyleEnums::FC_Primary, widget->font().pointSizeF());
+ widget->setFont(suggestedFont);
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ const QStyleOption opt;
+ widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt));
+ QApplication::setPalette(widgetPalette, "QPushButton");
+ } else if (qobject_cast<QToolButton *>(widget)){
+ const QFont suggestedFont = s60Font(
+ QS60StyleEnums::FC_Primary, widget->font().pointSizeF());
+ widget->setFont(suggestedFont);
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ QApplication::setPalette(widgetPalette, "QToolButton");
+ } else if (qobject_cast<QHeaderView *>(widget)){
+ const QFont suggestedFont = s60Font(
+ QS60StyleEnums::FC_Secondary, widget->font().pointSizeF());
+ widget->setFont(suggestedFont);
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0));
+ QHeaderView* header = qobject_cast<QHeaderView *>(widget);
+ widgetPalette.setColor(QPalette::Button, Qt::transparent );
+ if ( header->viewport() )
+ header->viewport()->setPalette(widgetPalette);
+ QApplication::setPalette(widgetPalette, "QHeaderView");
+ } else if (qobject_cast<QMenuBar *>(widget)){
+ widgetPalette.setColor(QPalette::All, QPalette::ButtonText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0));
+ QApplication::setPalette(widgetPalette, "QMenuBar");
+ } else if (qobject_cast<QTabBar *>(widget)){
+ widgetPalette.setColor(QPalette::Active, QPalette::WindowText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0));
+ QApplication::setPalette(widgetPalette, "QTabBar");
+ } else if (qobject_cast<QTableView *>(widget)){
+ widgetPalette.setColor(QPalette::All, QPalette::Text,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
+ QApplication::setPalette(widgetPalette, "QTableView");
+ } else if (qobject_cast<QGroupBox *>(widget)){
+ const QFont suggestedFont = s60Font(
+ QS60StyleEnums::FC_Title, widget->font().pointSizeF());
+ widget->setFont(suggestedFont);
+ } else if (qobject_cast<QLineEdit *>(widget)) {
+ widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
+ QApplication::setPalette(widgetPalette, "QLineEdit");
+ } else if (qobject_cast<QDial *> (widget)) {
+ const QColor color(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ widgetPalette.setColor(QPalette::WindowText, color);
+ widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button));
+ widgetPalette.setColor(QPalette::Dark, color.darker());
+ widgetPalette.setColor(QPalette::Light, color.lighter());
+ QApplication::setPalette(widgetPalette, "QDial");
+ }
+}
+
+void QS60StylePrivate::setBackgroundTexture(QApplication *app) const
+{
+ if (!app)
+ return;
+ QPalette applicationPalette = app->palette();
+ applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture());
+ app->setPalette(applicationPalette);
+}
+
+void QS60Style::polish(QApplication *application)
+{
+ Q_D(const QS60Style);
+ originalPalette = application->palette();
+ d->setThemePalette(application);
+}
+
+void QS60Style::polish(QWidget *widget)
+{
+ Q_D(const QS60Style);
+ QCommonStyle::polish(widget);
+
+ if (!widget)
+ return;
+
+ if (QS60StylePrivate::isSkinnableDialog(widget)) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ } else if (false
+#ifndef QT_NO_MENU
+ || qobject_cast<const QMenu *> (widget)
+#endif // QT_NO_MENU
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ } else if (false
+#ifndef QT_NO_COMBOBOX
+ || qobject_cast<const QComboBoxListView *>(widget)
+#endif //QT_NO_COMBOBOX
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ }
+ d->setThemePalette(widget);
+}
+
+void QS60Style::unpolish(QApplication *application)
+{
+ application->setPalette(originalPalette);
+}
+
+void QS60Style::unpolish(QWidget *widget)
+{
+ if (QS60StylePrivate::isSkinnableDialog(widget)) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ } else if (false
+#ifndef QT_NO_MENU
+ || qobject_cast<const QMenu *> (widget)
+#endif // QT_NO_MENU
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ } else if (false
+#ifndef QT_NO_COMBOBOX
+ || qobject_cast<const QComboBoxListView *>(widget)
+#endif //QT_NO_COMBOBOX
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ }
+
+ if (widget) {
+ widget->setPalette(QPalette());
+ }
+
+ QCommonStyle::unpolish(widget);
+}
+
+QVariant QS60StylePrivate::styleProperty(const char *name) const
+{
+ if (name == propertyKeyLayouts) {
+#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+ static QStringList layouts;
+ if (layouts.isEmpty())
+ for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++)
+ layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName);
+ return layouts;
+#else
+ qFatal("Cannot return list of 'canned' static layouts. Dynamic layouts are used!");
+#endif
+ }
+ return QVariant();
+}
+
+QFont QS60StylePrivate::s60Font(
+ QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+{
+ QFont result;
+ int actualPointSize = pointSize;
+ if (actualPointSize <= 0) {
+ const QFont appFont = QApplication::font();
+ actualPointSize = appFont.pointSize();
+ if (actualPointSize <= 0)
+ actualPointSize = appFont.pixelSize() * 72 / qt_defaultDpiY();
+ }
+ Q_ASSERT(actualPointSize > 0);
+ const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
+ if (!m_mappedFontsCache.contains(key)) {
+ result = s60Font_specific(fontCategory, actualPointSize);
+ m_mappedFontsCache.insert(key, result);
+ } else {
+ result = m_mappedFontsCache.value(key);
+ if (result.pointSize() != actualPointSize)
+ result.setPointSize(actualPointSize);
+ }
+ return result;
+}
+
+//todo: you could pass a reason to clear cache here, so that we could
+// deduce whether or not the specific cache needs to be cleared
+void QS60StylePrivate::clearCaches()
+{
+ m_colorCache.clear();
+ m_mappedFontsCache.clear();
+ QPixmapCache::clear();
+ m_backgroundValid = false;
+}
+
+QColor QS60StylePrivate::lighterColor(const QColor &baseColor)
+{
+ QColor result(baseColor);
+ bool modifyColor = false;
+ if (result.saturation() == 0) {
+ result.setHsv(result.hue(), 128, result.value());
+ modifyColor = true;
+ }
+ if (result.value() == 0) {
+ result.setHsv(result.hue(), result.saturation(), 128);
+ modifyColor = true;
+ }
+ if (modifyColor)
+ result = result.lighter(175);
+ else
+ result = result.lighter(225);
+ return result;
+}
+
+bool QS60StylePrivate::isSkinnableDialog(const QWidget *widget)
+{
+ return (qobject_cast<const QMessageBox *> (widget) ||
+ qobject_cast<const QErrorMessage *> (widget));
+}
+
+#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+void QS60StylePrivate::setCurrentLayout(int index)
+{
+ m_pmPointer = data[index];
+}
+#endif
+
+QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *option)
+{
+ QColor retColor (color);
+ if (option && !(option->state & QStyle::State_Enabled)) {
+ QColor hsvColor = retColor.toHsv();
+ int colorSat = hsvColor.saturation();
+ int colorVal = hsvColor.value();
+ colorSat = (colorSat!=0) ? (colorSat>>1) : 128;
+ colorVal = (colorVal!=0) ? (colorVal>>1) : 128;
+ hsvColor.setHsv(hsvColor.hue(), colorSat, colorVal);
+ retColor = hsvColor.toRgb();
+ }
+ return retColor;
+}
+
+/*!
+ \class QS60Style
+ \brief The QS60Style class provides a look and feel suitable for applications on S60.
+ \since 4.6
+ \ingroup appearance
+
+ \sa QMacStyle, QWindowsStyle, QWindowsXPStyle, QWindowsVistaStyle, QPlastiqueStyle, QCleanlooksStyle, QMotifStyle
+*/
+
+/*!
+ Constructs a QS60Style object.
+*/
+QS60Style::QS60Style()
+ : QCommonStyle(*new QS60StylePrivate)
+{
+}
+
+QS60Style::~QS60Style()
+{
+}
+
+/*!
+ \reimp
+*/
+void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
+{
+ const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
+ SubControls sub = option->subControls;
+
+ Q_D(const QS60Style);
+
+ switch (control) {
+#ifndef QT_NO_SCROLLBAR
+ case CC_ScrollBar:
+ if (const QStyleOptionSlider *optionSlider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
+ const bool horizontal = optionSlider->orientation == Qt::Horizontal;
+
+ const QRect scrollBarSlider = subControlRect(control, optionSlider, SC_ScrollBarSlider, widget);
+ const QRect grooveRect = subControlRect(control, optionSlider, SC_ScrollBarGroove, widget);
+
+ const QS60StylePrivate::SkinElements grooveElement =
+ horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical;
+ QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags);
+
+ QStyle::SubControls subControls = optionSlider->subControls;
+
+ // select correct slider (horizontal/vertical/pressed)
+ const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider));
+ const QS60StylePrivate::SkinElements handleElement =
+ horizontal ?
+ ( sliderPressed ?
+ QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal :
+ QS60StylePrivate::SE_ScrollBarHandleHorizontal ) :
+ ( sliderPressed ?
+ QS60StylePrivate::SE_ScrollBarHandlePressedVertical :
+ QS60StylePrivate::SE_ScrollBarHandleVertical);
+ QS60StylePrivate::drawSkinElement(handleElement, painter, scrollBarSlider, flags);
+ }
+ break;
+#endif // QT_NO_SCROLLBAR
+#ifndef QT_NO_SLIDER
+ case CC_Slider:
+ if (const QStyleOptionSlider *optionSlider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
+
+ // The groove is just a centered line. Maybe a qgn_graf_line_* at some point
+ const QRect sliderGroove = subControlRect(control, optionSlider, SC_SliderGroove, widget);
+ const QPoint sliderGrooveCenter = sliderGroove.center();
+ const bool horizontal = optionSlider->orientation == Qt::Horizontal;
+ painter->save();
+ if (widget)
+ painter->setPen(widget->palette().windowText().color());
+ if (horizontal)
+ painter->drawLine(0, sliderGrooveCenter.y(), sliderGroove.right(), sliderGrooveCenter.y());
+ else
+ painter->drawLine(sliderGrooveCenter.x(), 0, sliderGrooveCenter.x(), sliderGroove.bottom());
+ painter->restore();
+
+ const QRect sliderHandle = subControlRect(control, optionSlider, SC_SliderHandle, widget);
+ const QS60StylePrivate::SkinElements handleElement =
+ horizontal ? QS60StylePrivate::SE_SliderHandleHorizontal : QS60StylePrivate::SE_SliderHandleVertical;
+ QS60StylePrivate::drawSkinElement(handleElement, painter, sliderHandle, flags);
+
+ if (optionSlider->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*optionSlider);
+ fropt.rect = subElementRect(SE_SliderFocusRect, optionSlider, widget);
+ drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
+ }
+ break;
+#endif // QT_NO_SLIDER
+#ifndef QT_NO_COMBOBOX
+ case CC_ComboBox:
+ if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
+ const QRect cmbxEditField = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget);
+ const QRect cmbxFrame = subControlRect(CC_ComboBox, option, SC_ComboBoxFrame, widget);
+
+ const bool direction = cmb->direction == Qt::LeftToRight;
+
+ // Button frame
+ //todo: why calc rect here for button? Is there no suitable SE_xxx for that?
+ QStyleOptionFrame buttonOption;
+ buttonOption.QStyleOption::operator=(*cmb);
+ const int maxHeight = cmbxFrame.height();
+ const int maxWidth = cmbxFrame.width() - cmbxEditField.width();
+ const int topLeftPoint = direction ? cmbxEditField.right()+1 : cmbxEditField.left()+1-maxWidth;
+ const QRect buttonRect(topLeftPoint, cmbxEditField.top(), maxWidth, maxHeight);
+ buttonOption.rect = buttonRect;
+ buttonOption.state = cmb->state & (State_Enabled | State_MouseOver);
+ drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget);
+ // todo: we could draw qgn_prop_set_button skin item here
+
+ // draw label background - label itself is drawn separately
+ const QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_FrameLineEdit;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, cmbxEditField, flags);
+
+ if (sub & SC_ComboBoxArrow) {
+ // Draw the little arrow
+ buttonOption.rect.adjust(1, 1, -1, -1);
+ painter->save();
+ painter->setPen(option->palette.buttonText().color());
+ drawPrimitive(PE_IndicatorSpinDown, &buttonOption, painter, widget);
+ painter->restore();
+ }
+
+ if (cmb->subControls & SC_ComboBoxEditField) {
+ if (cmb->state & State_HasFocus && !cmb->editable) {
+ QStyleOptionFocusRect focus;
+ focus.QStyleOption::operator=(*cmb);
+ focus.rect = cmbxEditField;
+ focus.state |= State_FocusAtBorder;
+ focus.backgroundColor = cmb->palette.highlight().color();
+ drawPrimitive(PE_FrameFocusRect, &focus, painter, widget);
+ }
+ }
+ }
+ break;
+#endif // QT_NO_COMBOBOX
+#ifndef QT_NO_TOOLBUTTON
+ case CC_ToolButton:
+ if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
+ const State bflags = toolBtn->state;
+ const QRect button(subControlRect(control, toolBtn, SC_ToolButton, widget));
+ QStyleOptionToolButton toolButton = *toolBtn;
+
+ if (sub&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)) {
+ tool.rect = button;
+ 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 (toolBtn->state & State_HasFocus) {
+ QStyleOptionFocusRect fr;
+ fr.QStyleOption::operator=(*toolBtn);
+ const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
+ fr.rect.adjust(frameWidth, frameWidth, -frameWidth, -frameWidth);
+ drawPrimitive(PE_FrameFocusRect, &fr, painter, widget);
+ }
+
+ if (toolBtn->features & QStyleOptionToolButton::Arrow) {
+ QStyle::PrimitiveElement pe;
+ switch (toolBtn->arrowType) {
+ case Qt::LeftArrow:
+ pe = QStyle::PE_IndicatorArrowLeft;
+ break;
+ case Qt::RightArrow:
+ pe = QStyle::PE_IndicatorArrowRight;
+ break;
+ case Qt::UpArrow:
+ pe = QStyle::PE_IndicatorArrowUp;
+ break;
+ case Qt::DownArrow:
+ pe = QStyle::PE_IndicatorArrowDown;
+ break;
+ default:
+ break; }
+ toolButton.rect = button;
+ drawPrimitive(pe, &toolButton, painter, widget);
+ }
+
+ if (toolBtn->text.length()>0 ||
+ !toolBtn->icon.isNull()) {
+ const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
+ toolButton.rect = button.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
+ drawControl(CE_ToolButtonLabel, &toolButton, painter, widget);
+ }
+ }
+ break;
+#endif //QT_NO_TOOLBUTTON
+#ifndef QT_NO_SPINBOX
+ case CC_SpinBox:
+ if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
+ QStyleOptionSpinBox copy = *spinBox;
+ PrimitiveElement pe;
+
+ if (spinBox->subControls & SC_SpinBoxUp) {
+ copy.subControls = SC_SpinBoxUp;
+ QPalette pal2 = spinBox->palette;
+ if (!(spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled)) {
+ pal2.setCurrentColorGroup(QPalette::Disabled);
+ copy.state &= ~State_Enabled;
+ }
+
+ copy.palette = pal2;
+
+ if (spinBox->activeSubControls == SC_SpinBoxUp && (spinBox->state & State_Sunken)) {
+ copy.state |= State_On;
+ copy.state |= State_Sunken;
+ } else {
+ copy.state |= State_Raised;
+ copy.state &= ~State_Sunken;
+ }
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus
+ : PE_IndicatorSpinUp);
+
+ copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget);
+ drawPrimitive(PE_PanelButtonBevel, &copy, painter, widget);
+ copy.rect.adjust(1, 1, -1, -1);
+ drawPrimitive(pe, &copy, painter, widget);
+ }
+
+ if (spinBox->subControls & SC_SpinBoxDown) {
+ copy.subControls = SC_SpinBoxDown;
+ copy.state = spinBox->state;
+ QPalette pal2 = spinBox->palette;
+ if (!(spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled)) {
+ pal2.setCurrentColorGroup(QPalette::Disabled);
+ copy.state &= ~State_Enabled;
+ }
+ copy.palette = pal2;
+
+ if (spinBox->activeSubControls == SC_SpinBoxDown && (spinBox->state & State_Sunken)) {
+ copy.state |= State_On;
+ copy.state |= State_Sunken;
+ } else {
+ copy.state |= State_Raised;
+ copy.state &= ~State_Sunken;
+ }
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus
+ : PE_IndicatorSpinDown);
+
+ copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget);
+ drawPrimitive(PE_PanelButtonBevel, &copy, painter, widget);
+ copy.rect.adjust(1, 1, -1, -1);
+ drawPrimitive(pe, &copy, painter, widget);
+ }
+ }
+ break;
+#endif //QT_NO_SPINBOX
+#ifndef QT_NO_GROUPBOX
+ case CC_GroupBox:
+ if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
+ // 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) {
+ QStyleOptionFrameV2 frame;
+ frame.QStyleOption::operator=(*groupBox);
+ frame.features = groupBox->features;
+ frame.lineWidth = groupBox->lineWidth;
+ frame.midLineWidth = groupBox->midLineWidth;
+ frame.rect = subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget);
+ drawPrimitive(PE_FrameGroupBox, &frame, painter, widget);
+ }
+
+ // Draw title
+ if ((groupBox->subControls & QStyle::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))
+ alignment |= Qt::TextHideMnemonic;
+
+ drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | Qt::AlignVCenter | alignment,
+ groupBox->palette, groupBox->state & State_Enabled, groupBox->text,
+ textColor.isValid() ? QPalette::NoRole : QPalette::WindowText);
+ painter->restore();
+
+ if (groupBox->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*groupBox);
+ fropt.rect = textRect;
+ drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
+ }
+
+ // Draw checkbox
+ if (groupBox->subControls & SC_GroupBoxCheckBox) {
+ QStyleOptionButton box;
+ box.QStyleOption::operator=(*groupBox);
+ box.rect = checkBoxRect;
+ drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget);
+ }
+ }
+ break;
+#endif //QT_NO_GROUPBOX
+#ifndef QT_NO_DIAL
+ case CC_Dial:
+ if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
+ QStyleOptionSlider optionSlider = *slider;
+ QCommonStyle::drawComplexControl(control, &optionSlider, painter, widget);
+ }
+ break;
+#endif //QT_NO_DIAL
+
+ //todo: remove non-used complex widgets in final version
+ case CC_TitleBar:
+#ifdef QT3_SUPPORT
+ case CC_Q3ListView:
+#endif //QT3_SUPPORT
+#ifndef QT_NO_WORKSPACE
+ case CC_MdiControls:
+#endif //QT_NO_WORKSPACE
+ default:
+ QCommonStyle::drawComplexControl(control, option, painter, widget);
+ }
+}
+
+/*!
+ \reimp
+*/
+void QS60Style::drawControl(ControlElement 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;
+ switch (element) {
+ case CE_PushButton:
+ if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+
+ drawControl(CE_PushButtonBevel, btn, painter, widget);
+ QStyleOptionButton subopt = *btn;
+ subopt.rect = subElementRect(SE_PushButtonContents, btn, widget);
+
+ if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) {
+ if (buttonWidget->isCheckable()) {
+ QStyleOptionButton checkopt = subopt;
+
+ const int indicatorHeight(pixelMetric(PM_IndicatorHeight));
+ const int verticalAdjust = (option->rect.height() - indicatorHeight) >> 1;
+
+ checkopt.rect.adjust(pixelMetric(PM_ButtonMargin), verticalAdjust, 0, 0);
+ checkopt.rect.setWidth(pixelMetric(PM_IndicatorWidth));
+ checkopt.rect.setHeight(indicatorHeight);
+
+ drawPrimitive(PE_IndicatorCheckBox, &checkopt, painter, widget);
+ }
+ }
+
+ drawControl(CE_PushButtonLabel, &subopt, painter, widget);
+ if (btn->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*btn);
+ fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget);
+ drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
+ }
+ break;
+ case CE_PushButtonBevel:
+ if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ const bool isDisabled = !(option->state & QStyle::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;
+ if (isFlat) {
+ skinPart =
+ isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter;
+ } else {
+ skinElement =
+ isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
+ }
+ } else {
+ if (isFlat)
+ skinPart =QS60StyleEnums::SP_QsnFrButtonCenterInactive;
+ else
+ skinElement = QS60StylePrivate::SE_ButtonInactive;
+ }
+ if (isFlat)
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
+ else
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ }
+ break;
+ case CE_PushButtonLabel:
+ if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ QStyleOptionButton optionButton = *button;
+
+ if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) {
+ if (buttonWidget->isCheckable()) {
+ // space for check box.
+ optionButton.rect.adjust(pixelMetric(PM_IndicatorWidth)
+ + pixelMetric(PM_ButtonMargin) + pixelMetric(PM_CheckBoxLabelSpacing), 0, 0, 0);
+ }
+ }
+ QCommonStyle::drawControl(element, &optionButton, painter, widget);
+ }
+ break;
+ case CE_CheckBoxLabel:
+ if (const QStyleOptionButton *checkBox = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ QStyleOptionButton optionCheckBox = *checkBox;
+ QCommonStyle::drawControl(element, &optionCheckBox, painter, widget);
+ }
+ break;
+ case CE_RadioButtonLabel:
+ if (const QStyleOptionButton *radioButton = qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ QStyleOptionButton optionRadioButton = *radioButton;
+ QCommonStyle::drawControl(element, &optionRadioButton, painter, widget);
+ }
+ break;
+#ifndef QT_NO_TOOLBUTTON
+ case CE_ToolButtonLabel:
+ if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
+ QStyleOptionToolButton optionToolButton = *toolBtn;
+
+ if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
+ && (optionToolButton.state & State_Enabled)) {
+
+ const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off;
+ const QPixmap pm(optionToolButton.icon.pixmap(optionToolButton.rect.size().boundedTo(optionToolButton.iconSize),
+ QIcon::Normal, state));
+ optionToolButton.icon = generatedIconPixmap(QIcon::Selected, pm, &optionToolButton);
+ }
+
+ QCommonStyle::drawControl(element, &optionToolButton, painter, widget);
+ }
+ break;
+#endif //QT_NO_TOOLBUTTON
+ case CE_HeaderLabel:
+ if (const QStyleOptionHeader *headerLabel = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
+ QStyleOptionHeader optionHeaderLabel = *headerLabel;
+ QCommonStyle::drawControl(element, &optionHeaderLabel, painter, widget);
+ }
+ break;
+#ifndef QT_NO_COMBOBOX
+ case CE_ComboBoxLabel:
+ if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
+ QStyleOption optionComboBox = *comboBox;
+ optionComboBox.palette.setColor(QPalette::Active, QPalette::WindowText,
+ optionComboBox.palette.text().color() );
+ optionComboBox.palette.setColor(QPalette::Inactive, QPalette::WindowText,
+ optionComboBox.palette.text().color() );
+ QRect editRect = subControlRect(CC_ComboBox, comboBox, SC_ComboBoxEditField, widget);
+ painter->save();
+ painter->setClipRect(editRect);
+
+ if (!comboBox->currentIcon.isNull()) {
+ QIcon::Mode mode = comboBox->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ QPixmap pixmap = comboBox->currentIcon.pixmap(comboBox->iconSize, mode);
+ QRect iconRect(editRect);
+ iconRect.setWidth(comboBox->iconSize.width() + 4);
+ iconRect = alignedRect(comboBox->direction,
+ Qt::AlignLeft | Qt::AlignVCenter,
+ iconRect.size(), editRect);
+ if (comboBox->editable)
+ painter->fillRect(iconRect, optionComboBox.palette.brush(QPalette::Base));
+ drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap);
+
+ if (comboBox->direction == Qt::RightToLeft)
+ editRect.translate(-4 - comboBox->iconSize.width(), 0);
+ else
+ editRect.translate(comboBox->iconSize.width() + 4, 0);
+ }
+ if (!comboBox->currentText.isEmpty() && !comboBox->editable) {
+ QCommonStyle::drawItemText(painter,
+ editRect.adjusted(QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth), 0, -1, 0),
+ visualAlignment(comboBox->direction, Qt::AlignLeft | Qt::AlignVCenter),
+ comboBox->palette, comboBox->state & State_Enabled, comboBox->currentText);
+ }
+ painter->restore();
+ }
+ break;
+#endif //QT_NO_COMBOBOX
+#ifndef QT_NO_ITEMVIEWS
+ case CE_ItemViewItem:
+ if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
+ QStyleOptionViewItemV4 voptAdj = *vopt;
+ painter->save();
+
+ painter->setClipRect(voptAdj.rect);
+ const bool isSelected = (voptAdj.state & QStyle::State_HasFocus);
+
+ bool isVisible = false;
+ int scrollBarWidth = 0;
+ QList<QScrollBar *> scrollBars = qFindChildren<QScrollBar *>(widget);
+ for (int i = 0; i < scrollBars.size(); ++i) {
+ QScrollBar *scrollBar = scrollBars.at(i);
+ if (scrollBar && scrollBar->orientation() == Qt::Vertical) {
+ isVisible = scrollBar->isVisible();
+ scrollBarWidth = scrollBar->size().width();
+ break;
+ }
+ }
+
+ int rightValue = widget ? widget->contentsRect().right() : 0;
+
+ if (isVisible)
+ rightValue -= scrollBarWidth;
+
+ if (voptAdj.rect.right() > rightValue)
+ voptAdj.rect.setRight(rightValue);
+
+ const QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &voptAdj, widget);
+ QRect textRect = subElementRect(SE_ItemViewItemText, &voptAdj, widget);
+
+ // draw the background
+ const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option);
+ const QTableView *table = qobject_cast<const QTableView *>(widget);
+ if (table && tableOption) {
+ const QModelIndex index = tableOption->index;
+ //todo: Draw cell background only once - for the first cell.
+ QStyleOptionViewItemV4 voptAdj2 = voptAdj2;
+ const QModelIndex indexFirst = table->model()->index(0,0);
+ const QModelIndex indexLast = table->model()->index(
+ table->model()->rowCount()-1,table->model()->columnCount()-1);
+ if (table->viewport())
+ voptAdj2.rect = QRect( table->visualRect(indexFirst).topLeft(),
+ table->visualRect(indexLast).bottomRight()).intersect(table->viewport()->rect());
+ drawPrimitive(PE_PanelItemViewItem, &voptAdj2, painter, widget);
+ }
+
+ // draw the focus rect
+ if (isSelected)
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
+
+ // 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;
+ voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state);
+
+ // Draw selection check mark. Show check mark only in multi selection modes.
+ if (const QListView *listView = (qobject_cast<const QListView *>(widget))) {
+ const bool singleSelection =
+ listView &&
+ (listView->selectionMode() == QAbstractItemView::SingleSelection ||
+ listView->selectionMode() == QAbstractItemView::NoSelection);
+ QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget);
+ if (voptAdj.state & QStyle::State_Selected &&
+ !singleSelection) {
+ QStyleOptionViewItemV4 option(voptAdj);
+ option.rect = selectionRect;
+ // Draw selection mark.
+ drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, painter, widget);
+ if ( textRect.right() > selectionRect.left() )
+ textRect.setRight(selectionRect.left());
+ }
+ else if (singleSelection &&
+ voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) {
+ // draw the check mark
+ if (selectionRect.isValid()) {
+ QStyleOptionViewItemV4 option(*vopt);
+ option.rect = selectionRect;
+ option.state = option.state & ~QStyle::State_HasFocus;
+
+ switch (vopt->checkState) {
+ case Qt::Unchecked:
+ option.state |= QStyle::State_Off;
+ break;
+ case Qt::PartiallyChecked:
+ option.state |= QStyle::State_NoChange;
+ break;
+ case Qt::Checked:
+ option.state |= QStyle::State_On;
+ break;
+ }
+ drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, painter, widget);
+ }
+ }
+ }
+
+ // draw the text
+ if (!voptAdj.text.isEmpty()) {
+ const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option);
+ if (isSelected) {
+ if (qobject_cast<const QTableView *>(widget) && tableOption)
+ voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
+ else
+ voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
+ }
+ painter->setPen(voptAdj.palette.text().color());
+ d->viewItemDrawText(painter, &voptAdj, textRect);
+ }
+ painter->restore();
+ }
+ break;
+#endif // QT_NO_ITEMVIEWS
+#ifndef QT_NO_TABBAR
+ 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 directionMirrored = (optionTab->direction == Qt::RightToLeft);
+ QS60StylePrivate::SkinElements skinElement;
+ switch (optionTab->shape) {
+ case QTabBar::TriangularEast:
+ case QTabBar::RoundedEast:
+ skinElement = isSelected ? QS60StylePrivate::SE_TabBarTabEastActive:
+ QS60StylePrivate::SE_TabBarTabEastInactive;
+ break;
+ case QTabBar::TriangularSouth:
+ case QTabBar::RoundedSouth:
+ skinElement = isSelected ? QS60StylePrivate::SE_TabBarTabSouthActive:
+ QS60StylePrivate::SE_TabBarTabSouthInactive;
+ break;
+ case QTabBar::TriangularWest:
+ case QTabBar::RoundedWest:
+ skinElement = isSelected ? QS60StylePrivate::SE_TabBarTabWestActive:
+ QS60StylePrivate::SE_TabBarTabWestInactive;
+ break;
+ case QTabBar::TriangularNorth:
+ case QTabBar::RoundedNorth:
+ default:
+ skinElement = isSelected ? QS60StylePrivate::SE_TabBarTabNorthActive:
+ QS60StylePrivate::SE_TabBarTabNorthInactive;
+ break;
+ }
+ if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabNorthInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabSouthInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabWestInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
+ skinElement==QS60StylePrivate::SE_TabBarTabNorthActive||
+ skinElement==QS60StylePrivate::SE_TabBarTabSouthActive||
+ skinElement==QS60StylePrivate::SE_TabBarTabWestActive) {
+ const int borderThickness =
+ QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
+ const int tabOverlap =
+ QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
+ //todo: draw navi wipe behind tabbar - must be drawn with first draw
+ //QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, windowRect, flags);
+
+ if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
+ skinElement==QS60StylePrivate::SE_TabBarTabWestInactive||
+ skinElement==QS60StylePrivate::SE_TabBarTabWestActive){
+ optionTabAdj.rect.adjust(0, 0, 0, tabOverlap);
+ } else {
+ if (directionMirrored)
+ optionTabAdj.rect.adjust(-tabOverlap, 0, 0, 0);
+ else
+ optionTabAdj.rect.adjust(0, 0, tabOverlap, 0);
+ }
+ }
+ QS60StylePrivate::drawSkinElement(skinElement, painter, optionTabAdj.rect, flags);
+ }
+ break;
+ case CE_TabBarTabLabel:
+ if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(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 tabOverlap =
+ QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
+ const QRect windowRect = painter->window();
+
+ switch (tab->shape) {
+ case QTabBar::TriangularWest:
+ case QTabBar::RoundedWest:
+ case QTabBar::TriangularEast:
+ case QTabBar::RoundedEast:
+ tr.adjust(0, 0, 0, tabOverlap);
+ break;
+ case QTabBar::TriangularSouth:
+ case QTabBar::RoundedSouth:
+ case QTabBar::TriangularNorth:
+ case QTabBar::RoundedNorth:
+ default:
+ if (directionMirrored)
+ tr.adjust(-tabOverlap, 0, 0, 0);
+ else
+ tr.adjust(0, 0, tabOverlap, 0);
+ break;
+ }
+ painter->save();
+ QFont f = painter->font();
+ f.setPointSizeF(f.pointSizeF() * 0.72);
+ painter->setFont(f);
+
+ if (option->state & QStyle::State_Selected){
+ optionTab.palette.setColor(QPalette::Active, QPalette::WindowText,
+ QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option));
+ }
+
+ bool verticalTabs = optionTab.shape == QTabBar::RoundedEast
+ || optionTab.shape == QTabBar::RoundedWest
+ || optionTab.shape == QTabBar::TriangularEast
+ || optionTab.shape == QTabBar::TriangularWest;
+ bool selected = optionTab.state & State_Selected;
+ if (verticalTabs) {
+ painter->save();
+ int newX, newY, newRot;
+ if (optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::TriangularEast) {
+ newX = tr.width();
+ newY = tr.y();
+ newRot = 90;
+ } else {
+ newX = 0;
+ newY = tr.y() + tr.height();
+ newRot = -90;
+ }
+ tr.setRect(0, 0, tr.height(), tr.width());
+ QTransform m;
+ m.translate(newX, newY);
+ m.rotate(newRot);
+ painter->setTransform(m, true);
+ }
+ tr.adjust(0, 0, pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget),
+ pixelMetric(QStyle::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));
+ }
+
+ int alignment = Qt::AlignCenter | Qt::TextShowMnemonic;
+ if (!styleHint(SH_UnderlineShortcut, &optionTab, widget))
+ alignment |= Qt::TextHideMnemonic;
+ if (!optionTab.icon.isNull()) {
+ QSize iconSize = optionTab.iconSize;
+ int iconExtent = pixelMetric(PM_TabBarIconSize);
+ if (iconSize.height() > iconExtent || iconSize.width() > iconExtent)
+ iconSize = QSize(iconExtent, iconExtent);
+ QPixmap tabIcon = optionTab.icon.pixmap(iconSize,
+ (optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
+ if (tab->text.isEmpty())
+ painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), tr.center().y() - (tabIcon.height() >>1), tabIcon);
+ else
+ painter->drawPixmap(tr.left() + tabOverlap, tr.center().y() - (tabIcon.height() >>1), tabIcon);
+ tr.setLeft(tr.left() + iconSize.width() + 4);
+ }
+
+ QCommonStyle::drawItemText(painter, tr, alignment, optionTab.palette, tab->state & State_Enabled, tab->text, QPalette::WindowText);
+ if (verticalTabs)
+ painter->restore();
+
+ if (optionTab.state & State_HasFocus) {
+ const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth);
+ const int x1 = optionTab.rect.left();
+ const int x2 = optionTab.rect.right() - 1;
+
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*tab);
+ fropt.rect.setRect(x1 + 1 + OFFSET, optionTab.rect.y() + OFFSET,
+ x2 - x1 - 2*OFFSET, optionTab.rect.height() - 2*OFFSET);
+ drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
+
+ painter->restore();
+ }
+ break;
+#endif // QT_NO_TABBAR
+#ifndef QT_NO_PROGRESSBAR
+ case CE_ProgressBarContents:
+ if (const QStyleOptionProgressBarV2 *optionProgressBar = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ QRect progressRect = optionProgressBar->rect;
+
+ if (optionProgressBar->minimum == optionProgressBar->maximum && optionProgressBar->minimum == 0) {
+ // busy indicator
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect,flags);
+ } else {
+ const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0
+ : (qreal)optionProgressBar->progress / optionProgressBar->maximum;
+ 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);
+ } else {
+ progressRect.adjust(0, 1, 0, -1);
+ progressRect.setTop(progressRect.bottom() - int(progressRect.height() * progressFactor));
+ }
+
+ const QS60StylePrivate::SkinElements skinElement = optionProgressBar->orientation == Qt::Horizontal ?
+ QS60StylePrivate::SE_ProgressBarIndicatorHorizontal : QS60StylePrivate::SE_ProgressBarIndicatorVertical;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, progressRect, flags);
+ }
+ }
+ break;
+ case CE_ProgressBarGroove:
+ if (const QStyleOptionProgressBarV2 *optionProgressBar = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ const QS60StylePrivate::SkinElements skinElement = optionProgressBar->orientation == Qt::Horizontal ?
+ QS60StylePrivate::SE_ProgressBarGrooveHorizontal : QS60StylePrivate::SE_ProgressBarGrooveVertical;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ }
+ break;
+ case CE_ProgressBarLabel:
+ if (const QStyleOptionProgressBarV2 *progressbar = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ QStyleOptionProgressBarV2 optionProgressBar = *progressbar;
+ QCommonStyle::drawItemText(painter, progressbar->rect, flags | Qt::AlignCenter | Qt::TextSingleLine, optionProgressBar.palette,
+ progressbar->state & State_Enabled, progressbar->text, QPalette::WindowText);
+ }
+ break;
+#endif // QT_NO_PROGRESSBAR
+#ifndef QT_NO_MENUBAR
+ case CE_MenuBarItem:
+ if (const QStyleOptionMenuItem *menuBarItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
+ QStyleOptionMenuItem optionMenuBarItem = *menuBarItem;
+ QCommonStyle::drawControl(element, &optionMenuBarItem, painter, widget);
+ }
+ break;
+#endif //QT_NO_MENUBAR
+#ifndef QT_NO_MENU
+ case CE_MenuItem:
+ if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
+ QStyleOptionMenuItem optionMenuItem = *menuItem;
+ const bool enabled = optionMenuItem.state & State_Enabled;
+ const bool checkable = optionMenuItem.checkType != QStyleOptionMenuItem::NotCheckable;
+
+ uint text_flags = Qt::AlignLeading | Qt::TextShowMnemonic | Qt::TextDontClip
+ | Qt::TextSingleLine | Qt::AlignVCenter;
+ if (!styleHint(SH_UnderlineShortcut, menuItem, widget))
+ text_flags |= Qt::TextHideMnemonic;
+
+ QRect iconRect =
+ subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget);
+ QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
+ bool drawSubMenuIndicator = false;
+
+ switch(menuItem->menuItemType) {
+ case QStyleOptionMenuItem::Scroller:
+ case QStyleOptionMenuItem::Separator:
+ return; // no separators or scrollers in S60 menus
+ case QStyleOptionMenuItem::SubMenu:
+ drawSubMenuIndicator = true;
+ break;
+ default:
+ break;
+ }
+
+ if ((option->state & State_Selected) && (option->state & State_Enabled))
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
+
+ //todo: move the vertical spacing stuff into subElementRect
+ const int vSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
+ QStyleOptionMenuItem optionCheckBox;
+ if (checkable){
+ QRect checkBoxRect = optionMenuItem.rect;
+ checkBoxRect.setWidth(pixelMetric(PM_IndicatorWidth));
+ checkBoxRect.setHeight(pixelMetric(PM_IndicatorHeight));
+ optionCheckBox.QStyleOption::operator=(*menuItem);
+ optionCheckBox.rect = checkBoxRect;
+ const int moveByX = checkBoxRect.width()+vSpacing;
+ if (optionMenuItem.direction == Qt::LeftToRight) {
+ textRect.translate(moveByX,0);
+ iconRect.translate(moveByX, 0);
+ iconRect.setWidth(iconRect.width()+vSpacing);
+ textRect.setWidth(textRect.width()-moveByX-vSpacing);
+ } else {
+ textRect.setWidth(textRect.width()-moveByX);
+ iconRect.setWidth(iconRect.width()+vSpacing);
+ iconRect.translate(-optionCheckBox.rect.width()-vSpacing, 0);
+ optionCheckBox.rect.translate(textRect.width()+iconRect.width(),0);
+ }
+ drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
+ }
+ //draw icon and/or checkState
+ QPixmap pix = menuItem->icon.pixmap(pixelMetric(PM_SmallIconSize),
+ enabled ? QIcon::Normal : QIcon::Disabled);
+ const bool itemWithIcon = !pix.isNull();
+ if (itemWithIcon) {
+ drawItemPixmap(painter, iconRect, text_flags, pix);
+ if (optionMenuItem.direction == Qt::LeftToRight)
+ textRect.translate(vSpacing,0);
+ else
+ textRect.translate(-vSpacing,0);
+ textRect.setWidth(textRect.width()-vSpacing);
+ }
+
+ //draw indicators
+ if (drawSubMenuIndicator) {
+ QStyleOptionMenuItem arrowOptions;
+ arrowOptions.QStyleOption::operator=(*menuItem);
+ const int indicatorWidth = (pixelMetric(PM_ListViewIconSize, option, widget)>>1) +
+ pixelMetric(QStyle::PM_LayoutVerticalSpacing, option, widget);
+ if (optionMenuItem.direction == Qt::LeftToRight)
+ arrowOptions.rect.setLeft(textRect.right());
+ arrowOptions.rect.setWidth(indicatorWidth);
+ //by default sub menu indicator in S60 points to east,so here icon
+ // direction is set to north (and south when in RightToLeft)
+ const QS60StylePrivate::SkinElementFlag arrowDirection = (arrowOptions.direction == Qt::LeftToRight) ?
+ QS60StylePrivate::SF_PointNorth : QS60StylePrivate::SF_PointSouth;
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnIndiSubMenu, painter, arrowOptions.rect,
+ (flags | QS60StylePrivate::SF_ColorSkinned | arrowDirection));
+ }
+
+ //draw text
+ if (!enabled){
+ //In s60, if something becomes disabled, it is removed from menu, so no native look-alike available.
+ optionMenuItem.palette.setColor(QPalette::Disabled, QPalette::Text, QS60StylePrivate::lighterColor(
+ optionMenuItem.palette.color(QPalette::Disabled, QPalette::Text)));
+ painter->save();
+ painter->setOpacity(0.5);
+ QCommonStyle::drawItemText(painter, textRect, text_flags,
+ optionMenuItem.palette, enabled,
+ optionMenuItem.text, QPalette::Text);
+ painter->restore();
+ } else {
+ QCommonStyle::drawItemText(painter, textRect, text_flags,
+ optionMenuItem.palette, enabled,
+ optionMenuItem.text, QPalette::Text);
+ }
+ }
+ break;
+#endif //QT_NO_MENU
+
+ //todo: remove non-used widgets in final version
+ case CE_MenuEmptyArea:
+#ifndef QT_NO_MENUBAR
+ case CE_MenuBarEmptyArea:
+ break;
+#endif //QT_NO_MENUBAR
+
+ case CE_HeaderSection:
+ if ( const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
+ painter->save();
+ QPen linePen = QPen(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 1, header));
+ const int penWidth = (header->orientation == Qt::Horizontal) ?
+ linePen.width()+QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth)
+ : linePen.width()+QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth);
+ linePen.setWidth(penWidth);
+ painter->setPen(linePen);
+ if (header->orientation == Qt::Horizontal){
+ painter->drawLine(header->rect.bottomLeft(), header->rect.bottomRight());
+ } else {
+ if ( header->direction == Qt::LeftToRight ) {
+ painter->drawLine(header->rect.topRight(), header->rect.bottomRight());
+ } else {
+ painter->drawLine(header->rect.topLeft(), header->rect.bottomLeft());
+ }
+ }
+ painter->restore();
+ }
+ break;
+ case CE_HeaderEmptyArea:
+ {
+ QS60StylePrivate::SkinElementFlags adjFlags = flags;
+ QRect mtyRect = option->rect;
+ if (option->state & QStyle::State_Horizontal) {
+ mtyRect.adjust(-2,-2,2,-2);
+ } else {
+ if ( option->direction == Qt::LeftToRight ) {
+ mtyRect.adjust(-2,-2,0,2);
+ adjFlags |= QS60StylePrivate::SF_PointWest;
+ } else {
+ mtyRect.adjust(2,2,0,-2);
+ adjFlags |= QS60StylePrivate::SF_PointEast;
+ }
+ }
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags);
+ }
+ break;
+ case CE_Header:
+ if ( const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
+ QS60StylePrivate::SkinElementFlags adjFlags = flags;
+ QRect mtyRect = header->rect;
+ QRect parentRect = widget->parentWidget()->rect();
+ if (header->orientation == Qt::Horizontal) {
+ mtyRect.adjust(-2,-2,2,-2);
+ } else {
+ if ( header->direction == Qt::LeftToRight ) {
+ mtyRect.adjust(-2,-2,0,2);
+ adjFlags |= QS60StylePrivate::SF_PointWest;
+ } else {
+ mtyRect.adjust(2,2,0,-2);
+ adjFlags |= QS60StylePrivate::SF_PointEast;
+ }
+ }
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags);
+ QCommonStyle::drawControl(element, header, painter, widget);
+ }
+ break;
+#ifndef QT_NO_TOOLBAR
+ case CE_ToolBar:
+ if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) {
+ const QToolBar *tbWidget = qobject_cast<const QToolBar *>(widget);
+
+ if (!tbWidget || (widget && qobject_cast<QToolBar *>(widget->parentWidget())))
+ break;
+
+ // Normally in S60 5.0+ there is no background for toolbar, but in some cases with versatile QToolBar,
+ // it looks a bit strange. So, lets fillRect with Button.
+ if (!QS60StylePrivate::isToolBarBackground()) {
+ QList<QAction *> actions = tbWidget->actions();
+ bool justToolButtonsInToolBar = true;
+ for (int i = 0; i < actions.size(); ++i) {
+ QWidget *childWidget = tbWidget->widgetForAction(actions.at(i));
+ const QToolButton *button = qobject_cast<const QToolButton *>(childWidget);
+ if (!button){
+ justToolButtonsInToolBar = false;
+ }
+ }
+
+ // Draw frame background
+ // for vertical toolbars with text only and
+ // for toolbars with extension buttons and
+ // for toolbars with widgets in them.
+ if (!justToolButtonsInToolBar ||
+ (tbWidget &&
+ (tbWidget->orientation() == Qt::Vertical) &&
+ (tbWidget->toolButtonStyle() == Qt::ToolButtonTextOnly))) {
+ painter->save();
+ if (widget)
+ painter->setBrush(widget->palette().button());
+ painter->setOpacity(0.3);
+ painter->fillRect(toolBar->rect, painter->brush());
+ painter->restore();
+ }
+ } else {
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBar, painter, toolBar->rect, flags);
+ }
+ }
+ break;
+#endif //QT_NO_TOOLBAR
+
+ case CE_ShapedFrame:
+ case CE_MenuVMargin:
+ case CE_MenuHMargin:
+#ifndef QT_NO_MENU
+ case CE_MenuScroller:
+ case CE_MenuTearoff:
+#endif //QT_NO_MENU
+
+ case CE_CheckBox:
+ case CE_RadioButton:
+#ifndef QT_NO_TABBAR
+ case CE_TabBarTab:
+#endif //QT_NO_TABBAR
+#ifndef QT_NO_PROGRESSBAR
+ case CE_ProgressBar:
+#endif // QT_NO_PROGRESSBAR
+ case CE_Q3DockWindowEmptyArea:
+#ifndef QT_NO_SIZEGRIP
+ case CE_SizeGrip:
+#endif //QT_NO_SIZEGRIP
+ case CE_Splitter:
+#ifndef QT_NO_RUBBERBAND
+ case CE_RubberBand:
+#endif //QT_NO_RUBBERBAND
+#ifndef QT_NO_DOCKWIDGET
+ case CE_DockWidgetTitle:
+#endif //QT_NO_DOCKWIDGET
+ case CE_ScrollBarAddLine:
+ case CE_ScrollBarSubLine:
+ case CE_ScrollBarAddPage:
+ case CE_ScrollBarSubPage:
+ case CE_ScrollBarSlider:
+ case CE_ScrollBarFirst:
+ case CE_ScrollBarLast:
+ case CE_FocusFrame:
+#ifndef QT_NO_TOOLBOX
+ case CE_ToolBoxTab:
+ case CE_ToolBoxTabShape:
+ case CE_ToolBoxTabLabel:
+#endif //QT_NO_TOOLBOX
+ case CE_ColumnViewGrip:
+ default:
+ QCommonStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+/*!
+ \reimp
+*/
+void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
+ switch (element) {
+#ifndef QT_NO_LINEEDIT
+ case PE_PanelLineEdit:
+ if (const QStyleOptionFrame *lineEdit = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
+#ifndef QT_NO_COMBOBOX
+ if (widget && qobject_cast<const QComboBox *>(widget->parentWidget()))
+ break;
+#endif
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit,
+ painter, option->rect, flags);
+
+ if (lineEdit->state & State_HasFocus)
+ drawPrimitive(PE_FrameFocusRect, lineEdit, painter, widget);
+ }
+ break;
+#endif // QT_NO_LINEEDIT
+ case PE_IndicatorCheckBox:
+ {
+ const QRect indicatorRect = option->rect;
+ // Draw checkbox indicator as color skinned graphics.
+ const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
+ QS60StyleEnums::SP_QgnIndiCheckboxOn : QS60StyleEnums::SP_QgnIndiCheckboxOff;
+ QS60StylePrivate::drawSkinPart(skinPart, painter, indicatorRect,
+ (flags | QS60StylePrivate::SF_ColorSkinned));
+ }
+ break;
+ case PE_IndicatorViewItemCheck:
+ if (const QListView *listItem = (qobject_cast<const QListView *>(widget))) {
+ if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
+ const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator;
+ const bool singleSelection = listItem->selectionMode() ==
+ QAbstractItemView::SingleSelection || listItem->selectionMode() == QAbstractItemView::NoSelection;
+ // draw either checkbox at the beginning
+ if (checkBoxVisible && singleSelection) {
+ drawPrimitive(PE_IndicatorCheckBox, option, painter, widget);
+ // ... or normal "tick" selection at the end.
+ } else if (option->state & QStyle::State_Selected) {
+ QRect tickRect = option->rect;
+ const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
+ // adjust tickmark rect to exclude frame border
+ tickRect.adjust(0,-frameBorderWidth,0,-frameBorderWidth);
+ QS60StyleEnums::SkinParts skinPart = QS60StyleEnums::SP_QgnIndiMarkedAdd;
+ QS60StylePrivate::drawSkinPart(skinPart, painter, tickRect,
+ (flags | QS60StylePrivate::SF_ColorSkinned));
+ }
+ }
+ }
+ break;
+ case PE_IndicatorRadioButton:
+ {
+ QRect buttonRect = option->rect;
+ //there is empty (a. 33%) space in svg graphics for radiobutton
+ const qreal reduceWidth = (qreal)buttonRect.width()/3.0;
+ const qreal rectWidth = (qreal)option->rect.width() != 0 ? option->rect.width() : 1.0;
+ // Try to occupy the full area
+ const qreal scaler = 1 + (reduceWidth/rectWidth);
+ buttonRect.setWidth((int)((buttonRect.width()-reduceWidth) * scaler));
+ buttonRect.setHeight((int)(buttonRect.height() * scaler));
+ // move the rect up for half of the new height-gain
+ const int newY = (buttonRect.bottomRight().y() - option->rect.bottomRight().y()) >> 1 ;
+ buttonRect.adjust(0,-newY,0,-newY);
+
+ // Draw radiobutton indicator as color skinned graphics.
+ QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
+ QS60StyleEnums::SP_QgnIndiRadiobuttOn : QS60StyleEnums::SP_QgnIndiRadiobuttOff;
+ QS60StylePrivate::drawSkinPart(skinPart, painter, buttonRect,
+ (flags | QS60StylePrivate::SF_ColorSkinned));
+ }
+ break;
+ case PE_PanelButtonCommand:
+ case PE_PanelButtonTool:
+ case PE_PanelButtonBevel:
+ case PE_FrameButtonBevel:
+ {
+ const bool isPressed = option->state & QStyle::State_Sunken;
+ const QS60StylePrivate::SkinElements skinElement =
+ isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ }
+ break;
+#ifndef QT_NO_TOOLBUTTON
+ case PE_IndicatorArrowDown:
+ case PE_IndicatorArrowLeft:
+ case PE_IndicatorArrowRight:
+ case PE_IndicatorArrowUp:
+ {
+ QS60StyleEnums::SkinParts skinPart;
+ if (element==PE_IndicatorArrowDown)
+ skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
+ else if (element==PE_IndicatorArrowLeft)
+ skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowLeft;
+ else if (element==PE_IndicatorArrowRight)
+ skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowRight;
+ else if (element==PE_IndicatorArrowUp)
+ skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowUp;
+
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
+ }
+ break;
+#endif //QT_NO_TOOLBUTTON
+#ifndef QT_NO_SPINBOX
+ case PE_IndicatorSpinDown:
+ case PE_IndicatorSpinUp:
+ if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
+ QStyleOptionSpinBox optionSpinBox = *spinBox;
+ const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
+ QS60StyleEnums::SP_QgnGrafScrollArrowUp :
+ QS60StyleEnums::SP_QgnGrafScrollArrowDown;
+ const int adjustment = qMin(optionSpinBox.rect.width(), optionSpinBox.rect.height())/6;
+ optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
+ QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect,flags);
+ }
+#ifndef QT_NO_COMBOBOX
+ else if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
+ // We want to draw down arrow here for comboboxes as well.
+ const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
+ QStyleOptionFrame comboBox = *cmb;
+ const int adjustment = qMin(comboBox.rect.width(), comboBox.rect.height())/6;
+ comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
+ QS60StylePrivate::drawSkinPart(part, painter, comboBox.rect,flags);
+ }
+#endif //QT_NO_COMBOBOX
+ break;
+ case PE_IndicatorSpinMinus:
+ case PE_IndicatorSpinPlus:
+ if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
+ QStyleOptionSpinBox optionSpinBox = *spinBox;
+ QCommonStyle::drawPrimitive(element, &optionSpinBox, painter, widget);
+ }
+#ifndef QT_NO_COMBOBOX
+ else if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
+ // We want to draw down arrow here for comboboxes as well.
+ QStyleOptionFrame comboBox = *cmb;
+ comboBox.rect.adjust(0,2,0,-2);
+ QCommonStyle::drawPrimitive(element, &comboBox, painter, widget);
+ }
+#endif //QT_NO_COMBOBOX
+ break;
+#endif //QT_NO_SPINBOX
+ case PE_FrameFocusRect:
+ if (!(widget && qobject_cast<const QCalendarWidget *>(widget->parent())) ||
+ qobject_cast<const QComboBoxListView *>(widget)) {
+ // no focus selection for touch
+ if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) {
+ painter->save();
+ const int penWidth = QS60StylePrivate::focusRectPenWidth();
+#ifdef QT_KEYPAD_NAVIGATION
+ const Qt::PenStyle penStyle = widget->hasEditFocus() ? Qt::SolidLine :Qt::DotLine;
+ const qreal opacity = widget->hasEditFocus() ? 0.6 : 0.4;
+#else
+ const Qt::PenStyle penStyle = Qt::SolidLine;
+ const qreal opacity = 0.5;
+#endif
+ painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth, penStyle));
+ painter->setRenderHint(QPainter::Antialiasing);
+ painter->setOpacity(opacity);
+ // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred.
+ const qreal rectAdjustment = penWidth % 2?.5:0;
+ // Also we try to stay inside the option->rect, with penWidth > 1. Therefore these +1/-1
+ const QRectF adjustedRect = QRectF(option->rect).adjusted(
+ rectAdjustment + penWidth - 1,
+ rectAdjustment + penWidth - 1,
+ -rectAdjustment - penWidth + 1,
+ -rectAdjustment - penWidth + 1);
+ painter->drawRoundedRect(adjustedRect, penWidth * 1.5, penWidth * 1.5);
+ painter->restore();
+ }
+ }
+ break;
+ case PE_Widget:
+ if (QS60StylePrivate::isSkinnableDialog(widget) ||
+ qobject_cast<const QComboBoxListView *>(widget) ||
+ qobject_cast<const QMenu *> (widget)) {
+ QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ }
+ break;
+ case PE_FrameWindow:
+ case PE_FrameTabWidget:
+ if (const QStyleOptionTabWidgetFrame *tabFrame = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option)) {
+ QStyleOptionTabWidgetFrame optionTabFrame = *tabFrame;
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PanelBackground, painter, optionTabFrame.rect, flags);
+ }
+ break;
+ case PE_IndicatorHeaderArrow:
+ if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
+ if (header->sortIndicator & QStyleOptionHeader::SortUp)
+ drawPrimitive(PE_IndicatorArrowUp, header, painter, widget);
+ else if (header->sortIndicator & QStyleOptionHeader::SortDown)
+ drawPrimitive(PE_IndicatorArrowDown, header, painter, widget);
+ } // QStyleOptionHeader::None is not drawn => not needed
+ break;
+#ifndef QT_NO_GROUPBOX
+ case PE_FrameGroupBox:
+ if (const QStyleOptionFrameV2 *frame = qstyleoption_cast<const QStyleOptionFrameV2 *>(option))
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_SettingsList, painter, frame->rect, flags);
+ break;
+#endif //QT_NO_GROUPBOX
+
+ // Qt3 primitives are not supported
+ case PE_Q3CheckListController:
+ case PE_Q3CheckListExclusiveIndicator:
+ case PE_Q3CheckListIndicator:
+ case PE_Q3DockWindowSeparator:
+ case PE_Q3Separator:
+ Q_ASSERT(false);
+ break;
+ case PE_Frame:
+ if (const QStyleOptionFrameV3 *frame = qstyleoption_cast<const QStyleOptionFrameV3 *>(option))
+ drawPrimitive(PE_FrameFocusRect, frame, painter, widget);
+ break;
+#ifndef QT_NO_ITEMVIEWS
+ case PE_PanelItemViewItem:
+ case PE_PanelItemViewRow: // ### Qt 5: remove
+ if (qobject_cast<const QTableView *>(widget) && qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableItem, painter, option->rect, flags);
+ break;
+#endif //QT_NO_ITEMVIEWS
+
+ case PE_IndicatorMenuCheckMark:
+ if (const QStyleOptionMenuItem *checkBox = qstyleoption_cast<const QStyleOptionMenuItem *>(option)){
+ QStyleOptionMenuItem optionCheckBox = *checkBox;
+ if (optionCheckBox.checked)
+ optionCheckBox.state = (optionCheckBox.state | State_On);
+ drawPrimitive(PE_IndicatorCheckBox, &optionCheckBox, painter, widget);
+ }
+ break;
+#ifndef QT_NO_TOOLBAR
+ case PE_IndicatorToolBarHandle:
+ // no toolbar handles in S60/AVKON UI
+ case PE_IndicatorToolBarSeparator:
+ // no separators in S60/AVKON UI
+ break;
+#endif //QT_NO_TOOLBAR
+
+ case PE_PanelMenuBar:
+ case PE_FrameMenu:
+ break; //disable frame in menu
+
+ case PE_IndicatorBranch:
+ {
+#if defined(Q_WS_S60)
+ if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) {
+#else
+ if (true) {
+#endif
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ } else {
+ const bool rightLine = option->state & State_Item;
+ const bool downLine = option->state & State_Sibling;
+ const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling);
+
+ QS60StyleEnums::SkinParts skinPart;
+ bool drawSkinPart = false;
+ if (rightLine && downLine && upLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch;
+ drawSkinPart = true;
+ } else if (rightLine && upLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd;
+ drawSkinPart = true;
+ } else if (upLine && downLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight;
+ drawSkinPart = true;
+ }
+
+ if ( drawSkinPart ) {
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect,
+ (flags | QS60StylePrivate::SF_ColorSkinned));
+ }
+
+ if (option->state & State_Children) {
+ QS60StyleEnums::SkinParts skinPart =
+ (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
+ int minDimension = qMin(option->rect.width(), option->rect.height());
+ const int resizeValue = minDimension >> 1;
+ minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
+ QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
+ int verticalMagic(0);
+ // magic values for positioning svg icon.
+ if (option->rect.width() <= option->rect.height())
+ verticalMagic = 3;
+ iconRect.translate(3, verticalMagic - resizeValue);
+ QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
+ }
+ }
+ }
+ break;
+
+ // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
+ case PE_FrameLineEdit:
+ case PE_IndicatorButtonDropDown:
+ case PE_IndicatorDockWidgetResizeHandle:
+ case PE_PanelTipLabel:
+ case PE_PanelScrollAreaCorner:
+
+#ifndef QT_NO_TABBAR
+ case PE_IndicatorTabTear: // No tab tear in S60
+#endif // QT_NO_TABBAR
+ case PE_FrameDefaultButton:
+#ifndef QT_NO_DOCKWIDGET
+ case PE_FrameDockWidget:
+#endif //QT_NO_DOCKWIDGET
+#ifndef QT_NO_PROGRESSBAR
+ case PE_IndicatorProgressChunk:
+#endif //QT_NO_PROGRESSBAR
+#ifndef QT_NO_TOOLBAR
+ case PE_PanelToolBar:
+#endif //QT_NO_TOOLBAR
+#ifndef QT_NO_COLUMNVIEW
+ case PE_IndicatorColumnViewArrow:
+ case PE_IndicatorItemViewItemDrop:
+#endif //QT_NO_COLUMNVIEW
+ case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt.
+ default:
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ }
+}
+
+/*!
+ \reimp - sets the default colors
+*/
+void QS60Style::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette & palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const
+{
+ QPalette override = palette;
+ QCommonStyle::drawItemText(painter, rectangle, alignment, override, enabled, text, textRole);
+}
+
+/*!
+ \reimp
+*/
+int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
+{
+ int metricValue = QS60StylePrivate::pixelMetric(metric);
+ if (metricValue == KNotFound)
+ metricValue = QCommonStyle::pixelMetric(metric, option, widget);
+
+ if (metric == PM_SubMenuOverlap && widget){
+ const int widgetWidth = widget->width();
+ const QMenu *menu = qobject_cast<const QMenu *>(widget);
+ if (menu && menu->activeAction() && menu->activeAction()->menu()) {
+ const int menuWidth = menu->activeAction()->menu()->sizeHint().width();
+ metricValue = -menuWidth;
+ }
+ }
+ return metricValue;
+}
+/*! \reimp */
+QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
+ const QSize &csz, const QWidget *widget) const
+{
+ QSize sz(csz);
+ switch (ct) {
+ case CT_PushButton:
+ sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))
+ if (buttonWidget->isCheckable())
+ sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0);
+ break;
+ case CT_LineEdit:
+ if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
+ sz += QSize(2*f->lineWidth, 4*f->lineWidth);
+ break;
+ default:
+ sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ break;
+ }
+ return sz;
+}
+/*! \reimp */
+int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *widget,
+ QStyleHintReturn *hret) const
+{
+ int retValue = -1;
+ switch (sh) {
+ case SH_Table_GridLineColor: {
+ QColor lineColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0);
+ retValue = lineColor.rgb();
+ }
+ break;
+ case SH_GroupBox_TextLabelColor: {
+ QColor groupBoxTxtColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0);
+ retValue = groupBoxTxtColor.rgb();
+ }
+ break;
+ case SH_ScrollBar_ScrollWhenPointerLeavesControl:
+ retValue = true;
+ break;
+ case SH_Slider_SnapToValue:
+ retValue = true;
+ break;
+ case SH_Slider_StopMouseOverSlider:
+ retValue = true;
+ break;
+ case SH_LineEdit_PasswordCharacter:
+ retValue = '*';
+ break;
+ case SH_ComboBox_PopupFrameStyle:
+ retValue = QFrame::NoFrame;
+ break;
+ case SH_Dial_BackgroundRole:
+ retValue = QPalette::Base;
+ default:
+ break;
+ }
+ if (retValue == -1)
+ retValue = QCommonStyle::styleHint(sh, opt, widget, hret);
+ return retValue;
+}
+
+
+/*!
+ \reimp
+*/
+QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl scontrol, const QWidget *widget) const
+{
+ QRect ret;
+ switch (control) {
+#ifndef QT_NO_SCROLLBAR
+ // This implementation of subControlRect(CC_ScrollBar..) basically just removes the SC_ScrollBarSubLine and SC_ScrollBarAddLine
+ case CC_ScrollBar:
+ if (const QStyleOptionSlider *scrollbarOption = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
+ const QRect scrollBarRect = scrollbarOption->rect;
+ const bool isHorizontal = scrollbarOption->orientation == Qt::Horizontal;
+ const int maxlen = isHorizontal ? scrollBarRect.width() : scrollBarRect.height();
+ int sliderlen;
+
+ // calculate slider length
+ if (scrollbarOption->maximum != scrollbarOption->minimum) {
+ const uint range = scrollbarOption->maximum - scrollbarOption->minimum;
+ sliderlen = (qint64(scrollbarOption->pageStep) * maxlen) / (range + scrollbarOption->pageStep);
+
+ int slidermin = pixelMetric(PM_ScrollBarSliderMin, scrollbarOption, widget);
+ if (sliderlen < slidermin || range > (INT_MAX>>1))
+ sliderlen = slidermin;
+ if (sliderlen > maxlen)
+ sliderlen = maxlen;
+ } else {
+ sliderlen = maxlen;
+ }
+
+ const int sliderstart = sliderPositionFromValue(scrollbarOption->minimum,
+ scrollbarOption->maximum,
+ scrollbarOption->sliderPosition,
+ maxlen - sliderlen,
+ scrollbarOption->upsideDown);
+
+ switch (scontrol) {
+ case SC_ScrollBarSubLine: // top/left button
+ case SC_ScrollBarAddLine: // bottom/right button
+ break;
+ case SC_ScrollBarSubPage: // between top/left button and slider
+ if (isHorizontal)
+ ret.setRect(0, 0, sliderstart, scrollBarRect.height());
+ else
+ ret.setRect(0, 0, scrollBarRect.width(), sliderstart);
+ break;
+ case SC_ScrollBarAddPage: // between bottom/right button and slider
+ {
+ const int addPageLength = sliderstart + sliderlen;
+ if (isHorizontal)
+ ret = scrollBarRect.adjusted(addPageLength, 0, 0, 0);
+ else
+ ret = scrollBarRect.adjusted(0, addPageLength, 0, 0);
+ }
+ break;
+ case SC_ScrollBarGroove:
+ ret = scrollBarRect;
+ break;
+ case SC_ScrollBarSlider:
+ if (scrollbarOption->orientation == Qt::Horizontal)
+ ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
+ else
+ ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
+ break;
+ default:
+ break;
+ }
+ ret = visualRect(scrollbarOption->direction, scrollBarRect, ret);
+ }
+ break;
+#endif // QT_NO_SCROLLBAR
+ case CC_SpinBox:
+ 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;
+ QSize buttonSize;
+ buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness));
+ buttonSize.setWidth(buttonWidth);
+ buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
+
+ const int y = frameThickness + spinbox->rect.y();
+ const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width();
+
+ switch (scontrol) {
+ case SC_SpinBoxUp:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ return QRect();
+ ret = QRect(x, y, buttonWidth, buttonSize.height());
+ break;
+ case SC_SpinBoxDown:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ return QRect();
+ ret = QRect(x+buttonSize.width(), y, buttonWidth, buttonSize.height());
+ break;
+ case SC_SpinBoxEditField:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ ret = QRect(
+ frameThickness,
+ frameThickness,
+ spinbox->rect.width() - 2*frameThickness,
+ spinbox->rect.height() - 2*frameThickness);
+ else
+ ret = QRect(
+ frameThickness,
+ frameThickness,
+ x - frameThickness,
+ spinbox->rect.height() - 2*frameThickness);
+ break;
+ case SC_SpinBoxFrame:
+ ret = spinbox->rect;
+ break;
+ default:
+ break;
+ }
+ ret = visualRect(spinbox->direction, spinbox->rect, ret);
+ }
+ break;
+ case CC_ComboBox:
+ if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
+ ret = cmb->rect;
+ const int width = cmb->rect.width();
+ const int height = cmb->rect.height();
+ 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 = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize);
+ int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth;
+ const int ypos = cmb->rect.y();
+
+ QSize buttonSize;
+ buttonSize.setHeight(qMax(8, (cmb->rect.height()>>1) - frameThickness)); //minimum of 8 pixels
+ buttonSize.setWidth(buttonWidth+2*buttonMargin);
+ buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
+ switch (scontrol) {
+ case SC_ComboBoxArrow:
+ 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();
+ ret = QRect(
+ frameThickness,
+ frameThickness,
+ withFrameX - frameThickness,
+ cmb->rect.height() - 2*frameThickness);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case CC_GroupBox:
+ if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
+ ret = QCommonStyle::subControlRect(control, option, scontrol, widget);
+ switch (scontrol) {
+ case SC_GroupBoxCheckBox: //fallthrough
+ 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);
+ const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin);
+ ret.adjust(2,horizontalSpacing-3,0,0);
+ break;
+ case SC_GroupBoxFrame: {
+ const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget);
+ const int tbHeight = textBox.height();
+ ret.translate(0, -ret.y());
+ // include title to within the groupBox frame
+ ret.setHeight(ret.height()+tbHeight);
+ if (widget && ret.bottom() > widget->rect().bottom())
+ ret.setBottom(widget->rect().bottom());
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ default:
+ ret = QCommonStyle::subControlRect(control, option, scontrol, widget);
+ }
+ return ret;
+}
+
+QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, const QWidget *widget) const
+{
+ QRect ret;
+ switch (element) {
+ case SE_LineEditContents: {
+ // in S60 the input text box doesn't start from line Edit's TL, but
+ // a bit indented.
+ // todo: Should we NOT do this for combo boxes and spin boxes?
+ QRect lineEditRect = opt->rect;
+ int adjustment = opt->rect.height()>>2;
+ lineEditRect.adjust(adjustment,0,0,0);
+ ret = lineEditRect;
+ }
+ break;
+ case SE_TabBarTearIndicator:
+ ret = QRect(0,0,0,0);
+ break;
+ case SE_TabWidgetTabBar:
+ if (const QStyleOptionTabWidgetFrame *optionTab = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
+ ret = QCommonStyle::subElementRect(element, opt, widget);
+
+ if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
+ const int tabOverlapNoBorder =
+ QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap);
+ const int tabOverlap =
+ tabOverlapNoBorder-QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
+ const QTabWidget *tab = qobject_cast<const QTabWidget *>(widget);
+ int gain = (tab) ? tabOverlap * tab->count() : 0;
+ switch (twf->shape) {
+ case QTabBar::RoundedNorth:
+ case QTabBar::TriangularNorth:
+ case QTabBar::RoundedSouth:
+ case QTabBar::TriangularSouth: {
+ if (widget) {
+ // make sure that gain does not set the rect outside of widget boundaries
+ if (twf->direction == Qt::RightToLeft) {
+ if ((ret.left() - gain) < widget->rect().left())
+ gain = widget->rect().left()-ret.left();
+ ret.adjust(-gain,0,0,0);
+ } else {
+ if ((ret.right() + gain) > widget->rect().right())
+ gain = widget->rect().right()-ret.right();
+ ret.adjust(0,0,gain,0);
+ }
+ }
+ break;
+ }
+ default: {
+ if (widget) {
+ if ((ret.bottom() + gain) > widget->rect().bottom())
+ gain = widget->rect().bottom()-ret.bottom();
+ ret.adjust(0,0,0,gain);
+ }
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case SE_ItemViewItemText:
+ case SE_ItemViewItemDecoration:
+ if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
+ const QListWidget *listItem = qobject_cast<const QListWidget *>(widget);
+ const bool multiSelection = !listItem ? false :
+ listItem->selectionMode() == QAbstractItemView::MultiSelection ||
+ listItem->selectionMode() == QAbstractItemView::ExtendedSelection ||
+ listItem->selectionMode() == QAbstractItemView::ContiguousSelection;
+ ret = QCommonStyle::subElementRect(element, opt, widget);
+ // If both multiselect & check-state, then remove checkbox and move
+ // text and decoration towards the beginning
+ if (listItem &&
+ multiSelection &&
+ (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator)) {
+ const int verticalSpacing =
+ QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
+ //const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
+ const int checkBoxRectWidth = subElementRect(SE_ItemViewItemCheckIndicator, opt, widget).width();
+ ret.adjust(-checkBoxRectWidth-verticalSpacing,0,-checkBoxRectWidth-verticalSpacing,0);
+ }
+ } else if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
+ const bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable;
+ const bool subMenu = menuItem->menuItemType == QStyleOptionMenuItem::SubMenu;
+ int indicatorWidth = checkable ?
+ pixelMetric(PM_ListViewIconSize, opt, widget) :
+ pixelMetric(PM_SmallIconSize, opt, widget);
+ ret = menuItem->rect;
+ const int verticalSpacing =
+ QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
+
+ if (element == SE_ItemViewItemDecoration) {
+ if (menuItem->direction == Qt::RightToLeft)
+ ret.translate(ret.width()-indicatorWidth, 0);
+ ret.setWidth(indicatorWidth);
+ } else {
+ ret = menuItem->rect;
+ if (!menuItem->icon.isNull())
+ if (menuItem->direction == Qt::LeftToRight)
+ ret.adjust(indicatorWidth, 0, 0, 0);
+ else
+ ret.adjust(0, 0, -indicatorWidth, 0);
+
+ // Make room for submenu indicator
+ if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu){
+ // submenu indicator is very small, so lets halve the rect
+ indicatorWidth = indicatorWidth >> 1;
+ if (menuItem->direction == Qt::LeftToRight)
+ ret.adjust(0,0,-indicatorWidth,0);
+ else
+ ret.adjust(indicatorWidth,0,0,0);
+ }
+ }
+ }
+ break;
+ case SE_ItemViewItemCheckIndicator:
+ if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
+ const QListWidget *listItem = qobject_cast<const QListWidget *>(widget);
+
+ const bool singleSelection = listItem &&
+ (listItem->selectionMode() == QAbstractItemView::SingleSelection ||
+ listItem->selectionMode() == QAbstractItemView::NoSelection);
+ const bool checkBoxOnly = (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) &&
+ listItem &&
+ 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 itemHeight = opt->rect.height();
+ int heightOffset = 0;
+ if (indicatorHeight < itemHeight)
+ heightOffset = ((itemHeight - indicatorHeight)>>1);
+ if (checkBoxOnly) {
+ // Move rect and make it slightly smaller, so that
+ // a) highlight border does not cross the rect
+ // b) in s60 list checkbox is smaller than normal checkbox
+ ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3);
+ } else {
+ ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset,
+ indicatorWidth, indicatorHeight);
+ }
+ }
+ break;
+ case SE_HeaderLabel:
+ ret = QCommonStyle::subElementRect(element, opt, widget);
+ if (qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
+ // Subtract area needed for line
+ if (opt->state & State_Horizontal)
+ ret.setHeight(ret.height() - QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth));
+ else
+ ret.setWidth(ret.width() - QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth));
+ }
+ ret = visualRect(opt->direction, opt->rect, ret);
+ break;
+ case SE_FrameContents:
+ if (QS60StylePrivate::isTouchSupported()) {
+ return QCommonStyle::subElementRect(element, opt, widget);
+ } else if (const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
+ // We shrink the frame contents by focusFrameWidth, so that we can draw the frame around it in keypad navigation mode.
+ const int frameWidth = QS60StylePrivate::focusRectPenWidth();
+ ret = opt->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
+ ret = visualRect(opt->direction, opt->rect, ret);
+ }
+ break;
+ default:
+ ret = QCommonStyle::subElementRect(element, opt, widget);
+ }
+ return ret;
+}
+
+void QS60Style::setStyleProperty(const char *name, const QVariant &value)
+{
+ Q_D(QS60Style);
+ d->setStyleProperty_specific(name, value);
+}
+
+QVariant QS60Style::styleProperty(const char *name) const
+{
+ Q_D(const QS60Style);
+ return d->styleProperty_specific(name);
+}
+
+QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
+ const QStyleOption *option, const QWidget *widget) const
+{
+ const int iconDimension = QS60StylePrivate::pixelMetric(QStyle::PM_ToolBarIconSize);
+ const QRect iconSize = (!option) ? QRect(0,0,iconDimension,iconDimension) : option->rect;
+ QS60StyleEnums::SkinParts part;
+ QS60StylePrivate::SkinElementFlags adjustedFlags;
+ if (option)
+ adjustedFlags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
+
+ switch(standardIcon) {
+ case QStyle::SP_MessageBoxWarning:
+ part = QS60StyleEnums::SP_QgnNoteWarning;
+ break;
+ case QStyle::SP_MessageBoxInformation:
+ part = QS60StyleEnums::SP_QgnNoteInfo;
+ break;
+ case QStyle::SP_MessageBoxCritical:
+ part = QS60StyleEnums::SP_QgnNoteError;
+ break;
+ case QStyle::SP_MessageBoxQuestion:
+ part = QS60StyleEnums::SP_QgnNoteQuery;
+ break;
+ case QStyle::SP_ArrowRight:
+ part = QS60StyleEnums::SP_QgnIndiNaviArrowRight;
+ break;
+ case QStyle::SP_ArrowLeft:
+ part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
+ break;
+ case QStyle::SP_ArrowUp:
+ part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
+ adjustedFlags |= QS60StylePrivate::SF_PointEast;
+ break;
+ case QStyle::SP_ArrowDown:
+ part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
+ adjustedFlags |= QS60StylePrivate::SF_PointWest;
+ break;
+ case QStyle::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:
+ if (QApplication::layoutDirection() == Qt::RightToLeft)
+ return QS60Style::standardIcon(SP_ArrowLeft, option, widget);
+ return QS60Style::standardIcon(SP_ArrowRight, option, widget);
+ case QStyle::SP_ComputerIcon:
+ part = QS60StyleEnums::SP_QgnPropPhoneMemcLarge;
+ break;
+ case QStyle::SP_DirClosedIcon:
+ part = QS60StyleEnums::SP_QgnPropFolderSmall;
+ break;
+ case QStyle::SP_DirOpenIcon:
+ part = QS60StyleEnums::SP_QgnPropFolderCurrent;
+ break;
+ case QStyle::SP_DirIcon:
+ part = QS60StyleEnums::SP_QgnPropFolderSmall;
+ break;
+ case QStyle::SP_FileDialogNewFolder:
+ part = QS60StyleEnums::SP_QgnPropFolderSmallNew;
+ break;
+ case QStyle::SP_FileIcon:
+ part = QS60StyleEnums::SP_QgnPropFileSmall;
+ break;
+ case QStyle::SP_TrashIcon:
+ part = QS60StyleEnums::SP_QgnNoteErased;
+ break;
+ case QStyle::SP_ToolBarHorizontalExtensionButton:
+ part = QS60StyleEnums::SP_QgnIndiSubMenu;
+ if (QApplication::layoutDirection() == Qt::RightToLeft)
+ adjustedFlags |= QS60StylePrivate::SF_PointSouth;
+ break;
+ case QStyle::SP_ToolBarVerticalExtensionButton:
+ adjustedFlags |= QS60StylePrivate::SF_PointEast;
+ part = QS60StyleEnums::SP_QgnIndiSubMenu;
+ break;
+
+ default:
+ return QCommonStyle::standardIconImplementation(standardIcon, option, widget);
+ }
+ const QS60StylePrivate::SkinElementFlags flags = adjustedFlags;
+ const QPixmap cachedPixMap(QS60StylePrivate::cachedPart(part, iconSize.size(), flags));
+ return cachedPixMap.isNull() ?
+ QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap);
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_STYLE_S60 || QT_PLUGIN
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
new file mode 100644
index 0000000000..945e1826fd
--- /dev/null
+++ b/src/gui/styles/qs60style.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QS60STYLE_H
+#define QS60STYLE_H
+
+#include <QtGui/qcommonstyle.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+#if !defined(QT_NO_STYLE_S60)
+
+class QS60StylePrivate;
+
+class Q_GUI_EXPORT QS60Style : public QCommonStyle
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QS60Style)
+
+public:
+ QS60Style();
+ ~QS60Style();
+
+ void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
+ QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const;
+ int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
+ QStyleHintReturn *shret = 0) const;
+ QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl scontrol, const QWidget *widget = 0) const;
+ QRect subElementRect(SubElement element, const QStyleOption *opt, const QWidget *widget = 0) const;
+ void polish(QWidget *widget);
+ void unpolish(QWidget *widget);
+ void polish(QApplication *application);
+ void unpolish(QApplication *application);
+
+ void setStyleProperty(const char *name, const QVariant &value);
+ QVariant styleProperty(const char *name) const;
+
+#ifndef Q_WS_S60
+ static QStringList partKeys();
+ static QStringList colorListKeys();
+ void setS60Theme(const QHash<QString, QPicture> &parts,
+ const QHash<QPair<QString , int>, QColor> &colors);
+#endif // !Q_WS_S60
+
+#ifdef Q_WS_S60
+public slots:
+ void handleDynamicLayoutVariantSwitch();
+ void handleSkinChange();
+#endif // Q_WS_S60
+
+protected slots:
+ QIcon standardIconImplementation(
+ StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const;
+
+private:
+ Q_DISABLE_COPY(QS60Style)
+ friend class QStyleFactory;
+ QPalette originalPalette;
+};
+
+#endif // QT_NO_STYLE_S60
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QS60STYLE_H
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
new file mode 100644
index 0000000000..cf850c6a5d
--- /dev/null
+++ b/src/gui/styles/qs60style_p.h
@@ -0,0 +1,433 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QS60STYLE_P_H
+#define QS60STYLE_P_H
+
+#include "qs60style.h"
+#include "qcommonstyle_p.h"
+#include <QtCore/qhash.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+const int MAX_NON_CUSTOM_PIXELMETRICS = 92;
+const int CUSTOMVALUESCOUNT = 4;
+enum {
+ PM_Custom_FrameCornerWidth = MAX_NON_CUSTOM_PIXELMETRICS,
+ PM_Custom_FrameCornerHeight,
+ PM_Custom_BoldLineWidth,
+ PM_Custom_ThinLineWidth
+ };
+const int MAX_PIXELMETRICS = MAX_NON_CUSTOM_PIXELMETRICS + CUSTOMVALUESCOUNT;
+
+typedef struct {
+ unsigned short height;
+ unsigned short width;
+ int major_version;
+ int minor_version;
+ bool mirroring; // TODO: (nice to have) Use Qt::LayoutDirection
+ QString layoutName;
+} layoutHeader;
+
+#ifdef Q_OS_SYMBIAN
+NONSHARABLE_CLASS (QS60StyleEnums)
+#else
+class QS60StyleEnums
+#endif
+: public QObject
+{
+#ifndef Q_WS_S60
+ Q_OBJECT
+ Q_ENUMS(FontCategories)
+ Q_ENUMS(SkinParts)
+ Q_ENUMS(ColorLists)
+#endif // !Q_WS_S60
+
+public:
+ // S60 look-and-feel font categories
+ enum FontCategories {
+ FC_Undefined,
+ FC_Primary,
+ FC_Secondary,
+ FC_Title,
+ FC_PrimarySmall,
+ FC_Digital
+ };
+
+ enum SkinParts {
+ SP_QgnGrafBarWait,
+ SP_QgnGrafBarFrameCenter,
+ SP_QgnGrafBarFrameSideL,
+ SP_QgnGrafBarFrameSideR,
+ SP_QgnGrafBarProgress,
+ SP_QgnGrafScrollArrowDown,
+ SP_QgnGrafScrollArrowLeft,
+ SP_QgnGrafScrollArrowRight,
+ SP_QgnGrafScrollArrowUp,
+ SP_QgnGrafTabActiveL,
+ SP_QgnGrafTabActiveM,
+ SP_QgnGrafTabActiveR,
+ SP_QgnGrafTabPassiveL,
+ SP_QgnGrafTabPassiveM,
+ SP_QgnGrafTabPassiveR,
+ SP_QgnIndiCheckboxOff,
+ SP_QgnIndiCheckboxOn,
+ SP_QgnIndiHlColSuper, // Available in S60 release 3.2 and later.
+ SP_QgnIndiHlExpSuper, // Available in S60 release 3.2 and later.
+ SP_QgnIndiHlLineBranch, // Available in S60 release 3.2 and later.
+ SP_QgnIndiHlLineEnd, // Available in S60 release 3.2 and later.
+ SP_QgnIndiHlLineStraight, // Available in S60 release 3.2 and later.
+ SP_QgnIndiMarkedAdd,
+ SP_QgnIndiNaviArrowLeft,
+ SP_QgnIndiNaviArrowRight,
+ SP_QgnIndiRadiobuttOff,
+ SP_QgnIndiRadiobuttOn,
+ SP_QgnIndiSliderEdit,
+ SP_QgnIndiSubMenu,
+ SP_QgnNoteErased,
+ SP_QgnNoteError,
+ SP_QgnNoteInfo,
+ SP_QgnNoteOk,
+ SP_QgnNoteQuery,
+ SP_QgnNoteWarning,
+ SP_QgnPropFileSmall,
+ SP_QgnPropFolderCurrent,
+ SP_QgnPropFolderSmall,
+ SP_QgnPropFolderSmallNew,
+ SP_QgnPropPhoneMemcLarge,
+ SP_QsnCpScrollHandleBottomPressed, //ScrollBar handle, pressed state
+ SP_QsnCpScrollHandleMiddlePressed,
+ SP_QsnCpScrollHandleTopPressed,
+ SP_QsnBgScreen,
+ SP_QsnCpScrollBgBottom,
+ SP_QsnCpScrollBgMiddle,
+ SP_QsnCpScrollBgTop,
+ SP_QsnCpScrollHandleBottom,
+ SP_QsnCpScrollHandleMiddle,
+ SP_QsnCpScrollHandleTop,
+ SP_QsnFrButtonTbCornerTl, // Button, normal state
+ SP_QsnFrButtonTbCornerTr,
+ SP_QsnFrButtonTbCornerBl,
+ SP_QsnFrButtonTbCornerBr,
+ SP_QsnFrButtonTbSideT,
+ SP_QsnFrButtonTbSideB,
+ SP_QsnFrButtonTbSideL,
+ SP_QsnFrButtonTbSideR,
+ SP_QsnFrButtonTbCenter,
+ SP_QsnFrButtonTbCornerTlPressed, // Button, pressed state
+ SP_QsnFrButtonTbCornerTrPressed,
+ SP_QsnFrButtonTbCornerBlPressed,
+ SP_QsnFrButtonTbCornerBrPressed,
+ SP_QsnFrButtonTbSideTPressed,
+ SP_QsnFrButtonTbSideBPressed,
+ SP_QsnFrButtonTbSideLPressed,
+ SP_QsnFrButtonTbSideRPressed,
+ SP_QsnFrButtonTbCenterPressed,
+ SP_QsnFrCaleCornerTl, // calendar grid item
+ SP_QsnFrCaleCornerTr,
+ SP_QsnFrCaleCornerBl,
+ SP_QsnFrCaleCornerBr,
+ SP_QsnFrCaleGSideT,
+ SP_QsnFrCaleGSideB,
+ SP_QsnFrCaleGSideL,
+ SP_QsnFrCaleGSideR,
+ SP_QsnFrCaleCenter,
+ SP_QsnFrCaleHeadingCornerTl, // calendar grid header
+ SP_QsnFrCaleHeadingCornerTr,
+ SP_QsnFrCaleHeadingCornerBl,
+ SP_QsnFrCaleHeadingCornerBr,
+ SP_QsnFrCaleHeadingSideT,
+ SP_QsnFrCaleHeadingSideB,
+ SP_QsnFrCaleHeadingSideL,
+ SP_QsnFrCaleHeadingSideR,
+ SP_QsnFrCaleHeadingCenter,
+ SP_QsnFrInputCornerTl, // Text input field
+ SP_QsnFrInputCornerTr,
+ SP_QsnFrInputCornerBl,
+ SP_QsnFrInputCornerBr,
+ SP_QsnFrInputSideT,
+ SP_QsnFrInputSideB,
+ SP_QsnFrInputSideL,
+ SP_QsnFrInputSideR,
+ SP_QsnFrInputCenter,
+ SP_QsnFrListCornerTl, // List background
+ SP_QsnFrListCornerTr,
+ SP_QsnFrListCornerBl,
+ SP_QsnFrListCornerBr,
+ SP_QsnFrListSideT,
+ SP_QsnFrListSideB,
+ SP_QsnFrListSideL,
+ SP_QsnFrListSideR,
+ SP_QsnFrListCenter,
+ SP_QsnFrPopupCornerTl, // Option menu background
+ SP_QsnFrPopupCornerTr,
+ SP_QsnFrPopupCornerBl,
+ SP_QsnFrPopupCornerBr,
+ SP_QsnFrPopupSideT,
+ SP_QsnFrPopupSideB,
+ SP_QsnFrPopupSideL,
+ SP_QsnFrPopupSideR,
+ SP_QsnFrPopupCenter,
+ SP_QsnFrPopupPreviewCornerTl, // tool tip background
+ SP_QsnFrPopupPreviewCornerTr,
+ SP_QsnFrPopupPreviewCornerBl,
+ SP_QsnFrPopupPreviewCornerBr,
+ SP_QsnFrPopupPreviewSideT,
+ SP_QsnFrPopupPreviewSideB,
+ SP_QsnFrPopupPreviewSideL,
+ SP_QsnFrPopupPreviewSideR,
+ SP_QsnFrPopupPreviewCenter,
+ SP_QsnFrSetOptCornerTl, // Settings list
+ SP_QsnFrSetOptCornerTr,
+ SP_QsnFrSetOptCornerBl,
+ SP_QsnFrSetOptCornerBr,
+ SP_QsnFrSetOptSideT,
+ SP_QsnFrSetOptSideB,
+ SP_QsnFrSetOptSideL,
+ SP_QsnFrSetOptSideR,
+ SP_QsnFrSetOptCenter,
+ SP_QsnFrPopupSubCornerTl, // Toolbar background
+ SP_QsnFrPopupSubCornerTr,
+ SP_QsnFrPopupSubCornerBl,
+ SP_QsnFrPopupSubCornerBr,
+ SP_QsnFrPopupSubSideT,
+ SP_QsnFrPopupSubSideB,
+ SP_QsnFrPopupSubSideL,
+ SP_QsnFrPopupSubSideR,
+ SP_QsnFrPopupSubCenter,
+ SP_QsnFrSctrlButtonCornerTl, // Toolbar button
+ SP_QsnFrSctrlButtonCornerTr,
+ SP_QsnFrSctrlButtonCornerBl,
+ SP_QsnFrSctrlButtonCornerBr,
+ SP_QsnFrSctrlButtonSideT,
+ SP_QsnFrSctrlButtonSideB,
+ SP_QsnFrSctrlButtonSideL,
+ SP_QsnFrSctrlButtonSideR,
+ SP_QsnFrSctrlButtonCenter,
+ SP_QsnFrSctrlButtonCornerTlPressed, // Toolbar button, pressed
+ SP_QsnFrSctrlButtonCornerTrPressed,
+ SP_QsnFrSctrlButtonCornerBlPressed,
+ SP_QsnFrSctrlButtonCornerBrPressed,
+ SP_QsnFrSctrlButtonSideTPressed,
+ SP_QsnFrSctrlButtonSideBPressed,
+ SP_QsnFrSctrlButtonSideLPressed,
+ SP_QsnFrSctrlButtonSideRPressed,
+ SP_QsnFrSctrlButtonCenterPressed,
+ SP_QsnFrButtonCornerTlInactive, // Inactive button
+ SP_QsnFrButtonCornerTrInactive,
+ SP_QsnFrButtonCornerBlInactive,
+ SP_QsnFrButtonCornerBrInactive,
+ SP_QsnFrButtonSideTInactive,
+ SP_QsnFrButtonSideBInactive,
+ SP_QsnFrButtonSideLInactive,
+ SP_QsnFrButtonSideRInactive,
+ SP_QsnFrButtonCenterInactive
+ };
+
+ enum ColorLists {
+ CL_QsnHighlightColors,
+ CL_QsnIconColors,
+ CL_QsnLineColors,
+ CL_QsnOtherColors,
+ CL_QsnParentColors,
+ CL_QsnTextColors
+ };
+};
+
+// Private class
+#ifdef Q_OS_SYMBIAN
+NONSHARABLE_CLASS (QS60StylePrivate)
+#else
+class QS60StylePrivate
+#endif
+: public QCommonStylePrivate
+{
+ Q_DECLARE_PUBLIC(QS60Style)
+
+public:
+ QS60StylePrivate();
+ ~QS60StylePrivate();
+
+ enum SkinElements {
+ SE_ButtonNormal,
+ SE_ButtonPressed,
+ SE_FrameLineEdit,
+ SE_ProgressBarGrooveHorizontal,
+ SE_ProgressBarIndicatorHorizontal,
+ SE_ProgressBarGrooveVertical,
+ SE_ProgressBarIndicatorVertical,
+ SE_ScrollBarGrooveHorizontal,
+ SE_ScrollBarGrooveVertical,
+ SE_ScrollBarHandleHorizontal,
+ SE_ScrollBarHandleVertical,
+ SE_SliderHandleHorizontal,
+ SE_SliderHandleVertical,
+ SE_TabBarTabEastActive,
+ SE_TabBarTabEastInactive,
+ SE_TabBarTabNorthActive,
+ SE_TabBarTabNorthInactive,
+ SE_TabBarTabSouthActive,
+ SE_TabBarTabSouthInactive,
+ SE_TabBarTabWestActive,
+ SE_TabBarTabWestInactive,
+ SE_ListHighlight,
+ SE_OptionsMenu,
+ SE_SettingsList,
+ SE_TableItem,
+ SE_TableHeaderItem,
+ SE_ToolTip, //own graphic available on 3.2+ releases,
+ SE_ToolBar,
+ SE_ToolBarButton,
+ SE_ToolBarButtonPressed,
+ SE_PanelBackground,
+ SE_ScrollBarHandlePressedHorizontal, //only for 5.0+
+ SE_ScrollBarHandlePressedVertical,
+ SE_ButtonInactive,
+ };
+
+ enum SkinFrameElements {
+ SF_ButtonNormal,
+ SF_ButtonPressed,
+ SF_FrameLineEdit,
+ SF_ListHighlight,
+ SF_OptionsMenu,
+ SF_SettingsList,
+ SF_TableItem,
+ SF_TableHeaderItem,
+ SF_ToolTip,
+ SF_ToolBar,
+ SF_ToolBarButton,
+ SF_ToolBarButtonPressed,
+ SF_PanelBackground,
+ SF_ButtonInactive,
+ };
+
+ enum SkinElementFlag {
+ SF_PointNorth = 0x0001, // North = the default
+ SF_PointEast = 0x0002,
+ SF_PointSouth = 0x0004,
+ SF_PointWest = 0x0008,
+
+ SF_StateEnabled = 0x0010, // Enabled = the default
+ SF_StateDisabled = 0x0020,
+ SF_ColorSkinned = 0x0040,
+ };
+ Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag)
+
+ // draws skin element
+ static void drawSkinElement(SkinElements element, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
+ // draws a specific skin part
+ static void drawSkinPart(QS60StyleEnums::SkinParts part, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
+ // sets style property
+ void setStyleProperty(const char *name, const QVariant &value);
+ // sets specific style property
+ void setStyleProperty_specific(const char *name, const QVariant &value);
+ // gets style property
+ QVariant styleProperty(const char *name) const;
+ // gets specific style property
+ QVariant styleProperty_specific(const char *name) const;
+ // gets pixel metrics value
+ static short pixelMetric(int metric);
+ // gets color. 'index' is NOT 0-based.
+ // It corresponds to the enum key 1-based numbers of TAknsQsnXYZColorsIndex, not the values.
+ static QColor s60Color(QS60StyleEnums::ColorLists list,
+ int index, const QStyleOption *option);
+ // gets state specific color
+ static QColor stateColor(const QColor &color, const QStyleOption *option);
+ static QColor lighterColor(const QColor &baseColor);
+ static bool isSkinnableDialog(const QWidget *widget);
+ // gets layout
+ static const QHash<QStyle::PixelMetric, int> &s60StyleLayout();
+
+ QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
+ int pointSize = -1) const;
+ void clearCaches();
+ static QPixmap backgroundTexture();
+
+ static bool isTouchSupported();
+ static bool isToolBarBackground();
+
+ // calculates average color based on button skin graphics (minus borders).
+ QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const;
+ void setThemePalette(QApplication *application) const;
+ void setThemePalette(QWidget *application) const;
+ void setBackgroundTexture(QApplication *application) const;
+
+ static int focusRectPenWidth();
+
+#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+ static const layoutHeader m_layoutHeaders[];
+ static const short data[][MAX_PIXELMETRICS];
+
+ void setCurrentLayout(int layoutIndex);
+ void setActiveLayout();
+ // Pointer
+ static short const *m_pmPointer;
+ // number of layouts supported by the style
+ static const int m_numberOfLayouts;
+#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
+
+ mutable QHash<QPair<QS60StyleEnums::FontCategories , int>, QFont> m_mappedFontsCache;
+ mutable QHash<QS60StylePrivate::SkinFrameElements, QColor> m_colorCache;
+
+ // Has one entry per SkinFrameElements
+ static const struct frameElementCenter {
+ SkinElements element;
+ QS60StyleEnums::SkinParts center;
+ } m_frameElementsData[];
+
+ static QPixmap frame(SkinFrameElements frame, const QSize &size,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+
+private:
+ static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
+ static void drawRow(QS60StyleEnums::SkinParts start, QS60StyleEnums::SkinParts middle,
+ QS60StyleEnums::SkinParts end, Qt::Orientation orientation, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
+ static void drawFrame(SkinFrameElements frame, QPainter *painter,
+ const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
+
+ static QSize partSize(QS60StyleEnums::SkinParts part,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+ static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+ static QPixmap cachedPart(QS60StyleEnums::SkinParts part, const QSize &size,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+ static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+
+ static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
+
+ static void refreshUI();
+
+ static QSize screenSize();
+
+ static bool m_backgroundValid;
+ const static SkinElementFlags KDefaultSkinElementFlags;
+};
+
+QT_END_NAMESPACE
+
+#endif // QS60STYLE_P_H
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
new file mode 100644
index 0000000000..5a88f9a626
--- /dev/null
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -0,0 +1,294 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qs60style.h"
+#include "qs60style_p.h"
+#include "qfile.h"
+#include "qhash.h"
+#include "qapplication.h"
+#include "qpainter.h"
+#include "qpicture.h"
+#include "qstyleoption.h"
+#include "qtransform.h"
+#include "qlayout.h"
+#include "qpixmapcache.h"
+#include "qmetaobject.h"
+
+#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
+
+QT_BEGIN_NAMESPACE
+
+class QS60StyleModeSpecifics
+{
+public:
+ static QPixmap skinnedGraphics(QS60StyleEnums::SkinParts stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QHash<QString, QPicture> m_partPictures;
+ static QHash<QPair<QString , int>, QColor> m_colors;
+};
+QHash<QString, QPicture> QS60StyleModeSpecifics::m_partPictures;
+QHash<QPair<QString , int>, QColor> QS60StyleModeSpecifics::m_colors;
+
+QS60StylePrivate::QS60StylePrivate()
+{
+ setCurrentLayout(0);
+}
+
+QS60StylePrivate::~QS60StylePrivate()
+{
+}
+
+short QS60StylePrivate::pixelMetric(int metric)
+{
+ Q_ASSERT(metric < MAX_PIXELMETRICS);
+ const short returnValue = m_pmPointer[metric];
+ if (returnValue==-909)
+ return -1;
+ return returnValue;
+}
+
+QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
+ int index, const QStyleOption *option)
+{
+ const QString listKey = QS60Style::colorListKeys().at(list);
+ return QS60StylePrivate::stateColor(
+ QS60StyleModeSpecifics::m_colors.value(QPair<QString, int>(listKey, index)),
+ option
+ );
+}
+
+QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size,
+ QS60StylePrivate::SkinElementFlags flags)
+{
+ const QString partKey = QS60Style::partKeys().at(part);
+ const QPicture partPicture = QS60StyleModeSpecifics::m_partPictures.value(partKey);
+ QSize partSize(partPicture.boundingRect().size());
+ if (flags & (SF_PointEast | SF_PointWest)) {
+ const int temp = partSize.width();
+ partSize.setWidth(partSize.height());
+ partSize.setHeight(temp);
+ }
+ const qreal scaleX = size.width() / (qreal)partSize.width();
+ const qreal scaleY = size.height() / (qreal)partSize.height();
+
+ QImage partImage(size, QImage::Format_ARGB32);
+ partImage.fill(Qt::transparent);
+ QPainter resultPainter(&partImage);
+ QTransform t;
+
+ if (flags & SF_PointEast)
+ t.translate(size.width(), 0);
+ else if (flags & SF_PointSouth)
+ t.translate(size.width(), size.height());
+ else if (flags & SF_PointWest)
+ t.translate(0, size.height());
+
+ t.scale(scaleX, scaleY);
+
+ if (flags & SF_PointEast)
+ t.rotate(90);
+ else if (flags & SF_PointSouth)
+ t.rotate(180);
+ else if (flags & SF_PointWest)
+ t.rotate(270);
+
+ resultPainter.setTransform(t, true);
+ const_cast<QPicture *>(&partPicture)->play(&resultPainter);
+ resultPainter.end();
+
+ QPixmap result = QPixmap::fromImage(partImage);
+ if (flags & SF_StateDisabled) {
+ // TODO: fix this
+ QStyleOption opt;
+// opt.palette = q->standardPalette();
+ result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
+ }
+
+ return result;
+}
+
+QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
+ SkinElementFlags flags)
+{
+ const QS60StyleEnums::SkinParts center = m_frameElementsData[frame].center;
+ const QS60StyleEnums::SkinParts topLeft = QS60StyleEnums::SkinParts(center - 8);
+ const QS60StyleEnums::SkinParts topRight = QS60StyleEnums::SkinParts(center - 7);
+ const QS60StyleEnums::SkinParts bottomLeft = QS60StyleEnums::SkinParts(center - 6);
+ const QS60StyleEnums::SkinParts bottomRight = QS60StyleEnums::SkinParts(center - 5);
+ const QS60StyleEnums::SkinParts top = QS60StyleEnums::SkinParts(center - 4);
+ const QS60StyleEnums::SkinParts bottom = QS60StyleEnums::SkinParts(center - 3);
+ const QS60StyleEnums::SkinParts left = QS60StyleEnums::SkinParts(center - 2);
+ const QS60StyleEnums::SkinParts right = QS60StyleEnums::SkinParts(center - 1);
+
+ // The size of topLeft defines all other sizes
+ const QSize cornerSize(partSize(topLeft));
+ // if frame is so small that corners would cover it completely, draw only center piece
+ const bool drawOnlyCenter =
+ 2 * cornerSize.width() + 1 >= size.width() || 2 * cornerSize.height() + 1 >= size.height();
+
+ const int cornerWidth = cornerSize.width();
+ const int cornerHeight = cornerSize.height();
+ const int rectWidth = size.width();
+ const int rectHeight = size.height();
+ const QRect rect(QPoint(), size);
+
+ const QRect topLeftRect = QRect(rect.topLeft(), cornerSize);
+ const QRect topRect = rect.adjusted(cornerWidth, 0, -cornerWidth, -(rectHeight - cornerHeight));
+ const QRect topRightRect = topLeftRect.translated(rectWidth - cornerWidth, 0);
+ const QRect rightRect = rect.adjusted(rectWidth - cornerWidth, cornerHeight, 0, -cornerHeight);
+ const QRect bottomRightRect = topRightRect.translated(0, rectHeight - cornerHeight);
+ const QRect bottomRect = topRect.translated(0, rectHeight - cornerHeight);
+ const QRect bottomLeftRect = topLeftRect.translated(0, rectHeight - cornerHeight);
+ const QRect leftRect = rightRect.translated(cornerWidth - rectWidth, 0);
+ const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth);
+
+ QImage result(size, QImage::Format_ARGB32);
+ QPainter painter(&result);
+
+#if 0
+ painter.save();
+ painter.setOpacity(.3);
+ painter.fillRect(topLeftRect, Qt::red);
+ painter.fillRect(topRect, Qt::green);
+ painter.fillRect(topRightRect, Qt::blue);
+ painter.fillRect(rightRect, Qt::green);
+ painter.fillRect(bottomRightRect, Qt::red);
+ painter.fillRect(bottomRect, Qt::blue);
+ painter.fillRect(bottomLeftRect, Qt::green);
+ painter.fillRect(leftRect, Qt::blue);
+ painter.fillRect(centerRect, Qt::red);
+ painter.restore();
+#else
+ drawPart(topLeft, &painter, topLeftRect, flags);
+ drawPart(top, &painter, topRect, flags);
+ drawPart(topRight, &painter, topRightRect, flags);
+ drawPart(right, &painter, rightRect, flags);
+ drawPart(bottomRight, &painter, bottomRightRect, flags);
+ drawPart(bottom, &painter, bottomRect, flags);
+ drawPart(bottomLeft, &painter, bottomLeftRect, flags);
+ drawPart(left, &painter, leftRect, flags);
+ drawPart(center, &painter, centerRect, flags);
+#endif
+
+ return QPixmap::fromImage(result);
+}
+
+void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
+{
+ setStyleProperty(name, value);
+}
+
+QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
+{
+ return styleProperty(name);
+}
+
+QPixmap QS60StylePrivate::backgroundTexture()
+{
+ static QPixmap result;
+ // Poor mans caching. + Making sure that there is always only one background image in memory at a time
+
+/*
+ TODO: 1) Hold the background QPixmap as pointer in a static class member.
+ Also add a deleteBackground() function and call that in ~QS60StylePrivate()
+ 2) Don't cache the background at all as soon as we have native pixmap support
+*/
+
+ if (!m_backgroundValid) {
+ result = QPixmap();
+ result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size());
+ m_backgroundValid = true;
+ }
+ return result;
+}
+
+bool QS60StylePrivate::isTouchSupported()
+{
+#ifdef QT_KEYPAD_NAVIGATION
+ return !QApplication::keypadNavigationEnabled();
+#else
+ return true;
+#endif
+}
+
+bool QS60StylePrivate::isToolBarBackground()
+{
+ return true;
+}
+
+
+QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
+{
+ QFont result;
+ result.setPointSize(pointSize);
+ switch (fontCategory) {
+ case QS60StyleEnums::FC_Primary:
+ result.setBold(true);
+ break;
+ case QS60StyleEnums::FC_Secondary:
+ case QS60StyleEnums::FC_Title:
+ case QS60StyleEnums::FC_PrimarySmall:
+ case QS60StyleEnums::FC_Digital:
+ case QS60StyleEnums::FC_Undefined:
+ default:
+ break;
+ }
+ return result;
+}
+
+Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, enumPartKeys, {
+ const int enumIndex = QS60StyleEnums::staticMetaObject.indexOfEnumerator("SkinParts");
+ Q_ASSERT(enumIndex >= 0);
+ const QMetaEnum metaEnum = QS60StyleEnums::staticMetaObject.enumerator(enumIndex);
+ for (int i = 0; i < metaEnum.keyCount(); ++i) {
+ const QString enumKey = QString::fromLatin1(metaEnum.key(i));
+ QString partKey;
+ // Following loop does following conversions: "SP_QgnNoteInfo" to "qgn_note_info"...
+ for (int charPosition = 3; charPosition < enumKey.length(); charPosition++) {
+ if (charPosition > 3 && enumKey[charPosition].isUpper())
+ partKey.append(QChar::fromLatin1('_'));
+ partKey.append(enumKey[charPosition].toLower());
+ }
+ x->append(partKey);
+ }
+})
+
+QStringList QS60Style::partKeys()
+{
+ return *enumPartKeys();
+}
+
+Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, enumColorListKeys, {
+ const int enumIndex = QS60StyleEnums::staticMetaObject.indexOfEnumerator("ColorLists");
+ Q_ASSERT(enumIndex >= 0);
+ const QMetaEnum metaEnum = QS60StyleEnums::staticMetaObject.enumerator(enumIndex);
+ for (int i = 0; i < metaEnum.keyCount(); i++) {
+ const QString enumKey = QString::fromLatin1(metaEnum.key(i));
+ // Following line does following conversions: CL_QsnTextColors to "text"...
+ x->append(enumKey.mid(6, enumKey.length() - 12).toLower());
+ }
+})
+
+QStringList QS60Style::colorListKeys()
+{
+ return *enumColorListKeys();
+}
+
+void QS60Style::setS60Theme(const QHash<QString, QPicture> &parts,
+ const QHash<QPair<QString , int>, QColor> &colors)
+{
+ QS60StyleModeSpecifics::m_partPictures = parts;
+ QS60StyleModeSpecifics::m_colors = colors;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_STYLE_S60 || QT_PLUGIN
diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp
new file mode 100644
index 0000000000..025ef93778
--- /dev/null
+++ b/src/gui/styles/qs60style_symbian.cpp
@@ -0,0 +1,1355 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "qs60style.h"
+#include "qs60style_p.h"
+#include "qpainter.h"
+#include "qstyleoption.h"
+#include "qstyle.h"
+#include "private/qwindowsurface_s60_p.h"
+#include "private/qt_s60_p.h"
+#include "private/qcore_symbian_p.h"
+#include "qapplication.h"
+
+#include <w32std.h>
+#include <aknsconstants.h>
+#include <aknconsts.h>
+#include <aknsitemid.h>
+#include <aknsutils.h>
+#include <aknsdrawutils.h>
+#include <aknsskininstance.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
+#include <avkon.mbg>
+#include <AknFontAccess.h>
+#include <AknLayoutFont.h>
+#include <aknutils.h>
+
+#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
+
+QT_BEGIN_NAMESPACE
+
+enum TDrawType {
+ EDrawIcon,
+ EDrawBackground,
+ ENoDraw
+};
+
+enum TSupportRelease {
+ ES60_None = 0x0000, //indicates that the commonstyle should draw the graphics
+ ES60_3_1 = 0x0001,
+ ES60_3_2 = 0x0002,
+ ES60_5_0 = 0x0004,
+ // Add all new releases here
+ ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0
+};
+
+typedef struct {
+ const TAknsItemID &skinID;
+ TDrawType drawType;
+ int supportInfo;
+ int newMajorSkinId;
+ int newMinorSkinId;
+} partMapEntry;
+
+enum TFallbackMbmFile {
+ EAvkonMbm = 0,
+ ELastMbm
+};
+
+typedef struct {
+ const QS60StyleEnums::SkinParts partID;
+ TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value
+ int fallbackGraphicID;
+} fallbackMapEntry;
+
+class QS60StyleModeSpecifics
+{
+public:
+ static QPixmap skinnedGraphics(QS60StyleEnums::SkinParts stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QPixmap skinnedGraphics(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QPixmap colorSkinnedGraphics(const QS60StyleEnums::SkinParts &stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex);
+ static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format);
+ static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part);
+ static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame);
+ static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+
+private:
+ static QPixmap createSkinnedGraphicsL(QS60StyleEnums::SkinParts part,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QPixmap createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QPixmap colorSkinnedGraphicsL(const QS60StyleEnums::SkinParts &stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static void frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID &centerId);
+ static TRect innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect);
+ static void checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap);
+ static void checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap);
+ static void unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap);
+ static void colorGroupAndIndex(QS60StyleEnums::SkinParts skinID,
+ TAknsItemID &colorGroup, int colorIndex);
+ static void fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex);
+ static bool checkSupport(const int supportedRelease);
+ static TAknsItemID checkAndUpdateReleaseSpecificGraphics(int part);
+ // Array to match the skin ID, fallback graphics and Qt widget graphics.
+ static const partMapEntry m_partMap[];
+};
+
+const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
+ /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1},
+ // Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2.
+ // In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI.
+ /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */},
+ /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */},
+ /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */},
+ /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */},
+ /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */},
+ /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ // 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead.
+ /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/
+ /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/
+ /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/
+
+ /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards
+ /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ // ToolTip graphics different in 3.1 vs. 3.2+.
+ /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */
+ /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6},
+ /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3},
+ /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4},
+ /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca},
+ /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7},
+ /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8},
+ /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9},
+ /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2},
+
+ /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ // No toolbar frame for 5.0+ releases.
+ /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+
+ // Toolbar graphics is different in 3.1/3.2 vs. 5.0
+ /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/
+ /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302},
+ /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303},
+ /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304},
+ /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305},
+ /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306},
+ /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307},
+ /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308},
+ /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/
+
+ // No pressed state for toolbar button in 3.1/3.2.
+ /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/
+ /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622},
+ /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623},
+ /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624},
+ /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625},
+ /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626},
+ /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627},
+ /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628},
+ /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629},
+
+ // No inactive button graphics in 3.1/3.2
+ /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/
+ /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2},
+ /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3},
+ /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4},
+ /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5},
+ /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6},
+ /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7},
+ /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8},
+ /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon,ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9}
+
+};
+
+QPixmap QS60StyleModeSpecifics::skinnedGraphics(
+ QS60StyleEnums::SkinParts stylepart, const QSize &size,
+ QS60StylePrivate::SkinElementFlags flags)
+{
+ QPixmap themedImage;
+ TRAPD( error, {
+ const QPixmap skinnedImage = createSkinnedGraphicsL(stylepart, size, flags);
+ themedImage = skinnedImage;
+ });
+ if (error)
+ return themedImage = QPixmap();
+ return themedImage;
+}
+
+QPixmap QS60StyleModeSpecifics::skinnedGraphics(
+ QS60StylePrivate::SkinFrameElements frame, const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ QPixmap themedImage;
+ TRAPD( error, {
+ const QPixmap skinnedImage = createSkinnedGraphicsL(frame, size, flags);
+ themedImage = skinnedImage;
+ });
+ if (error)
+ return themedImage = QPixmap();
+ return themedImage;
+}
+
+QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics(
+ const QS60StyleEnums::SkinParts &stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ QPixmap colorGraphics;
+ TRAPD(error, colorGraphics = colorSkinnedGraphicsL(stylepart, size, flags));
+ return error ? QPixmap() : colorGraphics;
+}
+
+void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex)
+{
+ switch(stylepart) {
+ case QS60StyleEnums::SP_QgnGrafBarWait:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1;
+ break;
+ case QS60StyleEnums::SP_QgnGrafBarFrameCenter:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_bar_frame_center;
+ break;
+ case QS60StyleEnums::SP_QgnGrafBarFrameSideL:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_l;
+ break;
+ case QS60StyleEnums::SP_QgnGrafBarFrameSideR:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_r;
+ break;
+ case QS60StyleEnums::SP_QgnGrafBarProgress:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_bar_progress;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabActiveL:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_active_l;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabActiveM:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_active_m;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabActiveR:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_active_r;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabPassiveL:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_passive_l;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabPassiveM:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_passive_m;
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabPassiveR:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_graf_tab_passive_r;
+ break;
+ case QS60StyleEnums::SP_QgnIndiCheckboxOff:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_checkbox_off;
+ break;
+ case QS60StyleEnums::SP_QgnIndiCheckboxOn:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_checkbox_on;
+ break;
+ case QS60StyleEnums::SP_QgnIndiHlColSuper:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */
+ break;
+ case QS60StyleEnums::SP_QgnIndiHlExpSuper:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */
+ break;
+ case QS60StyleEnums::SP_QgnIndiHlLineBranch:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */
+ break;
+ case QS60StyleEnums::SP_QgnIndiHlLineEnd:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */
+ break;
+ case QS60StyleEnums::SP_QgnIndiHlLineStraight:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = 0x445E; /* EMbmAvkonQgn_indi_hl_line_straight */
+ break;
+ case QS60StyleEnums::SP_QgnIndiMarkedAdd:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_marked_add;
+ break;
+ case QS60StyleEnums::SP_QgnIndiNaviArrowLeft:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_left;
+ break;
+ case QS60StyleEnums::SP_QgnIndiNaviArrowRight:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_right;
+ break;
+ case QS60StyleEnums::SP_QgnIndiRadiobuttOff:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_radiobutt_off;
+ break;
+ case QS60StyleEnums::SP_QgnIndiRadiobuttOn:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_radiobutt_on;
+ break;
+ case QS60StyleEnums::SP_QgnIndiSliderEdit:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_slider_edit;
+ break;
+ case QS60StyleEnums::SP_QgnIndiSubMenu:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_indi_submenu;
+ break;
+ case QS60StyleEnums::SP_QgnNoteErased:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_erased;
+ break;
+ case QS60StyleEnums::SP_QgnNoteError:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_error;
+ break;
+ case QS60StyleEnums::SP_QgnNoteInfo:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_info;
+ break;
+ case QS60StyleEnums::SP_QgnNoteOk:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_ok;
+ break;
+ case QS60StyleEnums::SP_QgnNoteQuery:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_query;
+ break;
+ case QS60StyleEnums::SP_QgnNoteWarning:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_note_warning;
+ break;
+ case QS60StyleEnums::SP_QgnPropFileSmall:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_prop_file_small;
+ break;
+ case QS60StyleEnums::SP_QgnPropFolderCurrent:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_prop_folder_current;
+ break;
+ case QS60StyleEnums::SP_QgnPropFolderSmall:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_prop_folder_small;
+ break;
+ case QS60StyleEnums::SP_QgnPropFolderSmallNew:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_prop_folder_small_new;
+ break;
+ case QS60StyleEnums::SP_QgnPropPhoneMemcLarge:
+ fallbackFileName = KAvkonBitmapFile();
+ fallbackIndex = EMbmAvkonQgn_prop_phone_memc_large;
+ break;
+ default:
+ fallbackFileName = KNullDesC();
+ fallbackIndex = -1;
+ break;
+ }
+}
+
+QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL(
+ const QS60StyleEnums::SkinParts &stylepart,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ const int stylepartIndex = (int)stylepart;
+ const TAknsItemID skinId = m_partMap[stylepartIndex].skinID;
+
+ TInt fallbackGraphicID = -1;
+ HBufC* iconFile = HBufC::NewLC( KMaxFileName );
+ TPtr fileNamePtr = iconFile->Des();
+ fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID);
+
+ TAknsItemID colorGroup = KAknsIIDQsnIconColors;
+ int colorIndex = 0;
+ colorGroupAndIndex(stylepart, colorGroup, colorIndex);
+
+ const bool rotatedBy90or270 =
+ (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest));
+ const TSize targetSize =
+ rotatedBy90or270?TSize(size.height(), size.width()):TSize(size.width(), size.height());
+ CFbsBitmap *icon = 0;
+ CFbsBitmap *iconMask = 0;
+ const TInt fallbackGraphicsMaskID =
+ fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files
+ MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+ AknsUtils::CreateColorIconLC(
+ skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack);
+ User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved));
+ User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved));
+ QPixmap result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode()));
+ CleanupStack::PopAndDestroy(3); //icon, iconMask, iconFile
+ return result;
+}
+
+QColor QS60StyleModeSpecifics::colorValue(const TAknsItemID &colorGroup, int colorIndex)
+{
+ TRgb skinnedColor;
+ MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+ AknsUtils::GetCachedColor(skin, skinnedColor, colorGroup, colorIndex);
+ return QColor(skinnedColor.Red(),skinnedColor.Green(),skinnedColor.Blue());
+}
+
+QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format)
+{
+ Q_ASSERT(icon);
+ const TSize iconSize = icon->SizeInPixels();
+ const int iconBytesPerLine = CFbsBitmap::ScanLineLength(iconSize.iWidth, icon->DisplayMode());
+ const int iconBytesCount = iconBytesPerLine * iconSize.iHeight;
+
+ QImage iconImage(qt_TSize2QSize(iconSize), format);
+ if (iconImage.isNull())
+ return QPixmap();
+
+ checkAndUnCompressBitmap(icon);
+ if (!icon) //checkAndUnCompressBitmap might set icon to NULL
+ return QPixmap();
+
+ icon->LockHeap();
+ const uchar *const iconBytes = (uchar*)icon->DataAddress();
+ // The icon data needs to be copied, since the color format will be
+ // automatically converted to Format_ARGB32 when setAlphaChannel is called.
+ memcpy(iconImage.bits(), iconBytes, iconBytesCount);
+ icon->UnlockHeap();
+ if (mask) {
+ checkAndUnCompressBitmap(mask);
+ if (mask) { //checkAndUnCompressBitmap might set mask to NULL
+ const TSize maskSize = icon->SizeInPixels();
+ const int maskBytesPerLine = CFbsBitmap::ScanLineLength(maskSize.iWidth, mask->DisplayMode());
+ mask->LockHeap();
+ const uchar *const maskBytes = (uchar *)mask->DataAddress();
+ // Since no other bitmap should be locked, we can just "borrow" the mask data for setAlphaChannel
+ const QImage maskImage(maskBytes, maskSize.iWidth, maskSize.iHeight, maskBytesPerLine, QImage::Format_Indexed8);
+ if (!maskImage.isNull())
+ iconImage.setAlphaChannel(maskImage);
+ mask->UnlockHeap();
+ }
+ }
+
+ QTransform imageTransform;
+ if (flags & QS60StylePrivate::SF_PointEast) {
+ imageTransform.rotate(90);
+ } else if (flags & QS60StylePrivate::SF_PointSouth) {
+ imageTransform.rotate(180);
+ iconImage = iconImage.transformed(imageTransform);
+ } else if (flags & QS60StylePrivate::SF_PointWest) {
+ imageTransform.rotate(270);
+ }
+ if (imageTransform.isRotating())
+ iconImage = iconImage.transformed(imageTransform);
+
+ return QPixmap::fromImage(iconImage);
+}
+
+QPixmap QS60StylePrivate::backgroundTexture()
+{
+ static QPixmap result;
+ // Poor mans caching. + Making sure that there is always only one background image in memory at a time
+
+/*
+ TODO: 1) Hold the background QPixmap as pointer in a static class member.
+ Also add a deleteBackground() function and call that in ~QS60StylePrivate()
+ 2) Don't cache the background at all as soon as we have native pixmap support
+*/
+
+ if (!m_backgroundValid) {
+ result = QPixmap();
+ result = part(QS60StyleEnums::SP_QsnBgScreen,
+ QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags());
+ m_backgroundValid = true;
+ }
+ return result;
+}
+
+bool QS60StylePrivate::isTouchSupported()
+{
+ return bool(AknLayoutUtils::PenEnabled());
+}
+
+bool QS60StylePrivate::isToolBarBackground()
+{
+ return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+}
+
+void qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset,
+ const QBrush &brush)
+{
+ const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture());
+ if (backgroundTexture.cacheKey() == brush.texture().cacheKey()) {
+ const QPaintDevice *target = painter->device();
+ if (target->devType() == QInternal::Widget) {
+ const QWidget *widget = static_cast<const QWidget *>(target);
+ CCoeControl *control = widget->effectiveWinId();
+ TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0);
+ const QRegion translated = rgn.translated(offset);
+ const QVector<QRect> &rects = translated.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ const QRect rect(rects.at(i));
+ painter->drawPixmap(rect.topLeft(), backgroundTexture,
+ rect.translated(globalPos.iX, globalPos.iY));
+ }
+ }
+ } else {
+ const QRegion translated = rgn.translated(offset);
+ const QRect rect(translated.boundingRect());
+ painter->setClipRegion(translated);
+ painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
+ }
+}
+
+QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(
+ QS60StyleEnums::SkinParts part,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ if (!size.isValid())
+ return QPixmap();
+
+ // Check release support and change part, if necessary.
+ const TAknsItemID skinId = checkAndUpdateReleaseSpecificGraphics((int)part);
+ const int stylepartIndex = (int)part;
+ const TDrawType drawType = m_partMap[stylepartIndex].drawType;
+ Q_ASSERT(drawType != ENoDraw);
+ const bool rotatedBy90or270 =
+ (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest));
+ TSize targetSize =
+ rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
+
+ MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+
+ QPixmap result;
+
+ switch (drawType) {
+ case EDrawIcon:
+ {
+ TInt fallbackGraphicID = -1;
+ HBufC* iconFile = HBufC::NewLC( KMaxFileName );
+ TPtr fileNamePtr = iconFile->Des();
+ fallbackInfo(part, fileNamePtr, fallbackGraphicID);
+
+ CFbsBitmap *icon = 0;
+ CFbsBitmap *iconMask = 0;
+ const TInt fallbackGraphicsMaskID =
+ fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files
+// QS60WindowSurface::unlockBitmapHeap();
+ AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID);
+ User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved));
+ User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved));
+ result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode()));
+ CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile
+// QS60WindowSurface::lockBitmapHeap();
+ break;
+ }
+ case EDrawBackground:
+ {
+// QS60WindowSurface::unlockBitmapHeap();
+ CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen
+ CleanupStack::PushL(background);
+ User::LeaveIfError(background->Create(targetSize, EColor16MA));
+
+ // todo: push background into CleanupStack
+ CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background);
+ CleanupStack::PushL(dev);
+ CFbsBitGc* gc = NULL;
+ User::LeaveIfError(dev->CreateContext(gc));
+ CleanupStack::PushL(gc);
+
+ CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL(
+ skinId,
+ targetSize,
+ EFalse);
+ CleanupStack::PushL(bgContext);
+
+ const TBool drawn = AknsDrawUtils::DrawBackground(
+ skinInstance,
+ bgContext,
+ NULL,
+ *gc,
+ TPoint(),
+ targetSize,
+ KAknsDrawParamDefault | KAknsDrawParamRGBOnly);
+
+ if (drawn)
+ result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32);
+
+ CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext
+// QS60WindowSurface::lockBitmapHeap();
+ break;
+ }
+ }
+
+ return result; // TODO: Let fromFbsBitmap return a QPixmap
+}
+
+QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ if (!size.isValid())
+ return QPixmap();
+
+ const bool rotatedBy90or270 =
+ (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest));
+ TSize targetSize =
+ rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
+
+ MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+
+ QPixmap result;
+
+// QS60WindowSurface::unlockBitmapHeap();
+ static const bool canDoEColor16MAP = !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+ static const TDisplayMode displayMode = canDoEColor16MAP ? TDisplayMode(13) : EColor16MA; // 13 = EColor16MAP
+ static const TInt drawParam = canDoEColor16MAP ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly;
+
+ CFbsBitmap *frame = new (ELeave) CFbsBitmap(); //offscreen
+ CleanupStack::PushL(frame);
+ User::LeaveIfError(frame->Create(targetSize, displayMode));
+
+ CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL(frame);
+ CleanupStack::PushL(bitmapDev);
+ CFbsBitGc* bitmapGc = NULL;
+ User::LeaveIfError(bitmapDev->CreateContext(bitmapGc));
+ CleanupStack::PushL(bitmapGc);
+
+ frame->LockHeap();
+ memset(frame->DataAddress(), 0, frame->SizeInPixels().iWidth * frame->SizeInPixels().iHeight * 4); // 4: argb bytes
+ frame->UnlockHeap();
+
+ const TRect outerRect(TPoint(0, 0), targetSize);
+ const TRect innerRect = innerRectFromElement(frameElement, outerRect);
+
+ TAknsItemID frameSkinID, centerSkinID;
+ frameSkinID = centerSkinID = checkAndUpdateReleaseSpecificGraphics(QS60StylePrivate::m_frameElementsData[frameElement].center);
+ frameIdAndCenterId(frameElement, frameSkinID, centerSkinID);
+ const TBool drawn = AknsDrawUtils::DrawFrame( skinInstance,
+ *bitmapGc, outerRect, innerRect,
+ frameSkinID, centerSkinID,
+ drawParam );
+
+ if (canDoEColor16MAP) {
+ if (drawn)
+ result = fromFbsBitmap(frame, NULL, flags, QImage::Format_ARGB32_Premultiplied);
+ } else {
+ TDisplayMode maskDepth = EGray2;
+ // Query the skin item for possible frame graphics mask details.
+ if (skinInstance) {
+ CAknsMaskedBitmapItemData* skinMaskedBmp = static_cast<CAknsMaskedBitmapItemData*>(
+ skinInstance->GetCachedItemData(frameSkinID,EAknsITMaskedBitmap));
+ if (skinMaskedBmp && skinMaskedBmp->Mask())
+ maskDepth = skinMaskedBmp->Mask()->DisplayMode();
+ }
+ if (maskDepth != ENone) {
+ CFbsBitmap *frameMask = new (ELeave) CFbsBitmap(); //offscreen
+ CleanupStack::PushL(frameMask);
+ User::LeaveIfError(frameMask->Create(targetSize, maskDepth));
+
+ CFbsBitmapDevice* maskBitmapDevice = CFbsBitmapDevice::NewL(frameMask);
+ CleanupStack::PushL(maskBitmapDevice);
+ CFbsBitGc* maskBitGc = NULL;
+ User::LeaveIfError(maskBitmapDevice->CreateContext(maskBitGc));
+ CleanupStack::PushL(maskBitGc);
+
+ if (drawn) {
+ //ensure that the mask is really transparent
+ maskBitGc->Activate( maskBitmapDevice );
+ maskBitGc->SetPenStyle(CGraphicsContext::ENullPen);
+ maskBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+ maskBitGc->SetBrushColor(KRgbWhite);
+ maskBitGc->Clear();
+ maskBitGc->SetBrushStyle(CGraphicsContext::ENullBrush);
+
+ AknsDrawUtils::DrawFrame(skinInstance,
+ *maskBitGc, outerRect, innerRect,
+ frameSkinID, centerSkinID,
+ KAknsSDMAlphaOnly |KAknsDrawParamNoClearUnderImage);
+ result = fromFbsBitmap(frame, frameMask, flags, QImage::Format_ARGB32);
+ }
+ CleanupStack::PopAndDestroy(3, frameMask);
+ }
+ }
+ CleanupStack::PopAndDestroy(3, frame); //frame, bitmapDev, bitmapGc
+
+ return result; // TODO: Let fromFbsBitmap return a QPixmap
+}
+
+void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID &centerId)
+{
+// There are some major mix-ups in skin declarations for some frames.
+// First, the frames are not declared in sequence.
+// Second, the parts use different major than the frame-master.
+
+ switch(frameElement) {
+ case QS60StylePrivate::SF_ToolTip:
+ if (QSysInfo::s60Version()==QSysInfo::SV_S60_5_0 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) {
+ centerId.Set(EAknsMajorGeneric, 0x19c2);
+ frameId.Set(EAknsMajorSkin, 0x5300);
+ } else {
+ centerId.Set(KAknsIIDQsnFrPopupCenter);
+ frameId.iMinor = centerId.iMinor - 9;
+ }
+ break;
+ case QS60StylePrivate::SF_ToolBar:
+ if (QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) {
+ centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
+ frameId.Set(KAknsIIDQsnFrPopupSub);
+ }
+ break;
+ case QS60StylePrivate::SF_PanelBackground:
+ // remove center piece for panel graphics, so that only border is drawn
+ centerId.Set(KAknsIIDNone);
+ frameId.Set(KAknsIIDQsnFrSetOpt);
+ break;
+ default:
+ // center should be correct here
+ frameId.iMinor = centerId.iMinor - 9;
+ break;
+ }
+}
+
+TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect)
+{
+ TInt widthShrink = 0;
+ TInt heightShrink = 0;
+ switch(frameElement) {
+ case QS60StylePrivate::SF_PanelBackground:
+ // panel should have slightly slimmer border to enable thin line of background graphics between closest component
+ widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)-2;
+ heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight)-2;
+ break;
+ default:
+ widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
+ heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
+ break;
+ }
+ TRect innerRect(outerRect);
+ innerRect.Shrink(widthShrink, heightShrink);
+ return innerRect;
+}
+
+bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease)
+{
+ const QSysInfo::S60Version currentRelease = QSysInfo::s60Version();
+ return ( (currentRelease == QSysInfo::SV_S60_3_1 && supportedRelease & ES60_3_1) ||
+ (currentRelease == QSysInfo::SV_S60_3_2 && supportedRelease & ES60_3_2) ||
+ (currentRelease == QSysInfo::SV_S60_5_0 && supportedRelease & ES60_5_0));
+}
+
+TAknsItemID QS60StyleModeSpecifics::checkAndUpdateReleaseSpecificGraphics(int part)
+{
+ TAknsItemID newSkinId;
+ if (!checkSupport(m_partMap[(int)part].supportInfo))
+ newSkinId.Set(m_partMap[(int)part].newMajorSkinId, m_partMap[(int)part].newMinorSkinId);
+ else
+ newSkinId.Set(m_partMap[(int)part].skinID);
+ return newSkinId;
+}
+
+void QS60StyleModeSpecifics::checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap)
+{
+ TRAPD(error, checkAndUnCompressBitmapL(aOriginalBitmap));
+ if (error)
+ aOriginalBitmap = NULL;
+}
+
+void QS60StyleModeSpecifics::checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap)
+{
+ if (aOriginalBitmap->IsCompressedInRAM()) {
+ const TSize iconSize(aOriginalBitmap->SizeInPixels().iWidth,
+ aOriginalBitmap->SizeInPixels().iHeight);
+ CFbsBitmap* uncompressedBitmap = new (ELeave) CFbsBitmap();
+ CleanupStack::PushL(uncompressedBitmap);
+ User::LeaveIfError(uncompressedBitmap->Create(iconSize,
+ aOriginalBitmap->DisplayMode()));
+ unCompressBitmapL(iconSize, uncompressedBitmap, aOriginalBitmap);
+ CleanupStack::Pop(uncompressedBitmap);
+ User::LeaveIfError(aOriginalBitmap->Duplicate(
+ uncompressedBitmap->Handle()));
+ delete uncompressedBitmap;
+ }
+}
+
+QFont QS60StylePrivate::s60Font_specific(
+ QS60StyleEnums::FontCategories fontCategory, int pointSize)
+{
+ enum TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
+ switch (fontCategory) {
+ case QS60StyleEnums::FC_Primary:
+ aknFontCategory = EAknFontCategoryPrimary;
+ break;
+ case QS60StyleEnums::FC_Secondary:
+ aknFontCategory = EAknFontCategorySecondary;
+ break;
+ case QS60StyleEnums::FC_Title:
+ aknFontCategory = EAknFontCategoryTitle;
+ break;
+ case QS60StyleEnums::FC_PrimarySmall:
+ aknFontCategory = EAknFontCategoryPrimarySmall;
+ break;
+ case QS60StyleEnums::FC_Digital:
+ aknFontCategory = EAknFontCategoryDigital;
+ break;
+ case QS60StyleEnums::FC_Undefined:
+ default:
+ break;
+ }
+
+ // Create AVKON font according the given parameters
+ CWsScreenDevice* dev = CCoeEnv::Static()->ScreenDevice();
+ TAknFontSpecification spec(aknFontCategory, TFontSpec(), NULL);
+ if (pointSize > 0) {
+ const TInt pixelSize = dev->VerticalTwipsToPixels(pointSize * KTwipsPerPoint);
+ spec.SetTextPaneHeight(pixelSize + 4); // TODO: Is 4 a reasonable top+bottom margin?
+ }
+
+ QFont result;
+ TRAPD( error, {
+ const CAknLayoutFont* aknFont =
+ AknFontAccess::CreateLayoutFontFromSpecificationL(*dev, spec);
+
+ result = qt_TFontSpec2QFontL(aknFont->DoFontSpecInTwips());
+ if (result.pointSize() != pointSize)
+ result.setPointSize(pointSize); // Correct the font size returned by CreateLayoutFontFromSpecificationL()
+
+ delete aknFont;
+ });
+ if (error) result = QFont();
+ return result;
+}
+
+#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
+void QS60StylePrivate::setActiveLayout()
+{
+ //todo: how to find layouts that are of same size (QVGA1 vs. QVGA2)
+ const QSize activeScreenSize(screenSize());
+ int activeLayoutIndex = 0;
+ const bool mirrored = !QApplication::isLeftToRight();
+ const short screenHeight = (short)activeScreenSize.height();
+ const short screenWidth = (short)activeScreenSize.width();
+ for (int i=0; i<m_numberOfLayouts; i++) {
+ if (screenHeight==m_layoutHeaders[i].height &&
+ screenWidth==m_layoutHeaders[i].width &&
+ mirrored==m_layoutHeaders[i].mirroring) {
+ activeLayoutIndex = i;
+ break;
+ }
+ }
+ m_pmPointer = data[activeLayoutIndex];
+}
+#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
+
+QS60StylePrivate::QS60StylePrivate()
+{
+#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
+ // No need to set active layout, if dynamic metrics API is available
+ setActiveLayout();
+#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
+}
+
+QS60StylePrivate::~QS60StylePrivate()
+{
+ m_backgroundValid = false;
+}
+
+short QS60StylePrivate::pixelMetric(int metric)
+{
+#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
+ Q_ASSERT(metric < MAX_PIXELMETRICS);
+ const short returnValue = m_pmPointer[metric];
+ if (returnValue==-909)
+ return -1;
+ return returnValue;
+#else
+ //todo - call the pixelmetrics API directly
+ return 0;
+#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
+}
+
+bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part)
+{
+ bool disabledGraphic = false;
+ switch(part){
+ // inactive button graphics are available from 5.0 onwards
+ case QS60StyleEnums::SP_QsnFrButtonCornerTlInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerTrInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerBlInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerBrInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideTInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideBInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideLInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideRInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCenterInactive:
+ if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
+ QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
+ disabledGraphic = true;
+ break;
+ default:
+ break;
+ }
+ return disabledGraphic;
+}
+
+bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame)
+{
+ bool disabledGraphic = false;
+ switch(frame){
+ // inactive button graphics are available from 5.0 onwards
+ case QS60StylePrivate::SF_ButtonInactive:
+ if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
+ QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
+ disabledGraphic = true;
+ break;
+ default:
+ break;
+ }
+ return disabledGraphic;
+}
+
+QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part,
+ const QSize &size, QS60StylePrivate::SkinElementFlags flags)
+{
+ if (!QS60StylePrivate::isTouchSupported())
+ return QPixmap();
+
+ QS60StyleEnums::SkinParts updatedPart = part;
+ switch(part){
+ // AVKON UI has a abnormal handling for scrollbar graphics. It is possible that the root
+ // skin does not contain mandatory graphics for scrollbar pressed states. Therefore, AVKON UI
+ // creates dynamically these graphics by modifying the normal state scrollbar graphics slightly.
+ // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss
+ // (i.e. result is not valid), style needs to draw normal graphics instead and apply some
+ // modifications (similar to generatedIconPixmap()) to the result.
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
+ updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleBottom;
+ break;
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
+ updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleMiddle;
+ break;
+ case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
+ updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleTop;
+ break;
+ default:
+ break;
+ }
+ if (part==updatedPart) {
+ return QPixmap();
+ } else {
+ QPixmap result = skinnedGraphics(updatedPart, size, flags);
+ // TODO: fix this
+ QStyleOption opt;
+ // opt.palette = q->standardPalette();
+
+ // For now, always generate new icon based on "selected". In the future possibly, expand
+ // this to consist other possibilities as well.
+ result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt);
+ return result;
+ }
+}
+
+QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part,
+ const QSize &size, SkinElementFlags flags)
+{
+ QS60WindowSurface::unlockBitmapHeap();
+ QPixmap result = (flags & SF_ColorSkinned)?
+ QS60StyleModeSpecifics::colorSkinnedGraphics(part, size, flags)
+ : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags);
+ QS60WindowSurface::lockBitmapHeap();
+
+ if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) {
+ // TODO: fix this
+ QStyleOption opt;
+// opt.palette = q->standardPalette();
+ result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
+ }
+
+ if (!result)
+ result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags);
+
+ return result;
+}
+
+QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags)
+{
+ QS60WindowSurface::unlockBitmapHeap();
+ QPixmap result = QS60StyleModeSpecifics::skinnedGraphics(frame, size, flags);
+ QS60WindowSurface::lockBitmapHeap();
+
+ if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) {
+ // TODO: fix this
+ QStyleOption opt;
+// opt.palette = q->standardPalette();
+ result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
+ }
+ return result;
+}
+
+void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
+{
+ if (name == QLatin1String("foo")) {
+ // BaR
+ } else {
+ setStyleProperty(name, value);
+ }
+}
+
+QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
+{
+ if (name == QLatin1String("foo"))
+ return QLatin1String("Bar");
+ else
+ return styleProperty(name);
+}
+
+QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
+ int index, const QStyleOption *option)
+{
+ static const TAknsItemID *idMap[] = {
+ &KAknsIIDQsnHighlightColors,
+ &KAknsIIDQsnIconColors,
+ &KAknsIIDQsnLineColors,
+ &KAknsIIDQsnOtherColors,
+ &KAknsIIDQsnParentColors,
+ &KAknsIIDQsnTextColors
+ };
+ Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0]));
+ const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1);
+ return option ? QS60StylePrivate::stateColor(color, option) : color;
+}
+
+// If the public SDK returns compressed images, please let us also uncompress those!
+void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap)
+{
+ if (!aSrcBitmap)
+ User::Leave(KErrArgument);
+ if (!aTrgBitmap)
+ User::Leave(KErrArgument);
+
+ // Note! aSrcBitmap->IsCompressedInRAM() is always ETrue, since this method is called only if that applies!
+ ASSERT(aSrcBitmap->IsCompressedInRAM());
+
+ TDisplayMode displayMode = aSrcBitmap->DisplayMode();
+
+ if (displayMode != aTrgBitmap->DisplayMode())
+ User::Leave(KErrArgument);
+
+ TSize trgSize = aTrgBitmap->SizeInPixels();
+ TSize srcSize = aSrcBitmap->SizeInPixels();
+
+ // calculate the valid drawing area
+ TRect drawRect = aTrgRect;
+ drawRect.Intersection(TRect(TPoint(0, 0), trgSize));
+
+ if (drawRect.IsEmpty())
+ return;
+
+ CFbsBitmap* realSource = new (ELeave) CFbsBitmap();
+ CleanupStack::PushL(realSource);
+ User::LeaveIfError(realSource->Create(srcSize, displayMode));
+ CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(realSource);
+ CleanupStack::PushL(dev);
+ CFbsBitGc* gc = NULL;
+ User::LeaveIfError(dev->CreateContext(gc));
+ CleanupStack::PushL(gc);
+ gc->BitBlt(TPoint(0, 0), aSrcBitmap);
+ CleanupStack::PopAndDestroy(2); // dev, gc
+
+ // Heap lock for FBServ large chunk is only needed with large bitmaps.
+ if (realSource->IsLargeBitmap() || aTrgBitmap->IsLargeBitmap()) {
+ aTrgBitmap->LockHeapLC(ETrue); // fbsheaplock
+ } else {
+ CleanupStack::PushL((TAny*) NULL);
+ }
+
+ TUint32* srcAddress = realSource->DataAddress();
+ TUint32* trgAddress = aTrgBitmap->DataAddress();
+
+ const TInt xSkip = (srcSize.iWidth << 8) / aTrgRect.Width();
+ const TInt ySkip = (srcSize.iHeight << 8) / aTrgRect.Height();
+
+ const TInt drawWidth = drawRect.Width();
+ const TInt drawHeight = drawRect.Height();
+
+ TRect offsetRect(aTrgRect.iTl, drawRect.iTl);
+ const TInt yPosOffset = ySkip * offsetRect.Height();
+ const TInt xPosOffset = xSkip * offsetRect.Width();
+
+ if ((displayMode == EGray256) || (displayMode == EColor256)) {
+ TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ displayMode);
+ TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ displayMode);
+
+ TUint8* trgAddress8 = reinterpret_cast<TUint8*> (trgAddress);
+
+ TInt yPos = yPosOffset;
+ // skip left and top margins in the beginning
+ trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX;
+
+ for (TInt y = 0; y < drawHeight; y++) {
+ TUint8* srcAddress8 = reinterpret_cast<TUint8*> (srcAddress)
+ + (srcScanLen8 * (yPos >> 8));
+
+ TInt xPos = xPosOffset;
+ for (TInt x = 0; x < drawWidth; x++) {
+ *(trgAddress8++) = srcAddress8[xPos >> 8];
+ xPos += xSkip;
+ }
+
+ yPos += ySkip;
+
+ trgAddress8 += trgScanLen8 - drawWidth;
+ }
+ } else if (displayMode == EColor4K || displayMode == EColor64K) {
+ TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ displayMode) >>1;
+ TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ displayMode) >>1;
+
+ TUint16* trgAddress16 = reinterpret_cast<TUint16*> (trgAddress);
+
+ TInt yPos = yPosOffset;
+ // skip left and top margins in the beginning
+ trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX;
+
+ for (TInt y = 0; y < drawHeight; y++) {
+ TUint16* srcAddress16 = reinterpret_cast<TUint16*> (srcAddress)
+ + (srcScanLen16 * (yPos >> 8));
+
+ TInt xPos = xPosOffset;
+ for (TInt x = 0; x < drawWidth; x++) {
+ *(trgAddress16++) = srcAddress16[xPos >> 8];
+ xPos += xSkip;
+ }
+
+ yPos += ySkip;
+
+ trgAddress16 += trgScanLen16 - drawWidth;
+ }
+ } else if (displayMode == EColor16MU || displayMode == EColor16MA) {
+ TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ displayMode) >>2;
+ TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ displayMode) >>2;
+
+ TUint32* trgAddress32 = reinterpret_cast<TUint32*> (trgAddress);
+
+ TInt yPos = yPosOffset;
+ // skip left and top margins in the beginning
+ trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX;
+
+ for (TInt y = 0; y < drawHeight; y++) {
+ TUint32* srcAddress32 = reinterpret_cast<TUint32*> (srcAddress)
+ + (srcScanLen32 * (yPos >> 8));
+
+ TInt xPos = xPosOffset;
+ for (TInt x = 0; x < drawWidth; x++) {
+ *(trgAddress32++) = srcAddress32[xPos >> 8];
+ xPos += xSkip;
+ }
+
+ yPos += ySkip;
+
+ trgAddress32 += trgScanLen32 - drawWidth;
+ }
+ } else { User::Leave(KErrUnknown);}
+
+ CleanupStack::PopAndDestroy(2); // fbsheaplock, realSource
+}
+
+QSize QS60StylePrivate::screenSize()
+{
+ TSize mySize = QS60Data::screenDevice()->SizeInPixels();
+ return QSize(mySize.iWidth, mySize.iHeight);
+}
+
+void QS60StyleModeSpecifics::colorGroupAndIndex(
+ QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex)
+{
+ switch(skinID) {
+ case QS60StyleEnums::SP_QgnIndiSubMenu:
+ case QS60StyleEnums::SP_QgnIndiHlColSuper:
+ case QS60StyleEnums::SP_QgnIndiHlExpSuper:
+ case QS60StyleEnums::SP_QgnIndiHlLineBranch:
+ case QS60StyleEnums::SP_QgnIndiHlLineEnd:
+ case QS60StyleEnums::SP_QgnIndiHlLineStraight:
+ case QS60StyleEnums::SP_QgnIndiRadiobuttOff:
+ case QS60StyleEnums::SP_QgnIndiRadiobuttOn:
+ case QS60StyleEnums::SP_QgnIndiCheckboxOff:
+ case QS60StyleEnums::SP_QgnIndiCheckboxOn:
+ colorGroup = KAknsIIDQsnIconColors;
+ colorIndex = EAknsCIQsnIconColorsCG1;
+ break;
+ default:
+ break;
+ }
+}
+
+void QS60Style::handleDynamicLayoutVariantSwitch()
+{
+ Q_D(QS60Style);
+ d->clearCaches();
+#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
+ d->setActiveLayout();
+#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
+ d->refreshUI();
+ d->setBackgroundTexture(qApp);
+ foreach (QWidget *widget, QApplication::allWidgets())
+ widget->ensurePolished();
+}
+
+void QS60Style::handleSkinChange()
+{
+ Q_D(QS60Style);
+ d->clearCaches();
+ d->setThemePalette(qApp);
+ foreach (QWidget *topLevelWidget, QApplication::allWidgets()){
+ QEvent e(QEvent::StyleChange);
+ QApplication::sendEvent(topLevelWidget, &e);
+ d->setThemePalette(topLevelWidget);
+ topLevelWidget->ensurePolished();
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_STYLE_S60 || QT_PLUGIN
diff --git a/src/gui/styles/qstyle_s60_simulated.qrc b/src/gui/styles/qstyle_s60_simulated.qrc
new file mode 100644
index 0000000000..72aab9e624
--- /dev/null
+++ b/src/gui/styles/qstyle_s60_simulated.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <qresource prefix="/trolltech/styles/s60style">
+ <file>images/s60themes.dat</file>
+ </qresource>
+</RCC>
diff --git a/src/gui/styles/qstylefactory.cpp b/src/gui/styles/qstylefactory.cpp
index 70717dbb8c..42cd6dcc1a 100644
--- a/src/gui/styles/qstylefactory.cpp
+++ b/src/gui/styles/qstylefactory.cpp
@@ -69,6 +69,9 @@
#ifndef QT_NO_STYLE_WINDOWSMOBILE
#include "qwindowsmobilestyle.h"
#endif
+#ifndef QT_NO_STYLE_S60
+#include "qs60style.h"
+#endif
QT_BEGIN_NAMESPACE
@@ -154,6 +157,11 @@ QStyle *QStyleFactory::create(const QString& key)
ret = new QCDEStyle;
else
#endif
+#ifndef QT_NO_STYLE_S60
+ if (style == QLatin1String("s60"))
+ ret = new QS60Style;
+ else
+#endif
#ifndef QT_NO_STYLE_PLASTIQUE
if (style == QLatin1String("plastique"))
ret = new QPlastiqueStyle;
@@ -233,6 +241,10 @@ QStringList QStyleFactory::keys()
if (!list.contains(QLatin1String("CDE")))
list << QLatin1String("CDE");
#endif
+#ifndef QT_NO_STYLE_S60
+ if (!list.contains(QLatin1String("S60")))
+ list << QLatin1String("S60");
+#endif
#ifndef QT_NO_STYLE_PLASTIQUE
if (!list.contains(QLatin1String("Plastique")))
list << QLatin1String("Plastique");
diff --git a/src/gui/styles/qstylesheetstyle_default.cpp b/src/gui/styles/qstylesheetstyle_default.cpp
index 742cfe13b9..74e23b8d6e 100644
--- a/src/gui/styles/qstylesheetstyle_default.cpp
+++ b/src/gui/styles/qstylesheetstyle_default.cpp
@@ -154,11 +154,12 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
Value value;
Pseudo pseudo;
AttributeSelector attr;
-
+
// pixmap based style doesn't support any features
bool styleIsPixmapBased = baseStyle()->inherits("QMacStyle")
|| baseStyle()->inherits("QWindowsXPStyle")
- || baseStyle()->inherits("QGtkStyle");
+ || baseStyle()->inherits("QGtkStyle")
+ || baseStyle()->inherits("QS60Style");
/*QLineEdit {
@@ -212,7 +213,7 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
ADD_BASIC_SELECTOR;
ADD_SELECTOR;
-
+
SET_PROPERTY(QLatin1String("padding-top"), PaddingTop);
ADD_VALUE(Value::Identifier, QString::fromLatin1("2px"));
ADD_DECLARATION;
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 376f8341fe..9aa170e8be 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -155,3 +155,20 @@ contains( styles, windowsmobile ) {
DEFINES += QT_NO_STYLE_WINDOWSMOBILE
}
+contains( styles, s60 ) {
+ HEADERS += \
+ styles/qs60style.h \
+ styles/qs60style_p.h
+ SOURCES += styles/qs60style.cpp
+ DEFINES += QT_S60STYLE_LAYOUTDATA_SIMULATED
+ symbian {
+ SOURCES += styles/qs60style_symbian.cpp
+ # TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw
+ LIBS += aknicon aknskins aknskinsrv fontutils
+ LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
+ } else {
+ SOURCES += styles/qs60style_simulated.cpp
+ }
+} else {
+ DEFINES += QT_NO_STYLE_S60
+}
diff --git a/src/gui/text/qabstractfontengine_p.h b/src/gui/text/qabstractfontengine_p.h
index 4752de5d0c..59b54bdbdd 100644
--- a/src/gui/text/qabstractfontengine_p.h
+++ b/src/gui/text/qabstractfontengine_p.h
@@ -91,7 +91,7 @@ public:
virtual Type type() const { return Proxy; }
virtual const char *name() const { return "proxy engine"; }
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_WS_S60)
virtual void draw(QPaintEngine *, qreal, qreal, const QTextItemInt &);
#endif
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 38621c19c6..0bd2d9ab8b 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -48,6 +48,7 @@
#include <qfontmetrics.h>
#include <qbrush.h>
#include <qimagereader.h>
+#include "private/qfunctions_p.h"
#ifndef QT_NO_CSSPARSER
@@ -378,12 +379,12 @@ static const QCssKnownValue styleFeatures[NumKnownStyleFeatures - 1] = {
{ "none", StyleFeature_None }
};
-static bool operator<(const QString &name, const QCssKnownValue &prop)
+Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &name, const QCssKnownValue &prop)
{
return QString::compare(name, QLatin1String(prop.name), Qt::CaseInsensitive) < 0;
}
-static bool operator<(const QCssKnownValue &prop, const QString &name)
+Q_STATIC_GLOBAL_OPERATOR bool operator<(const QCssKnownValue &prop, const QString &name)
{
return QString::compare(QLatin1String(prop.name), name, Qt::CaseInsensitive) < 0;
}
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index f73ffb5dd6..6ee1d039bd 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -72,6 +72,9 @@
#include "qfontengine_qpf_p.h"
#endif
#endif
+#ifdef Q_WS_S60
+#include "qt_s60_p.h"
+#endif
#include <QMutexLocker>
@@ -169,6 +172,9 @@ Q_GUI_EXPORT int qt_defaultDpiX()
if (!subScreens.isEmpty())
screen = subScreens.at(0);
dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4)));
+#elif defined(Q_WS_S60)
+ const TReal inchWidth = (TReal)S60->screenWidthInTwips / KTwipsPerInch;
+ dpi = S60->screenWidthInPixels / inchWidth;
#endif // Q_WS_X11
return dpi;
@@ -195,6 +201,9 @@ Q_GUI_EXPORT int qt_defaultDpiY()
if (!subScreens.isEmpty())
screen = subScreens.at(0);
dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4)));
+#elif defined(Q_WS_S60)
+ const TReal inchHeight = (TReal)S60->screenHeightInTwips / KTwipsPerInch;
+ dpi = S60->screenHeightInPixels / inchHeight;
#endif // Q_WS_X11
return dpi;
@@ -788,7 +797,12 @@ QFont::QFont(const QString &family, int pointSize, int weight, bool italic)
resolve_mask = QFont::FamilyResolved;
if (pointSize <= 0) {
+#ifdef Q_WS_S60
+ // TODO: What should the default QFont pointSize for Q_WS_S60 be?
+ pointSize = 7;
+#else
pointSize = 12;
+#endif
} else {
resolve_mask |= QFont::SizeResolved;
}
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
new file mode 100644
index 0000000000..260609112f
--- /dev/null
+++ b/src/gui/text/qfont_s60.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qfont.h"
+#include "qt_s60_p.h"
+#include <private/qwindowsurface_s60_p.h>
+#include "qmutex.h"
+
+QT_BEGIN_NAMESPACE
+
+#if 1
+#ifdef QT_NO_FREETYPE
+Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex);
+#endif // QT_NO_FREETYPE
+
+QString QFont::lastResortFamily() const
+{
+#ifdef QT_NO_FREETYPE
+ QMutexLocker locker(lastResortFamilyMutex());
+ static QString family;
+ if (family.isEmpty()) {
+ QS60WindowSurface::unlockBitmapHeap();
+ CFont *font;
+ const TInt err = S60->screenDevice()->GetNearestFontInTwips(font, TFontSpec());
+ Q_ASSERT(err == KErrNone);
+ const TFontSpec spec = font->FontSpecInTwips();
+ family = QString((const QChar *)spec.iTypeface.iName.Ptr(), spec.iTypeface.iName.Length());
+ S60->screenDevice()->ReleaseFont(font);
+ QS60WindowSurface::lockBitmapHeap();
+ }
+ return family;
+#else
+ // For the FreeType case we just hard code the face name, since otherwise on
+ // East Asian systems we may get a name for a stroke based (non-ttf) font.
+
+ // TODO: Get the type face name in a proper way
+
+ const bool isJapaneseOrChineseSystem =
+ User::Language() == ELangJapanese || User::Language() == ELangPrcChinese;
+
+ return QLatin1String(isJapaneseOrChineseSystem?"Heisei Kaku Gothic S60":"Series 60 Sans");
+#endif // QT_NO_FREETYPE
+}
+#else // 0
+QString QFont::lastResortFamily() const
+{
+ return QLatin1String("Series 60 Sans");
+}
+#endif // 0
+
+QString QFont::defaultFamily() const
+{
+ return lastResortFamily();
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index c3fc9f55cb..1345d2119b 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -56,6 +56,11 @@
#include <stdlib.h>
#include <limits.h>
+#if (defined(Q_WS_QWS) || defined(Q_WS_S60)) && !defined(QT_NO_FREETYPE)
+# include <ft2build.h>
+# include FT_TRUETYPE_TABLES_H
+#endif
+
// #define QFONTDATABASE_DEBUG
#ifdef QFONTDATABASE_DEBUG
# define FD_DEBUG qDebug
@@ -76,6 +81,8 @@
QT_BEGIN_NAMESPACE
+#define SMOOTH_SCALABLE 0xffff
+
extern int qt_defaultDpiY(); // in qfont.cpp
Q_GUI_EXPORT bool qt_enable_test_font = false;
@@ -141,10 +148,10 @@ struct QtFontSize
QtFontEncoding *encodingID(int id, uint xpoint = 0, uint xres = 0,
uint yres = 0, uint avgwidth = 0, bool add = false);
#endif // Q_WS_X11
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
QByteArray fileName;
int fileIndex;
-#endif
+#endif // defined(Q_WS_QWS) || defined(Q_WS_S60)
};
@@ -215,12 +222,12 @@ struct QtFontStyle
delete [] weightName;
delete [] setwidthName;
#endif
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_S60)
while (count--) {
#ifdef Q_WS_X11
free(pixelSizes[count].encodings);
#endif
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
pixelSizes[count].fileName.~QByteArray();
#endif
}
@@ -238,7 +245,7 @@ struct QtFontStyle
const char *weightName;
const char *setwidthName;
#endif // Q_WS_X11
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
bool antialiased;
#endif
@@ -276,7 +283,7 @@ QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add)
pixelSizes[count].count = 0;
pixelSizes[count].encodings = 0;
#endif
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
new (&pixelSizes[count].fileName) QByteArray;
pixelSizes[count].fileIndex = 0;
#endif
@@ -358,7 +365,7 @@ struct QtFontFamily
fixedPitchComputed(false),
#endif
name(n), count(0), foundries(0)
-#if defined(Q_WS_QWS)
+#if defined(Q_WS_QWS) || defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
, bogusWritingSystems(false)
#endif
{
@@ -388,7 +395,7 @@ struct QtFontFamily
#endif
QString name;
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) || defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
QByteArray fontFilename;
int fontFileIndex;
#endif
@@ -398,7 +405,7 @@ struct QtFontFamily
int count;
QtFontFoundry **foundries;
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
bool bogusWritingSystems;
QStringList fallbackFamilies;
#endif
@@ -442,7 +449,7 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create)
// ### copied to tools/makeqpf/qpf2.cpp
-#if (defined(Q_WS_QWS) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if (defined(Q_WS_QWS) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_S60)
// see the Unicode subset bitfields in the MSDN docs
static int requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] = {
// Any,
@@ -563,6 +570,15 @@ static QList<QFontDatabase::WritingSystem> determineWritingSystemsFromTrueTypeBi
}
#endif
+#if defined(Q_WS_S60) && defined(QT_NO_FREETYPE)
+// class with virtual destructor, derived in qfontdatabase_s60.cpp
+class QFontDatabaseS60Store
+{
+public:
+ virtual ~QFontDatabaseS60Store() {};
+};
+#endif
+
class QFontDatabasePrivate
{
public:
@@ -571,6 +587,9 @@ public:
#if defined(Q_WS_QWS)
, stream(0)
#endif
+#if defined(Q_WS_S60) && defined(QT_NO_FREETYPE)
+ , s60Store(0)
+#endif
{ }
~QFontDatabasePrivate() {
free();
@@ -582,6 +601,12 @@ public:
::free(families);
families = 0;
count = 0;
+#if defined(Q_WS_S60) && defined(QT_NO_FREETYPE)
+ if (s60Store) {
+ delete s60Store;
+ s60Store = 0;
+ }
+#endif
// don't clear the memory fonts!
}
@@ -609,17 +634,22 @@ public:
#if defined(Q_WS_QWS)
bool loadFromCache(const QString &fontPath);
+ void addQPF2File(const QByteArray &file);
+#endif // Q_WS_QWS
+#if defined(Q_WS_QWS) || defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
void addFont(const QString &familyname, const char *foundryname, int weight,
bool italic, int pixelSize, const QByteArray &file, int fileIndex,
bool antialiased,
const QList<QFontDatabase::WritingSystem> &writingSystems = QList<QFontDatabase::WritingSystem>());
- void addQPF2File(const QByteArray &file);
#ifndef QT_NO_FREETYPE
QStringList addTTFile(const QByteArray &file, const QByteArray &fontData = QByteArray());
+#endif // QT_NO_FREETYPE
#endif
-
+#if defined(Q_WS_QWS)
QDataStream *stream;
QStringList fallbackFamilies;
+#elif defined(Q_WS_S60) && defined(QT_NO_FREETYPE)
+ const QFontDatabaseS60Store *s60Store;
#endif
};
@@ -665,6 +695,118 @@ QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create)
return families[pos];
}
+#if defined(Q_WS_QWS) || defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
+void QFontDatabasePrivate::addFont(const QString &familyname, const char *foundryname, int weight, bool italic, int pixelSize,
+ const QByteArray &file, int fileIndex, bool antialiased,
+ const QList<QFontDatabase::WritingSystem> &writingSystems)
+{
+// qDebug() << "Adding font" << familyname << weight << italic << pixelSize << file << fileIndex << antialiased;
+ QtFontStyle::Key styleKey;
+ styleKey.style = italic ? QFont::StyleItalic : QFont::StyleNormal;
+ styleKey.weight = weight;
+ styleKey.stretch = 100;
+ QtFontFamily *f = family(familyname, true);
+
+ if (writingSystems.isEmpty()) {
+ for (int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws) {
+ f->writingSystems[ws] = QtFontFamily::Supported;
+ }
+ f->bogusWritingSystems = true;
+ } else {
+ for (int i = 0; i < writingSystems.count(); ++i) {
+ f->writingSystems[writingSystems.at(i)] = QtFontFamily::Supported;
+ }
+ }
+
+ QtFontFoundry *foundry = f->foundry(QString::fromLatin1(foundryname), true);
+ QtFontStyle *style = foundry->style(styleKey, true);
+ style->smoothScalable = (pixelSize == 0);
+ style->antialiased = antialiased;
+ QtFontSize *size = style->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
+ size->fileName = file;
+ size->fileIndex = fileIndex;
+
+#if defined(Q_WS_QWS)
+ if (stream) {
+ *stream << familyname << foundry->name << weight << quint8(italic) << pixelSize
+ << file << fileIndex << quint8(antialiased);
+ *stream << quint8(writingSystems.count());
+ for (int i = 0; i < writingSystems.count(); ++i)
+ *stream << quint8(writingSystems.at(i));
+ }
+#else // ..in case of defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
+ f->fontFilename = file;
+ f->fontFileIndex = fileIndex;
+#endif
+}
+#endif
+
+#if (defined(Q_WS_QWS) || defined(Q_WS_S60)) && !defined(QT_NO_FREETYPE)
+QStringList QFontDatabasePrivate::addTTFile(const QByteArray &file, const QByteArray &fontData)
+{
+ QStringList families;
+ extern FT_Library qt_getFreetype();
+ FT_Library library = qt_getFreetype();
+
+ int index = 0;
+ int numFaces = 0;
+ do {
+ FT_Face face;
+ FT_Error error;
+ if (!fontData.isEmpty()) {
+ error = FT_New_Memory_Face(library, (const FT_Byte *)fontData.constData(), fontData.size(), index, &face);
+ } else {
+ error = FT_New_Face(library, file, index, &face);
+ }
+ if (error != FT_Err_Ok) {
+ qDebug() << "FT_New_Face failed with index" << index << ":" << hex << error;
+ break;
+ }
+ numFaces = face->num_faces;
+
+ int weight = QFont::Normal;
+ bool italic = face->style_flags & FT_STYLE_FLAG_ITALIC;
+
+ if (face->style_flags & FT_STYLE_FLAG_BOLD)
+ weight = QFont::Bold;
+
+ QList<QFontDatabase::WritingSystem> writingSystems;
+ // detect symbol fonts
+ for (int i = 0; i < face->num_charmaps; ++i) {
+ FT_CharMap cm = face->charmaps[i];
+ if (cm->encoding == ft_encoding_adobe_custom
+ || cm->encoding == ft_encoding_symbol) {
+ writingSystems.append(QFontDatabase::Symbol);
+ break;
+ }
+ }
+ if (writingSystems.isEmpty()) {
+ TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(face, ft_sfnt_os2);
+ if (os2) {
+ quint32 unicodeRange[4] = {
+ os2->ulUnicodeRange1, os2->ulUnicodeRange2, os2->ulUnicodeRange3, os2->ulUnicodeRange4
+ };
+ quint32 codePageRange[2] = {
+ os2->ulCodePageRange1, os2->ulCodePageRange2
+ };
+
+ writingSystems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
+ //for (int i = 0; i < writingSystems.count(); ++i)
+ // qDebug() << QFontDatabase::writingSystemName(writingSystems.at(i));
+ }
+ }
+
+ QString family = QString::fromAscii(face->family_name);
+ families.append(family);
+ addFont(family, /*foundry*/ "", weight, italic,
+ /*pixelsize*/ 0, file, index, /*antialias*/ true, writingSystems);
+
+ FT_Done_Face(face);
+ ++index;
+ } while (index < numFaces);
+ return families;
+}
+#endif
static const int scriptForWritingSystem[] = {
QUnicodeTables::Common, // Any
@@ -814,7 +956,7 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe
#endif
#endif
-#if defined(Q_WS_X11) || defined(Q_WS_WIN)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_S60)
static void getEngineData(const QFontPrivate *d, const QFontCache::Key &key)
{
// look for the requested font in the engine data cache
@@ -866,8 +1008,6 @@ QMutex *qt_fontdatabase_mutex()
return fontDatabaseMutex();
}
-#define SMOOTH_SCALABLE 0xffff
-
QT_BEGIN_INCLUDE_NAMESPACE
#if defined(Q_WS_X11)
# include "qfontdatabase_x11.cpp"
@@ -877,6 +1017,8 @@ QT_BEGIN_INCLUDE_NAMESPACE
# include "qfontdatabase_win.cpp"
#elif defined(Q_WS_QWS)
# include "qfontdatabase_qws.cpp"
+#elif defined(Q_WS_S60)
+# include "qfontdatabase_s60.cpp"
#endif
QT_END_INCLUDE_NAMESPACE
@@ -2254,7 +2396,16 @@ QString QFontDatabase::writingSystemSample(WritingSystem writingSystem)
sample += QChar(0xac2f);
break;
case Vietnamese:
+ {
+ static const char vietnameseUtf8[] = {
+ char(0xef), char(0xbb), char(0xbf), char(0xe1), char(0xbb), char(0x97),
+ char(0xe1), char(0xbb), char(0x99),
+ char(0xe1), char(0xbb), char(0x91),
+ char(0xe1), char(0xbb), char(0x93),
+ };
+ sample += QString::fromUtf8(vietnameseUtf8, sizeof(vietnameseUtf8));
break;
+ }
case Ogham:
sample += QChar(0x1681);
sample += QChar(0x1682);
diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h
index eadb6babdb..c169e29882 100644
--- a/src/gui/text/qfontdatabase.h
+++ b/src/gui/text/qfontdatabase.h
@@ -151,7 +151,7 @@ public:
private:
static void createDatabase();
static void parseFontName(const QString &name, QString &foundry, QString &family);
-#if defined(Q_WS_QWS)
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request);
#endif
static void load(const QFontPrivate *d, int script);
@@ -165,6 +165,7 @@ private:
friend class QFontDialogPrivate;
friend class QFontEngineMultiXLFD;
friend class QFontEngineMultiQWS;
+ friend class QFontEngineMultiS60;
QFontDatabasePrivate *d;
};
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index eb8a0cf5c2..33b0728a0d 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -50,7 +50,6 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#include FT_TRUETYPE_TABLES_H
#endif
#include "qfontengine_qpf_p.h"
@@ -81,44 +80,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
const quint8 DatabaseVersion = 4;
-void QFontDatabasePrivate::addFont(const QString &familyname, const char *foundryname, int weight, bool italic, int pixelSize,
- const QByteArray &file, int fileIndex, bool antialiased,
- const QList<QFontDatabase::WritingSystem> &writingSystems)
-{
-// qDebug() << "Adding font" << familyname << weight << italic << pixelSize << file << fileIndex << antialiased;
- QtFontStyle::Key styleKey;
- styleKey.style = italic ? QFont::StyleItalic : QFont::StyleNormal;
- styleKey.weight = weight;
- styleKey.stretch = 100;
- QtFontFamily *f = family(familyname, true);
-
- if (writingSystems.isEmpty()) {
- for (int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws) {
- f->writingSystems[ws] = QtFontFamily::Supported;
- }
- f->bogusWritingSystems = true;
- } else {
- for (int i = 0; i < writingSystems.count(); ++i) {
- f->writingSystems[writingSystems.at(i)] = QtFontFamily::Supported;
- }
- }
-
- QtFontFoundry *foundry = f->foundry(QString::fromLatin1(foundryname), true);
- QtFontStyle *style = foundry->style(styleKey, true);
- style->smoothScalable = (pixelSize == 0);
- style->antialiased = antialiased;
- QtFontSize *size = style->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
- size->fileName = file;
- size->fileIndex = fileIndex;
-
- if (stream) {
- *stream << familyname << foundry->name << weight << quint8(italic) << pixelSize
- << file << fileIndex << quint8(antialiased);
- *stream << quint8(writingSystems.count());
- for (int i = 0; i < writingSystems.count(); ++i)
- *stream << quint8(writingSystems.at(i));
- }
-}
+// QFontDatabasePrivate::addFont() went into qfontdatabase.cpp
#ifndef QT_NO_QWS_QPF2
void QFontDatabasePrivate::addQPF2File(const QByteArray &file)
@@ -178,74 +140,9 @@ void QFontDatabasePrivate::addQPF2File(const QByteArray &file)
::close(f);
#endif
}
-#endif
-
-#ifndef QT_NO_FREETYPE
-QStringList QFontDatabasePrivate::addTTFile(const QByteArray &file, const QByteArray &fontData)
-{
- QStringList families;
- extern FT_Library qt_getFreetype();
- FT_Library library = qt_getFreetype();
-
- int index = 0;
- int numFaces = 0;
- do {
- FT_Face face;
- FT_Error error;
- if (!fontData.isEmpty()) {
- error = FT_New_Memory_Face(library, (const FT_Byte *)fontData.constData(), fontData.size(), index, &face);
- } else {
- error = FT_New_Face(library, file, index, &face);
- }
- if (error != FT_Err_Ok) {
- qDebug() << "FT_New_Face failed with index" << index << ":" << hex << error;
- break;
- }
- numFaces = face->num_faces;
-
- int weight = QFont::Normal;
- bool italic = face->style_flags & FT_STYLE_FLAG_ITALIC;
-
- if (face->style_flags & FT_STYLE_FLAG_BOLD)
- weight = QFont::Bold;
-
- QList<QFontDatabase::WritingSystem> writingSystems;
- // detect symbol fonts
- for (int i = 0; i < face->num_charmaps; ++i) {
- FT_CharMap cm = face->charmaps[i];
- if (cm->encoding == ft_encoding_adobe_custom
- || cm->encoding == ft_encoding_symbol) {
- writingSystems.append(QFontDatabase::Symbol);
- break;
- }
- }
- if (writingSystems.isEmpty()) {
- TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(face, ft_sfnt_os2);
- if (os2) {
- quint32 unicodeRange[4] = {
- os2->ulUnicodeRange1, os2->ulUnicodeRange2, os2->ulUnicodeRange3, os2->ulUnicodeRange4
- };
- quint32 codePageRange[2] = {
- os2->ulCodePageRange1, os2->ulCodePageRange2
- };
-
- writingSystems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
- //for (int i = 0; i < writingSystems.count(); ++i)
- // qDebug() << QFontDatabase::writingSystemName(writingSystems.at(i));
- }
- }
+#endif // QT_NO_QWS_QPF2
- QString family = QString::fromAscii(face->family_name);
- families.append(family);
- addFont(family, /*foundry*/ "", weight, italic,
- /*pixelsize*/ 0, file, index, /*antialias*/ true, writingSystems);
-
- FT_Done_Face(face);
- ++index;
- } while (index < numFaces);
- return families;
-}
-#endif
+// QFontDatabasePrivate::addTTFile() went into qfontdatabase.cpp
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt);
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
new file mode 100644
index 0000000000..0b4567ce5d
--- /dev/null
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -0,0 +1,348 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qapplication_p.h>
+#include "qdir.h"
+#include "qfont_p.h"
+#include "qfontengine_s60_p.h"
+#include "qabstractfileengine.h"
+#include "qdesktopservices.h"
+#include "qt_s60_p.h"
+#include "qendian.h"
+#include <private/qwindowsurface_s60_p.h>
+#include <private/qcore_symbian_p.h>
+#if defined(QT_NO_FREETYPE)
+#include <OPENFONT.H>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_NO_FREETYPE)
+class QFontDatabaseS60StoreImplementation : public QFontDatabaseS60Store
+{
+public:
+ QFontDatabaseS60StoreImplementation();
+ ~QFontDatabaseS60StoreImplementation();
+
+ const QFontEngineS60Extensions *extension(const QString &typeface) const;
+
+private:
+ RHeap* m_heap;
+ CFontStore *m_store;
+ COpenFontRasterizer *m_rasterizer;
+ mutable QHash<QString, const QFontEngineS60Extensions *> m_extensions;
+};
+
+QFontDatabaseS60StoreImplementation::QFontDatabaseS60StoreImplementation()
+{
+ m_heap = User::ChunkHeap(NULL, 0x1000, 0x100000);
+ m_store = CFontStore::NewL(m_heap);
+ m_rasterizer = COpenFontRasterizer::NewL(TUid::Uid(0x101F7F5E));
+ m_store->InstallRasterizerL(m_rasterizer);
+ QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));
+ dir.setNameFilters(QStringList() << QLatin1String("*.ttf") << QLatin1String("*.ccc"));
+ for (int i = 0; i < int(dir.count()); ++i) {
+ const QString fontFile = QDir::toNativeSeparators(dir.absoluteFilePath(dir[i]));
+ m_store->AddFileL(qt_QString2TPtrC(fontFile));
+ }
+}
+QFontDatabaseS60StoreImplementation::~QFontDatabaseS60StoreImplementation()
+{
+ qDeleteAll(m_extensions);
+ delete m_rasterizer;
+ delete m_store;
+ m_heap->Close();
+}
+
+const QFontEngineS60Extensions *QFontDatabaseS60StoreImplementation::extension(const QString &typeface) const
+{
+ if (!m_extensions.contains(typeface)) {
+ CFont* font = NULL;
+ TFontSpec spec(qt_QString2TPtrC(typeface), 1);
+ spec.iHeight = 1;
+ const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, spec);
+ Q_ASSERT(err == KErrNone && font);
+ CBitmapFont *bitmapFont = static_cast<CBitmapFont*>(font);
+ m_extensions.insert(typeface, new QFontEngineS60Extensions(bitmapFont->OpenFont()));
+ }
+ return m_extensions.value(typeface);
+}
+#else
+class QFontEngineFTS60 : public QFontEngineFT
+{
+public:
+ QFontEngineFTS60(const QFontDef &fd);
+};
+
+QFontEngineFTS60::QFontEngineFTS60(const QFontDef &fd)
+ : QFontEngineFT(fd)
+{
+ default_hint_style = HintFull;
+}
+#endif // defined(QT_NO_FREETYPE)
+
+/*
+ QFontEngineS60::pixelsToPoints, QFontEngineS60::pointsToPixels, QFontEngineMultiS60::QFontEngineMultiS60
+ and QFontEngineMultiS60::QFontEngineMultiS60 should be in qfontengine_s60.cpp. But since also the
+ Freetype based font rendering need them, they are here.
+*/
+qreal QFontEngineS60::pixelsToPoints(qreal pixels, Qt::Orientation orientation)
+{
+ return (orientation == Qt::Horizontal?
+ S60->screenDevice()->HorizontalPixelsToTwips(pixels)
+ :S60->screenDevice()->VerticalPixelsToTwips(pixels)) / KTwipsPerPoint;
+}
+
+qreal QFontEngineS60::pointsToPixels(qreal points, Qt::Orientation orientation)
+{
+ const int twips = points * KTwipsPerPoint;
+ return orientation == Qt::Horizontal?
+ S60->screenDevice()->HorizontalTwipsToPixels(twips)
+ :S60->screenDevice()->VerticalTwipsToPixels(twips);
+}
+
+QFontEngineMultiS60::QFontEngineMultiS60(QFontEngine *first, int script, const QStringList &fallbackFamilies)
+ : QFontEngineMulti(fallbackFamilies.size() + 1)
+ , m_script(script)
+ , m_fallbackFamilies(fallbackFamilies)
+{
+ engines[0] = first;
+ first->ref.ref();
+ fontDef = engines[0]->fontDef;
+}
+
+void QFontEngineMultiS60::loadEngine(int at)
+{
+ Q_ASSERT(at < engines.size());
+ Q_ASSERT(engines.at(at) == 0);
+
+ QFontDef request = fontDef;
+ request.styleStrategy |= QFont::NoFontMerging;
+ request.family = m_fallbackFamilies.at(at-1);
+ engines[at] = QFontDatabase::findFont(m_script,
+ /*fontprivate*/0,
+ request);
+ Q_ASSERT(engines[at]);
+}
+
+static void initializeDb()
+{
+ QFontDatabasePrivate *db = privateDb();
+ if(!db || db->count)
+ return;
+
+#if defined(QT_NO_FREETYPE)
+ if (!db->s60Store)
+ db->s60Store = new QFontDatabaseS60StoreImplementation;
+
+ QS60WindowSurface::unlockBitmapHeap();
+ const int numTypeFaces = QS60Data::screenDevice()->NumTypefaces();
+ const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store);
+ Q_ASSERT(store);
+ for (int i = 0; i < numTypeFaces; i++) {
+ TTypefaceSupport typefaceSupport;
+ QS60Data::screenDevice()->TypefaceSupport(typefaceSupport, i);
+ CFont *font; // We have to get a font instance in order to know all the details
+ TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
+ QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec);
+ if (font->TypeUid() == KCFbsFontUid) {
+ TOpenFontFaceAttrib faceAttrib;
+ const CFbsFont *cfbsFont = dynamic_cast<const CFbsFont *>(font);
+ Q_ASSERT(cfbsFont);
+ cfbsFont->GetFaceAttrib(faceAttrib);
+
+ QtFontStyle::Key styleKey;
+ styleKey.style = faceAttrib.IsItalic()?QFont::StyleItalic:QFont::StyleNormal;
+ styleKey.weight = faceAttrib.IsBold()?QFont::Bold:QFont::Normal;
+
+ QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
+ QtFontFamily *family = db->family(familyName, true);
+ family->fixedPitch = faceAttrib.IsMonoWidth();
+ QtFontFoundry *foundry = family->foundry(QString(), true);
+ QtFontStyle *style = foundry->style(styleKey, true);
+ style->smoothScalable = typefaceSupport.iIsScalable;
+ style->pixelSize(0, true);
+
+ const QFontEngineS60Extensions *extension = store->extension(familyName);
+ const QByteArray os2Table = extension->getSfntTable(MAKE_TAG('O', 'S', '/', '2'));
+ const unsigned char* data = reinterpret_cast<const unsigned char*>(os2Table.constData());
+ const unsigned char* ulUnicodeRange = data + 42;
+ quint32 unicodeRange[4] = {
+ qFromBigEndian<quint32>(ulUnicodeRange),
+ qFromBigEndian<quint32>(ulUnicodeRange + 4),
+ qFromBigEndian<quint32>(ulUnicodeRange + 8),
+ qFromBigEndian<quint32>(ulUnicodeRange + 12)
+ };
+ const unsigned char* ulCodePageRange = data + 78;
+ quint32 codePageRange[2] = {
+ qFromBigEndian<quint32>(ulCodePageRange),
+ qFromBigEndian<quint32>(ulCodePageRange + 4)
+ };
+ const QList<QFontDatabase::WritingSystem> writingSystems =
+ determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
+ foreach (const QFontDatabase::WritingSystem system, writingSystems)
+ family->writingSystems[system] = QtFontFamily::Supported;
+ }
+ QS60Data::screenDevice()->ReleaseFont(font);
+ }
+ QS60WindowSurface::lockBitmapHeap();
+#else // defined(QT_NO_FREETYPE)
+ QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));
+ dir.setNameFilters(QStringList() << QLatin1String("*.ttf")
+ << QLatin1String("*.ttc") << QLatin1String("*.pfa")
+ << QLatin1String("*.pfb"));
+ for (int i = 0; i < int(dir.count()); ++i) {
+ const QByteArray file = QFile::encodeName(dir.absoluteFilePath(dir[i]));
+ db->addTTFile(file);
+ }
+#endif // defined(QT_NO_FREETYPE)
+}
+
+static inline void load(const QString &family = QString(), int script = -1)
+{
+ Q_UNUSED(family)
+ Q_UNUSED(script)
+ initializeDb();
+}
+
+static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
+{
+ Q_UNUSED(fnt);
+}
+
+bool QFontDatabase::supportsThreadedFontRendering()
+{
+ return false;
+}
+
+static
+QFontDef cleanedFontDef(const QFontDef &req)
+{
+ QFontDef result = req;
+ if (result.pixelSize <= 0) {
+ result.pixelSize = QFontEngineS60::pointsToPixels(qMax(qreal(1.0), result.pointSize));
+ result.pointSize = 0;
+ }
+ return result;
+}
+
+QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFontDef &req)
+{
+ const QFontCache::Key key(cleanedFontDef(req), script);
+
+ if (!privateDb()->count)
+ initializeDb();
+
+ QFontEngine *fe = QFontCache::instance()->findEngine(key);
+ if (!fe) {
+ // Making sure that fe->fontDef.family will be an existing font.
+ initializeDb();
+ QFontDatabasePrivate *db = privateDb();
+ QtFontDesc desc;
+ QList<int> blacklistedFamilies;
+ match(script, req, req.family, QString(), -1, &desc, blacklistedFamilies);
+ if (!desc.family) // falling back to application font
+ desc.family = db->family(QApplication::font().defaultFamily());
+ Q_ASSERT(desc.family);
+
+ // Making sure that desc.family supports the requested script
+ QtFontDesc mappedDesc;
+ bool supportsScript = false;
+ do {
+ match(script, req, QString(), QString(), -1, &mappedDesc, blacklistedFamilies);
+ if (mappedDesc.family == desc.family) {
+ supportsScript = true;
+ break;
+ }
+ blacklistedFamilies.append(mappedDesc.familyIndex);
+ } while (mappedDesc.family);
+ if (!supportsScript) {
+ blacklistedFamilies.clear();
+ match(script, req, QString(), QString(), -1, &mappedDesc, blacklistedFamilies);
+ if (mappedDesc.family)
+ desc = mappedDesc;
+ }
+
+ const QString fontFamily = desc.family->name;
+ QFontDef request = req;
+ request.family = fontFamily;
+#if defined(QT_NO_FREETYPE)
+ const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store);
+ Q_ASSERT(store);
+ const QFontEngineS60Extensions *extension = store->extension(fontFamily);
+ fe = new QFontEngineS60(request, extension);
+#else
+ QFontEngine::FaceId faceId;
+ const QtFontFamily * const reqQtFontFamily = db->family(fontFamily);
+ faceId.filename = reqQtFontFamily->fontFilename;
+ faceId.index = reqQtFontFamily->fontFileIndex;
+
+ QFontEngineFTS60 *fte = new QFontEngineFTS60(cleanedFontDef(request));
+ if (fte->init(faceId, true, QFontEngineFT::Format_A8))
+ fe = fte;
+ else
+ delete fte;
+#endif
+
+ Q_ASSERT(fe);
+ if (script == QUnicodeTables::Common
+ && !(req.styleStrategy & QFont::NoFontMerging)
+ && !fe->symbol) {
+
+ QStringList commonFonts;
+ for (int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws) {
+ if (scriptForWritingSystem[ws] != script)
+ continue;
+ for (int i = 0; i < db->count; ++i) {
+ if (db->families[i]->writingSystems[ws] & QtFontFamily::Supported)
+ commonFonts.append(db->families[i]->name);
+ }
+ }
+
+ // Hack: Prioritize .ccc fonts
+ const QString niceEastAsianFont(QLatin1String("Sans MT 936_S60"));
+ if (commonFonts.removeAll(niceEastAsianFont) > 0)
+ commonFonts.prepend(niceEastAsianFont);
+
+ fe = new QFontEngineMultiS60(fe, script, commonFonts);
+ }
+ }
+ fe->ref.ref();
+ QFontCache::instance()->insertEngine(key, fe);
+ return fe;
+}
+
+void QFontDatabase::load(const QFontPrivate *d, int script)
+{
+ QFontEngine *fe = 0;
+ QFontDef req = d->request;
+
+ if (!d->engineData) {
+ const QFontCache::Key key(cleanedFontDef(req), script);
+ getEngineData(d, key);
+ }
+
+ // the cached engineData could have already loaded the engine we want
+ if (d->engineData->engines[script])
+ fe = d->engineData->engines[script];
+
+ if (!fe) {
+ if (qt_enable_test_font && req.family == QLatin1String("__Qt__Box__Engine__")) {
+ fe = new QTestFontEngine(req.pixelSize);
+ fe->fontDef = req;
+ } else {
+ fe = findFont(script, d, req);
+ }
+ d->engineData->engines[script] = fe;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index d7a9c236d0..c2c23eed60 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -819,7 +819,7 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(QFontEngineGlyphCache::Type key,
return 0;
}
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS)
+#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_S60)
static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
{
uint left_right = (left << 16) + right;
@@ -1110,6 +1110,18 @@ quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
return 0;
}
+Q_GLOBAL_STATIC_WITH_INITIALIZER(QVector<QRgb>, qt_grayPalette, {
+ x->resize(256);
+ QRgb *it = x->data();
+ for (int i = 0; i < x->size(); ++i, ++it)
+ *it = 0xff000000 | i | (i<<8) | (i<<16);
+});
+
+const QVector<QRgb> &QFontEngine::grayPalette()
+{
+ return *qt_grayPalette();
+}
+
// ------------------------------------------------------------------
// The box font engine
// ------------------------------------------------------------------
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 284904bee1..649d78bc1d 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -255,7 +255,7 @@ public:
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);
bool loadGlyphs(QGlyphSet *gs, glyph_t *glyphs, int num_glyphs, GlyphFormat format = Format_Render);
-#if defined(Q_WS_QWS)
+#if defined(Q_WS_QWS) || defined(Q_WS_S60)
virtual void draw(QPaintEngine * /*p*/, qreal /*x*/, qreal /*y*/, const QTextItemInt & /*si*/) {}
#endif
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index dc18991b9b..a5aa0972ed 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -113,6 +113,10 @@ public:
QPF1,
QPF2,
Proxy,
+
+ // S60 types
+ S60FontEngine, // Cannot be simply called "S60". Reason is qt_s60Data.h
+
TestFontEngine = 0x1000
};
@@ -164,7 +168,7 @@ public:
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const {}
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_WS_S60)
virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si) = 0;
#endif
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
@@ -231,7 +235,7 @@ public:
bool symbol;
mutable HB_FontRec hbFont;
mutable HB_Face hbFace;
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS)
+#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_S60)
struct KernPair {
uint left_right;
QFixed adjust;
@@ -247,6 +251,9 @@ public:
int glyphFormat;
+protected:
+ static const QVector<QRgb> &grayPalette();
+
private:
/// remove old entries from the glyph cache. Helper method for the setGlyphCache ones.
void expireGlyphCache();
@@ -322,7 +329,7 @@ public:
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_WS_S60)
void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
#endif
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
@@ -614,4 +621,8 @@ QT_END_NAMESPACE
# include "private/qfontengine_win_p.h"
#endif
+#if defined(Q_WS_S60) && !defined(QT_NO_FREETYPE)
+# include "private/qfontengine_ft_p.h"
+#endif
+
#endif // QFONTENGINE_P_H
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
new file mode 100644
index 0000000000..eec09f4370
--- /dev/null
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -0,0 +1,309 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qfontengine_s60_p.h"
+#include "qtextengine_p.h"
+#include "qglobal.h"
+#include <private/qapplication_p.h>
+#include <private/qwindowsurface_s60_p.h>
+#include "qimage.h"
+#include "qt_s60_p.h"
+
+#include <e32base.h>
+#include <e32std.h>
+#include <EIKENV.H>
+#include <GDI.H>
+
+QT_BEGIN_NAMESPACE
+
+static const int maxFontSizeInPixels = 60;
+
+QFontEngineS60Extensions::QFontEngineS60Extensions(COpenFont *font)
+ : m_font(font)
+ , m_cmap(0)
+ , m_symbolCMap(false)
+{
+ TAny *shapingExtension = NULL;
+ m_font->ExtendedInterface(KUidOpenFontShapingExtension, shapingExtension);
+ m_shapingExtension = static_cast<MOpenFontShapingExtension*>(shapingExtension);
+ TAny *trueTypeExtension = NULL;
+ m_font->ExtendedInterface(KUidOpenFontTrueTypeExtension, trueTypeExtension);
+ m_trueTypeExtension = static_cast<MOpenFontTrueTypeExtension*>(trueTypeExtension);
+ Q_ASSERT(m_shapingExtension && m_trueTypeExtension);
+}
+
+QByteArray QFontEngineS60Extensions::getSfntTable(uint tag) const
+{
+ Q_ASSERT(m_trueTypeExtension->HasTrueTypeTable(tag));
+ TInt error = KErrNone;
+ TInt tableByteLength = 0;
+ TAny *table = m_trueTypeExtension->GetTrueTypeTable(error, tag, &tableByteLength);
+ QByteArray result(static_cast<const char*>(table), tableByteLength);
+ m_trueTypeExtension->ReleaseTrueTypeTable(table);
+ return result;
+}
+
+const unsigned char *QFontEngineS60Extensions::cmap() const
+{
+ if (!m_cmap) {
+ m_cmapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p'));
+ int size = 0;
+ m_cmap = QFontEngineS60::getCMap(reinterpret_cast<const uchar *>(m_cmapTable.constData()), m_cmapTable.size(), &m_symbolCMap, &size);
+ }
+ return m_cmap;
+}
+
+QPainterPath QFontEngineS60Extensions::glyphOutline(glyph_t glyph) const
+{
+ QPainterPath result;
+ QPolygonF polygon;
+ TInt glyphIndex = glyph;
+ TInt pointNumber = 0;
+ TInt x, y;
+ while (m_shapingExtension->GlyphPointInFontUnits(glyphIndex, pointNumber++, x, y)) {
+ const QPointF point(qreal(x) / 0xffff, qreal(y) / 0xffff);
+ if (polygon.contains(point)) {
+ result.addPolygon(polygon);
+ result.closeSubpath();
+ polygon.clear();
+ } else {
+ polygon.append(point);
+ }
+ }
+ return result;
+}
+
+// duplicated from qfontengine_xyz.cpp
+static inline unsigned int getChar(const QChar *str, int &i, const int len)
+{
+ unsigned int uc = str[i].unicode();
+ if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) {
+ uint low = str[i+1].unicode();
+ if (low >= 0xdc00 && low < 0xe000) {
+ uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000;
+ ++i;
+ }
+ }
+ return uc;
+}
+
+QFontEngineS60::QFontEngineS60(const QFontDef &request, const QFontEngineS60Extensions *extensions)
+ : m_extensions(extensions)
+{
+ QFontEngine::fontDef = request;
+ m_fontSizeInPixels = (request.pixelSize >= 0)?
+ request.pixelSize:pointsToPixels(request.pointSize);
+ QS60WindowSurface::unlockBitmapHeap();
+ m_textRenderBitmap = new (ELeave) CFbsBitmap();
+ const TSize bitmapSize(1, 1); // It is just a dummy bitmap that I need to keep the font alive (or maybe not)
+ User::LeaveIfError(m_textRenderBitmap->Create(bitmapSize, EGray256));
+ m_textRenderBitmapDevice = CFbsBitmapDevice::NewL(m_textRenderBitmap);
+ User::LeaveIfError(m_textRenderBitmapDevice->CreateContext(m_textRenderBitmapGc));
+ cache_cost = sizeof(QFontEngineS60) + bitmapSize.iHeight * bitmapSize.iWidth * 4;
+
+ TFontSpec fontSpec(qt_QString2TPtrC(request.family), m_fontSizeInPixels);
+ fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
+ fontSpec.iFontStyle.SetPosture(request.style == QFont::StyleNormal?EPostureUpright:EPostureItalic);
+ fontSpec.iFontStyle.SetStrokeWeight(request.weight > QFont::Normal?EStrokeWeightBold:EStrokeWeightNormal);
+ const TInt errorCode = m_textRenderBitmapDevice->GetNearestFontInPixels(m_font, fontSpec);
+ Q_ASSERT(errorCode == 0);
+ m_textRenderBitmapGc->UseFont(m_font);
+ QS60WindowSurface::lockBitmapHeap();
+}
+
+QFontEngineS60::~QFontEngineS60()
+{
+ QS60WindowSurface::unlockBitmapHeap();
+ m_textRenderBitmapGc->DiscardFont();
+ delete m_textRenderBitmapGc;
+ m_textRenderBitmapGc = NULL;
+ m_textRenderBitmapDevice->ReleaseFont(m_font);
+ delete m_textRenderBitmapDevice;
+ m_textRenderBitmapDevice = NULL;
+ delete m_textRenderBitmap;
+ m_textRenderBitmap = NULL;
+ QS60WindowSurface::lockBitmapHeap();
+}
+
+bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
+{
+ if (*nglyphs < len) {
+ *nglyphs = len;
+ return false;
+ }
+
+ HB_Glyph *g = glyphs->glyphs;
+ const unsigned char* cmap = m_extensions->cmap();
+ for (int i = 0; i < len; ++i) {
+ const unsigned int uc = getChar(characters, i, len);
+ *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc);
+ }
+
+ glyphs->numGlyphs = g - glyphs->glyphs;
+ *nglyphs = glyphs->numGlyphs;
+
+ if (flags & QTextEngine::GlyphIndicesOnly)
+ return true;
+
+ recalcAdvances(glyphs, flags);
+ return true;
+}
+
+void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
+{
+ Q_UNUSED(flags);
+ for (int i = 0; i < glyphs->numGlyphs; i++) {
+ const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]);
+ glyphs->advances_x[i] = glyphs->offsets[i].x = bbox.xoff;
+ glyphs->advances_y[i] = glyphs->offsets[i].y = bbox.yoff;
+ }
+}
+
+QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph)
+{
+ TOpenFontCharMetrics metrics;
+ const TUint8 *glyphBitmapBytes;
+ TSize glyphBitmapSize;
+ getCharacterData(glyph, metrics, glyphBitmapBytes, glyphBitmapSize);
+ QImage result(glyphBitmapBytes, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight, glyphBitmapSize.iWidth, QImage::Format_Indexed8);
+ result.setColorTable(grayPalette());
+
+ // The above setColorTable() call detached the image data anyway, so why not shape tha data a bit, while we can.
+ // CFont::GetCharacterData() returns 8-bit data that obviously was 4-bit data before, and converted to 8-bit incorrectly.
+ // The data values are 0x00, 0x10 ... 0xe0, 0xf0. So, a real opaque 0xff is never reached, which we get punished
+ // for every time we want to blit this glyph in the raster paint engine.
+ // "Fix" is to convert all 0xf0 to 0xff. Is fine, quality wise, and I assume faster than correcting all values.
+ // Blitting is however, evidentially faster now.
+ const int bpl = result.bytesPerLine();
+ for (int row = 0; row < result.height(); ++row) {
+ uchar *scanLine = result.scanLine(row);
+ for (int column = 0; column < bpl; ++column) {
+ if (*scanLine == 0xf0)
+ *scanLine = 0xff;
+ scanLine++;
+ }
+ }
+
+ return result;
+}
+
+glyph_metrics_t QFontEngineS60::boundingBox(const QGlyphLayout &glyphs)
+{
+ glyph_metrics_t overall;
+ // initialize with line height, we get the same behaviour on all platforms
+ overall.y = -ascent();
+ overall.height = ascent() + descent() + 1;
+
+ QFixed ymax = 0;
+ QFixed xmax = 0;
+ for (int i = 0; i < glyphs.numGlyphs; i++) {
+ const glyph_metrics_t glyphBounds = boundingBox_const(glyphs.glyphs[i]);
+ QFixed x = overall.xoff + glyphs.offsets[i].x + glyphBounds.x;
+ QFixed y = overall.yoff + glyphs.offsets[i].y - glyphBounds.y;
+ overall.x = qMin(overall.x, x);
+ overall.y = qMin(overall.y, y);
+ xmax = qMax(xmax, x + glyphBounds.width);
+ ymax = qMax(ymax, y + glyphBounds.height);
+ overall.xoff += glyphBounds.xoff;
+ }
+ overall.height = qMax(overall.height, ymax - overall.y);
+ overall.width = xmax - overall.x;
+
+ return overall;
+}
+
+glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const
+{
+ TOpenFontCharMetrics metrics;
+ const TUint8 *glyphBitmapBytes;
+ TSize glyphBitmapSize;
+ getCharacterData(glyph, metrics, glyphBitmapBytes, glyphBitmapSize);
+ TRect glyphBounds;
+ metrics.GetHorizBounds(glyphBounds);
+ const glyph_metrics_t result(
+ glyphBounds.iTl.iX,
+ glyphBounds.iTl.iY,
+ glyphBounds.Width(),
+ glyphBounds.Height(),
+ metrics.HorizAdvance(),
+ 0
+ );
+ return result;
+}
+
+glyph_metrics_t QFontEngineS60::boundingBox(glyph_t glyph)
+{
+ return boundingBox_const(glyph);
+}
+
+QFixed QFontEngineS60::ascent() const
+{
+ return m_font->FontMaxAscent();
+}
+
+QFixed QFontEngineS60::descent() const
+{
+ return m_font->FontMaxDescent();
+}
+
+QFixed QFontEngineS60::leading() const
+{
+ return 0;
+}
+
+qreal QFontEngineS60::maxCharWidth() const
+{
+ return m_font->MaxCharWidthInPixels();
+}
+
+const char *QFontEngineS60::name() const
+{
+ return "QFontEngineS60";
+}
+
+bool QFontEngineS60::canRender(const QChar *string, int len)
+{
+ const unsigned char *cmap = m_extensions->cmap();
+ for (int i = 0; i < len; ++i) {
+ const unsigned int uc = getChar(string, i, len);
+ if (QFontEngine::getTrueTypeGlyphIndex(cmap, uc) == 0)
+ return false;
+ }
+ return true;
+}
+
+QByteArray QFontEngineS60::getSfntTable(uint tag) const
+{
+ return m_extensions->getSfntTable(tag);
+}
+
+QFontEngine::Type QFontEngineS60::type() const
+{
+ return QFontEngine::S60FontEngine;
+}
+
+void QFontEngineS60::getCharacterData(glyph_t glyph, TOpenFontCharMetrics& metrics, const TUint8*& bitmap, TSize& bitmapSize) const
+{
+ // Setting the most significant bit tells GetCharacterData
+ // that 'code' is a Glyph ID, rather than a UTF-16 value
+ const TUint specialCode = (TUint)glyph | 0x80000000;
+
+ const CFont::TCharacterDataAvailability availability =
+ m_font->GetCharacterData(specialCode, metrics, bitmap, bitmapSize);
+ const glyph_t fallbackGlyph = '?';
+ if (availability != CFont::EAllCharacterData) {
+ const CFont::TCharacterDataAvailability fallbackAvailability =
+ m_font->GetCharacterData(fallbackGlyph, metrics, bitmap, bitmapSize);
+ Q_ASSERT(fallbackAvailability == CFont::EAllCharacterData);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
new file mode 100644
index 0000000000..ef4a5081e5
--- /dev/null
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QFONTENGINE_S60_P_H
+#define QFONTENGINE_S60_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qconfig.h"
+#include "qfontengine_p.h"
+#include "qsize.h"
+#include <OPENFONT.H>
+
+class CFbsBitmap;
+class CFbsBitmapDevice;
+class CFbsBitGc;
+class CFont;
+
+QT_BEGIN_NAMESPACE
+
+// ..gives us access to truetype tables, UTF-16<->GlyphID mapping, and glyph outlines
+class QFontEngineS60Extensions
+{
+public:
+ QFontEngineS60Extensions(COpenFont *font);
+
+ QByteArray getSfntTable(uint tag) const;
+ const unsigned char *cmap() const;
+ QPainterPath glyphOutline(glyph_t glyph) const;
+
+private:
+ COpenFont *m_font;
+ const MOpenFontShapingExtension *m_shapingExtension;
+ mutable MOpenFontTrueTypeExtension *m_trueTypeExtension;
+ mutable const unsigned char *m_cmap;
+ mutable bool m_symbolCMap;
+ mutable QByteArray m_cmapTable;
+};
+
+class QFontEngineS60 : public QFontEngine
+{
+public:
+ QFontEngineS60(const QFontDef &fontDef, const QFontEngineS60Extensions *extensions);
+ ~QFontEngineS60();
+
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
+ void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const;
+
+ QImage alphaMapForGlyph(glyph_t glyph);
+
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
+ glyph_metrics_t boundingBox_const(glyph_t glyph) const; // Const correctnes quirk.
+ glyph_metrics_t boundingBox(glyph_t glyph);
+
+ QFixed ascent() const;
+ QFixed descent() const;
+ QFixed leading() const;
+ qreal maxCharWidth() const;
+ qreal minLeftBearing() const { return 0; }
+ qreal minRightBearing() const { return 0; }
+
+ QByteArray getSfntTable(uint tag) const;
+
+ static qreal pixelsToPoints(qreal pixels, Qt::Orientation orientation = Qt::Horizontal);
+ static qreal pointsToPixels(qreal points, Qt::Orientation orientation = Qt::Horizontal);
+
+ const char *name() const;
+
+ bool canRender(const QChar *string, int len);
+
+ Type type() const;
+
+private:
+ friend class QFontPrivate;
+
+ QFixed glyphAdvance(HB_Glyph glyph) const;
+ void getCharacterData(glyph_t glyph, TOpenFontCharMetrics& metrics, const TUint8*& bitmap, TSize& bitmapSize) const;
+
+ CFbsBitmap *m_textRenderBitmap;
+ CFbsBitmapDevice *m_textRenderBitmapDevice;
+ CFbsBitGc *m_textRenderBitmapGc;
+ CFont* m_font;
+ const QFontEngineS60Extensions *m_extensions;
+ qreal m_fontSizeInPixels;
+};
+
+class QFontEngineMultiS60 : public QFontEngineMulti
+{
+public:
+ QFontEngineMultiS60(QFontEngine *first, int script, const QStringList &fallbackFamilies);
+ void loadEngine(int at);
+
+ int m_script;
+ QStringList m_fallbackFamilies;
+};
+
+QT_END_NAMESPACE
+
+#endif // QFONTENGINE_S60_P_H
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index f3d025c77a..c74af23027 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1870,6 +1870,8 @@ QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const
return QVariant(block.text());
case Qt::ImCurrentSelection:
return QVariant(d->cursor.selectedText());
+ case Qt::ImMaximumTextLength:
+ return QVariant(); // No limit.
default:
return QVariant();
}
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index fc33d4358f..e4d24ff739 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -106,9 +106,27 @@ embedded {
DEFINES += QT_NO_FONTCONFIG
}
+symbian {
+ SOURCES += \
+ text/qfont_s60.cpp
+ contains(QT_CONFIG, freetype) {
+ SOURCES += \
+ text/qfontengine_ft.cpp
+ HEADERS += \
+ text/qfontengine_ft_p.h
+ DEFINES += \
+ QT_NO_FONTCONFIG
+ } else {
+ SOURCES += \
+ text/qfontengine_s60.cpp
+ HEADERS += \
+ text/qfontengine_s60_p.h
+ LIBS += -lfntstr -lecom
+ }
+}
+
contains(QT_CONFIG, freetype) {
SOURCES += \
- ../3rdparty/freetype/builds/unix/ftsystem.c \
../3rdparty/freetype/src/base/ftbase.c \
../3rdparty/freetype/src/base/ftbbox.c \
../3rdparty/freetype/src/base/ftdebug.c \
@@ -152,10 +170,19 @@ contains(QT_CONFIG, freetype) {
../3rdparty/freetype/src/autofit/afloader.c\
../3rdparty/freetype/src/autofit/autofit.c
+ symbian {
+ SOURCES += \
+ ../3rdparty/freetype/src/base/ftsystem.c
+ } else {
+ SOURCES += \
+ ../3rdparty/freetype/builds/unix/ftsystem.c
+ INCLUDEPATH += \
+ ../3rdparty/freetype/builds/unix
+ }
+
INCLUDEPATH += \
../3rdparty/freetype/src \
- ../3rdparty/freetype/include \
- ../3rdparty/freetype/builds/unix
+ ../3rdparty/freetype/include
DEFINES += FT2_BUILD_LIBRARY FT_CONFIG_OPTION_SYSTEM_ZLIB
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index faa4e7b685..8410a69903 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -482,7 +482,7 @@ QMatchData QCompletionEngine::filterHistory()
for (int i = 0; i < source->rowCount(); i++) {
QString str = source->index(i, c->column).data().toString();
if (str.startsWith(c->prefix, c->cs)
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN)
&& (!dirModel || QDir::toNativeSeparators(str) != QDir::separator())
#endif
)
@@ -987,7 +987,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
delete oldModel;
#ifndef QT_NO_DIRMODEL
if (qobject_cast<QDirModel *>(model)) {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
setCaseSensitivity(Qt::CaseInsensitive);
#else
setCaseSensitivity(Qt::CaseSensitive);
@@ -1620,7 +1620,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const
idx = parent.sibling(parent.row(), index.column());
} while (idx.isValid());
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN)
if (list.count() == 1) // only the separator or some other text
return list[0];
list[0].clear() ; // the join below will provide the separator
@@ -1654,7 +1654,10 @@ QStringList QCompleter::splitPath(const QString& path) const
QString pathCopy = QDir::toNativeSeparators(path);
QString sep = QDir::separator();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+ if (pathCopy == QLatin1String("\\"))
+ return QStringList(pathCopy);
+#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
return QStringList(pathCopy);
QString doubleSlash(QLatin1String("\\\\"));
@@ -1667,7 +1670,9 @@ QStringList QCompleter::splitPath(const QString& path) const
QRegExp re(QLatin1String("[") + QRegExp::escape(sep) + QLatin1String("]"));
QStringList parts = pathCopy.split(re);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+ // Do nothing
+#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (!doubleSlash.isEmpty())
parts[0].prepend(doubleSlash);
#else
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 84aa16e5ad..b84b63f309 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -53,6 +53,8 @@
#include "qdesktopservices_win.cpp"
#elif defined(Q_WS_MAC)
#include "qdesktopservices_mac.cpp"
+#elif defined(Q_WS_S60)
+#include "qdesktopservices_s60.cpp"
#endif
#include <qhash.h>
@@ -285,6 +287,11 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
\note The storage location returned can be a directory that does not exist; i.e., it
may need to be created by the system or the user.
+
+ \note On Symbian OS, DataLocation and ApplicationsLocation always point to appropriate
+ folder on same drive with executable. FontsLocation always points to folder on ROM drive.
+ Rest of the standard locations point to folder on same drive with executable, except
+ that if executable is in ROM the folder from C drive is returned.
\note On Mac OS X, DataLocation does not include QCoreApplication::organizationName.
Use code like this to add it:
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
new file mode 100644
index 0000000000..a32a91ca92
--- /dev/null
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -0,0 +1,359 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// This flag changes the implementation to use S60 CDcoumentHandler
+// instead of apparch when opening the files
+#undef USE_DOCUMENTHANDLER
+
+#include <qcoreapplication.h>
+#include <qdir.h>
+#include <qurl.h>
+#include <private/qcore_symbian_p.h>
+
+#include <miutset.h> // KUidMsgTypeSMTP
+#include <txtrich.h> // CRichText
+#include <f32file.h> // TDriveUnit etc
+#include <eikenv.h> // CEikonEnv
+#include <apgcli.h> // RApaLsSession
+#include <apgtask.h> // TApaTaskList, TApaTask
+#include <sendui.h> // CSendUi
+#include <cmessagedata.h> // CMessageData
+#include <pathinfo.h> // PathInfo
+#ifdef USE_DOCUMENTHANDLER
+#include <documenthandler.h> // CDocumentHandler
+#endif
+
+QT_BEGIN_NAMESPACE
+
+_LIT(KSysBin, "\\Sys\\Bin\\");
+_LIT(KTempDir, "\\System\\Temp\\");
+_LIT(KBrowserPrefix, "4 " );
+_LIT(KFontsDir, "z:\\resource\\Fonts\\");
+const TUid KUidBrowser = { 0x10008D39 };
+
+static void handleMailtoSchemeL(const QUrl &url)
+{
+ QString recipient = url.path();
+ QString subject = url.queryItemValue("subject");
+ QString body = url.queryItemValue("body");
+ QString to = url.queryItemValue("to");
+ QString cc = url.queryItemValue("cc");
+ QString bcc = url.queryItemValue("bcc");
+
+ // these fields might have comma separated addresses
+ QStringList recipients = recipient.split(",");
+ QStringList tos = to.split(",");
+ QStringList ccs = cc.split(",");
+ QStringList bccs = bcc.split(",");
+
+
+ CSendUi* sendUi = CSendUi::NewLC();
+
+ // Construct symbian sendUI data holder
+ CMessageData* messageData = CMessageData::NewLC();
+
+ // Subject
+ TPtrC subj( qt_QString2TPtrC(subject) );
+ messageData->SetSubjectL( &subj );
+
+ // Body
+ CParaFormatLayer* paraFormat = CParaFormatLayer::NewL();
+ CleanupStack::PushL( paraFormat );
+ CCharFormatLayer* charFormat = CCharFormatLayer::NewL();
+ CleanupStack::PushL( charFormat );
+ CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat );
+ CleanupStack::PushL( bodyRichText );
+
+ TPtrC bodyPtr( qt_QString2TPtrC(body) );
+ if( bodyPtr.Length() )
+ {
+ bodyRichText->InsertL( 0, bodyPtr );
+ }
+ else
+ {
+ bodyRichText->InsertL( 0, KNullDesC );
+ }
+
+ messageData->SetBodyTextL( bodyRichText );
+
+ // To
+ foreach(QString item, recipients)
+ messageData->AppendToAddressL(qt_QString2TPtrC(item));
+
+ foreach(QString item, tos)
+ messageData->AppendToAddressL(qt_QString2TPtrC(item));
+
+ // Cc
+ foreach(QString item, ccs)
+ messageData->AppendCcAddressL(qt_QString2TPtrC(item));
+
+ // Bcc
+ foreach(QString item, bccs)
+ messageData->AppendBccAddressL(qt_QString2TPtrC(item));
+
+ sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData );
+ CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi
+}
+
+static bool handleMailtoScheme(const QUrl &url)
+{
+ TRAPD(err, handleMailtoSchemeL(url));
+ return err ? false : true;
+}
+
+static void handleOtherSchemesL(const TDesC& aUrl)
+{
+ // Other schemes are at the moment passed to WEB browser
+ HBufC* buf16 = HBufC::NewLC( aUrl.Length() + KBrowserPrefix.iTypeLength );
+ buf16->Des().Copy( KBrowserPrefix ); // Prefix used to launch correct browser view
+ buf16->Des().Append( aUrl );
+
+ TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
+ TApaTask task = taskList.FindApp( KUidBrowser );
+ if ( task.Exists() )
+ {
+ // Switch to existing browser instance
+ HBufC8* param8 = HBufC8::NewLC( buf16->Length() );
+ param8->Des().Append( buf16->Des() );
+ task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
+ CleanupStack::PopAndDestroy( param8 );
+ }
+ else
+ {
+ // Start a new browser instance
+ RApaLsSession appArcSession;
+ User::LeaveIfError( appArcSession.Connect() );
+ CleanupClosePushL<RApaLsSession>( appArcSession );
+ TThreadId id;
+ appArcSession.StartDocument( *buf16, KUidBrowser , id );
+ CleanupStack::PopAndDestroy(); // appArcSession
+ }
+
+ CleanupStack::PopAndDestroy( buf16 );
+}
+
+static bool handleOtherSchemes(const QUrl &url)
+{
+ TRAPD( err, handleOtherSchemesL(qt_QString2TPtrC(url.toEncoded())));
+ return err ? false : true;
+}
+
+static TDriveUnit exeDrive()
+{
+ RProcess me;
+ TFileName processFileName = me.FileName();
+ TDriveUnit drive(processFileName);
+ return drive;
+}
+
+static TDriveUnit writableExeDrive()
+{
+ TDriveUnit drive = exeDrive();
+ if( drive.operator TInt() == EDriveZ )
+ return TDriveUnit( EDriveC );
+ return drive;
+}
+
+static TPtrC writableDataRoot()
+{
+ TDriveUnit drive = exeDrive();
+ switch( drive.operator TInt() ){
+ case EDriveC:
+ return PathInfo::PhoneMemoryRootPath();
+ break;
+ case EDriveE:
+ return PathInfo::MemoryCardRootPath();
+ break;
+ case EDriveZ:
+ // It is not possible to write on ROM drive ->
+ // return phone mem root path instead
+ return PathInfo::PhoneMemoryRootPath();
+ break;
+ default:
+ // TODO: Should we return drive root similar to MemoryCardRootPath
+ return PathInfo::PhoneMemoryRootPath();
+ break;
+ }
+}
+
+static void openDocumentL(const TDesC& aUrl)
+{
+#ifndef USE_DOCUMENTHANDLER
+ // Start app associated to file MIME type by using RApaLsSession
+ // Apparc base method cannot be used to open app in embedded mode,
+ // but seems to be most stable way at the moment
+ RApaLsSession appArcSession;
+ User::LeaveIfError( appArcSession.Connect() );
+ CleanupClosePushL<RApaLsSession>( appArcSession );
+ TThreadId id;
+ // ESwitchFiles means do not start another instance
+ // Leaves if file does not exist, leave is trapped in openDocument and false returned to user.
+ User::LeaveIfError( appArcSession.StartDocument( aUrl, id,
+ RApaLsSession::ESwitchFiles ) ); // ELaunchNewApp
+ CleanupStack::PopAndDestroy(); // appArcSession
+#else
+ // This is an alternative way to launch app associated to MIME type
+ // CDocumentHandler would support opening apps in embedded mode,
+ // but our Qt application window group seems to always get switched on top of embedded one
+ // -> Cannot use menus etc of embedded app -> used
+
+ CDocumentHandler* docHandler = CDocumentHandler::NewLC();
+ TDataType temp;
+ //Standalone file opening fails for some file-types at least in S60 3.1 emulator
+ //For example .txt file fails with KErrAlreadyInUse and music files with KERN-EXEC 0
+ //Workaround is to use OpenFileEmbeddedL
+ //docHandler->OpenFileL(aUrl, temp);
+
+ // Opening file with CDocumentHandler will leave if file does not exist
+ // Leave is trapped in openDocument and false returned to user.
+ docHandler->OpenFileEmbeddedL(aUrl, temp);
+ CleanupStack::PopAndDestroy(docHandler);
+#endif
+}
+
+#ifdef USE_SCHEMEHANDLER
+// The schemehandler component only exist in private SDK. This implementation
+// exist here just for convenience in case that we need to use it later on
+// The schemehandle based implementation is not yet tested.
+
+// The biggest advantage of schemehandler is that it can handle
+// wide range of schemes and is extensible by plugins
+static bool handleUrl(const QUrl &url)
+{
+ if (!url.isValid())
+ return false;
+
+ TRAPD( err, handleUrlL(qt_QString2TPtrC(url.toString())));
+ return err ? false : true;
+}
+
+static void handleUrlL(const TDesC& aUrl)
+{
+ CSchemeHandler* schemeHandler = CSchemeHandler::NewL( aUrl );
+ CleanupStack::PushL( schemeHandler );
+ schemeHandler->HandleUrlStandaloneL(); // Process the Url in standalone mode
+ CleanupStack::PopAndDestroy();
+}
+static bool launchWebBrowser(const QUrl &url)
+{
+ return handleUrl(url);
+}
+
+static bool openDocument(const QUrl &file)
+{
+ return handleUrl(url);
+}
+#endif
+
+static bool launchWebBrowser(const QUrl &url)
+{
+ if (!url.isValid())
+ return false;
+
+ if (url.scheme() == QLatin1String("mailto")) {
+ return handleMailtoScheme(url);
+ }
+ return handleOtherSchemes( url );
+}
+
+static bool openDocument(const QUrl &file)
+{
+ if (!file.isValid())
+ return false;
+
+ QString filePath = file.toLocalFile();
+ filePath = QDir::toNativeSeparators(filePath);
+ TRAPD(err, openDocumentL(qt_QString2TPtrC(filePath)));
+ return err ? false : true;
+}
+
+QString QDesktopServices::storageLocation(StandardLocation type)
+{
+ TFileName path;
+
+ switch (type) {
+ case DesktopLocation:
+ qWarning("QDesktopServices::storageLocation %d not implemented", type);
+ break;
+ case DocumentsLocation:
+ path.Append(writableDataRoot());
+ break;
+ case FontsLocation:
+ path.Append(KFontsDir);
+ break;
+ case ApplicationsLocation:
+ path.Append(exeDrive().Name());
+ path.Append(KSysBin);
+ break;
+ case MusicLocation:
+ path.Append(writableDataRoot());
+ path.Append(PathInfo::SoundsPath());
+ break;
+ case MoviesLocation:
+ path.Append(writableDataRoot());
+ path.Append(PathInfo::VideosPath());
+ break;
+ case PicturesLocation:
+ path.Append(writableDataRoot());
+ path.Append(PathInfo::ImagesPath());
+ break;
+ case TempLocation:
+ path.Append(writableExeDrive().Name());
+ path.Append(KTempDir);
+ //return QDir::tempPath(); break;
+ break;
+ case HomeLocation:
+ path.Append(writableDataRoot());
+ //return QDir::homePath(); break;
+ break;
+ case DataLocation:
+ CEikonEnv::Static()->FsSession().PrivatePath( path );
+ // TODO: Should we actually return phone mem if data is on ROM?
+ path.Insert( 0, exeDrive().Name() );
+ break;
+ default:
+ break;
+ }
+
+ // Convert to cross-platform format and clean the path
+ QString nativePath = QString::fromUtf16(path.Ptr(), path.Length());
+ QString qtPath = QDir::fromNativeSeparators(nativePath);
+ qtPath = QDir::cleanPath(qtPath);
+
+ // Note: The storage location returned can be a directory that does not exist;
+ // i.e., it may need to be created by the system or the user.
+ return qtPath;
+}
+
+typedef QString (*LocalizerFunc)(QString&);
+
+static QString defaultLocalizedDirectoryName(QString&)
+{
+ return QString();
+}
+
+QString QDesktopServices::displayName(StandardLocation type)
+{
+ static LocalizerFunc ptrLocalizerFunc = NULL;
+
+ if (!ptrLocalizerFunc) {
+ ptrLocalizerFunc = reinterpret_cast<LocalizerFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_LocalizedDirectoryName));
+ if (!ptrLocalizerFunc)
+ ptrLocalizerFunc = &defaultLocalizedDirectoryName;
+ }
+
+ QString rawPath = storageLocation(type);
+ return ptrLocalizerFunc(rawPath);
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index e628229f0c..69c53ae569 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -35,6 +35,11 @@ embedded {
util/qsystemtrayicon_qws.cpp
}
+symbian {
+ # QDesktopServices uses CSendUi which is located on app layer
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+}
+
!embedded:!x11:mac {
OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm
}
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index 8028fdceb6..abe592d843 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -687,8 +687,9 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
Q_D(QAbstractSlider);
e->ignore();
if (e->orientation() != d->orientation && !rect().contains(e->pos()))
+ {
return;
-
+ }
static qreal offset = 0;
static QAbstractSlider *offset_owner = 0;
if (offset_owner != this){
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 09a51fe39f..e9884bbafb 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -640,6 +640,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Escape:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
+ case Qt::Key_Context2: // TODO: aportale, KEYPAD_NAVIGATION_HACK when softkey support is there
#endif
combo->hidePopup();
return true;
@@ -2421,6 +2422,10 @@ void QComboBox::showPopup()
container->setUpdatesEnabled(updatesEnabled);
container->update();
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::keypadNavigationEnabled())
+ view()->setEditFocus(true);
+#endif
}
/*!
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index b76d019708..0d8e16f8ae 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -97,8 +97,7 @@ extern void qt_mac_secure_keyboard(bool); //qapplication_mac.cpp
static inline bool shouldEnableInputMethod(QLineEdit *lineedit)
{
- const QLineEdit::EchoMode mode = lineedit->echoMode();
- return !lineedit->isReadOnly() && (mode == QLineEdit::Normal || mode == QLineEdit::PasswordEchoOnEdit);
+ return !lineedit->isReadOnly();
}
/*!
@@ -544,7 +543,13 @@ void QLineEdit::setEchoMode(EchoMode mode)
Q_D(QLineEdit);
if (mode == (EchoMode)d->echoMode)
return;
- setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
+ Qt::InputMethodHints imHints = inputMethodHints();
+ if (mode == Password) {
+ imHints |= Qt::ImhHiddenText;
+ } else {
+ imHints &= ~Qt::ImhHiddenText;
+ }
+ setInputMethodHints(imHints);
d->echoMode = mode;
d->passwordEchoEditing = false;
d->updateTextLayout();
@@ -1768,6 +1773,13 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e)
}
}
#endif
+
+ if (e->button() == Qt::LeftButton && qApp->autoSipEnabled()
+ && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) {
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(this, &event);
+ }
+ d->clickCausedFocus = 0;
}
/*! \reimp
@@ -2330,6 +2342,8 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const
return QVariant(d->text);
case Qt::ImCurrentSelection:
return QVariant(selectedText());
+ case Qt::ImMaximumTextLength:
+ return QVariant(maxLength());
default:
return QVariant();
}
@@ -2348,6 +2362,8 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
d->moveCursor(d->nextMaskBlank(0));
else if (!d->hasSelectedText())
selectAll();
+ } else if (e->reason() == Qt::MouseFocusReason) {
+ d->clickCausedFocus = 1;
}
#ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && e->reason() == Qt::PopupFocusReason))
@@ -2926,6 +2942,7 @@ void QLineEditPrivate::moveCursor(int pos, bool mark)
selDirty = false;
emit q->selectionChanged();
}
+ q->updateMicroFocus();
emitCursorPositionChanged();
}
diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h
index 532528bbbf..3db903ff2b 100644
--- a/src/gui/widgets/qlineedit_p.h
+++ b/src/gui/widgets/qlineedit_p.h
@@ -76,7 +76,8 @@ public:
: cursor(0), preeditCursor(0), cursorTimer(0), frame(1),
cursorVisible(0), hideCursor(false), separator(0), readOnly(0),
dragEnabled(0), contextMenuEnabled(1), echoMode(0), textDirty(0),
- selDirty(0), validInput(1), alignment(Qt::AlignLeading | Qt::AlignVCenter), ascent(0),
+ selDirty(0), validInput(1), clickCausedFocus(0),
+ alignment(Qt::AlignLeading | Qt::AlignVCenter), ascent(0),
maxLength(32767), hscroll(0), vscroll(0), lastCursorPos(-1), maskData(0),
modifiedState(0), undoState(0), selstart(0), selend(0), userInput(false),
emitingEditingFinished(false), passwordEchoEditing(false)
@@ -110,6 +111,7 @@ public:
uint textDirty : 1;
uint selDirty : 1;
uint validInput : 1;
+ uint clickCausedFocus : 1;
uint alignment;
int ascent;
int maxLength;
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 7396a9d445..6be0f1979d 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -1794,6 +1794,22 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(p));
const int desktopFrame = style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, this);
bool adjustToDesktop = !window()->testAttribute(Qt::WA_DontShowOnScreen);
+#ifdef QT_KEYPAD_NAVIGATION
+ if (!atAction && QApplication::keypadNavigationEnabled()) {
+ // Try to have one item activated
+ if (d->defaultAction && d->defaultAction->isEnabled()) {
+ atAction = d->defaultAction;
+ // TODO: This works for first level menus, not yet sub menus
+ } else {
+ foreach (QAction *action, d->actionList)
+ if (action->isEnabled()) {
+ atAction = action;
+ break;
+ }
+ }
+ d->currentAction = atAction;
+ }
+#endif
if (d->ncols > 1) {
pos.setY(screen.top()+desktopFrame);
} else if (atAction) {
@@ -2571,6 +2587,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
case Qt::Key_Escape:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
+ case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there
#endif
key_consumed = true;
if (d->tornoff) {
@@ -2848,6 +2865,16 @@ void QMenu::actionEvent(QActionEvent *e)
d->wce_menu->syncAction(e->action());
#endif
+#ifdef Q_OS_SYMBIAN
+ if (!d->symbian_menu)
+ d->symbian_menu = new QMenuPrivate::QSymbianMenuPrivate;
+ if (e->type() == QEvent::ActionAdded)
+ d->symbian_menu->addAction(e->action(), d->symbian_menu->findAction(e->before()));
+ else if (e->type() == QEvent::ActionRemoved)
+ d->symbian_menu->removeAction(e->action());
+ else if (e->type() == QEvent::ActionChanged)
+ d->symbian_menu->syncAction(e->action());
+#endif
if (isVisible()) {
d->updateActions();
resize(sizeHint());
diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h
index 867baee1c8..1676eb87a3 100644
--- a/src/gui/widgets/qmenu.h
+++ b/src/gui/widgets/qmenu.h
@@ -52,11 +52,19 @@
#endif
QT_BEGIN_HEADER
+#ifdef Q_OS_SYMBIAN
+ class CEikMenuPane;
+#endif
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
+#ifdef Q_OS_SYMBIAN
+ IMPORT_C void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
+ IMPORT_C void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
+#endif
+
#ifndef QT_NO_MENU
class QMenuPrivate;
@@ -145,7 +153,6 @@ public:
HMENU wceMenu(bool create = false);
#endif
-
bool separatorsCollapsible() const;
void setSeparatorsCollapsible(bool collapse);
@@ -177,6 +184,9 @@ protected:
#ifdef Q_OS_WINCE
QAction* wceCommands(uint command);
#endif
+#ifdef Q_OS_SYMBIAN
+ void symbianCommands(int command);
+#endif
private Q_SLOTS:
void internalSetSloppyAction();
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index 74367c4b99..a45f12f236 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -61,6 +61,9 @@
#include "QtCore/qbasictimer.h"
#include "private/qwidget_p.h"
+#ifdef Q_OS_SYMBIAN
+class CEikMenuPane;
+#endif
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENU
@@ -120,6 +123,15 @@ struct QWceMenuAction {
QWceMenuAction() : menuHandle(0), command(0) {}
};
#endif
+#ifdef Q_OS_SYMBIAN
+struct QSymbianMenuAction {
+ uint command;
+ int parent;
+ CEikMenuPane* menuPane;
+ QPointer<QAction> action;
+ QSymbianMenuAction() : command(0) {}
+};
+#endif
class QMenuPrivate : public QWidgetPrivate
{
@@ -135,6 +147,9 @@ public:
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
,wce_menu(0)
#endif
+#ifdef Q_OS_SYMBIAN
+ ,symbian_menu(0)
+#endif
#ifdef QT3_SUPPORT
,emitHighlighted(false)
#endif
@@ -148,6 +163,10 @@ public:
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
delete wce_menu;
#endif
+#ifdef Q_OS_SYMBIAN
+ delete symbian_menu;
+#endif
+
}
void init();
@@ -318,7 +337,29 @@ public:
HMENU wceMenu(bool create = false);
QAction* wceCommands(uint command);
#endif
-
+#if defined(Q_OS_SYMBIAN)
+ struct QSymbianMenuPrivate {
+ QList<QSymbianMenuAction*> actionItems;
+ QSymbianMenuPrivate();
+ ~QSymbianMenuPrivate();
+ void addAction(QAction *, QSymbianMenuAction* =0);
+ void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0);
+ void syncAction(QSymbianMenuAction *);
+ inline void syncAction(QAction *a) { syncAction(findAction(a)); }
+ void removeAction(QSymbianMenuAction *);
+ void rebuild(bool reCreate = false);
+ inline void removeAction(QAction *a) { removeAction(findAction(a)); }
+ inline QSymbianMenuAction *findAction(QAction *a) {
+ for(int i = 0; i < actionItems.size(); i++) {
+ QSymbianMenuAction *act = actionItems[i];
+ if(a == act->action)
+ return act;
+ }
+ return 0;
+ }
+ } *symbian_menu;
+ bool symbianCommands(int command);
+#endif
QPointer<QWidget> noReplayFor;
};
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
new file mode 100644
index 0000000000..86affe3b99
--- /dev/null
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -0,0 +1,392 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include "qmenu.h"
+#include "qapplication.h"
+#include "qmainwindow.h"
+#include "qtoolbar.h"
+#include "qevent.h"
+#include "qstyle.h"
+#include "qdebug.h"
+#include "qwidgetaction.h"
+#include <eikmenub.h>
+#include <eikmenup.h>
+#include <private/qapplication_p.h>
+#include <private/qmenu_p.h>
+#include <private/qmenubar_p.h>
+#include <qt_s60_p.h>
+#include <eikaufty.h>
+#include <eikbtgpc.h>
+#include <QtCore/qlibrary.h>
+#include <avkon.rsg>
+
+#ifndef QT_NO_MENUBAR
+
+QT_BEGIN_NAMESPACE
+
+// ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones
+typedef QMultiHash<QWidget *, QMenuBarPrivate *> MenuBarHash;
+Q_GLOBAL_STATIC(MenuBarHash, menubars)
+
+#define QT_FIRST_MENU_ITEM 32000
+
+struct SymbianMenuItem
+{
+ int id;
+ CEikMenuPaneItem::SData menuItemData;
+ QList<SymbianMenuItem*> children;
+ QAction* action;
+};
+
+static QList<SymbianMenuItem*> symbianMenus;
+static QList<QMenuBar*> nativeMenuBars;
+static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+
+bool menuExists()
+{
+ QWidget *w = qApp->activeWindow();
+ QMenuBarPrivate *mb = menubars()->value(w);
+ if ((!mb) && !menubars()->count())
+ return false;
+ return true;
+}
+
+// ### FIX THIS, copy/paste of original (faulty) stripped text implementation.
+// Implementation should be removed from QAction implementation to some generic place
+static QString qt_strippedText_copy_from_qaction(QString s)
+{
+ s.remove(QString::fromLatin1("..."));
+ int i = 0;
+ while (i < s.size()) {
+ ++i;
+ if (s.at(i-1) != QLatin1Char('&'))
+ continue;
+ if (i < s.size() && s.at(i) == QLatin1Char('&'))
+ ++i;
+ s.remove(i-1,1);
+ }
+ return s.trimmed();
+};
+
+static SymbianMenuItem* qt_symbian_find_menu(int id, const QList<SymbianMenuItem*> &parent)
+{
+ int index=0;
+ while (index < parent.count()) {
+ SymbianMenuItem* temp = parent[index];
+ if (temp->menuItemData.iCascadeId == id)
+ return temp;
+ else if (temp->menuItemData.iCascadeId != 0) {
+ SymbianMenuItem* result = qt_symbian_find_menu( id, temp->children);
+ if (result)
+ return result;
+ }
+ index++;
+ }
+ return 0;
+}
+
+static SymbianMenuItem* qt_symbian_find_menu_item(int id, const QList<SymbianMenuItem*> &parent)
+{
+ int index=0;
+ while (index < parent.count()) {
+ SymbianMenuItem* temp = parent[index];
+ if (temp->menuItemData.iCascadeId != 0) {
+ SymbianMenuItem* result = qt_symbian_find_menu_item( id, temp->children);
+ if (result)
+ return result;
+ }
+ else if (temp->menuItemData.iCommandId == id)
+ return temp;
+ index++;
+
+ }
+ return 0;
+}
+
+static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMenuItem*>* parent)
+{
+ if (action->action->isVisible()) {
+ if (action->action->isSeparator())
+ return;
+
+// ### FIX THIS, the qt_strippedText2 doesn't work perfectly for stripping & marks. Same bug is in QAction
+// New really working method is needed in a place where the implementation isn't copy/pasted
+ QString text = qt_strippedText_copy_from_qaction(action->action->text());
+ HBufC* menuItemText = qt_QString2HBufCNewL(text);
+
+ if (action->action->menu()) {
+ SymbianMenuItem* menuItem = new SymbianMenuItem();
+ menuItem->menuItemData.iCascadeId = action->command;
+ menuItem->menuItemData.iCommandId = action->command;
+ menuItem->menuItemData.iFlags = 0;
+ menuItem->menuItemData.iText = *menuItemText;
+ menuItem->action = action->action;
+ if (action->action->menu()->actions().size() == 0 || !action->action->isEnabled() )
+ menuItem->menuItemData.iFlags |= EEikMenuItemDimmed;
+ parent->append(menuItem);
+
+ if (action->action->menu()->actions().size() > 0) {
+ for (int c2= 0; c2 < action->action->menu()->actions().size(); ++c2) {
+ QSymbianMenuAction *symbianAction2 = new QSymbianMenuAction;
+ symbianAction2->action = action->action->menu()->actions().at(c2);
+ QMenu * menu = symbianAction2->action->menu();
+ symbianAction2->command = qt_symbian_menu_static_cmd_id++;
+ qt_symbian_insert_action(symbianAction2, &(menuItem->children));
+ }
+ }
+
+ } else {
+ SymbianMenuItem* menuItem = new SymbianMenuItem();
+ menuItem->menuItemData.iCascadeId = 0;
+ menuItem->menuItemData.iCommandId = action->command;
+ menuItem->menuItemData.iFlags = 0;
+ menuItem->menuItemData.iText = *menuItemText;
+ menuItem->action = action->action;
+ if (!action->action->isEnabled()){
+ menuItem->menuItemData.iFlags += EEikMenuItemDimmed;
+ }
+
+ if (action->action->isCheckable()) {
+ if (action->action->isChecked())
+ menuItem->menuItemData.iFlags += EEikMenuItemCheckBox | EEikMenuItemSymbolOn;
+ else
+ menuItem->menuItemData.iFlags += EEikMenuItemCheckBox;
+ }
+ parent->append(menuItem);
+ }
+ delete menuItemText;
+ }
+}
+
+void deleteAll(QList<SymbianMenuItem*> *items)
+{
+ while (!items->isEmpty()) {
+ SymbianMenuItem* temp = items->takeFirst();
+ deleteAll(&temp->children);
+ delete temp;
+ }
+}
+
+static void setSoftkeys()
+{
+ CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba();
+ if (cba){
+ if (menuExists())
+ cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT);
+ else
+ cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT);
+ }
+}
+
+static void rebuildMenu()
+{
+ QMenuBarPrivate *mb = 0;
+ setSoftkeys();
+ QWidget *w = qApp->activeWindow();
+ if (w)
+ {
+ mb = menubars()->value(w);
+ qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+ deleteAll( &symbianMenus );
+ if (!mb)
+ return;
+ mb->symbian_menubar->rebuild();
+ }
+ }
+
+Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane)
+{
+ if (!menuExists())
+ return;
+ rebuildMenu();
+ for (int i = 0; i < symbianMenus.count(); ++i)
+ menuPane->AddMenuItemL(symbianMenus.at(i)->menuItemData);
+}
+
+Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id)
+{
+ SymbianMenuItem* menu = qt_symbian_find_menu(id, symbianMenus);
+ if (menu) {
+ for (int i = 0; i < menu->children.count(); ++i)
+ menuPane->AddMenuItemL(menu->children.at(i)->menuItemData);
+ }
+}
+
+void QMenu::symbianCommands(int command)
+{
+ Q_D(QMenu);
+ d->symbianCommands(command);
+}
+
+void QMenuBar::symbianCommands(int command)
+{
+ int size = nativeMenuBars.size();
+ for (int i = 0; i < nativeMenuBars.size(); ++i) {
+ bool result = nativeMenuBars.at(i)->d_func()->symbianCommands(command);
+ if (result)
+ return;
+ }
+}
+
+bool QMenuBarPrivate::symbianCommands(int command)
+{
+ SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
+ if (!menu)
+ return false;
+
+ emit q_func()->triggered(menu->action);
+ menu->action->activate(QAction::Trigger);
+ return true;
+}
+
+bool QMenuPrivate::symbianCommands(int command)
+{
+ SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
+ if (!menu)
+ return false;
+
+ emit q_func()->triggered(menu->action);
+ menu->action->activate(QAction::Trigger);
+ return true;
+}
+
+void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent)
+{
+ Q_Q(QMenuBar);
+ if (parent && parent->isWindow()){
+ menubars()->insert(q->window(), this);
+ symbian_menubar = new QSymbianMenuBarPrivate(this);
+ nativeMenuBars.append(q);
+ }
+}
+
+void QMenuBarPrivate::symbianDestroyMenuBar()
+{
+ Q_Q(QMenuBar);
+ int index = nativeMenuBars.indexOf(q);
+ nativeMenuBars.removeAt(index);
+ menubars()->remove(q->window(), this);
+ rebuildMenu();
+ if (symbian_menubar)
+ delete symbian_menubar;
+ symbian_menubar = 0;
+}
+
+QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar)
+{
+ d = menubar;
+}
+
+QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate()
+{
+ deleteAll( &symbianMenus );
+ symbianMenus.clear();
+ d = 0;
+ rebuild();
+}
+
+QMenuPrivate::QSymbianMenuPrivate::QSymbianMenuPrivate()
+{
+}
+
+QMenuPrivate::QSymbianMenuPrivate::~QSymbianMenuPrivate()
+{
+
+}
+
+void QMenuPrivate::QSymbianMenuPrivate::addAction(QAction *a, QSymbianMenuAction *before)
+{
+ QSymbianMenuAction *action = new QSymbianMenuAction;
+ action->action = a;
+ action->command = qt_symbian_menu_static_cmd_id++;
+ addAction(action, before);
+}
+
+void QMenuPrivate::QSymbianMenuPrivate::addAction(QSymbianMenuAction *action, QSymbianMenuAction *before)
+{
+ if (!action)
+ return;
+ int before_index = actionItems.indexOf(before);
+ if (before_index < 0) {
+ before = 0;
+ before_index = actionItems.size();
+ }
+ actionItems.insert(before_index, action);
+}
+
+
+void QMenuPrivate::QSymbianMenuPrivate::syncAction(QSymbianMenuAction *)
+{
+ rebuild();
+}
+
+void QMenuPrivate::QSymbianMenuPrivate::removeAction(QSymbianMenuAction *action)
+{
+ actionItems.removeAll(action);
+ delete action;
+ action = 0;
+ rebuild();
+}
+
+void QMenuPrivate::QSymbianMenuPrivate::rebuild(bool)
+{
+}
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::addAction(QAction *a, QSymbianMenuAction *before)
+{
+ QSymbianMenuAction *action = new QSymbianMenuAction;
+ action->action = a;
+ action->command = qt_symbian_menu_static_cmd_id++;
+ addAction(action, before);
+}
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::addAction(QSymbianMenuAction *action, QSymbianMenuAction *before)
+{
+ if (!action)
+ return;
+ int before_index = actionItems.indexOf(before);
+ if (before_index < 0) {
+ before = 0;
+ before_index = actionItems.size();
+ }
+ actionItems.insert(before_index, action);
+}
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::syncAction(QSymbianMenuAction*)
+{
+ rebuild();
+}
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *action)
+{
+ actionItems.removeAll(action);
+ delete action;
+ rebuild();
+}
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild()
+{
+ setSoftkeys();
+ qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+ deleteAll( &symbianMenus );
+ if (!d)
+ return;
+ for (int i = 0; i < d->actions.size(); ++i) {
+ QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction;
+ symbianActionTopLevel->action = d->actions.at(i);
+ symbianActionTopLevel->parent = 0;
+ symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++;
+ qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus);
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif //QT_NO_MENUBAR
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index c63da64752..fb8a69bc68 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -732,6 +732,12 @@ void QMenuBarPrivate::init()
q->hide();
}
#endif
+#ifdef Q_OS_SYMBIAN
+ symbianCreateMenuBar(q->parentWidget());
+ if(symbian_menubar)
+ q->hide();
+#endif
+
q->setBackgroundRole(QPalette::Button);
oldWindow = oldParent = 0;
#ifdef QT3_SUPPORT
@@ -781,6 +787,10 @@ QMenuBar::~QMenuBar()
if (qt_wince_is_mobile())
d->wceDestroyMenuBar();
#endif
+#ifdef Q_OS_SYMBIAN
+ Q_D(QMenuBar);
+ d->symbianDestroyMenuBar();
+#endif
}
/*!
@@ -1035,6 +1045,12 @@ void QMenuBar::setVisible(bool visible)
if(d->wce_menubar)
return;
#endif
+#ifdef Q_OS_SYMBIAN
+ Q_D(QMenuBar);
+ if(d->symbian_menubar)
+ return;
+#endif
+
QWidget::setVisible(visible);
}
@@ -1292,6 +1308,17 @@ void QMenuBar::actionEvent(QActionEvent *e)
d->wce_menubar->syncAction(e->action());
}
#endif
+#ifdef Q_OS_SYMBIAN
+ if(d->symbian_menubar) {
+ if(e->type() == QEvent::ActionAdded)
+ d->symbian_menubar->addAction(e->action(), d->symbian_menubar->findAction(e->before()));
+ else if(e->type() == QEvent::ActionRemoved)
+ d->symbian_menubar->removeAction(e->action());
+ else if(e->type() == QEvent::ActionChanged)
+ d->symbian_menubar->syncAction(e->action());
+ }
+#endif
+
if(e->type() == QEvent::ActionAdded) {
connect(e->action(), SIGNAL(triggered()), this, SLOT(_q_actionTriggered()));
connect(e->action(), SIGNAL(hovered()), this, SLOT(_q_actionHovered()));
@@ -1378,6 +1405,11 @@ void QMenuBarPrivate::handleReparent()
if (qt_wince_is_mobile() && wce_menubar)
wce_menubar->rebuild();
#endif
+#ifdef Q_OS_SYMBIAN
+ if (symbian_menubar)
+ symbian_menubar->rebuild();
+#endif
+
}
#ifdef QT3_SUPPORT
@@ -1616,6 +1648,8 @@ QSize QMenuBar::minimumSizeHint() const
const bool as_gui_menubar = !d->mac_menubar;
#elif defined (Q_OS_WINCE)
const bool as_gui_menubar = !d->wce_menubar;
+#elif defined (Q_OS_SYMBIAN)
+ const bool as_gui_menubar = !d->symbian_menubar;
#else
const bool as_gui_menubar = true;
#endif
@@ -1676,6 +1710,8 @@ QSize QMenuBar::sizeHint() const
const bool as_gui_menubar = !d->mac_menubar;
#elif defined (Q_OS_WINCE)
const bool as_gui_menubar = !d->wce_menubar;
+#elif defined (Q_OS_SYMBIAN)
+ const bool as_gui_menubar = !d->symbian_menubar;
#else
const bool as_gui_menubar = true;
#endif
@@ -1739,6 +1775,8 @@ int QMenuBar::heightForWidth(int) const
const bool as_gui_menubar = !d->mac_menubar;
#elif defined (Q_OS_WINCE)
const bool as_gui_menubar = !d->wce_menubar;
+#elif defined (Q_OS_SYMBIAN)
+ const bool as_gui_menubar = !d->symbian_menubar;
#else
const bool as_gui_menubar = true;
#endif
diff --git a/src/gui/widgets/qmenubar.h b/src/gui/widgets/qmenubar.h
index 42f0c0c952..36c983b6dc 100644
--- a/src/gui/widgets/qmenubar.h
+++ b/src/gui/widgets/qmenubar.h
@@ -118,6 +118,10 @@ public:
static void wceRefresh();
#endif
+#ifdef Q_OS_SYMBIAN
+ static void symbianCommands(int command);
+#endif
+
public Q_SLOTS:
virtual void setVisible(bool visible);
diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h
index 223346bd4a..d562cd9182 100644
--- a/src/gui/widgets/qmenubar_p.h
+++ b/src/gui/widgets/qmenubar_p.h
@@ -61,6 +61,13 @@
#include "qguifunctions_wince.h"
#endif
+#ifndef QT_NO_MENUBAR
+#ifdef Q_OS_SYMBIAN
+class CCoeControl;
+class CEikMenuBar;
+#endif
+#endif
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENUBAR
@@ -78,7 +85,11 @@ public:
#ifdef Q_OS_WINCE
, wce_menubar(0), wceClassicMenu(false)
#endif
- { }
+#ifdef Q_OS_SYMBIAN
+ , symbian_menubar(0)
+#endif
+
+ { }
~QMenuBarPrivate()
{
#ifdef Q_WS_MAC
@@ -87,6 +98,9 @@ public:
#ifdef Q_OS_WINCE
delete wce_menubar;
#endif
+#ifdef Q_OS_SYMBIAN
+ delete symbian_menubar;
+#endif
}
void init();
@@ -220,6 +234,34 @@ public:
void wceRefresh();
bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command);
#endif
+#ifdef Q_OS_SYMBIAN
+ void symbianCreateMenuBar(QWidget *);
+ void symbianDestroyMenuBar();
+ struct QSymbianMenuBarPrivate {
+ QList<QSymbianMenuAction*> actionItems;
+ QMenuBarPrivate *d;
+ QSymbianMenuBarPrivate(QMenuBarPrivate *menubar);
+ ~QSymbianMenuBarPrivate();
+ void addAction(QAction *, QSymbianMenuAction* =0);
+ void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0);
+ void syncAction(QSymbianMenuAction *);
+ inline void syncAction(QAction *a) { syncAction(findAction(a)); }
+ void removeAction(QSymbianMenuAction *);
+ void rebuild();
+ inline void removeAction(QAction *a) { removeAction(findAction(a)); }
+ inline QSymbianMenuAction *findAction(QAction *a) {
+ for(int i = 0; i < actionItems.size(); i++) {
+ QSymbianMenuAction *act = actionItems[i];
+ if(a == act->action)
+ return act;
+ }
+ return 0;
+ }
+
+ } *symbian_menubar;
+ bool symbianCommands(int command);
+
+#endif
};
#endif
diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri
index 86dc4535d2..fc57944410 100644
--- a/src/gui/widgets/widgets.pri
+++ b/src/gui/widgets/widgets.pri
@@ -160,3 +160,7 @@ wince*: {
RC_FILE = widgets/qmenu_wince.rc
!static: QMAKE_WRITE_DEFAULT_RC = 1
}
+
+symbian*: {
+ SOURCES += widgets/qmenu_symbian.cpp
+}
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 67df52666e..e31621c4bc 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -97,6 +97,43 @@ QT_BEGIN_NAMESPACE
/*!
Create a new QNetworkCookie object, initializing the cookie name
+ and its value to empty QByteArray
+
+ A cookie is only valid if it has a name. However, the value is
+ opaque to the application and being empty may have significance to
+ the remote server.
+*/
+QNetworkCookie::QNetworkCookie()
+ : d(new QNetworkCookiePrivate)
+{
+ qRegisterMetaType<QNetworkCookie>();
+ qRegisterMetaType<QList<QNetworkCookie> >();
+
+ d->name = QByteArray();
+ d->value = QByteArray();
+}
+
+/*!
+ Create a new QNetworkCookie object, initializing the cookie name
+ to \a name and its value to empty QByteArray.
+
+ A cookie is only valid if it has a name. However, the value is
+ opaque to the application and being empty may have significance to
+ the remote server.
+*/
+QNetworkCookie::QNetworkCookie( const QByteArray &name )
+ : d(new QNetworkCookiePrivate)
+{
+ qRegisterMetaType<QNetworkCookie>();
+ qRegisterMetaType<QList<QNetworkCookie> >();
+
+ d->name = name;
+ d->value = QByteArray();
+}
+
+
+/*!
+ Create a new QNetworkCookie object, initializing the cookie name
to \a name and its value to \a value.
A cookie is only valid if it has a name. However, the value is
diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h
index e8dfab0804..9112635881 100644
--- a/src/network/access/qnetworkcookie.h
+++ b/src/network/access/qnetworkcookie.h
@@ -67,7 +67,9 @@ public:
Full
};
- QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray());
+ QNetworkCookie();
+ QNetworkCookie(const QByteArray &name );
+ QNetworkCookie(const QByteArray &name, const QByteArray &value );
QNetworkCookie(const QNetworkCookie &other);
~QNetworkCookie();
QNetworkCookie &operator=(const QNetworkCookie &other);
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 56b793dae7..4f9ea52c64 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -238,6 +238,18 @@ public:
};
/*!
+ Constructs a QNetworkRequest object with empty QUrl.
+
+ \sa url(), setUrl()
+*/
+QNetworkRequest::QNetworkRequest()
+ : d(new QNetworkRequestPrivate)
+{
+ d->url = QUrl();
+}
+
+
+/*!
Constructs a QNetworkRequest object with \a url as the URL to be
requested.
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index 6f34bceaf7..4c4159d8ed 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -86,7 +86,9 @@ public:
AlwaysCache
};
- explicit QNetworkRequest(const QUrl &url = QUrl());
+
+ explicit QNetworkRequest();
+ explicit QNetworkRequest(const QUrl &url);
QNetworkRequest(const QNetworkRequest &other);
~QNetworkRequest();
QNetworkRequest &operator=(const QNetworkRequest &other);
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 8aa6ff4c58..bf07aabe0d 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -20,7 +20,8 @@ SOURCES += kernel/qauthenticator.cpp \
kernel/qnetworkproxy.cpp \
kernel/qnetworkinterface.cpp
-unix:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
+symbian: SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_symbian.cpp
+unix:!symbian:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
win32:SOURCES += kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp
mac:LIBS+= -framework SystemConfiguration
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index f987520dfb..3271debd2c 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -148,7 +148,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
if (address.setAddress(hostName)) {
// Reverse lookup
// Reverse lookups using getnameinfo are broken on darwin, use gethostbyaddr instead.
-#if !defined (QT_NO_GETADDRINFO) && !defined (Q_OS_DARWIN)
+#if !defined (QT_NO_GETADDRINFO) && !defined (Q_OS_DARWIN) && !defined (Q_OS_SYMBIAN)
sockaddr_in sa4;
#ifndef QT_NO_IPV6
sockaddr_in6 sa6;
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 960999e55c..ff3624e9cf 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -604,8 +604,13 @@ QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface)
<< ", hardware address = " << networkInterface.hardwareAddress()
<< ", flags = ";
flagsDebug(debug, networkInterface.flags());
+#if defined(Q_CC_RVCT)
+ // RVCT gets confused with << networkInterface.addressEntries(), reason unknown.
+ debug.nospace() << ")\n";
+#else
debug.nospace() << ", entries = " << networkInterface.addressEntries()
<< ")\n";
+#endif
return debug.space();
}
#endif
diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp
new file mode 100644
index 0000000000..82c673f3e0
--- /dev/null
+++ b/src/network/kernel/qnetworkinterface_symbian.cpp
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+//#define QNETWORKINTERFACE_DEBUG
+
+//#include "qset.h"
+#include "qnetworkinterface.h"
+#include "qnetworkinterface_p.h"
+//#include <private/qnativesocketengine_p.h>
+//#include "qalgorithms.h"
+
+
+#ifndef QT_NO_NETWORKINTERFACE
+
+#include <in_sock.h>
+#include <in_iface.h>
+#include <es_sock.h>
+
+//#include <sys/types.h>
+//#include <sys/socket.h>
+//#include <errno.h>
+//#include <net/if.h>
+//#include <qplatformdefs.h>
+
+QT_BEGIN_NAMESPACE
+
+
+static QNetworkInterface::InterfaceFlags convertFlags( const TSoInetInterfaceInfo& aInfo )
+{
+ QNetworkInterface::InterfaceFlags flags = 0;
+ flags |= (aInfo.iState == EIfUp) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);
+ // We do not have separate flag for running in Symbian OS
+ flags |= (aInfo.iState == EIfUp) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);
+ flags |= (aInfo.iFeatures&KIfCanBroadcast) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);
+ flags |= (aInfo.iFeatures&KIfIsLoopback) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0);
+ flags |= (aInfo.iFeatures&KIfIsPointToPoint) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0);
+ flags |= (aInfo.iFeatures&KIfCanMulticast) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0);
+ return flags;
+}
+
+QString qstringFromDesc( const TDesC& aData )
+{
+ return QString::fromUtf16(aData.Ptr(), aData.Length());
+}
+
+static QList<QNetworkInterfacePrivate *> interfaceListing()
+{
+ TInt err( KErrNone );
+ QList<QNetworkInterfacePrivate *> interfaces;
+
+ // Connect to Native socket server
+ RSocketServ socketServ;
+ err = socketServ.Connect();
+ if( err )
+ return interfaces;
+
+ // Open dummy socket for interface queries
+ RSocket socket;
+ err = socket.Open( socketServ, _L("udp"));
+ if( err )
+ {
+ socketServ.Close();
+ return interfaces;
+ }
+
+ // Ask socket to start enumerating interfaces
+ err = socket.SetOpt( KSoInetEnumInterfaces, KSolInetIfCtrl );
+ if( err )
+ {
+ socket.Close();
+ socketServ.Close();
+ return interfaces;
+ }
+
+ int ifindex = 0;
+ TPckgBuf<TSoInetInterfaceInfo> infoPckg;
+ TSoInetInterfaceInfo &info = infoPckg();
+ while( socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, infoPckg) == KErrNone )
+ {
+ // Do not include IPv6 addresses because netmask and broadcast address cannot be determined correctly
+ if( info.iName != KNullDesC && info.iAddress.IsV4Mapped() )
+ {
+ TName address;
+ QNetworkAddressEntry entry;
+ QNetworkInterfacePrivate *iface = 0;
+
+ iface = new QNetworkInterfacePrivate;
+ iface->index = ifindex++;
+ interfaces << iface;
+ iface->name = qstringFromDesc( info.iName );
+ iface->flags = convertFlags( info );
+
+ if( /*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec )
+ {
+ for ( TInt i = sizeof(SSockAddr); i < sizeof(SSockAddr) + info.iHwAddr.GetUserLen(); i++ )
+ {
+ address.AppendNumFixedWidth(info.iHwAddr[i], EHex, 2);
+ if( ( i + 1) < sizeof(SSockAddr) + info.iHwAddr.GetUserLen() )
+ address.Append( _L(":") );
+ }
+ address.UpperCase();
+ iface->hardwareAddress = qstringFromDesc( address );
+ }
+
+ // Get the address of the interface
+ info.iAddress.Output(address);
+ entry.setIp( QHostAddress( qstringFromDesc( address ) ) );
+
+ // Get the interface netmask
+ // TODO: For some reason netmask is always 0.0.0.0
+ //info.iNetMask.Output(address);
+ //entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) );
+
+ // Workaround: Let Symbian determine netmask based on IP address class
+ // TODO: works only for IPv4
+ TInetAddr netmask;
+ netmask.NetMask( info.iAddress );
+ netmask.Output(address);
+ entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) );
+
+ // Get the interface broadcast address
+ if (iface->flags & QNetworkInterface::CanBroadcast)
+ {
+ // For some reason broadcast address is always 0.0.0.0
+ // info.iBrdAddr.Output(address);
+ // entry.setBroadcast( QHostAddress( qstringFromDesc( address ) ) );
+
+ // Workaround: Let Symbian determine broadcast address based on IP address
+ // TODO: works only for IPv4
+ TInetAddr broadcast;
+ broadcast.NetBroadcast( info.iAddress );
+ broadcast.Output(address);
+ entry.setBroadcast( QHostAddress( qstringFromDesc( address ) ) );
+ }
+
+ // Add new entry to interface address entries
+ iface->addressEntries << entry;
+
+#if defined(QNETWORKINTERFACE_DEBUG)
+ qDebug("\n Found network interface %s, interface flags:\n\
+ IsUp = %d, IsRunning = %d, CanBroadcast = %d,\n\
+ IsLoopBack = %d, IsPointToPoint = %d, CanMulticast = %d, \n\
+ ip = %s, netmask = %s, broadcast = %s,\n\
+ hwaddress = %s",
+ iface->name.toLatin1().constData(),
+ iface->flags & QNetworkInterface::IsUp, iface->flags & QNetworkInterface::IsRunning, iface->flags & QNetworkInterface::CanBroadcast,
+ iface->flags & QNetworkInterface::IsLoopBack, iface->flags & QNetworkInterface::IsPointToPoint, iface->flags & QNetworkInterface::CanMulticast,
+ entry.ip().toString().toLatin1().constData(), entry.netmask().toString().toLatin1().constData(), entry.broadcast().toString().toLatin1().constData(),
+ iface->hardwareAddress.toLatin1().constData());
+#endif
+ }
+ }
+ socket.Close();
+ socketServ.Close();
+ return interfaces;
+}
+
+QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan()
+{
+ return interfaceListing();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_NETWORKINTERFACE
diff --git a/src/network/network.pro b/src/network/network.pro
index d476b56722..59cffd0a10 100644
--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -3,6 +3,13 @@
TARGET = QtNetwork
QPRO_PWD = $$PWD
DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE
+#DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG
+#DEFINES += QNETWORKDISKCACHE_DEBUG
+#DEFINES += QSSLSOCKET_DEBUG
+#DEFINES += QHOSTINFO_DEBUG
+#DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG
+#DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG
+#DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG
QT = core
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000
@@ -15,3 +22,10 @@ include(socket/socket.pri)
include(ssl/ssl.pri)
QMAKE_LIBS += $$QMAKE_LIBS_NETWORK
+
+
+symbian {
+ TARGET.UID3=0x2001B2DE
+ LIBS += -lesock -linsock
+}
+
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 336a7e75fa..768cafbf77 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1049,8 +1049,9 @@ void QAbstractSocketPrivate::_q_abortConnectionAttempt()
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::_q_abortConnectionAttempt() (timed out)");
#endif
- if (socketEngine)
+ if (socketEngine) {
socketEngine->setWriteNotificationEnabled(false);
+ }
connectTimer->stop();
if (addresses.isEmpty()) {
diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp
index e7d22523c3..d3ccb6957e 100644
--- a/src/network/socket/qlocalserver_unix.cpp
+++ b/src/network/socket/qlocalserver_unix.cpp
@@ -106,6 +106,24 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
::memcpy(addr.sun_path, fullServerName.toLatin1().data(),
fullServerName.toLatin1().size() + 1);
+#ifdef Q_OS_SYMBIAN
+ // In SYMBIAN OS it can currently happen that accept is called twice,
+ // once from waitForNewConnection and once via QSocketNotfier activity
+ //
+ // As an workaround, we set the socket to non blocking so possible
+ // subsequent call to accept will not block in any case
+ //
+ // This change can be removed once more generic fix to select thread
+ // syncronization problem is implemented.
+ int flags = fcntl(listenSocket, F_GETFL, 0);
+ if (-1 == flags
+ || -1 == (fcntl(listenSocket, F_SETFL, flags | O_NONBLOCK))) {
+ setError(QLatin1String("QLocalServer::listen"));
+ closeServer();
+ return false;
+ }
+#endif
+
// bind
if(-1 == qBind(listenSocket, (sockaddr *)&addr, sizeof(sockaddr_un))) {
setError(QLatin1String("QLocalServer::listen"));
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index 38643f177c..2471043b5e 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -282,7 +282,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
}
::memcpy(name.sun_path, connectingPathName.toLatin1().data(),
connectingPathName.toLatin1().size() + 1);
- if (-1 == qConnect(connectingSocket, (struct sockaddr *)&name, sizeof(name))) {
+ if (-1 == qConnect(connectingSocket, (struct sockaddr *)&name, sizeof(name)) && errno != EISCONN) {
QString function = QLatin1String("QLocalSocket::connectToServer");
switch (errno)
{
@@ -300,6 +300,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
case ETIMEDOUT:
errorOccurred(QLocalSocket::SocketTimeoutError, function);
break;
+ case EINPROGRESS:
case EAGAIN:
// Try again later, all of the sockets listening are full
if (!delayConnect) {
@@ -514,9 +515,9 @@ bool QLocalSocket::waitForConnected(int msec)
if (state() != ConnectingState)
return (state() == ConnectedState);
- fd_set readfds;
- FD_ZERO(&readfds);
- FD_SET(d->connectingSocket, &readfds);
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(d->connectingSocket, &fds);
timeval timeout;
timeout.tv_sec = msec / 1000;
@@ -532,7 +533,14 @@ bool QLocalSocket::waitForConnected(int msec)
timer.start();
while (state() == ConnectingState
&& (-1 == msec || timer.elapsed() < msec)) {
- result = ::select(d->connectingSocket + 1, &readfds, 0, 0, &timeout);
+#ifdef Q_OS_SYMBIAN
+ // On Symbian, ready-to-write is signaled when non-blocking socket
+ // connect is finised. Is ready-to-read really used on other
+ // UNIX paltforms when using non-blocking AF_UNIX socket?
+ result = ::select(d->connectingSocket + 1, 0, &fds, 0, &timeout);
+#else
+ result = ::select(d->connectingSocket + 1, &fds, 0, 0, &timeout);
+#endif
if (-1 == result && errno != EINTR) {
d->errorOccurred( QLocalSocket::UnknownSocketError,
QLatin1String("QLocalSocket::waitForConnected"));
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index b25b887c29..6b2e1943c5 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -381,11 +381,13 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb
return false;
}
+
// Make sure we receive out-of-band data
+ // On Symbian OS this works only with native IP stack, not with WinSock
if (socketType == QAbstractSocket::TcpSocket
&& !setOption(ReceiveOutOfBandData, 1)) {
qWarning("QNativeSocketEngine::initialize unable to inline out-of-band data");
- }
+ }
// Set the send and receive buffer sizes to a magic size, found
// most optimal for our platforms.
@@ -1086,10 +1088,13 @@ protected:
bool QExceptionNotifier::event(QEvent *e)
{
if (e->type() == QEvent::SockAct) {
- engine->exceptionNotification();
+ if (engine->state() == QAbstractSocket::ConnectingState)
+ engine->connectionNotification();
+ else
+ engine->exceptionNotification();
return true;
}
- return QSocketNotifier::event(e);
+ return QSocketNotifier::event(e);
}
void QNativeSocketEngine::setReadNotificationEnabled(bool enable)
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 3366f2de9a..515ad84044 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -52,15 +52,22 @@
//
// We mean it.
//
-
#include "QtNetwork/qhostaddress.h"
#include "private/qabstractsocketengine_p.h"
#ifndef Q_OS_WIN
#include "qplatformdefs.h"
+#else
+#include <Winsock2.h> // sockaddr_storage, sockaddr_in
+#endif
+
+#ifdef Q_OS_SYMBIAN
+#include <private/qeventdispatcher_symbian_p.h>
+#include<unistd.h>
#endif
QT_BEGIN_NAMESPACE
+
#ifndef Q_OS_WIN
// Almost always the same. If not, specify in qplatformdefs.h.
#if !defined(QT_SOCKOPTLEN_T)
@@ -76,14 +83,144 @@ static inline int qt_socket_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *a
// UnixWare 7 redefines listen -> _listen
static inline int qt_socket_listen(int s, int backlog)
-{ return ::listen(s, backlog); }
+{
+ return ::listen(s, backlog);
+}
#if defined(listen)
# undef listen
#endif
+static inline int qt_socket_connect(int s, const struct sockaddr * addrptr, socklen_t namelen)
+{
+ return ::connect(s, addrptr, namelen);
+}
+#if defined(connect)
+# undef connect
+#endif
+
+static inline int qt_socket_bind(int s, const struct sockaddr * addrptr, socklen_t namelen)
+{
+ return ::bind(s, addrptr, namelen);
+}
+#if defined(bind)
+# undef bind
+#endif
+
+static inline int qt_socket_write(int socket, const char *data, qint64 len)
+{
+ return ::write(socket, data, len);
+}
+#if defined(write)
+# undef write
+#endif
+
+static inline int qt_socket_read(int socket, char *data, qint64 len)
+{
+ return ::read(socket, data, len);
+}
+#if defined(read)
+# undef read
+#endif
+
+static inline int qt_socket_recv(int socket, void *data, size_t length, int flags)
+{
+ return ::recv(socket, data, length, flags);
+}
+#if defined(recv)
+# undef recv
+#endif
+
+static inline int qt_socket_recvfrom(int socket, void *data, size_t length,
+ int flags, struct sockaddr *address,
+ socklen_t *address_length)
+{
+ return ::recvfrom(socket, data, length, flags, address, address_length);
+}
+#if defined(recvfrom)
+# undef recvfrom
+#endif
+
+static inline int qt_socket_sendto(int socket, const void *data, size_t length,
+ int flags, const struct sockaddr *dest_addr,
+ socklen_t dest_length)
+{
+ return ::sendto(socket, data, length, flags, dest_addr, dest_length);
+}
+#if defined(sendto)
+# undef sendto
+#endif
+static inline int qt_socket_close(int socket)
+{
+ return ::close(socket);
+}
+#if defined(close)
+# undef close
+#endif
+
+static inline int qt_socket_fcntl(int socket, int command, int option)
+{
+ return ::fcntl(socket, command, option);
+}
+#if defined(fcntl)
+# undef fcntl
+#endif
+
+static inline int qt_socket_ioctl(int socket, int command, char *option)
+{
+ return ::ioctl(socket, command, option);
+}
+#if defined(ioctl)
+# undef ioctl
+#endif
+
+static inline int qt_socket_getsockname(int socket, struct sockaddr *address, socklen_t *address_len)
+{
+ return ::getsockname(socket, address, address_len);
+}
+#if defined(getsockname)
+# undef getsockname
+#endif
+
+static inline int qt_socket_getpeername(int socket, struct sockaddr *address, socklen_t *address_len)
+{
+ return ::getpeername(socket, address, address_len);
+}
+#if defined(getpeername)
+# undef getpeername
+#endif
+
+static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
+{
+ return ::select(nfds, readfds, writefds, exceptfds, timeout);
+}
+
+#if defined(select)
+# undef select
+#endif
+
+static inline int qt_socket_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlen)
+{
+ return ::getsockopt(socket, level, optname, optval, optlen);
+}
+
+#if defined(getsockopt)
+# undef getsockopt
+#endif
+
+static inline int qt_socket_setsockopt(int socket, int level, int optname, void *optval, socklen_t optlen)
+{
+ return ::setsockopt(socket, level, optname, optval, optlen);
+}
+
+#if defined(setsockopt)
+# undef setsockopt
+#endif
+
// UnixWare 7 redefines socket -> _socket
static inline int qt_socket_socket(int domain, int type, int protocol)
-{ return ::socket(domain, type, protocol); }
+{
+ return ::socket(domain, type, protocol);
+}
#if defined(socket)
# undef socket
#endif
@@ -177,6 +314,12 @@ public:
int socketDescriptor;
+#if !defined(QT_NO_IPV6)
+ struct sockaddr_storage aa;
+#else
+ struct sockaddr_in aa;
+#endif
+
QSocketNotifier *readNotifier, *writeNotifier, *exceptNotifier;
#ifdef Q_OS_WIN
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index cc372a6442..a3f62db127 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
//#define QNATIVESOCKETENGINE_DEBUG
-
#include "qnativesocketengine_p.h"
#include "qiodevice.h"
#include "qhostaddress.h"
@@ -59,6 +58,10 @@
#include <arpa/inet.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <private/qeventdispatcher_symbian_p.h>
+#endif
+
#if defined QNATIVESOCKETENGINE_DEBUG
#include <qstring.h>
#include <ctype.h>
@@ -100,6 +103,7 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxSize)
static void qt_ignore_sigpipe()
{
+#ifndef Q_NO_POSIX_SIGNALS
// Set to ignore SIGPIPE once only.
static QBasicAtomicInt atom = Q_BASIC_ATOMIC_INITIALIZER(0);
if (atom.testAndSetRelaxed(0, 1)) {
@@ -108,6 +112,10 @@ static void qt_ignore_sigpipe()
noaction.sa_handler = SIG_IGN;
::sigaction(SIGPIPE, &noaction, 0);
}
+#else
+ // Posix signals are not supported by the underlying platform
+ // so we don't need to ignore sigpipe signal explicitly
+#endif
}
/*
@@ -127,7 +135,7 @@ static inline void qt_socket_getPortAndAddress(struct sockaddr *sa, quint16 *por
*addr = tmpAddress;
#ifndef QT_NO_IPV6IFNAME
char scopeid[IFNAMSIZ];
- if (::if_indextoname(sa6->sin6_scope_id, scopeid) > 0) {
+ if (::if_indextoname(sa6->sin6_scope_id, scopeid)) {
addr->setScopeId(QLatin1String(scopeid));
} else
#endif
@@ -189,7 +197,8 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
}
// Ensure that the socket is closed on exec*().
- ::fcntl(socket, F_SETFD, FD_CLOEXEC);
+ qt_socket_fcntl(socket, F_SETFD, FD_CLOEXEC);
+
socketDescriptor = socket;
return true;
}
@@ -227,8 +236,9 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
int v = -1;
QT_SOCKOPTLEN_T len = sizeof(v);
- if (getsockopt(socketDescriptor, SOL_SOCKET, n, (char *) &v, &len) != -1)
+ if (qt_socket_getsockopt(socketDescriptor, SOL_SOCKET, n, (char *) &v, &len) != -1)
return v;
+
return -1;
}
@@ -255,14 +265,14 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
break;
case QNativeSocketEngine::NonBlockingSocketOption: {
// Make the socket nonblocking.
- int flags = ::fcntl(socketDescriptor, F_GETFL, 0);
+ int flags = qt_socket_fcntl(socketDescriptor, F_GETFL, 0);
if (flags == -1) {
#ifdef QNATIVESOCKETENGINE_DEBUG
perror("QNativeSocketEnginePrivate::setOption(): fcntl(F_GETFL) failed");
#endif
return false;
}
- if (::fcntl(socketDescriptor, F_SETFL, flags | O_NONBLOCK) == -1) {
+ if (qt_socket_fcntl(socketDescriptor, F_SETFL, flags | O_NONBLOCK) == -1) {
#ifdef QNATIVESOCKETENGINE_DEBUG
perror("QNativeSocketEnginePrivate::setOption(): fcntl(F_SETFL) failed");
#endif
@@ -272,7 +282,9 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
return true;
}
case QNativeSocketEngine::AddressReusable:
-#ifdef SO_REUSEPORT
+#ifdef Q_OS_SYMBIAN
+ n = SO_REUSEADDR;
+#elif SO_REUSEPORT
n = SO_REUSEPORT;
#else
n = SO_REUSEADDR;
@@ -285,11 +297,16 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
break;
}
- return ::setsockopt(socketDescriptor, SOL_SOCKET, n, (char *) &v, sizeof(v)) == 0;
+ return qt_socket_setsockopt(socketDescriptor, SOL_SOCKET, n, (char *) &v, sizeof(v)) == 0;
+
}
bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16 port)
{
+#ifdef QNATIVESOCKETENGINE_DEBUG
+ qDebug("QNativeSocketEnginePrivate::nativeConnect() : %d ", socketDescriptor);
+#endif
+
struct sockaddr_in sockAddrIPv4;
struct sockaddr *sockAddrPtr = 0;
QT_SOCKLEN_T sockAddrSize = 0;
@@ -328,7 +345,8 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
// unreachable
}
- int connectResult = QT_SOCKET_CONNECT(socketDescriptor, sockAddrPtr, sockAddrSize);
+ int connectResult = qt_socket_connect(socketDescriptor, sockAddrPtr, sockAddrSize);
+
if (connectResult == -1) {
switch (errno) {
case EISCONN:
@@ -431,7 +449,8 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &address, quint16
// unreachable
}
- int bindResult = QT_SOCKET_BIND(socketDescriptor, sockAddrPtr, sockAddrSize);
+ int bindResult = qt_socket_bind(socketDescriptor, sockAddrPtr, sockAddrSize);
+
if (bindResult < 0) {
switch(errno) {
case EADDRINUSE:
@@ -499,8 +518,15 @@ int QNativeSocketEnginePrivate::nativeAccept()
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativeAccept() == %i", acceptedDescriptor);
#endif
- // Ensure that the socket is closed on exec*()
- ::fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC);
+
+ //check if we have vaild descriptor at all
+ if(acceptedDescriptor > 0) {
+ // Ensure that the socket is closed on exec*()
+ qt_socket_fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC);
+ } else {
+ qWarning("QNativeSocketEnginePrivate::nativeAccept() - acceptedDescriptor <= 0");
+ }
+
return acceptedDescriptor;
}
@@ -540,7 +566,7 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
ssize_t readBytes;
do {
char c;
- readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, storagePtr, &storageSize);
+ readBytes = qt_socket_recvfrom(socketDescriptor, &c, 1, MSG_PEEK, storagePtr, &storageSize);
} while (readBytes == -1 && errno == EINTR);
// If there's no error, or if our buffer was too small, there must be a
@@ -554,16 +580,25 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
return result;
}
+#ifdef Q_OS_SYMBIAN
+qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
+{
+ size_t nbytes = 0;
+ qt_socket_ioctl(socketDescriptor, E32IONREAD, (char *) &nbytes);
+ return qint64(nbytes-28);
+}
+#else
qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
{
QVarLengthArray<char, 8192> udpMessagePeekBuffer(8192);
- ssize_t recvResult = -1;
+ ssize_t recvResult = -1;
+
for (;;) {
// the data written to udpMessagePeekBuffer is discarded, so
// this function is still reentrant although it might not look
// so.
- recvResult = ::recv(socketDescriptor, udpMessagePeekBuffer.data(),
- udpMessagePeekBuffer.size(), MSG_PEEK);
+ recvResult = qt_socket_recv(socketDescriptor, udpMessagePeekBuffer.data(),
+ udpMessagePeekBuffer.size(), MSG_PEEK);
if (recvResult == -1 && errno == EINTR)
continue;
@@ -572,14 +607,14 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
udpMessagePeekBuffer.resize(udpMessagePeekBuffer.size() * 2);
}
-
+
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativePendingDatagramSize() == %i", recvResult);
#endif
return qint64(recvResult);
}
-
+#endif
qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxSize,
QHostAddress *address, quint16 *port)
{
@@ -595,7 +630,7 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
ssize_t recvFromResult = 0;
do {
char c;
- recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
+ recvFromResult = qt_socket_recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
0, (struct sockaddr *)&aa, &sz);
} while (recvFromResult == -1 && errno == EINTR);
@@ -646,10 +681,9 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l
// ignore the SIGPIPE signal
qt_ignore_sigpipe();
-
ssize_t sentBytes;
do {
- sentBytes = ::sendto(socketDescriptor, data, len,
+ sentBytes = qt_socket_sendto(socketDescriptor, data, len,
0, sockAddrPtr, sockAddrSize);
} while (sentBytes == -1 && errno == EINTR);
@@ -692,7 +726,7 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
// Determine local address
memset(&sa, 0, sizeof(sa));
- if (::getsockname(socketDescriptor, sockAddrPtr, &sockAddrSize) == 0) {
+ if (qt_socket_getsockname(socketDescriptor, sockAddrPtr, &sockAddrSize) == 0) {
qt_socket_getPortAndAddress(sockAddrPtr, &localPort, &localAddress);
// Determine protocol family
@@ -716,13 +750,13 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
}
// Determine the remote address
- if (!::getpeername(socketDescriptor, sockAddrPtr, &sockAddrSize))
+ if (!qt_socket_getpeername(socketDescriptor, sockAddrPtr, &sockAddrSize))
qt_socket_getPortAndAddress(sockAddrPtr, &peerPort, &peerAddress);
// Determine the socket type (UDP/TCP)
int value = 0;
QT_SOCKOPTLEN_T valueSize = sizeof(int);
- if (::getsockopt(socketDescriptor, SOL_SOCKET, SO_TYPE, &value, &valueSize) == 0) {
+ if (qt_socket_getsockopt(socketDescriptor, SOL_SOCKET, SO_TYPE, &value, &valueSize) == 0) {
if (value == SOCK_STREAM)
socketType = QAbstractSocket::TcpSocket;
else if (value == SOCK_DGRAM)
@@ -753,7 +787,7 @@ void QNativeSocketEnginePrivate::nativeClose()
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEngine::nativeClose()");
#endif
- ::close(socketDescriptor);
+ qt_socket_close(socketDescriptor);
}
qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
@@ -767,7 +801,7 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
// of an interrupting signal.
ssize_t writtenBytes;
do {
- writtenBytes = ::write(socketDescriptor, data, len);
+ writtenBytes = qt_socket_write(socketDescriptor, data, len);
} while (writtenBytes < 0 && errno == EINTR);
if (writtenBytes < 0) {
@@ -809,7 +843,7 @@ qint64 QNativeSocketEnginePrivate::nativeRead(char *data, qint64 maxSize)
ssize_t r = 0;
do {
- r = ::read(socketDescriptor, data, maxSize);
+ r = qt_socket_read(socketDescriptor, data, maxSize);
} while (r == -1 && errno == EINTR);
if (r < 0) {
@@ -827,6 +861,9 @@ qint64 QNativeSocketEnginePrivate::nativeRead(char *data, qint64 maxSize)
case EIO:
setError(QAbstractSocket::NetworkError, ReadErrorString);
break;
+#ifdef Q_OS_SYMBIAN
+ case EPIPE:
+#endif
case ECONNRESET:
r = 0;
break;
@@ -854,18 +891,48 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) co
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
+#ifdef Q_OS_SYMBIAN
+ fd_set fdexec;
+ FD_ZERO(&fdexec);
+ FD_SET(socketDescriptor, &fdexec);
+#endif
+
QTime timer;
timer.start();
int retval;
do {
if (selectForRead)
- retval = select(socketDescriptor + 1, &fds, 0, 0, timeout < 0 ? 0 : &tv);
+#ifndef Q_OS_SYMBIAN
+ retval = qt_socket_select(socketDescriptor + 1, &fds, 0, 0, timeout < 0 ? 0 : &tv);
+#else
+ retval = qt_socket_select(socketDescriptor + 1, &fds, 0, &fdexec, timeout < 0 ? 0 : &tv);
+#endif
else
- retval = select(socketDescriptor + 1, 0, &fds, 0, timeout < 0 ? 0 : &tv);
+#ifndef Q_OS_SYMBIAN
+ retval = qt_socket_select(socketDescriptor + 1, 0, &fds, 0, timeout < 0 ? 0 : &tv);
+#else
+ retval = qt_socket_select(socketDescriptor + 1, 0, &fds, &fdexec, timeout < 0 ? 0 : &tv);
+#endif
+
+
+#ifdef Q_OS_SYMBIAN
+ bool selectForExec = false;
+ if(retval != 0) {
+ if(retval < 0) {
+ qWarning("nativeSelect(....) returned < 0 for socket %d", socketDescriptor);
+ }
+ selectForExec = FD_ISSET(socketDescriptor, &fdexec);
+ }
+ if(selectForExec) {
+ qWarning("nativeSelect (selectForRead %d, retVal %d, errno %d) Unexpected expectfds ready in fd %d",
+ selectForRead, retval, errno, socketDescriptor);
+ }
+#endif
- if (retval != -1 || errno != EINTR)
+ if (retval != -1 || errno != EINTR) {
break;
+ }
if (timeout > 0) {
// recalculate the timeout
@@ -896,6 +963,12 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
FD_ZERO(&fdwrite);
if (checkWrite)
FD_SET(socketDescriptor, &fdwrite);
+
+#ifdef Q_OS_SYMBIAN
+ fd_set fdexec;
+ FD_ZERO(&fdexec);
+ FD_SET(socketDescriptor, &fdexec);
+#endif
struct timeval tv;
tv.tv_sec = timeout / 1000;
@@ -906,9 +979,33 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
int ret;
do {
- ret = select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
- if (ret != -1 || errno != EINTR)
+#ifndef Q_OS_SYMBIAN
+ ret = qt_socket_select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
+#else
+ ret = qt_socket_select(socketDescriptor + 1, &fdread, &fdwrite, &fdexec, timeout < 0 ? 0 : &tv);
+ bool selectForExec = false;
+ if(ret != 0) {
+ if(ret < 0) {
+ qWarning("nativeSelect(....) returned < 0 for socket %d", socketDescriptor);
+ }
+ selectForExec = FD_ISSET(socketDescriptor, &fdexec);
+ }
+ if(selectForExec) {
+ qWarning("nativeSelect (checkRead %d, checkWrite %d, ret %d, errno %d): Unexpected expectfds ready in fd %d",
+ checkRead, checkWrite, ret, errno, socketDescriptor);
+ if (checkRead)
+ FD_SET(socketDescriptor, &fdread);
+ if (checkWrite)
+ FD_SET(socketDescriptor, &fdwrite);
+
+ if ((ret == -1) && ( errno == ECONNREFUSED || errno == EPIPE ))
+ ret = 1;
+
+ }
+#endif
+ if (ret != -1 || errno != EINTR) {
break;
+ }
if (timeout > 0) {
// recalculate the timeout
@@ -925,9 +1022,9 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
} while (true);
if (ret <= 0)
return ret;
-
*selectForRead = FD_ISSET(socketDescriptor, &fdread);
*selectForWrite = FD_ISSET(socketDescriptor, &fdwrite);
+
return ret;
}
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index c41e32dc27..b6b0e89974 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -59,7 +59,11 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_OS_SYMBIAN
+static const int MaxWriteBufferSize = 4*1024;
+#else
static const int MaxWriteBufferSize = 128*1024;
+#endif
//#define QSOCKS5SOCKETLAYER_DEBUG
diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp
index 820404db0f..e46cb4c426 100644
--- a/src/network/socket/qudpsocket.cpp
+++ b/src/network/socket/qudpsocket.cpp
@@ -91,6 +91,13 @@
This enum describes the different flags you can pass to modify the
behavior of QUdpSocket::bind().
+
+ \note On Symbian OS bind flags behaviour depends on process capabilties.
+ If process has NetworkControl capability, the bind attempt with
+ ReuseAddressHint will always succeed even the address and port is already
+ bound by another socket with any flags. If process does not have
+ NetworkControl capability, the bind attempt to address and port already
+ bound by another socket will always fail.
\value ShareAddress Allow other services to bind to the same address
and port. This is useful when multiple processes share
@@ -346,6 +353,9 @@ qint64 QUdpSocket::pendingDatagramSize() const
as even if they are sent successfully, they are likely to be
fragmented by the IP layer before arriving at their final
destination.
+
+ \warning In S60 5.0 and earlier versions, the writeDatagram return
+ value is not reliable for large datagrams.
\warning Calling this function on a connected UDP socket may
result in an error and no packet being sent. If you are using a
@@ -365,6 +375,16 @@ qint64 QUdpSocket::writeDatagram(const char *data, qint64 size, const QHostAddre
return -1;
qint64 sent = d->socketEngine->writeDatagram(data, size, address, port);
+#ifdef Q_OS_SYMBIAN
+ if( QSysInfo::s60Version() <= QSysInfo::SV_S60_5_0 ) {
+ // This is evil hack, but for some reason native RSocket::SendTo returns 0,
+ // for large datagrams (such as 600 bytes). Based on comments from Open C team
+ // this should happen only in platforms <= S60 5.0.
+ // As an workaround, we just set sent = size
+ if( sent == 0 )
+ sent = size;
+ }
+#endif
d->cachedSocketDescriptor = d->socketEngine->socketDescriptor();
if (sent >= 0) {
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index b1fe64ad97..dad43d2896 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -42,5 +42,3 @@ wince*: {
DEFINES += QT_LOCALSOCKET_TCP
}
-
-
diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp
index daa6533af5..3096fee799 100644
--- a/src/network/ssl/qsslerror.cpp
+++ b/src/network/ssl/qsslerror.cpp
@@ -110,6 +110,23 @@ public:
\sa QSslCertificate
*/
+
+// RVCT compiler in debug build does not like about default values in const-
+// So as an workaround we define all constructor overloads here explicitly
+QSslError::QSslError()
+ : d(new QSslErrorPrivate)
+{
+ d->error = QSslError::NoError;
+ d->certificate = QSslCertificate();
+}
+
+QSslError::QSslError(SslError error)
+ : d(new QSslErrorPrivate)
+{
+ d->error = error;
+ d->certificate = QSslCertificate();
+}
+
QSslError::QSslError(SslError error, const QSslCertificate &certificate)
: d(new QSslErrorPrivate)
{
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index c120215f42..50cc142dc5 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -86,8 +86,14 @@ public:
UnspecifiedError = -1
};
- QSslError(SslError error = NoError, const QSslCertificate &certificate = QSslCertificate());
+ // RVCT compiler in debug build does not like about default values in const-
+ // So as an workaround we define all constructor overloads here explicitly
+ QSslError();
+ QSslError(SslError error);
+ QSslError(SslError error, const QSslCertificate &certificate);
+
QSslError(const QSslError &other);
+
~QSslError();
QSslError &operator=(const QSslError &other);
bool operator==(const QSslError &other) const;
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index b3be42afc7..968fdc0bc4 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -77,6 +77,10 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/x509_vfy.h>
+#ifdef Q_OS_SYMBIAN
+#include <openssl/dsa.h>
+#include <openssl/rsa.h>
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 196e19d7f6..5427370f34 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -1,6 +1,16 @@
# OpenSSL support; compile in QSslSocket.
contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri)
+
+
+symbian {
+ TRY_INCLUDEPATHS = $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE
+ for(p, TRY_INCLUDEPATHS) {
+ pp = $$join(p, "", "", "/openssl")
+ exists($$pp):INCLUDEPATH *= $$pp
+ }
+} else {
+ include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri)
+}
HEADERS += ssl/qssl.h \
ssl/qsslcertificate.h \
diff --git a/src/phonon/phonon.pro b/src/phonon/phonon.pro
index ec7e46adfa..679a1b0426 100644
--- a/src/phonon/phonon.pro
+++ b/src/phonon/phonon.pro
@@ -13,6 +13,13 @@ PHONON_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/phonon
unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
+# Phonon depends on numeric_limits. Enabling STL support in Qt
+# would bring in link dependencies, and we don't need that for
+# numeric_limits, hence we here merely ensure we bring in the necessary
+# header.
+symbian:INCLUDEPATH += $${EPOCROOT}epoc32/include/stdapis/stlport \
+ $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+
# Input
HEADERS += $$PHONON_DIR/abstractaudiooutput.h \
$$PHONON_DIR/abstractaudiooutput_p.h \
@@ -113,3 +120,9 @@ contains(QT_CONFIG, dbus) {
}
contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
+
+symbian: {
+ # Without this setting, code using numeric_limits will fail
+ # for winscw, although armv5 works fine no matter what.
+ MMP_RULES += "option cw -wchar_t on"
+}
diff --git a/src/plugins/codecs/cn/cn.pro b/src/plugins/codecs/cn/cn.pro
index a7b8b60508..b0a8a91779 100644
--- a/src/plugins/codecs/cn/cn.pro
+++ b/src/plugins/codecs/cn/cn.pro
@@ -12,3 +12,5 @@ SOURCES = qgb18030codec.cpp \
target.path += $$[QT_INSTALL_PLUGINS]/codecs
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E615
diff --git a/src/plugins/codecs/jp/jp.pro b/src/plugins/codecs/jp/jp.pro
index 8626912148..6480e43418 100644
--- a/src/plugins/codecs/jp/jp.pro
+++ b/src/plugins/codecs/jp/jp.pro
@@ -23,3 +23,5 @@ unix {
target.path += $$[QT_INSTALL_PLUGINS]/codecs
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E614
diff --git a/src/plugins/codecs/kr/kr.pro b/src/plugins/codecs/kr/kr.pro
index 9199e33c2e..1cc28d80a5 100644
--- a/src/plugins/codecs/kr/kr.pro
+++ b/src/plugins/codecs/kr/kr.pro
@@ -16,3 +16,5 @@ wince*: {
target.path += $$[QT_INSTALL_PLUGINS]/codecs
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001B2E5
diff --git a/src/plugins/codecs/tw/tw.pro b/src/plugins/codecs/tw/tw.pro
index 8039f4bb01..2ebb94f013 100644
--- a/src/plugins/codecs/tw/tw.pro
+++ b/src/plugins/codecs/tw/tw.pro
@@ -12,3 +12,5 @@ SOURCES = qbig5codec.cpp \
target.path += $$[QT_INSTALL_PLUGINS]/codecs
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001B2E4
diff --git a/src/plugins/iconengines/svgiconengine/svgiconengine.pro b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
index 2e105eeabc..5c5a31ebd1 100644
--- a/src/plugins/iconengines/svgiconengine/svgiconengine.pro
+++ b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
@@ -9,3 +9,5 @@ QT += xml svg
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/iconengines
target.path += $$[QT_INSTALL_PLUGINS]/iconengines
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001B2E3
diff --git a/src/plugins/imageformats/gif/gif.pro b/src/plugins/imageformats/gif/gif.pro
index 74586b2c20..8a5c51a587 100644
--- a/src/plugins/imageformats/gif/gif.pro
+++ b/src/plugins/imageformats/gif/gif.pro
@@ -8,3 +8,5 @@ SOURCES += main.cpp \
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E61A
diff --git a/src/plugins/imageformats/ico/ico.pro b/src/plugins/imageformats/ico/ico.pro
index 73665cd729..eadff416e3 100644
--- a/src/plugins/imageformats/ico/ico.pro
+++ b/src/plugins/imageformats/ico/ico.pro
@@ -10,3 +10,5 @@ SOURCES += main.cpp \
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E616
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index f3109024cb..e2e1a66b9b 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro
+++ b/src/plugins/imageformats/jpeg/jpeg.pro
@@ -71,3 +71,5 @@ contains(QT_CONFIG, system-jpeg) {
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E61B
diff --git a/src/plugins/imageformats/mng/mng.pro b/src/plugins/imageformats/mng/mng.pro
index f0943f5580..35cb47a818 100644
--- a/src/plugins/imageformats/mng/mng.pro
+++ b/src/plugins/imageformats/mng/mng.pro
@@ -47,3 +47,5 @@ contains(QT_CONFIG, system-zlib) {
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E619
diff --git a/src/plugins/imageformats/svg/svg.pro b/src/plugins/imageformats/svg/svg.pro
index 747d556216..bcf4c21ddf 100644
--- a/src/plugins/imageformats/svg/svg.pro
+++ b/src/plugins/imageformats/svg/svg.pro
@@ -9,3 +9,5 @@ QT += xml svg
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E618
diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro
index 8930cf3c25..312f99c4cc 100644
--- a/src/plugins/imageformats/tiff/tiff.pro
+++ b/src/plugins/imageformats/tiff/tiff.pro
@@ -56,6 +56,9 @@ contains(QT_CONFIG, system-tiff) {
wince*: {
SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp
}
+ symbian*: {
+ SOURCES += ../../../3rdparty/libtiff/port/lfind.c
+ }
}
contains(QT_CONFIG, system-zlib) {
@@ -68,3 +71,5 @@ contains(QT_CONFIG, system-zlib) {
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target
+
+symbian:TARGET.UID3=0x2001E617
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index cf4edf1b13..c08056e32a 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -10,3 +10,4 @@ unix {
embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers
!win32:!embedded:!mac:SUBDIRS *= inputmethods
contains(QT_CONFIG, phonon): SUBDIRS *= phonon
+symbian:SUBDIRS = imageformats codecs iconengines s60 sqldrivers
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
index ae390213eb..47ad4a183e 100644
--- a/src/plugins/qpluginbase.pri
+++ b/src/plugins/qpluginbase.pri
@@ -13,3 +13,8 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
include(../qt_targets.pri)
wince*:LIBS += $$QMAKE_LIBS_GUI
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = All -Tcb
+}
diff --git a/src/plugins/s60/3_1/3_1.pro b/src/plugins/s60/3_1/3_1.pro
new file mode 100644
index 0000000000..568a33ccf1
--- /dev/null
+++ b/src/plugins/s60/3_1/3_1.pro
@@ -0,0 +1,8 @@
+include(../s60pluginbase.pri)
+
+TARGET = qts60plugin_3_1
+
+SOURCES += ../src/qlocale_3_1.cpp \
+ ../src/qdesktopservices_3_1.cpp
+
+TARGET.UID3=0x2001E620
diff --git a/src/plugins/s60/3_2/3_2.pro b/src/plugins/s60/3_2/3_2.pro
new file mode 100644
index 0000000000..97409d3f86
--- /dev/null
+++ b/src/plugins/s60/3_2/3_2.pro
@@ -0,0 +1,15 @@
+include(../s60pluginbase.pri)
+
+TARGET = qts60plugin_3_2
+
+contains(S60_VERSION, 3.1) {
+ SOURCES += ../src/qlocale_3_1.cpp \
+ ../src/qdesktopservices_3_1.cpp
+} else {
+ SOURCES += ../src/qlocale_3_2.cpp \
+ ../src/qdesktopservices_3_2.cpp
+ LIBS += -ldirectorylocalizer
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+}
+
+TARGET.UID3=0x2001E621
diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro
new file mode 100644
index 0000000000..878a466a37
--- /dev/null
+++ b/src/plugins/s60/5_0/5_0.pro
@@ -0,0 +1,15 @@
+include(../s60pluginbase.pri)
+
+TARGET = qts60plugin_5_0
+
+contains(S60_VERSION, 3.1) {
+ SOURCES += ../src/qlocale_3_1.cpp \
+ ../src/qdesktopservices_3_1.cpp
+} else {
+ SOURCES += ../src/qlocale_3_2.cpp \
+ ../src/qdesktopservices_3_2.cpp
+ LIBS += -ldirectorylocalizer
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+}
+
+TARGET.UID3=0x2001E622
diff --git a/src/plugins/s60/bwins/qts60pluginu.def b/src/plugins/s60/bwins/qts60pluginu.def
new file mode 100644
index 0000000000..549f71f138
--- /dev/null
+++ b/src/plugins/s60/bwins/qts60pluginu.def
@@ -0,0 +1,7 @@
+EXPORTS
+ ?defaultFormatL@@YAXAAVTTime@@AAVTDes16@@ABVTDesC16@@ABVTLocale@@@Z @ 1 NONAME ; void defaultFormatL(class TTime &, class TDes16 &, class TDesC16 const &, class TLocale const &)
+ ?defaultGetTimeFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 2 NONAME ; class TPtrC16 defaultGetTimeFormatSpec(class TExtendedLocale &)
+ ?defaultGetLongDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 3 NONAME ; class TPtrC16 defaultGetLongDateFormatSpec(class TExtendedLocale &)
+ ?defaultGetShortDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 4 NONAME ; class TPtrC16 defaultGetShortDateFormatSpec(class TExtendedLocale &)
+ ?localizedDirectoryName@@YA?AVQString@@AAV1@@Z @ 5 NONAME ; class QString localizedDirectoryName(class QString &)
+
diff --git a/src/plugins/s60/eabi/qts60pluginu.def b/src/plugins/s60/eabi/qts60pluginu.def
new file mode 100644
index 0000000000..a433a5d30f
--- /dev/null
+++ b/src/plugins/s60/eabi/qts60pluginu.def
@@ -0,0 +1,7 @@
+EXPORTS
+ _Z14defaultFormatLR5TTimeR6TDes16RK7TDesC16RK7TLocale @ 1 NONAME
+ _Z24defaultGetTimeFormatSpecR15TExtendedLocale @ 2 NONAME
+ _Z28defaultGetLongDateFormatSpecR15TExtendedLocale @ 3 NONAME
+ _Z29defaultGetShortDateFormatSpecR15TExtendedLocale @ 4 NONAME
+ _Z22localizedDirectoryNameR7QString @ 5 NONAME
+
diff --git a/src/plugins/s60/s60.pro b/src/plugins/s60/s60.pro
new file mode 100644
index 0000000000..8ae639c82b
--- /dev/null
+++ b/src/plugins/s60/s60.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+symbian:SUBDIRS = 3_1 3_2 5_0
diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri
new file mode 100644
index 0000000000..62100f929a
--- /dev/null
+++ b/src/plugins/s60/s60pluginbase.pri
@@ -0,0 +1,15 @@
+# Note: These version based 'plugins' are not an actual Qt plugins,
+# they are just regular runtime loaded libraries
+include(../../qpluginbase.pri)
+
+CONFIG -= plugin
+MMP_RULES -= EXPORTUNFROZEN
+
+defBlock = \
+ "$${LITERAL_HASH}ifdef WINSCW" \
+ "DEFFILE ../bwins/qts60plugin.def" \
+ "$${LITERAL_HASH}else" \
+ "DEFFILE ../eabi/qts60plugin.def" \
+ "$${LITERAL_HASH}endif"
+
+MMP_RULES += defBlock \ No newline at end of file
diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp
new file mode 100644
index 0000000000..1b7edbdc7e
--- /dev/null
+++ b/src/plugins/s60/src/qdesktopservices_3_1.cpp
@@ -0,0 +1,20 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <qglobal.h>
+#include <qstring.h>
+
+EXPORT_C QString localizedDirectoryName(QString&)
+{
+ qWarning("QDesktopServices::displayName() not implemented for this platform version");
+ return QString();
+}
+
diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
new file mode 100644
index 0000000000..e563c14ecb
--- /dev/null
+++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qcore_symbian_p.h>
+#include <cdirectorylocalizer.h> // CDirectoryLocalizer
+#include <qstring.h>
+#include <qdir.h>
+
+EXPORT_C QString localizedDirectoryName(QString& rawPath)
+{
+ QString ret;
+
+ TRAPD(err,
+ CDirectoryLocalizer* localizer = CDirectoryLocalizer::NewL();
+ CleanupStack::PushL(localizer);
+ localizer->SetFullPath(qt_QString2TPtrC(QDir::toNativeSeparators(rawPath)));
+ if(localizer->IsLocalized()){
+ TPtrC locName(localizer->LocalizedName());
+ ret = qt_TDesC2QStringL(locName);
+ }
+ CleanupStack::PopAndDestroy(localizer);
+ )
+
+ if (err != KErrNone)
+ ret = QString();
+
+ return ret;
+}
+
diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp
new file mode 100644
index 0000000000..95cf2445dd
--- /dev/null
+++ b/src/plugins/s60/src/qlocale_3_1.cpp
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <e32std.h>
+
+EXPORT_C void defaultFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
+{
+ des.Zero();
+}
+
+EXPORT_C TPtrC defaultGetTimeFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
+
+EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
+
+EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp
new file mode 100644
index 0000000000..027eefc8a4
--- /dev/null
+++ b/src/plugins/s60/src/qlocale_3_2.cpp
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include <e32std.h>
+
+EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale& locale)
+{
+ return locale.GetLongDateFormatSpec();
+}
+
+EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale& locale)
+{
+ return locale.GetShortDateFormatSpec();
+}
+
+EXPORT_C TPtrC defaultGetTimeFormatSpec(TExtendedLocale& locale)
+{
+ return locale.GetTimeFormatSpec();
+}
+
+EXPORT_C void defaultFormatL(TTime& time, TDes& des, const TDesC& format, const TLocale& locale)
+{
+ time.FormatL(des, format, locale);
+}
diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro
index 39c58d4f2b..2bd5f2c18c 100644
--- a/src/plugins/sqldrivers/sqldrivers.pro
+++ b/src/plugins/sqldrivers/sqldrivers.pro
@@ -9,3 +9,7 @@ contains(sql-plugins, db2) : SUBDIRS += db2
contains(sql-plugins, sqlite) : SUBDIRS += sqlite
contains(sql-plugins, sqlite2) : SUBDIRS += sqlite2
contains(sql-plugins, ibase) : SUBDIRS += ibase
+
+contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ symbian:contains(CONFIG, system-sqlite): SUBDIRS += sqlite_symbian
+ }
diff --git a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip
new file mode 100644
index 0000000000..923cca4e47
--- /dev/null
+++ b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip
Binary files differ
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
new file mode 100644
index 0000000000..bacf23b21a
--- /dev/null
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
@@ -0,0 +1,8 @@
+# Use subdirs template to suppress generation of unnecessary files
+TEMPLATE = subdirs
+
+# We just want to extract the zip file containing sqlite binaries for Symbian
+!exists($${EPOCROOT}epoc32/release/armv5/urel/sqlite3.dll): {
+ BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
+}
+
diff --git a/src/qbase.pri b/src/qbase.pri
index f7c8a959df..d52120a80f 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -94,6 +94,12 @@ win32 {
INCLUDEPATH += tmp
!static: DEFINES+=QT_MAKEDLL
}
+symbian {
+ !static {
+ DEFINES+=QT_MAKEDLL
+ TARGET.CAPABILITY = All -Tcb
+ }
+}
win32-borland:INCLUDEPATH += kernel
aix-g++* {
@@ -115,7 +121,7 @@ embedded:DEPENDPATH += ;$$EMBEDDED_H
#install directives
include(qt_install.pri)
-unix {
+unix:!symbian {
CONFIG += create_libtool create_pc explicitlib
QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS]
QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS]
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
new file mode 100644
index 0000000000..dc702f9f9f
--- /dev/null
+++ b/src/s60installs/qt.iby
@@ -0,0 +1,94 @@
+#ifndef QT_IBY
+#define QT_IBY
+
+#include <bldvariant.hrh>
+
+// Dependancies for more than one module
+#include <base.iby>
+#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine,
+#include <cone.iby> // QtGui, QtOpenGL
+
+// QtGui dependancies
+#include <bafl.iby>
+#include <store.iby>
+#include <fntstore.iby>
+#include <ecom.iby>
+#include <fontutils.iby>
+#include <fepbase.iby>
+#include <fbserv.iby>
+#include <bitgdi.iby>
+#include <gdi.iby>
+#include <wserv.iby>
+#include <apparc.iby>
+#include <uikon.iby>
+#include <etext.iby>
+#include <emime.iby>
+#include <eikstd.iby>
+#include <mmf.iby>
+#include <avkon.iby>
+#include <commonui.iby>
+#include <platformenv.iby>
+#include <senduiservices.iby>
+#include <aknicon.iby>
+#include <aknskins.iby>
+
+// QtNetwork dependancies
+#include <esock_core.iby>
+#include <insock.iby>
+
+// QtOpenGL dependancies
+///@todo Problem here as we need libegl.dll and libglesv2.dll but they may come from a variety of places
+/// depending on the platform we're on
+
+#warning("qt.iby: hack - BINARY_SELECTION_ORDER really needs to be at the baseport/device level as it depends on the device type");
+BINARY_SELECTION_ORDER ARMV6,ARMV5 // hack - this really needs to be at the baseport/device level as it depends on the device type
+
+file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtOpenGL.dll SHARED_LIB_DIR\QtOpenGL.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll PAGED
+
+// imageformats
+file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll PAGED
+file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll PAGED
+file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll PAGED
+file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll PAGED
+file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll PAGED
+file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll PAGED
+
+// codecs
+file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll PAGED
+file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll PAGED
+file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll PAGED
+file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll PAGED
+
+// iconengines
+file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll PAGED
+
+S60_APP_RESOURCE(s60main)
+
+// imageformats stubs
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
+
+// codecs stubs
+data=\epoc32\winscw\c\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
+data=\epoc32\winscw\c\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
+
+// iconengines stubs
+data=\epoc32\winscw\c\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+
+// Stub sis file
+data=ZSYSTEM\install\qt.sis System\Install\qt.sis
+
+#endif // __QT_IBY__
diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro
new file mode 100644
index 0000000000..9aadfc02a8
--- /dev/null
+++ b/src/s60installs/qt_libs.pro
@@ -0,0 +1,75 @@
+# Use subdirs template to suppress generation of unnecessary files
+TEMPLATE = subdirs
+
+symbian: {
+ load(data_caging_paths)
+
+ SUBDIRS=
+ TARGET = "QtLibs pre-release"
+ TARGET.UID3 = 0x2001E61C
+ VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
+
+ qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc
+ qtresources.path = $$APP_RESOURCE_DIR
+
+ qtlibraries.sources = \
+ QtCore.dll \
+ QtXml.dll \
+ QtGui.dll \
+ QtNetwork.dll \
+ QtScript.dll \
+ QtTest.dll \
+ QtSql.dll \
+ qts60plugin_3_1.dll \
+ qts60plugin_3_2.dll \
+ qts60plugin_5_0.dll
+
+
+ # TODO: This should be conditional in PKG file, see commented code below
+ # However we don't yet have such mechanism in place
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ contains(CONFIG, system-sqlite): qtlibraries.sources += sqlite3.dll
+ }
+
+ #; EXISTS statement does not resolve !. Lets check the most common drives
+ #IF NOT EXISTS("c:\sys\bin\sqlite3.dll") AND NOT EXISTS("e:\sys\bin\sqlite3.dll") AND NOT EXISTS("z:\sys\bin\sqlite3.dll")
+ #"\Epoc32\release\armv5\UREL\sqlite3.dll"-"!:\sys\bin\sqlite3.dll"
+ #ENDIF
+
+ qtlibraries.path = /sys/bin
+ qtlibraries.depends = "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
+ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
+ qtlibraries.depends += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
+ }
+ contains(QT_CONFIG, stl) {
+ qtlibraries.depends += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
+ }
+
+ !contains(QT_CONFIG, no-jpeg): imageformats_plugins.sources += qjpeg.dll
+ !contains(QT_CONFIG, no-gif): imageformats_plugins.sources += qgif.dll
+ !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += qmng.dll
+ !contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += qtiff.dll
+ !contains(QT_CONFIG, no-ico): imageformats_plugins.sources += qico.dll
+ imageformats_plugins.path = $$QT_PLUGINS_BASE_DIR/imageformats
+
+ codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
+ codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
+
+ DEPLOYMENT += qtresources qtlibraries imageformats_plugins codecs_plugins
+
+ contains(QT_CONFIG, svg): {
+ qtlibraries.sources += QtSvg.dll
+ imageformats_plugins.sources += qsvg.dll
+ iconengines_plugins.sources = qsvgicon.dll
+ iconengines_plugins.path = $$QT_PLUGINS_BASE_DIR/iconengines
+ DEPLOYMENT += iconengines_plugins
+ }
+
+ contains(QT_CONFIG, phonon): {
+ qtlibraries.sources += Phonon.dll
+ }
+
+ BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)"
+ BLD_INF_RULES.prj_exports += "qtvggraphicssystem.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qtvggraphicssystem.iby)"
+ BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)"
+}
diff --git a/src/s60installs/qtdemoapps.iby b/src/s60installs/qtdemoapps.iby
new file mode 100644
index 0000000000..d888135d8c
--- /dev/null
+++ b/src/s60installs/qtdemoapps.iby
@@ -0,0 +1,15 @@
+#ifndef QTDEMOAPPS_IBY
+#define QTDEMOAPPS_IBY
+
+// A subset of Qt demo & example applications
+
+// Note that star requires OpenVG and the Qt OpenVG paint engine
+S60_APP_EXE(star)
+S60_APP_RESOURCE(star)
+data=\epoc32\data\Z\private\10003a3f\import\Apps\star_reg.rsc \private\10003a3f\import\apps\star_reg.rsc
+
+S60_APP_EXE(wiggly)
+S60_APP_RESOURCE(wiggly)
+data=\epoc32\data\Z\private\10003a3f\import\Apps\wiggly_reg.rsc \private\10003a3f\import\apps\wiggly_reg.rsc
+
+#endif // QTDEMOAPPS_IBY
diff --git a/src/s60installs/qtvggraphicssystem.iby b/src/s60installs/qtvggraphicssystem.iby
new file mode 100644
index 0000000000..6aec404b8b
--- /dev/null
+++ b/src/s60installs/qtvggraphicssystem.iby
@@ -0,0 +1,9 @@
+#ifndef QTVGGRAPHICSSYSTEM_IBY
+#define QTVGGRAPHICSSYSTEM_IBY
+
+#include <qt.iby>
+
+file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll qvggraphicssystem.dll
+data=\epoc32\winscw\c\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
+
+#endif // QTVGGRAPHICSSYSTEM_IBY
diff --git a/src/s60main/qts60main.cpp b/src/s60main/qts60main.cpp
new file mode 100644
index 0000000000..1d19cc6943
--- /dev/null
+++ b/src/s60main/qts60main.cpp
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+#include <eikstart.h>
+#include "qts60mainapplication.h"
+
+/**
+ * factory function to create the QtS60Main application class
+ */
+LOCAL_C CApaApplication* NewApplication()
+ {
+ return new CQtS60MainApplication;
+ }
+
+/**
+ * A normal Symbian OS executable provides an E32Main() function which is
+ * called by the operating system to start the program.
+ */
+GLDEF_C TInt E32Main()
+ {
+ return EikStart::RunApplication( NewApplication );
+ }
+
diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp
new file mode 100644
index 0000000000..10a784a0dc
--- /dev/null
+++ b/src/s60main/qts60main_mcrt0.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_3RDPARTY_LICENSE$
+**
+****************************************************************************/
+
+// MCRT0.CPP
+//
+// © Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
+// Copyright (c) Symbian Software Ltd 1997-2004. All rights reserved.
+//
+
+// EPOC32 version of crt0.c for C programs which always want multi-threaded support
+
+#include <e32std.h>
+#include <e32base.h>
+#include "estlib.h"
+
+#ifdef __ARMCC__
+__asm int CallMain(int argc, char *argv[], char *envp[])
+{
+ import main
+ code32
+ b main
+}
+#define CALLMAIN(argc, argv, envp) CallMain(argc, argv, envp)
+#else
+extern "C" int main (int argc, char *argv[], char *envp[]);
+#define CALLMAIN(argc, argv, envp) main(argc, argv, envp)
+#endif
+
+// Dummy function to handle GCCE toolchain problem
+extern "C" GLDEF_C int __GccGlueInit()
+{
+ return 0;
+}
+
+extern "C" IMPORT_C void exit (int ret);
+
+GLDEF_C TInt QtMainWrapper()
+{
+ int argc=0;
+ char **argv=0;
+ char **envp=0;
+ // get args & environment
+ __crt0(argc,argv,envp);
+ CleanupArrayDelete<char*>::PushL(argv);
+ CleanupArrayDelete<char*>::PushL(envp);
+ //Call user(application)'s main
+ int ret = CALLMAIN(argc,argv,envp);
+ CleanupStack::PopAndDestroy(2,argv);
+ return ret;
+}
+
+
+#ifdef __GCC32__
+
+/* stub function inserted into main() by GCC */
+extern "C" void __gccmain (void) {}
+
+/* Default GCC entrypoint */
+extern "C" TInt _mainCRTStartup (void)
+{
+ extern TInt _E32Startup();
+ return _E32Startup();
+}
+
+#endif /* __GCC32__ */
+
+#ifdef __EABI__
+
+// standard entrypoint for C runtime, expected by some linkers
+// Symbian OS does not currently use this function
+extern "C" void __main() {}
+#endif
diff --git a/src/s60main/qts60mainapplication.cpp b/src/s60main/qts60mainapplication.cpp
new file mode 100644
index 0000000000..807b5afd26
--- /dev/null
+++ b/src/s60main/qts60mainapplication.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+#include "qts60maindocument.h"
+#include "qts60mainapplication.h"
+#include <bautils.h>
+#include <coemain.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+_LIT( KQtWrapperResourceFile,"\\resource\\apps\\s60main.rsc" );
+
+// -----------------------------------------------------------------------------
+// CQtS60MainApplication::CreateDocumentL()
+// Creates CApaDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CQtS60MainApplication::CreateDocumentL()
+ {
+ // Create an QtS60Main document, and return a pointer to it
+ return (static_cast<CApaDocument*>( CQtS60MainDocument::NewL( *this ) ) );
+ }
+
+// -----------------------------------------------------------------------------
+// CQtS60MainApplication::AppDllUid()
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CQtS60MainApplication::AppDllUid() const
+ {
+ // Return the UID for the QtS60Main application
+ return ProcessUid();
+ }
+
+// -----------------------------------------------------------------------------
+// CQtS60MainApplication::ResourceFileName()
+// Returns application resource filename
+// -----------------------------------------------------------------------------
+//
+TFileName CQtS60MainApplication::ResourceFileName() const
+ {
+ TFindFile finder(iCoeEnv->FsSession());
+ TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC);
+ if (err == KErrNone)
+ return finder.File();
+ return KNullDesC();
+ }
+
+
+// End of File
+
diff --git a/src/s60main/qts60mainapplication.h b/src/s60main/qts60mainapplication.h
new file mode 100644
index 0000000000..318f83b0b0
--- /dev/null
+++ b/src/s60main/qts60mainapplication.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __QtS60MainAPPLICATION_H__
+#define __QtS60MainAPPLICATION_H__
+
+// INCLUDES
+#include <aknapp.h>
+
+// CLASS DECLARATION
+
+static TUid ProcessUid()
+ {
+ RProcess me;
+ TSecureId securId = me.SecureId();
+ me.Close();
+ return securId.operator TUid();
+ }
+
+/**
+* CQtS60MainApplication application class.
+* Provides factory to create concrete document object.
+* An instance of CQtS60MainApplication is the application part of the
+* AVKON application framework for the QtS60Main example application.
+*/
+class CQtS60MainApplication : public CAknApplication
+ {
+ public: // Functions from base classes
+
+ /**
+ * From CApaApplication, AppDllUid.
+ * @return Application's UID (KUidQtS60MainApp).
+ */
+ TUid AppDllUid() const;
+
+ /**
+ * From CApaApplication, ResourceFileName
+ * @return Application's resource filename (KUidQtS60MainApp).
+ */
+ TFileName ResourceFileName() const;
+
+ protected: // Functions from base classes
+
+ /**
+ * From CApaApplication, CreateDocumentL.
+ * Creates CQtS60MainDocument document object. The returned
+ * pointer in not owned by the CQtS60MainApplication object.
+ * @return A pointer to the created document object.
+ */
+ CApaDocument* CreateDocumentL();
+ };
+
+#endif // __QtS60MainAPPLICATION_H__
+
+// End of File
+
diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp
new file mode 100644
index 0000000000..dafbe96fc1
--- /dev/null
+++ b/src/s60main/qts60mainappui.cpp
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <eikmenub.h>
+#include <eikmenup.h>
+#include <barsread.h>
+#include <s60main.rsg>
+#include <avkon.rsg>
+
+#include "qts60mainappui.h"
+#include <QtGui/qapplication.h>
+#include <QtGui/qmenu.h>
+#include <QtGui/private/qt_s60_p.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CQtS60MainAppUi::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainAppUi::ConstructL()
+{
+ // Initialise app UI with standard value.
+ // ENoAppResourceFile and ENonStandardResourceFile makes UI to work without
+ // resource files in most SDKs. S60 3rd FP1 public seems to require resource file
+ // even these flags are defined
+ BaseConstructL(CAknAppUi::EAknEnableSkin);
+
+ // Create async callback to call Qt main,
+ // this is required to give S60 app FW to finish starting correctly
+ TCallBack callBack( OpenCMainStaticCallBack, this );
+ iAsyncCallBack = new(ELeave) CAsyncCallBack( callBack, CActive::EPriorityIdle );
+ iAsyncCallBack->Call();
+}
+
+// -----------------------------------------------------------------------------
+// CQtS60MainAppUi::CQtS60MainAppUi()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CQtS60MainAppUi::CQtS60MainAppUi()
+{
+ // No implementation required
+}
+
+// -----------------------------------------------------------------------------
+// CQtS60MainAppUi::~CQtS60MainAppUi()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CQtS60MainAppUi::~CQtS60MainAppUi()
+{
+ delete iAsyncCallBack;
+}
+
+// -----------------------------------------------------------------------------
+// CQtS60MainAppUi::HandleCommandL()
+// Takes care of command handling.
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainAppUi::HandleCommandL( TInt aCommand )
+{
+ if (qApp)
+ qApp->s60HandleCommandL(aCommand);
+}
+
+void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control)
+{
+ int result = 0;
+ if (qApp)
+ result = qApp->s60ProcessEvent(const_cast<TWsEvent*>(&aEvent));
+
+ if (result <= 0)
+ CAknAppUi::HandleWsEventL(aEvent, control);
+}
+
+
+// -----------------------------------------------------------------------------
+// Called by the framework when the application status pane
+// size is changed. Passes the new client rectangle to the
+// AppView
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainAppUi::HandleStatusPaneSizeChange()
+{
+ HandleResourceChangeL(KInternalStatusPaneChange);
+ HandleStackedControlsResourceChange(KInternalStatusPaneChange);
+}
+
+// -----------------------------------------------------------------------------
+// Called asynchronously from ConstructL() - passes call to nan static method
+// -----------------------------------------------------------------------------
+//
+TInt CQtS60MainAppUi::OpenCMainStaticCallBack( TAny* aObject )
+{
+ CQtS60MainAppUi* myObj = static_cast<CQtS60MainAppUi*>( aObject );
+ myObj->OpenCMainCallBack();
+ return 0;
+}
+
+#include "qtS60main_mcrt0.cpp"
+
+// -----------------------------------------------------------------------------
+// Invokes Qt main, the Qt main will block and when we return from there
+// application should be closed. -> Call Exit();
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainAppUi::OpenCMainCallBack()
+{
+ TInt ret = QtMainWrapper();
+ Exit();
+}
+
+void CQtS60MainAppUi::DynInitMenuBarL(TInt, CEikMenuBar *)
+{
+}
+
+void CQtS60MainAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane)
+{
+ if (aResourceId == R_QT_WRAPPERAPP_MENU){
+ if (aMenuPane->NumberOfItemsInPane() <= 1)
+ qt_symbian_show_toplevel(aMenuPane);
+
+ }
+ else if( aResourceId != R_AVKON_MENUPANE_FEP_DEFAULT && aResourceId != R_AVKON_MENUPANE_EDITTEXT_DEFAULT && aResourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT ){
+ qt_symbian_show_submenu(aMenuPane, aResourceId);
+ }
+}
+
+void CQtS60MainAppUi::RestoreMenuL(CCoeControl* aMenuWindow,TInt aMenuId,TMenuType aMenuType)
+{
+ if ((aMenuId==R_QT_WRAPPERAPP_MENUBAR) || (aMenuId == R_AVKON_MENUPANE_FEP_DEFAULT)) {
+ TResourceReader reader;
+ iCoeEnv->CreateResourceReaderLC(reader,aMenuId);
+ aMenuWindow->ConstructFromResourceL(reader);
+ CleanupStack::PopAndDestroy();
+ }
+
+ if (aMenuType==EMenuPane)
+ DynInitMenuPaneL(aMenuId,(CEikMenuPane*)aMenuWindow);
+ else
+ DynInitMenuBarL(aMenuId,(CEikMenuBar*)aMenuWindow);
+ }
+
+// End of File
+
diff --git a/src/s60main/qts60mainappui.h b/src/s60main/qts60mainappui.h
new file mode 100644
index 0000000000..3addb0cee9
--- /dev/null
+++ b/src/s60main/qts60mainappui.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __QtS60MainAPPUI_H__
+#define __QtS60MainAPPUI_H__
+
+// INCLUDES
+#include <aknappui.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+* CQtS60MainAppUi application UI class.
+* Interacts with the user through the UI and request message processing
+* from the handler class
+*/
+class CQtS60MainAppUi : public CAknAppUi
+ {
+ public: // Constructors and destructor
+
+ /**
+ * ConstructL.
+ * 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * CQtS60MainAppUi.
+ * C++ default constructor. This needs to be public due to
+ * the way the framework constructs the AppUi
+ */
+ CQtS60MainAppUi();
+
+ /**
+ * ~CQtS60MainAppUi.
+ * Virtual Destructor.
+ */
+ virtual ~CQtS60MainAppUi();
+
+ protected:
+ void RestoreMenuL(CCoeControl* aMenuWindow,TInt aMenuId,TMenuType aMenuType);
+ void DynInitMenuBarL(TInt aResourceId, CEikMenuBar *aMenuBar);
+ void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane);
+
+ private: // Functions from base classes
+
+ /**
+ * From CEikAppUi, HandleCommandL.
+ * Takes care of command handling.
+ * @param aCommand Command to be handled.
+ */
+ void HandleCommandL( TInt aCommand );
+
+ /**
+ * HandleStatusPaneSizeChange.
+ * Called by the framework when the application status pane
+ * size is changed.
+ */
+ void HandleStatusPaneSizeChange();
+
+ /**
+ * Static callback method for invoking Qt main.
+ * Called asynchronously from ConstructL() - passes call to non static method.
+ */
+ static TInt OpenCMainStaticCallBack( TAny* aObject );
+
+ /**
+ * Callback method for invoking Qt main.
+ * Called from static OpenCMainStaticCallBack.
+ */
+ void OpenCMainCallBack();
+
+ protected:
+ void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
+
+
+ private: // Data
+
+ /**
+ * Async callback object to call Qt main
+ * Owned by CQtS60MainAppUi
+ */
+ CAsyncCallBack* iAsyncCallBack;
+
+ };
+
+#endif // __QtS60MainAPPUI_H__
+
+// End of File
+
diff --git a/src/s60main/qts60maindocument.cpp b/src/s60main/qts60maindocument.cpp
new file mode 100644
index 0000000000..9ab426d1ec
--- /dev/null
+++ b/src/s60main/qts60maindocument.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+#include "qts60mainappui.h"
+#include "qts60maindocument.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CQtS60MainDocument::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CQtS60MainDocument* CQtS60MainDocument::NewL( CEikApplication& aApp )
+ {
+ CQtS60MainDocument* self = NewLC( aApp );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CQtS60MainDocument::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CQtS60MainDocument* CQtS60MainDocument::NewLC( CEikApplication& aApp )
+ {
+ CQtS60MainDocument* self = new ( ELeave ) CQtS60MainDocument( aApp );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CQtS60MainDocument::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainDocument::ConstructL()
+ {
+ // No implementation required
+ }
+
+// -----------------------------------------------------------------------------
+// CQtS60MainDocument::CQtS60MainDocument()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CQtS60MainDocument::CQtS60MainDocument( CEikApplication& aApp )
+ : CAknDocument( aApp )
+ {
+ // No implementation required
+ }
+
+// ---------------------------------------------------------------------------
+// CQtS60MainDocument::~CQtS60MainDocument()
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CQtS60MainDocument::~CQtS60MainDocument()
+ {
+ // No implementation required
+ }
+
+// ---------------------------------------------------------------------------
+// CQtS60MainDocument::CreateAppUiL()
+// Constructs CreateAppUi.
+// ---------------------------------------------------------------------------
+//
+CEikAppUi* CQtS60MainDocument::CreateAppUiL()
+ {
+ // Create the application user interface, and return a pointer to it;
+ // the framework takes ownership of this object
+ return ( static_cast <CEikAppUi*> ( new ( ELeave )CQtS60MainAppUi ) );
+ }
+
+// End of File
+
diff --git a/src/s60main/qts60maindocument.h b/src/s60main/qts60maindocument.h
new file mode 100644
index 0000000000..4979e7fbc9
--- /dev/null
+++ b/src/s60main/qts60maindocument.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __QTS60MAINDOCUMENT_H__
+#define __QTS60MAINDOCUMENT_H__
+
+// INCLUDES
+#include <akndoc.h>
+
+// FORWARD DECLARATIONS
+class CQtS60MainAppUi;
+class CEikApplication;
+
+
+// CLASS DECLARATION
+
+/**
+* CQtS60MainDocument application class.
+* An instance of class CQtS60MainDocument is the Document part of the
+* AVKON application framework for the QtS60Main application.
+*/
+class CQtS60MainDocument : public CAknDocument
+ {
+ public: // Constructors and destructor
+
+ /**
+ * NewL.
+ * Two-phased constructor.
+ * Construct a CQtS60MainDocument for the AVKON application aApp
+ * using two phase construction, and return a pointer
+ * to the created object.
+ * @param aApp Application creating this document.
+ * @return A pointer to the created instance of CQtS60MainDocument.
+ */
+ static CQtS60MainDocument* NewL( CEikApplication& aApp );
+
+ /**
+ * NewLC.
+ * Two-phased constructor.
+ * Construct a CQtS60MainDocument for the AVKON application aApp
+ * using two phase construction, and return a pointer
+ * to the created object.
+ * @param aApp Application creating this document.
+ * @return A pointer to the created instance of CQtS60MainDocument.
+ */
+ static CQtS60MainDocument* NewLC( CEikApplication& aApp );
+
+ /**
+ * ~CQtS60MainDocument
+ * Virtual Destructor.
+ */
+ virtual ~CQtS60MainDocument();
+
+ public: // Functions from base classes
+
+ /**
+ * CreateAppUiL
+ * From CEikDocument, CreateAppUiL.
+ * Create a CQtS60MainAppUi object and return a pointer to it.
+ * The object returned is owned by the Uikon framework.
+ * @return Pointer to created instance of AppUi.
+ */
+ CEikAppUi* CreateAppUiL();
+
+ private: // Constructors
+
+ /**
+ * ConstructL
+ * 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * CQtS60MainDocument.
+ * C++ default constructor.
+ * @param aApp Application creating this document.
+ */
+ CQtS60MainDocument( CEikApplication& aApp );
+
+ };
+
+#endif // __QTS60MAINDOCUMENT_H__
+
+// End of File
+
diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
new file mode 100644
index 0000000000..f74943f54b
--- /dev/null
+++ b/src/s60main/s60main.pro
@@ -0,0 +1,55 @@
+# Additional Qt project file for qtmain lib on Symbian
+TEMPLATE = lib
+TARGET = qtmain
+DESTDIR = $$QMAKE_LIBDIR_QT
+QT =
+
+CONFIG += staticlib warn_on
+CONFIG -= qt shared
+
+symbian {
+ # Note: UID only needed for ensuring that no filename generation conflicts occur
+ TARGET.UID3 = 0x2001E61F
+ CONFIG += png zlib
+ CONFIG -= jpeg
+ INCLUDEPATH += tmp $$QMAKE_INCDIR_QT/QtCore $$MW_LAYER_SYSTEMINCLUDE
+ SOURCES = qts60main.cpp \
+ qts60mainapplication.cpp \
+ qts60mainappui.cpp \
+ qts60maindocument.cpp
+
+ HEADERS = qts60mainapplication.h \
+ qts60mainappui.h \
+ qts60maindocument.h
+
+ # This block serves the minimalistic resource file for S60 3.1 platforms.
+ # Note there is no way to ifdef S60 version in mmp file, that is why the resource
+ # file is always compiled for WINSCW
+ minimalAppResource31 = \
+ "START RESOURCE s60main.rss" \
+ "HEADER" \
+ "TARGETPATH resource\apps" \
+ "END"
+ MMP_RULES += minimalAppResource31
+
+ # s60main needs to be built in ARM mode for GCCE to work.
+ MMP_RULES+="ALWAYS_BUILD_AS_ARM"
+
+ # staticlib should not have any lib depencies in s60
+ # This seems not to work, some hard coded libs are still added as dependency
+ LIBS =
+} else {
+ error("$$_FILE_ is intended only for Symbian!")
+}
+
+symbian-abld: {
+ # abld build commands generated resources after the static library is built, and
+ # we have dependency to resource from static lib -> resources need to be generated
+ # explicitly before library
+ rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1"
+ rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>NUL"
+ QMAKE_EXTRA_TARGETS += rsgFix rsgFix2
+ PRE_TARGETDEPS += rsgFix rsgFix2
+}
+
+include(../qbase.pri)
diff --git a/src/s60main/s60main.rss b/src/s60main/s60main.rss
new file mode 100644
index 0000000000..569f59e30c
--- /dev/null
+++ b/src/s60main/s60main.rss
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+// Even S60 application have ENoAppResourceFile and ENonStandardResourceFile
+// flags set, the S60 3rd Edition FP1 emulator requires applications to have
+// very minimalistic application resource file, otherwise apps refures to start
+// This file serves the minimalistic resource file for S60 3.1 platforms.
+
+// RESOURCE IDENTIFIER
+NAME QTMA // 4 letter ID
+
+// INCLUDES
+//#include <eikon.rh>
+#include <appinfo.rh>
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+
+// RESOURCE DEFINITIONS
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF r_default_document_name
+ {
+ buf="QTMA";
+ }
+
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_qt_wrapperapp_menubar;
+ cba = R_AVKON_SOFTKEYS_EXIT;
+ }
+
+RESOURCE MENU_BAR r_qt_wrapperapp_menubar
+ {
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_qt_wrapperapp_menu; }
+ };
+ }
+
+RESOURCE MENU_PANE r_qt_wrapperapp_menu
+ {
+ }
+// End of File
+
diff --git a/src/script/qscriptengine_p.cpp b/src/script/qscriptengine_p.cpp
index a2e58de182..27b8101eab 100644
--- a/src/script/qscriptengine_p.cpp
+++ b/src/script/qscriptengine_p.cpp
@@ -1706,6 +1706,8 @@ QScriptEnginePrivate::QScriptEnginePrivate()
m_maxCallDepth = 640;
#elif defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6)
m_maxCallDepth = 360;
+#elif defined(Q_OS_SYMBIAN)
+ m_maxCallDepth = 128; //stack size limitation of 80k, has headroom for other stack vars.
#else
m_maxCallDepth = 512;
#endif
diff --git a/src/script/qscriptvalueimplfwd_p.h b/src/script/qscriptvalueimplfwd_p.h
index 059842e564..9c811bf348 100644
--- a/src/script/qscriptvalueimplfwd_p.h
+++ b/src/script/qscriptvalueimplfwd_p.h
@@ -77,7 +77,7 @@ class QScriptEnginePrivate;
namespace QScript
{
class Member;
-};
+}
class QScriptValueImpl
{
@@ -88,6 +88,17 @@ public:
StringTypeHint
};
+ QScript::Type m_type;
+ union {
+ bool m_bool_value;
+ int m_int_value;
+ qsreal m_number_value;
+ void *m_ptr_value;
+ QScriptObject *m_object_value;
+ QScriptNameIdImpl *m_string_value;
+ QString *m_lazy_string_value;
+ };
+
inline QScriptValueImpl();
inline QScriptValueImpl(QScriptValue::SpecialValue val);
inline QScriptValueImpl(bool val);
@@ -218,16 +229,6 @@ public:
bool detectedCycle() const;
- QScript::Type m_type;
- union {
- bool m_bool_value;
- int m_int_value;
- qsreal m_number_value;
- void *m_ptr_value;
- QScriptObject *m_object_value;
- QScriptNameIdImpl *m_string_value;
- QString *m_lazy_string_value;
- };
};
QT_END_NAMESPACE
diff --git a/src/script/script.pro b/src/script/script.pro
index 9aa9bc21b3..47925277ad 100644
--- a/src/script/script.pro
+++ b/src/script/script.pro
@@ -10,3 +10,5 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
include(../qbase.pri)
include(script.pri)
+
+symbian:TARGET.UID3=0x2001B2E1
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp
index 8a808b67b2..4c1f1f4408 100644
--- a/src/sql/kernel/qsqlfield.cpp
+++ b/src/sql/kernel/qsqlfield.cpp
@@ -159,11 +159,20 @@ public:
\sa setRequiredStatus() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly()
*/
+QSqlField::QSqlField()
+{
+ d = new QSqlFieldPrivate(QString(), QVariant::Invalid);
+}
+
+QSqlField::QSqlField(const QString& fieldName)
+{
+ d = new QSqlFieldPrivate(fieldName, QVariant::Invalid);
+}
+
QSqlField::QSqlField(const QString& fieldName, QVariant::Type type)
{
d = new QSqlFieldPrivate(fieldName, type);
}
-
/*!
Constructs a copy of \a other.
*/
diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h
index 58b3616551..a5bd8c472b 100644
--- a/src/sql/kernel/qsqlfield.h
+++ b/src/sql/kernel/qsqlfield.h
@@ -58,9 +58,9 @@ class Q_SQL_EXPORT QSqlField
public:
enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 };
- QSqlField(const QString& fieldName = QString(),
- QVariant::Type type = QVariant::Invalid);
-
+ QSqlField();
+ QSqlField(const QString& fieldName);
+ QSqlField(const QString& fieldName, QVariant::Type type);
QSqlField(const QSqlField& other);
QSqlField& operator=(const QSqlField& other);
bool operator==(const QSqlField& other) const;
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 180bfc72d7..cffc57073a 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -52,7 +52,9 @@
QT_BEGIN_NAMESPACE
struct QHolder {
- QHolder(const QString& hldr = QString(), int index = -1): holderName(hldr), holderPos(index) {}
+ QHolder(): holderName(QString()), holderPos(-1) {}
+ QHolder(const QString& hldr): holderName(hldr), holderPos(-1) {}
+ QHolder(const QString& hldr, int index): holderName(hldr), holderPos(index) {}
bool operator==(const QHolder& h) const { return h.holderPos == holderPos && h.holderName == holderName; }
bool operator!=(const QHolder& h) const { return h.holderPos != holderPos || h.holderName != holderName; }
QString holderName;
diff --git a/src/sql/sql.pro b/src/sql/sql.pro
index 3cca4e0b3a..60be7486e0 100644
--- a/src/sql/sql.pro
+++ b/src/sql/sql.pro
@@ -17,3 +17,11 @@ include(kernel/kernel.pri)
include(drivers/drivers.pri)
include(models/models.pri)
+symbian: {
+ TARGET.UID3=0x2001E61D
+
+ # Workaroud for problems with paging this dll
+ MMP_RULES -= PAGED
+ MMP_RULES *= UNPAGED
+}
+
diff --git a/src/src.pro b/src/src.pro
index f40c6ad7f3..3e63e6e5c2 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -5,6 +5,11 @@ unset(SRC_SUBDIRS)
win32:SRC_SUBDIRS += src_winmain
wince*:{
SRC_SUBDIRS += src_corelib src_xml src_gui src_sql src_network src_script src_testlib
+} symbian {
+ SRC_SUBDIRS += src_s60main src_corelib src_xml src_gui src_network src_sql src_script src_testlib
+ contains(QT_CONFIG, svg): SRC_SUBDIRS += src_svg
+ SRC_SUBDIRS += src_plugins
+ SRC_SUBDIRS += $$QT_SOURCE_TREE/src/s60installs/qt_libs.pro
} else {
SRC_SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic src_corelib src_xml src_network src_gui src_sql src_script src_testlib
contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support
@@ -18,9 +23,9 @@ win32:{
!wince*: SRC_SUBDIRS += src_tools_idc
}
+!symbian {
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): SRC_SUBDIRS += src_opengl
contains(QT_CONFIG, xmlpatterns): SRC_SUBDIRS += src_xmlpatterns
-contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon
contains(QT_CONFIG, svg): SRC_SUBDIRS += src_svg
contains(QT_CONFIG, webkit) {
#exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): SRC_SUBDIRS += src_javascriptcore
@@ -28,7 +33,12 @@ contains(QT_CONFIG, webkit) {
}
contains(QT_CONFIG, scripttools): SRC_SUBDIRS += src_scripttools
SRC_SUBDIRS += src_plugins
+}
+contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon
+
+src_s60main.subdir = $$QT_SOURCE_TREE/src/s60main
+src_s60main.target = sub-s60main
src_winmain.subdir = $$QT_SOURCE_TREE/src/winmain
src_winmain.target = sub-winmain
src_tools_bootstrap.subdir = $$QT_SOURCE_TREE/src/tools/bootstrap
@@ -81,7 +91,7 @@ src_webkit.subdir = $$QT_SOURCE_TREE/src/3rdparty/webkit/WebCore
src_webkit.target = sub-webkit
#CONFIG += ordered
-!wince*:!ordered {
+!wince*:!symbian:!ordered {
src_tools_moc.depends = src_tools_bootstrap
src_tools_rcc.depends = src_tools_bootstrap
src_tools_uic.depends = src_tools_bootstrap
@@ -115,6 +125,7 @@ src_webkit.target = sub-webkit
}
}
+!symbian {
# This creates a sub-src rule
sub_src_target.CONFIG = recursive
sub_src_target.recurse = $$SRC_SUBDIRS
@@ -163,6 +174,7 @@ for(subname, SRC_SUBDIRS) {
debug.depends = $$EXTRA_DEBUG_TARGETS
release.depends = $$EXTRA_RELEASE_TARGETS
QMAKE_EXTRA_TARGETS += debug release
+}
SUBDIRS += $$SRC_SUBDIRS
diff --git a/src/svg/svg.pro b/src/svg/svg.pro
index aef0786e89..662940a5c4 100644
--- a/src/svg/svg.pro
+++ b/src/svg/svg.pro
@@ -40,6 +40,8 @@ SOURCES += \
INCLUDEPATH += ../3rdparty/harfbuzz/src
+symbian:TARGET.UID3=0x2001B2E2
+
#zlib support
contains(QT_CONFIG, zlib) {
INCLUDEPATH += ../3rdparty/zlib
diff --git a/src/testlib/3rdparty/cycle_p.h b/src/testlib/3rdparty/cycle_p.h
index b4b687628e..547fdc15e3 100644
--- a/src/testlib/3rdparty/cycle_p.h
+++ b/src/testlib/3rdparty/cycle_p.h
@@ -491,4 +491,21 @@ INLINE_ELAPSED(inline)
#define HAVE_TICK_COUNTER
#endif
+/*----------------------------------------------------------------*/
+/* Symbian */
+#if defined(__SYMBIAN32__) && !defined(HAVE_TICK_COUNTER)
+#include <e32std.h>
+
+typedef TUint32 CycleCounterTicks;
+
+static inline CycleCounterTicks getticks(void)
+{
+ return User::FastCounter();
+}
+
+INLINE_ELAPSED(inline)
+
+#define HAVE_TICK_COUNTER
+#endif
+
#endif // QBENCHLIB_CYCLE_H
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index 7687fec973..64594c110b 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -219,6 +219,7 @@ void QTest::setIterationCountHint(int count)
{
QBenchmarkTestMethodData::current->adjustIterationCount(count);
}
+
/*! \internal
*/
void QTest::setIterationCount(int count)
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 6f10d72365..c408c1c93e 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -54,6 +54,10 @@
#include "windows.h"
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <e32debug.h>
+#endif
+
#ifdef Q_OS_WINCE
#include <QtCore/QString>
#endif
@@ -159,6 +163,12 @@ namespace QTest {
// OutputDebugString is not threadsafe
OutputDebugStringA(str);
LeaveCriticalSection(&outputCriticalSection);
+#elif defined(Q_OS_SYMBIAN)
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(str));
+ HBufC* hbuffer = HBufC::NewL(ptr.Length());
+ hbuffer->Des().Copy(ptr);
+ RDebug::Print(_L("[QTestLib Message] %S"), hbuffer);
+ delete hbuffer;
#endif
QAbstractTestLogger::outputString(str);
}
diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h
index d6b0655d19..ba7da2a41d 100644
--- a/src/testlib/qtest_global.h
+++ b/src/testlib/qtest_global.h
@@ -52,7 +52,7 @@ QT_MODULE(Test)
#ifdef QTEST_EMBED
# define Q_TESTLIB_EXPORT
-#elif !defined(QT_SHARED)
+#elif !defined(QT_SHARED) && !(defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT))
# define Q_TESTLIB_EXPORT
#else
# ifdef QTESTLIB_MAKEDLL
@@ -62,10 +62,11 @@ QT_MODULE(Test)
# endif
#endif
-#if (defined (Q_CC_MSVC) && _MSC_VER < 1310) || defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3))
+#if (defined (Q_CC_MSVC) && _MSC_VER < 1310) || defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3)) || defined (Q_CC_NOKIAX86)
# define QTEST_NO_SPECIALIZATIONS
#endif
+
#if (defined Q_CC_HPACC) && (defined __ia64)
# ifdef Q_TESTLIB_EXPORT
# undef Q_TESTLIB_EXPORT
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index b5200dc169..27ba6da843 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1279,7 +1279,7 @@ static void qInvokeTestMethods(QObject *testObject)
QTEST_ASSERT(metaObject);
QTestLog::startLogging();
-
+
QTestResult::setCurrentTestFunction("initTestCase");
QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
QTestTable::globalTestTable();
@@ -1399,6 +1399,11 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
#endif
+#ifdef Q_OS_SYMBIAN
+//### FIX THIS temporary hack to delay execution of symbian os tests. Used to get emulator to stable state before running testcase
+ qSleep(3000);
+#endif
+
QTestResult::reset();
QTEST_ASSERT(testObject);
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 4e5deff935..b104e9329d 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -119,11 +119,22 @@ class QTestData;
namespace QTest
{
- template <typename T>
+#ifndef Q_CC_NOKIAX86
+ template <typename T>
inline char *toString(const T &)
{
return 0;
}
+#else
+ // Nokia X86 compiler bug:
+ // does not export template specializations if parent template is inline
+ template <typename T>
+ Q_TESTLIB_EXPORT char *toString(const T &)
+ {
+ return 0;
+ }
+#endif
+
Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length);
Q_TESTLIB_EXPORT char *toString(const char *);
@@ -168,6 +179,7 @@ namespace QTest
}
Q_TESTLIB_EXPORT QTestData &newRow(const char *dataTag);
+#ifndef Q_CC_NOKIAX86
template <typename T>
inline bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected,
const char *file, int line)
@@ -177,6 +189,20 @@ namespace QTest
: compare_helper(false, "Compared values are not the same",
toString<T>(t1), toString<T>(t2), actual, expected, file, line);
}
+#else
+ // Nokia X86 compiler bug:
+ // does not export template specializations if parent template is inline
+ template <typename T>
+ Q_TESTLIB_EXPORT bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected,
+ const char *file, int line)
+ {
+ return (t1 == t2)
+ ? compare_helper(true, "COMPARE()", file, line)
+ : compare_helper(false, "Compared values are not the same",
+ toString<T>(t1), toString<T>(t2), actual, expected, file, line);
+ }
+#endif
+
template <>
Q_TESTLIB_EXPORT bool qCompare<float>(float const &t1, float const &t2,
@@ -233,7 +259,7 @@ namespace QTest
return qCompare<qreal>(qreal(t1), t2, actual, expected, file, line);
}
-#elif defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE)
+#elif defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
template <>
inline bool qCompare<qreal, double>(qreal const &t1, double const &t2, const char *actual,
const char *expected, const char *file, int line)
@@ -289,6 +315,28 @@ namespace QTest
return compare_string_helper(t1, t2, actual, expected, file, line);
}
#else /* QTEST_NO_SPECIALIZATIONS */
+
+// In Synmbian we have QTEST_NO_SPECIALIZATIONS defined, but still float related specialization
+// Should be uses. If QTEST_NO_SPECIALIZATIONS is enabled we get ambiguous overload errors
+#if defined(QT_ARCH_SYMBIAN)
+ template <typename T1, typename T2>
+ bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int);
+
+ template <>
+ inline bool qCompare<qreal, double>(qreal const &t1, double const &t2, const char *actual,
+ const char *expected, const char *file, int line)
+ {
+ return qCompare<float>(float(t1), float(t2), actual, expected, file, line);
+ }
+
+ template <>
+ inline bool qCompare<double, qreal>(double const &t1, qreal const &t2, const char *actual,
+ const char *expected, const char *file, int line)
+ {
+ return qCompare<float>(float(t1), float(t2), actual, expected, file, line);
+ }
+#endif
+
inline bool qCompare(const char *t1, const char *t2, const char *actual,
const char *expected, const char *file, int line)
{
@@ -322,13 +370,24 @@ namespace QTest
return compare_string_helper(t1, t2, actual, expected, file, line);
}
+ // NokiaX86 and RVCT do not like implicitly comparing bool with int
+#ifndef QTEST_NO_SPECIALIZATIONS
+ template <>
+#endif
+ inline bool qCompare(bool const &t1, int const &t2,
+ const char *actual, const char *expected, const char *file, int line)
+ {
+ return qCompare<int>(int(t1), t2, actual, expected, file, line);
+ }
+
+
template <class T>
inline bool qTest(const T& actual, const char *elementName, const char *actualStr,
const char *expected, const char *file, int line)
{
return qCompare(actual, *static_cast<const T *>(QTest::qElementData(elementName,
qMetaTypeId<T>())), actualStr, expected, file, line);
- }
+ }
}
#undef QTEST_COMPARE_DECL
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index 90bd92db9f..de42b6decc 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -25,3 +25,5 @@ mac {
include(../qbase.pri)
QMAKE_TARGET_PRODUCT = QTestLib
QMAKE_TARGET_DESCRIPTION = Qt Unit Testing Library
+
+symbian:TARGET.UID3=0x2001B2DF
diff --git a/src/tools/bootstrap/bootstrap.pri b/src/tools/bootstrap/bootstrap.pri
index 1cf103b2ef..47266539f3 100644
--- a/src/tools/bootstrap/bootstrap.pri
+++ b/src/tools/bootstrap/bootstrap.pri
@@ -55,7 +55,7 @@ hpux-acc*|hpuxi-acc* {
unix:LIBS += -lz
# win32:LIBS += libz.lib
}
-win32:LIBS += -luser32
+win32:!win32-mwc:LIBS += -luser32
mac {
CONFIG -= incremental
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 45cbbfdeec..d1703c84bf 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -515,7 +515,12 @@ void Preprocessor::substituteMacro(const MacroName &macro, Symbols &substituted,
Symbols saveSymbols = symbols;
int saveIndex = index;
- symbols = macros.value(macro).symbols;
+ // This is a workaround for a compiler bug that did not like the QHash::value function that
+ // simply did: "return T();" This code should essentially do the same thing but declares the
+ // default instance outside and calls the other QHash::value() implementation that returns
+ // 'dummy' as the default value now.
+ Macro dummy;
+ symbols = macros.value(macro, dummy).symbols;
index = 0;
safeset += macro;
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index ade033976b..ba68636e7a 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -302,7 +302,9 @@ private:
// used for parsing of entity references
struct XmlRef {
- XmlRef(const QString &_name = QString(), const QString &_value = QString())
+ XmlRef()
+ : index(0) {}
+ XmlRef(const QString &_name, const QString &_value)
: name(_name), value(_value), index(0) {}
bool isEmpty() const { return index == value.length(); }
QChar next() { return value.at(index++); }
diff --git a/src/xml/xml.pro b/src/xml/xml.pro
index 0c7133cf0e..8d1bf68103 100644
--- a/src/xml/xml.pro
+++ b/src/xml/xml.pro
@@ -18,3 +18,5 @@ win32-borland {
include(dom/dom.pri)
include(sax/sax.pri)
include(stream/stream.pri)
+
+symbian:TARGET.UID3=0x2001B2E0
diff --git a/src/xmlpatterns/data/qabstractfloatcasters.cpp b/src/xmlpatterns/data/qabstractfloatcasters.cpp
index bf53fa4d3b..95ac17a000 100644
--- a/src/xmlpatterns/data/qabstractfloatcasters.cpp
+++ b/src/xmlpatterns/data/qabstractfloatcasters.cpp
@@ -63,9 +63,19 @@ template <const bool isDouble>
Item BooleanToAbstractFloatCaster<isDouble>::castFrom(const Item &from,
const QExplicitlySharedDataPointer<DynamicContext> &context) const
{
+#if defined(Q_CC_RVCT)
+ // RVCT doesn't like using template parameter in trinary operator when the trinary operator result is
+ // passed directly into another constructor.
+ bool tempDouble = isDouble;
+ if(from.template as<AtomicValue>()->evaluateEBV(context))
+ return tempDouble ? toItem(CommonValues::DoubleOne) : toItem(CommonValues::FloatOne);
+ else
+ return tempDouble ? toItem(CommonValues::DoubleZero) : toItem(CommonValues::FloatZero);
+#else
if(from.template as<AtomicValue>()->evaluateEBV(context))
return isDouble ? toItem(CommonValues::DoubleOne) : toItem(CommonValues::FloatOne);
else
return isDouble ? toItem(CommonValues::DoubleZero) : toItem(CommonValues::FloatZero);
+#endif
}
diff --git a/src/xmlpatterns/data/qschemanumeric.cpp b/src/xmlpatterns/data/qschemanumeric.cpp
index 4f42db955d..a23bb6de70 100644
--- a/src/xmlpatterns/data/qschemanumeric.cpp
+++ b/src/xmlpatterns/data/qschemanumeric.cpp
@@ -51,8 +51,7 @@
#include "qschemanumeric_p.h"
/**
- * @file
- * @short Contains class Numeric. This file was originally called qnumeric.cpp,
+ * @file Contains class Numeric. This file was originally called qnumeric.cpp,
* but was renamed to stay consistent with qschemanumeric_p.h
*/
diff --git a/src/xmlpatterns/functions/qcomparingaggregator.cpp b/src/xmlpatterns/functions/qcomparingaggregator.cpp
index a87e659b48..4c3f1b6cf3 100644
--- a/src/xmlpatterns/functions/qcomparingaggregator.cpp
+++ b/src/xmlpatterns/functions/qcomparingaggregator.cpp
@@ -203,8 +203,13 @@ ComparingAggregator<oper, result>::typeCheck(const StaticContext::Ptr &context,
if(!m_operands.first()->staticType()->cardinality().allowsMany())
return m_operands.first();
-
+
+#if defined(Q_CC_RVCT)
+ // explicit scope needed in RVCT
+ ComparingAggregator<oper, result>::prepareComparison(fetchComparator(t1, t1, context));
+#else
prepareComparison(fetchComparator(t1, t1, context));
+#endif
return me;
}
diff --git a/src/xmlpatterns/functions/qsequencefns_p.h b/src/xmlpatterns/functions/qsequencefns_p.h
index 3f79a5f55e..1c67d89c51 100644
--- a/src/xmlpatterns/functions/qsequencefns_p.h
+++ b/src/xmlpatterns/functions/qsequencefns_p.h
@@ -146,13 +146,28 @@ namespace QPatternist
*/
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
{
+#if defined(Q_CC_RVCT) && !defined(QT_NO_DEBUG)
+ // RVCT doesn't like using template parameter in trinary operator when the trinary operator result is
+ // passed directly into another constructor.
+ bool tempAssert = (Id == IDExistsFN || Id == IDEmptyFN);
+ Q_ASSERT(tempAssert);
+#else
Q_ASSERT(Id == IDExistsFN || Id == IDEmptyFN);
+#endif
+
const Expression::Ptr me(FunctionCall::compress(context));
if(me != this)
return me;
+#if defined(Q_CC_RVCT)
+ // RVCT doesn't like using template parameter in trinary operator when the trinary operator result is
+ // passed directly into another constructor.
+ Expression::ID tempId = Id;
+ const Cardinality myCard((tempId == IDExistsFN) ? Cardinality::oneOrMore() : Cardinality::empty());
+#else
const Cardinality myCard((Id == IDExistsFN) ? Cardinality::oneOrMore() : Cardinality::empty());
+#endif
const Cardinality card(m_operands.first()->staticType()->cardinality());
if(myCard.isMatch(card))
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 6ab71f854d..6c3d26be0a 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -351,7 +351,7 @@ void PaintCommands::staticInit()
"^gradient_setCoordinateMode\\s+(\\w*)$",
"gradient_setCoordinateMode <coordinate method enum>",
"gradient_setCoordinateMode ObjectBoundingMode");
-
+#ifdef QT3_SUPPORT
DECL_PAINTCOMMANDSECTION("qt3 drawing ops");
DECL_PAINTCOMMAND("qt3_drawArc", command_qt3_drawArc,
"^qt3_drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
@@ -377,7 +377,7 @@ void PaintCommands::staticInit()
"^qt3_drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w)?\\s*(-?\\w)?$",
"qt3_drawRoundRect <x> <y> <w> <h> [rx] [ry]",
"qt3_drawRoundRect 10 10 20 20 3 3");
-
+#endif
DECL_PAINTCOMMANDSECTION("drawing ops");
DECL_PAINTCOMMAND("drawPoint", command_drawPoint,
"^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
@@ -1237,6 +1237,7 @@ void PaintCommands::command_drawArc(QRegExp re)
m_painter->drawArc(x, y, w, h, angle, sweep);
}
+#ifdef QT3_SUPPORT
/***************************************************************************************************/
void PaintCommands::command_qt3_drawRect(QRegExp re)
{
@@ -1352,7 +1353,7 @@ void PaintCommands::command_qt3_drawArc(QRegExp re)
static_cast<Q3Painter*>(m_painter)->drawArc(x, y, w, h, angle, sweep);
#endif
}
-
+#endif //QT3_SUPPORT
/***************************************************************************************************/
void PaintCommands::command_drawText(QRegExp re)
{
diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h
index 9eafe02d2f..8049acabb3 100644
--- a/tests/arthur/common/paintcommands.h
+++ b/tests/arthur/common/paintcommands.h
@@ -181,12 +181,14 @@ private:
void command_gradient_setCoordinateMode(QRegExp re);
// commands: drawing ops
+#ifdef QT3_SUPPORT
void command_qt3_drawArc(QRegExp re);
void command_qt3_drawChord(QRegExp re);
void command_qt3_drawEllipse(QRegExp re);
void command_qt3_drawPie(QRegExp re);
void command_qt3_drawRect(QRegExp re);
void command_qt3_drawRoundRect(QRegExp re);
+#endif
void command_drawArc(QRegExp re);
void command_drawChord(QRegExp re);
void command_drawConvexPolygon(QRegExp re);
diff --git a/tests/arthur/common/qengines.cpp b/tests/arthur/common/qengines.cpp
index 9cd23898f4..3288f527b5 100644
--- a/tests/arthur/common/qengines.cpp
+++ b/tests/arthur/common/qengines.cpp
@@ -49,6 +49,7 @@
#include <QDir>
#include <QDebug>
#include <QPrintEngine>
+#include <QWidget>
// For QApplicationPrivate::graphics_system_name
#include <private/qapplication_p.h>
@@ -100,6 +101,7 @@ void QtEngines::init()
m_engines << new GLEngine;
#endif
+#ifndef QT_NO_PRINTER
m_engines << new PDFEngine
#ifdef Q_WS_X11
<< new PSEngine
@@ -108,7 +110,8 @@ void QtEngines::init()
<< new WinPrintEngine
#endif
;
-
+#endif //QT_NO_PRINTER
+
m_foreignEngines << new RSVGEngine;
}
@@ -432,7 +435,7 @@ void WidgetEngine::cleanup()
delete m_widget;
}
-
+#ifndef QT_NO_PRINTER
PDFEngine::PDFEngine()
{
}
@@ -605,6 +608,7 @@ void PSEngine::cleanup()
delete printer; printer = 0;
}
#endif
+#endif //QT_NO_PRINTER
RSVGEngine::RSVGEngine()
{
diff --git a/tests/arthur/common/qengines.h b/tests/arthur/common/qengines.h
index 6366d90f47..80e12bec51 100644
--- a/tests/arthur/common/qengines.h
+++ b/tests/arthur/common/qengines.h
@@ -158,6 +158,7 @@ private:
WidgetEngineWidget *m_widget;
};
+#ifndef QT_NO_PRINTER
class PDFEngine : public QEngine
{
public:
@@ -218,7 +219,7 @@ private:
QString m_tempFile;
};
#endif
-
+#endif //QT_NO_PRINTER
class RSVGEngine : public QEngine
{
diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro
index 193dbd28dd..341eabcaf3 100644
--- a/tests/arthur/lance/lance.pro
+++ b/tests/arthur/lance/lance.pro
@@ -12,6 +12,12 @@ RESOURCES += icons.qrc
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
contains(QT_CONFIG, qt3support):QT += qt3support
-QT += xml svg
+symbian*: {
+ testData.sources = $$QT_BUILD_TREE/tests/arthur/data/qps
+ testData.path = .
+ DEPLOYMENT += testData
+}
+
+QT += xml svg
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp
index 3f1d112265..054dfc1892 100644
--- a/tests/arthur/lance/main.cpp
+++ b/tests/arthur/lance/main.cpp
@@ -199,7 +199,6 @@ static void displayCommands()
" pixmap_load filename name_in_script\n"
" image_load filename name_in_script\n");
}
-
static InteractiveWidget *interactive_widget = 0;
static void runInteractive()
@@ -587,6 +586,7 @@ int main(int argc, char **argv)
case PrinterType:
{
+#ifndef QT_NO_PRINTER
PaintCommands pcmd(QStringList(), 800, 800);
pcmd.setVerboseMode(verboseMode);
pcmd.setType(type);
@@ -614,11 +614,13 @@ int main(int argc, char **argv)
}
Q_ASSERT(!p.paintingActive());
+#endif
break;
}
case PsType:
case PdfType:
{
+#ifndef QT_NO_PRINTER
PaintCommands pcmd(QStringList(), 800, 800);
pcmd.setVerboseMode(verboseMode);
pcmd.setType(type);
@@ -641,6 +643,7 @@ int main(int argc, char **argv)
pt.end();
printf("write file: %s\n", qPrintable(file));
+#endif
break;
}
case GrabType:
@@ -663,7 +666,6 @@ int main(int argc, char **argv)
printf("%s grabbed to %s\n", qPrintable(files.at(j)), qPrintable(filename));
break;
}
-
default:
break;
}
@@ -674,7 +676,6 @@ int main(int argc, char **argv)
QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
app.exec();
}
-
delete activeWidget;
#endif
return 0;
diff --git a/tests/auto/JoinResults.py b/tests/auto/JoinResults.py
new file mode 100644
index 0000000000..8a98572f60
--- /dev/null
+++ b/tests/auto/JoinResults.py
@@ -0,0 +1,66 @@
+import string, sys, os, datetime, time, re
+import socket
+
+Enviroment=''
+RstPath=''
+QtVersion=''
+
+def JoinResults():
+ timestamp = time.localtime()
+
+ #result_qt_WITH_symbian_ON_2008-05-15_09-42-48_USING_4.4.0-rc1.xml
+ rstFileName = time.strftime(RstPath+'\\result\\result_qt_WITH_symbian_ON_%Y-%m-%d_%H-%M-%S_USING_'+QtVersion+'.xml', timestamp)
+ rst = open(rstFileName,'w')
+
+ rst.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
+ rst.write('<Testrun>\n')
+ rst.write('<Environment>\n')
+ rst.write('<HostName>'+socket.gethostname()+'</HostName>\n')
+ rst.write('<MakeSpec>symbian-'+Enviroment+'</MakeSpec>\n')
+ rst.write('</Environment>\n')
+ rst.write(time.strftime('<Timestamp date="%Y-%m-%d" time="%H:%M:%S"/>\n',timestamp))
+
+
+ for root, dirs, files in os.walk(RstPath):
+ for name in files:
+ if not re.search('result_qt_WITH_', name ) and \
+ re.match(name.split('.')[1], 'xml'):
+ rst.write('<TestCase name="'+name.split('.')[0]+'">\n')
+ path = root+'/'+name
+ temp = open(path,'r')
+ templines = temp.readlines()
+ Validate( templines )
+ rst.writelines(templines);
+ temp.close()
+ rst.write('</TestCase>\n')
+
+ rst.write('</Testrun>\n')
+ rst.close
+
+def Validate(lines):
+ regexp1 = re.compile('\s*</TestFunction>\s*')
+ regexp2 = re.compile('\s*<TestFunction name=\s*')
+ regexp1Flag = False
+ regexp2Flag = False
+ for index, line in enumerate(lines):
+ if len(line) > 0 and regexp1.search(line):
+ if regexp1Flag:
+ lines[index] = ''
+ else:
+ regexp1Flag = True
+ elif len(line) > 0 and regexp2.search(line):
+ if regexp2Flag:
+ lines[index] = ''
+ else:
+ regexp2Flag = True
+ else:
+ regexp1Flag = False
+ regexp2Flag = False
+
+
+if __name__ == '__main__':
+ Enviroment = sys.argv[1]
+ RstPath = sys.argv[2]
+ QtVersion = sys.argv[3]
+
+ JoinResults()
diff --git a/tests/auto/_Categories/Qt3Support.txt b/tests/auto/_Categories/Qt3Support.txt
new file mode 100644
index 0000000000..a55523c383
--- /dev/null
+++ b/tests/auto/_Categories/Qt3Support.txt
@@ -0,0 +1,51 @@
+q3accel
+q3action
+q3actiongroup
+q3buttongroup
+q3canvas
+q3checklistitem
+q3combobox
+q3cstring
+q3databrowser
+q3dateedit
+q3datetimeedit
+q3deepcopy
+q3dict
+q3dns
+q3dockwindow
+q3filedialog
+q3frame
+q3groupbox
+q3hbox
+q3header
+q3iconview
+q3listbox
+q3listview
+q3listviewitemiterator
+q3mainwindow
+q3popupmenu
+q3process
+q3progressbar
+q3progressdialog
+q3ptrlist
+q3richtext
+q3scrollview
+q3semaphore
+q3serversocket
+q3socket
+q3socketdevice
+q3sqlcursor
+q3sqlselectcursor
+q3stylesheet
+q3tabdialog
+q3table
+q3textbrowser
+q3textedit
+q3textstream
+q3timeedit
+q3toolbar
+q3uridrag
+q3urloperator
+q3valuelist
+q3valuevector
+q3widgetstack
diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt
new file mode 100644
index 0000000000..fc19f45763
--- /dev/null
+++ b/tests/auto/_Categories/QtCore.txt
@@ -0,0 +1,105 @@
+# QtCore
+
+collections
+exceptionsafety
+qabstractitemmodel
+# Requires std
+#qalgorithms
+qatomicint
+qatomicpointer
+qbitarray
+qbuffer
+qbytearray
+qcache
+qchar
+qcoreapplication
+qcryptographichash
+qdatastream
+qdate
+qdatetime
+qdebug
+qdir
+qdiriterator
+qevent
+qeventloop
+qexplicitlyshareddatapointer
+qfile cetest-subdir: test
+qfileinfo
+qfilesystemwatcher
+qflags
+qfuture
+qfuturewatcher
+qgetputenv
+qglobal
+qhash
+qiodevice
+qlibrary cetest-subdir: tst
+qline
+qlist
+qlocale cetest-subdir: test
+qmap
+qmetaobject
+qmetatype
+qmutex
+qmutexlocker
+qnumeric
+qobject cetest-pro: tst_qobject.pro
+qobjectperformance
+qobjectrace
+qplugin cetest-pro: tst_qplugin.pro
+qpluginloader cetest-subdir: tst
+qpoint
+qpointer
+qprocess cetest-subdir: test
+qqueue
+qrand
+qreadlocker
+qreadwritelock
+qrect
+qregexp
+qresourceengine
+qsemaphore
+qset
+qsettings
+qsharedmemory cetest-subdir: test
+qsharedpointer
+qsignalmapper
+qsignalspy
+qsize
+qsizef
+qsocketnotifier
+#qstl requires STL
+qstring
+qstringlist
+qstringmatcher
+qsysinfo
+qsystemsemaphore cetest-subdir: test
+#qtconcurrentfilter Not supported yet for s60 -> skip(std)
+# Uses std, though unclear if it is actually needed. To be re-investigated when QT_NO_CONCURRENT is removed.
+#qtconcurrentiteratekernel
+#qtconcurrentmap not supported yet for s60 -> skip(std)
+qtconcurrentrun
+qtconcurrentthreadengine
+qtemporaryfile
+qtextboundaryfinder
+qtextcodec
+qtextstream cetest-subdir: test
+qthread
+qthreadonce
+qthreadpool
+qthreadstorage
+qtime
+qtimeline
+qtimer
+# Requires MD5 Qt solutions to work
+#qtmd5
+qtranslator
+qurl
+quuid
+qvariant
+qvarlengtharray
+qvector
+qwaitcondition
+qwineventnotifier
+qwritelocker
+q_func_info
diff --git a/tests/auto/_Categories/QtDBus.txt b/tests/auto/_Categories/QtDBus.txt
new file mode 100644
index 0000000000..26490f1460
--- /dev/null
+++ b/tests/auto/_Categories/QtDBus.txt
@@ -0,0 +1,15 @@
+qdbusabstractadaptor
+qdbusconnection
+qdbuscontext
+qdbusinterface
+qdbuslocalcalls
+qdbusmarshall
+qdbusmetaobject
+qdbusmetatype
+qdbuspendingcall
+qdbuspendingreply
+qdbusperformance
+qdbusreply
+qdbusserver
+qdbusthreading
+qdbusxmlparser
diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt
new file mode 100644
index 0000000000..f0975e4b96
--- /dev/null
+++ b/tests/auto/_Categories/QtGui.txt
@@ -0,0 +1,191 @@
+languagechange
+qabstractbutton
+qabstractitemview
+#qabstractprintdialog NO PRINTING SUPPORT
+qabstractproxymodel
+qabstractscrollarea
+qabstractslider
+qabstractspinbox
+qabstracttextdocumentlayout
+#qaccessibility Requires sql support -> disabled for now
+#qaccessibility_mac
+qaction
+qactiongroup
+qapplication cetest-subdir: test
+qboxlayout
+qbrush
+qbuttongroup
+qcalendarwidget
+qcheckbox
+qclipboard cetest-subdir: test
+qcolor
+qcolordialog
+qcolumnview
+qcombobox
+qcommandlinkbutton
+qcompleter
+qcomplextext
+#qcopchannel QCOP NOT SUPPORTED
+qcssparser
+qdatawidgetmapper
+qdatetimeedit
+qdesktopservices
+qdesktopwidget
+qdial
+qdialog
+qdialogbuttonbox
+qdirectpainter cetest-subdir: test
+qdirmodel
+qdockwidget
+qdoublespinbox
+qdoublevalidator
+qdrag
+qerrormessage
+qfiledialog
+qfileiconprovider
+qfilesystemmodel
+qfocusevent
+qfocusframe
+qfont
+qfontcombobox
+qfontdatabase
+qfontdialog
+qfontmetrics
+qformlayout
+qgraphicsgridlayout
+qgraphicsitem
+qgraphicsitemanimation
+qgraphicslayout
+qgraphicslayoutitem
+qgraphicslinearlayout
+qgraphicspixmapitem
+qgraphicspolygonitem
+qgraphicsproxywidget
+qgraphicsscene
+qgraphicsview
+qgraphicswidget
+qgridlayout
+qgroupbox
+qguivariant
+qheaderview
+qicoimageformat
+qicon
+qimage
+qimageiohandler
+qimagereader
+qimagewriter
+qinputdialog
+qintvalidator
+qitemdelegate
+qitemeditorfactory
+qitemmodel
+qitemselectionmodel
+qitemview
+qkeyevent
+qkeysequence
+qlabel
+qlayout
+qlcdnumber
+qlineedit
+qlistview
+qlistwidget
+#qmacstyle
+qmainwindow
+#qmdiarea Not relevant for S60, skip for now
+#qmdisubwindow not relevant for S60, skip for now
+qmenu
+qmenubar
+#qmessagebox that's a hanger
+qmouseevent
+qmouseevent_modal
+qmovie
+qmultiscreen
+qpaintengine
+qpainter
+qpainterpath
+qpainterpathstroker
+qpalette
+qpathclipper
+qpen
+qpicture
+qpixmap
+qpixmapcache
+qpixmapfilter
+qplaintextedit
+qpointarray
+#qprinter NO PRINTING SUPPORT ON SYMBIAN YET
+#qprinterinfo
+qprogressbar
+qprogressdialog
+qpushbutton
+qradiobutton
+qregexpvalidator
+qregion
+qscrollarea
+qscrollbar
+qshortcut
+qsidebar
+qsizegrip
+qslider
+qsortfilterproxymodel
+qsound
+qspinbox
+qsplitter
+qstackedlayout
+qstackedwidget
+qstandarditem
+qstandarditemmodel
+qstatusbar
+qstringlistmodel
+qstyle
+qstyleoption
+qstylesheetstyle
+qsyntaxhighlighter
+#qsystemtrayicon not relevant for s60, skip for now
+qtabbar
+qtableview
+qtablewidget
+qtabwidget
+qtessellator
+qtextblock
+qtextbrowser
+qtextcursor
+qtextdocument
+qtextdocumentfragment
+qtextdocumentlayout
+qtextedit
+qtextformat
+qtextlayout
+qtextlist
+qtextobject
+qtextodfwriter
+#This test can only be compiled on HW currently, because it does not use reduced exports
+#Because we are planning to use class level exports also in HW later on, there is no
+#sense to enable this at all
+#qtextpiecetable
+qtextscriptengine
+qtexttable
+qtoolbar
+qtoolbox
+qtoolbutton
+qtooltip
+qtransform
+qtransformedscreen
+qtreeview
+qtreewidget
+qtreewidgetitemiterator
+qtwidgets
+qundogroup
+qundostack
+qwidget
+qwidgetaction
+qwidget_window
+qwindowsurface
+qwizard
+qwmatrix
+qworkspace
+qwsembedwidget
+qwsinputmethod
+qwswindowsystem
+qx11info
+qzip
diff --git a/tests/auto/_Categories/QtHelp.txt b/tests/auto/_Categories/QtHelp.txt
new file mode 100644
index 0000000000..89e01fc380
--- /dev/null
+++ b/tests/auto/_Categories/QtHelp.txt
@@ -0,0 +1,5 @@
+qhelpcontentmodel
+qhelpenginecore
+qhelpgenerator
+qhelpindexmodel
+qhelpprojectdata
diff --git a/tests/auto/_Categories/QtNetwork.txt b/tests/auto/_Categories/QtNetwork.txt
new file mode 100644
index 0000000000..60df74ab2c
--- /dev/null
+++ b/tests/auto/_Categories/QtNetwork.txt
@@ -0,0 +1,29 @@
+qabstractnetworkcache
+qabstractsocket
+qftp
+qhostaddress
+qhostinfo
+qhttp
+qhttpnetworkconnection
+qhttpnetworkreply
+qhttpsocketengine
+qlocalsocket cetest-subdir: test
+qnativesocketengine
+qnetworkaddressentry
+qnetworkcachemetadata
+qnetworkcookie
+qnetworkcookiejar
+qnetworkdiskcache
+qnetworkinterface
+qnetworkproxy
+qnetworkreply cetest-subdir: test
+qnetworkrequest
+qsocks5socketengine
+qsslcertificate
+qsslcipher
+qsslerror
+qsslkey
+qsslsocket
+qtcpserver cetest-subdir: test
+qtcpsocket cetest-subdir: test
+qudpsocket cetest-subdir: test
diff --git a/tests/auto/_Categories/QtOpenGl.txt b/tests/auto/_Categories/QtOpenGl.txt
new file mode 100644
index 0000000000..a4e12badbc
--- /dev/null
+++ b/tests/auto/_Categories/QtOpenGl.txt
@@ -0,0 +1 @@
+qgl \ No newline at end of file
diff --git a/tests/auto/_Categories/QtScript.txt b/tests/auto/_Categories/QtScript.txt
new file mode 100644
index 0000000000..abd93a4bff
--- /dev/null
+++ b/tests/auto/_Categories/QtScript.txt
@@ -0,0 +1,13 @@
+qscriptable
+qscriptclass
+qscriptcontext
+qscriptcontextinfo
+qscriptengine
+qscriptengineagent
+#qscriptenginedebugger does not compile, requires QtScriptTools.lib
+qscriptjstestsuite
+qscriptqobject
+qscriptstring
+qscriptv8testsuite
+qscriptvalue
+qscriptvalueiterator
diff --git a/tests/auto/_Categories/QtSql.txt b/tests/auto/_Categories/QtSql.txt
new file mode 100644
index 0000000000..55c1464553
--- /dev/null
+++ b/tests/auto/_Categories/QtSql.txt
@@ -0,0 +1,11 @@
+qsql
+qsqlbatch
+qsqldatabase
+qsqlerror
+qsqlfield
+qsqlquery
+qsqlquerymodel
+qsqlrecord
+qsqlrelationaltablemodel
+qsqltablemodel
+qsqlthread
diff --git a/tests/auto/_Categories/QtSvg.txt b/tests/auto/_Categories/QtSvg.txt
new file mode 100644
index 0000000000..8bd3cb2697
--- /dev/null
+++ b/tests/auto/_Categories/QtSvg.txt
@@ -0,0 +1,3 @@
+qsvgdevice
+qsvggenerator
+qsvgrenderer
diff --git a/tests/auto/_Categories/QtTest.txt b/tests/auto/_Categories/QtTest.txt
new file mode 100644
index 0000000000..082a028349
--- /dev/null
+++ b/tests/auto/_Categories/QtTest.txt
@@ -0,0 +1 @@
+selftests
diff --git a/tests/auto/_Categories/QtWebkit.txt b/tests/auto/_Categories/QtWebkit.txt
new file mode 100644
index 0000000000..5c29b205ae
--- /dev/null
+++ b/tests/auto/_Categories/QtWebkit.txt
@@ -0,0 +1,2 @@
+qwebframe
+qwebpage
diff --git a/tests/auto/_Categories/QtXml.txt b/tests/auto/_Categories/QtXml.txt
new file mode 100644
index 0000000000..ec5664610e
--- /dev/null
+++ b/tests/auto/_Categories/QtXml.txt
@@ -0,0 +1,5 @@
+qdom
+qxml
+qxmlinputsource
+qxmlsimplereader
+qxmlstream
diff --git a/tests/auto/_Categories/QtXmlPatterns.txt b/tests/auto/_Categories/QtXmlPatterns.txt
new file mode 100644
index 0000000000..17de3efd80
--- /dev/null
+++ b/tests/auto/_Categories/QtXmlPatterns.txt
@@ -0,0 +1,27 @@
+checkxmlfiles
+patternistexamplefiletree
+patternistexamples
+patternistheaders
+qabstractmessagehandler
+qabstracturiresolver
+qabstractxmlforwarditerator
+qabstractxmlnodemodel
+qabstractxmlreceiver
+qapplicationargumentparser
+qautoptr
+qsimplexmlnodemodel
+qsourcelocation
+qtokenautomaton
+qxmlformatter
+qxmlitem
+qxmlname
+qxmlnamepool
+qxmlnodemodelindex
+qxmlquery
+qxmlresultitems
+qxmlserializer
+xmlpatterns
+xmlpatternsdiagnosticsts
+xmlpatternsview
+xmlpatternsxqts
+xmlpatternsxslts
diff --git a/tests/auto/_Categories/all_categories.txt b/tests/auto/_Categories/all_categories.txt
new file mode 100644
index 0000000000..cc31f4b2cf
--- /dev/null
+++ b/tests/auto/_Categories/all_categories.txt
@@ -0,0 +1,16 @@
+#unsorted
+
+atwrapper
+bic
+compile
+compilerwarnings
+headers
+macgui
+macplist
+symbols
+uiloader
+moc
+rcc
+uic
+uic3
+qmake \ No newline at end of file
diff --git a/tests/auto/_Categories/phonon.txt b/tests/auto/_Categories/phonon.txt
new file mode 100644
index 0000000000..67911b3f12
--- /dev/null
+++ b/tests/auto/_Categories/phonon.txt
@@ -0,0 +1,2 @@
+mediaobject
+mediaobject_wince_ds9
diff --git a/tests/auto/_Categories/qmake.txt b/tests/auto/_Categories/qmake.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/_Categories/qmake.txt
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 60e6657caf..aa7c1167ed 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,3 +1,4 @@
+QT = core
TEMPLATE = subdirs
# Directories
diff --git a/tests/auto/autobuildruncategory.bat b/tests/auto/autobuildruncategory.bat
new file mode 100644
index 0000000000..3f434ee74c
--- /dev/null
+++ b/tests/auto/autobuildruncategory.bat
@@ -0,0 +1,11 @@
+@echo off
+REM Compile all test cases from given category file
+
+REM Create root directory for autotest results
+IF NOT EXIST %3 MKDIR %3
+
+REM Set Module variable
+FOR /F %%i IN ("%1") DO SET MODULE=%%~ni
+
+REM run single test
+FOR /F "eol=# tokens=1*" %%i in (%1) do CALL autobuildrunsingle.bat %2 %%i %3 %4 %%j %%k
diff --git a/tests/auto/autobuildrunsingle.bat b/tests/auto/autobuildrunsingle.bat
new file mode 100644
index 0000000000..adb9871924
--- /dev/null
+++ b/tests/auto/autobuildrunsingle.bat
@@ -0,0 +1,71 @@
+@echo off
+REM runtest
+
+SET QTVERSION=%4
+
+IF %1 == winscw goto winscw:
+IF %1 == armv5 goto armv5:
+IF %1 == gcce goto gcce:
+goto end:
+
+:winscw
+IF EXIST \epoc32\release\winscw\udeb\tst_%2.exe (
+ call \epoc32\release\winscw\udeb\tst_%2.exe -lightxml
+ if ERRORLEVEL 1 (
+ echo ^<TestFunction name="PANIC"^> >> \Epoc32\winscw\c\system\data\out.txt
+ echo ^<Incident type="fail" file="" line="0"^> >> \Epoc32\winscw\c\system\data\out.txt
+ echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> \Epoc32\winscw\c\system\data\out.txt
+ echo ^<Description^>^<![CDATA['MESSAGE: TEST CASE PANICS]]^>^</Description^> >> \Epoc32\winscw\c\system\data\out.txt
+ echo ^</Incident^> >> \Epoc32\winscw\c\system\data\out.txt
+ echo ^</TestFunction^> >> \Epoc32\winscw\c\system\data\out.txt )
+ copy /Y \Epoc32\winscw\c\system\data\out.txt %3\%2.xml
+ goto end:
+) ELSE (
+goto notExist:
+)
+
+:ARMV5
+IF EXIST \epoc32\release\armv5\urel\tst_%2.exe (
+ pushd .
+ cd %2
+ IF _%5 == _cetest-subdir: (
+ echo Running cetest from subdir: %6
+ cd %6
+ )
+ IF _%5 == _cetest-pro: (
+ call cetest -release -f %6 -project-delete -lightxml -o %3\%2.xml
+ ) ELSE (
+ call cetest -release -project-delete -lightxml -o %3\%2.xml
+ )
+ if EXIST %3\%2.xml if ERRORLEVEL 1 (
+ echo ^<TestFunction name="PANIC"^> >> %3\%2.xml
+ echo ^<Incident type="fail" file="" line="0"^> >> %3\%2.xml
+ echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> %3\%2.xml
+ echo ^<Description^>^<![CDATA['MESSAGE: TEST CASE PANICS]]^>^</Description^> >> %3\%2.xml
+ echo ^</Incident^> >> %3\%2.xml
+ echo ^</TestFunction^> >> %3\%2.xml
+ )
+ popd
+ goto end:
+) ELSE (
+goto notExist:
+)
+
+:gcce
+goto end:
+
+:notExist
+echo AAA: %3\%2.xml
+echo ^<Environment^> >> %3\%2.xml
+echo ^<QtVersion^>%QTVERSION%^</QtVersion^> >> %3\%2.xml
+echo ^<QTestVersion^>%QTVERSION%^</QTestVersion^> >> %3\%2.xml
+echo ^</Environment^> >> %3\%2.xml
+echo ^<TestFunction name="initTestCase"^> >> %3\%2.xml
+echo ^<Incident type="fail" file="" line="0"^> >> %3\%2.xml
+echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> %3\%2.xml
+echo ^<Description^>^<![CDATA['MESSAGE: COMPILE FAIL]]^>^</Description^> >> %3\%2.xml
+echo ^</Incident^> >> %3\%2.xml
+echo ^</TestFunction^> >> %3\%2.xml
+goto end:
+
+:end
diff --git a/tests/auto/autobuildtests.bat b/tests/auto/autobuildtests.bat
new file mode 100644
index 0000000000..55ffad7585
--- /dev/null
+++ b/tests/auto/autobuildtests.bat
@@ -0,0 +1,19 @@
+@echo off
+REM NOTE: If this script is modified, it is likely that next automatic test will fail horribly,
+REM unless manual pull from repository is done before running it.
+
+
+REM Sync git
+cd ..\..\
+call git clean -dfx
+//call git reset --hard
+call git pull
+
+
+REM Auto tests builder
+REM 1. argument is enviroment: wincw, armv5 or gcce
+REM 2. argument is result's path: like \autotestResults
+REM 3. argument is path to pscp.exe: like c:\
+
+call tests\auto\autobuildtestsmain.bat %1 %2 %3
+
diff --git a/tests/auto/autobuildtestsmain.bat b/tests/auto/autobuildtestsmain.bat
new file mode 100644
index 0000000000..33ccd15512
--- /dev/null
+++ b/tests/auto/autobuildtestsmain.bat
@@ -0,0 +1,38 @@
+@echo off
+SET QTVERSION=4.4.2
+
+IF NOT EXIST %2\result\sent MKDIR %2\result\sent
+
+REM Delete old results
+del /Q %2\*.*
+
+REM Build enviroment
+set path=%cd%\bin;%path%
+make confclean
+configure -cetest -platform win32-mwc -xplatform symbian-abld -openssl-linked -qconfig symbian
+call bldmake bldfiles
+call abld clean
+call abld reallyclean
+IF %1 == winscw call abld build winscw udeb
+IF %1 == armv5 call abld build armv5 urel
+IF %1 == gcce call abld build gcce urel
+
+REM Build auto tests
+cd \qts60\tests\auto
+for %%i in (QtCore QtGui QtNetwork QtXml QtSvg QtScript) do call compilecategory.bat _Categories\%%i.txt %1
+
+
+REM run auto tests
+cd \qts60\tests\auto
+for %%i in (QtCore QtGui QtNetwork QtXml QtSvg QtScript) do call autobuildruncategory.bat _Categories\%%i.txt %1 %2 %QTVERSION%
+
+REM Collect test results
+cd \qts60\tests\auto
+echo call python joinresults.py %1 %2 %QTVERSION%
+call python joinresults.py %1 %2 %QTVERSION%
+
+REM send the result file
+call %3pscp.exe -i "%USERPROFILE%\.ssh\puttyssh.ppk" %2\Result\*.xml qtestmaster@kramer-nokia.troll.no:/home/qtestmaster/results
+
+REM Copy the result file to different directory that it not sent again
+move %2\Result\*.xml %2\Result\sent
diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index 96985c9c5e..c368c02114 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -6,7 +6,7 @@ QT -= gui
include (../xmlpatterns.pri)
-wince*: {
+wince*|symbian*: {
QT += network
addFiles.sources = \
$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
diff --git a/tests/auto/collections/collections.pro b/tests/auto/collections/collections.pro
index f47c2eb2e5..876e9034c4 100644
--- a/tests/auto/collections/collections.pro
+++ b/tests/auto/collections/collections.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_collections.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/compilecategory.bat b/tests/auto/compilecategory.bat
new file mode 100644
index 0000000000..59e31b56e8
--- /dev/null
+++ b/tests/auto/compilecategory.bat
@@ -0,0 +1,4 @@
+@echo off
+REM Compile all test cases from given gategory file
+
+FOR /F "eol=# tokens=1*" %%i in (%1) do CALL compilesingle.bat %%i %2
diff --git a/tests/auto/compilerwarnings/compilerwarnings.pro b/tests/auto/compilerwarnings/compilerwarnings.pro
index 9e16c5ee96..beb0279094 100644
--- a/tests/auto/compilerwarnings/compilerwarnings.pro
+++ b/tests/auto/compilerwarnings/compilerwarnings.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
SOURCES += tst_compilerwarnings.cpp
QT = core
-
RESOURCES = compilerwarnings.qrc
diff --git a/tests/auto/compilesingle.bat b/tests/auto/compilesingle.bat
new file mode 100644
index 0000000000..a9bb5f469c
--- /dev/null
+++ b/tests/auto/compilesingle.bat
@@ -0,0 +1,28 @@
+@echo off
+REM Compile test case from folder as a parameter
+
+pushd .
+cd %1
+REM call abld reallyclean
+call qmake -r
+call bldmake bldfiles
+
+REM reallyclean is not always deleting executables for some reason, so do that explicitly before building
+
+IF %2 == winscw (
+call abld reallyclean winscw
+call del /q /f \epoc32\release\winscw\udeb\tst_%1.exe
+call abld build winscw udeb
+)
+IF %2 == armv5 (
+call abld reallyclean armv5
+call del /q /f \epoc32\release\armv5\urel\tst_%1.exe
+call abld build armv5 urel
+)
+IF %2 == gcce (
+call abld reallyclean gcce
+call del /q /f \epoc32\release\gcce\urel\tst_%1.exe
+call abld build gcce urel
+)
+
+popd \ No newline at end of file
diff --git a/tests/auto/exceptionsafety/exceptionsafety.pro b/tests/auto/exceptionsafety/exceptionsafety.pro
index 23b8f73528..d162219f7c 100644
--- a/tests/auto/exceptionsafety/exceptionsafety.pro
+++ b/tests/auto/exceptionsafety/exceptionsafety.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
-QT -= gui
SOURCES += tst_exceptionsafety.cpp
+QT = core
diff --git a/tests/auto/headers/headers.pro b/tests/auto/headers/headers.pro
index 9da40ce00b..703da7c91b 100644
--- a/tests/auto/headers/headers.pro
+++ b/tests/auto/headers/headers.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_headers.cpp
QT = core
-
-
diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp
index b71d34173d..507bcdf46b 100644
--- a/tests/auto/languagechange/tst_languagechange.cpp
+++ b/tests/auto/languagechange/tst_languagechange.cpp
@@ -212,7 +212,12 @@ void tst_languageChange::retranslatability()
"languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to "
"get proper widget layout.");
TransformTranslator translator;
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // Allow a little extra time or emulator startup delays cause failure
+ QTimer::singleShot(5000, &translator, SLOT(install()));
+#else
QTimer::singleShot(500, &translator, SLOT(install()));
+#endif
switch (dialogType) {
case InputDialog:
(void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
@@ -235,7 +240,17 @@ void tst_languageChange::retranslatability()
QString fooName = tmpParentDir + "/foo";
QDir dir;
QCOMPARE(dir.mkpath(tmpDir), true);
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // Just create a new file instead of copying exe, because exe is not there in emulator
+ {
+ QFile fooFile(fooName);
+ QVERIFY(fooFile.open(QIODevice::WriteOnly | QIODevice::Text));
+ for(int i=0; i<2048; i++) // File needs to be big enough for size to read in KB
+ fooFile.write("@");
+ }
+#else
QCOMPARE(QFile::copy(QApplication::applicationFilePath(), fooName), true);
+#endif
dlg.setDirectory(tmpParentDir);
#ifdef Q_OS_WINCE
@@ -244,7 +259,12 @@ void tst_languageChange::retranslatability()
dlg.setFileMode(QFileDialog::ExistingFiles);
dlg.setViewMode(QFileDialog::Detail);
dlg.exec();
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // increase the wait time because of increased delay caused by emulator startup
+ QTest::qWait(15000);
+#else
QTest::qWait(3000);
+#endif
QCOMPARE(QFile::remove(fooName), true);
QCOMPARE(dir.rmdir(tmpDir), true);
QCOMPARE(dir.rmdir(tmpParentDir), true);
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 5a2f9c3fa6..7204b270bb 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -41,19 +41,79 @@
#include <QString>
#include <QtNetwork/QHostInfo>
+#ifdef Q_OS_SYMBIAN
+#include <sys/socket.h>
+#include <net/if.h>
+#include <QSharedPointer>
+#include <QHash>
+#endif
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+// In emulator we use WINSOCK connectivity by default. Unfortunately winsock
+// does not work very well with UDP sockets. This defines skips some test
+// cases which have known problems.
+
+// NOTE: Prefer to use WINPCAP based connectivity in S60 emulator when running
+// network tests. WINPCAP connectivity uses Symbian OS IP stack,
+// correspondingly as HW does. When using WINPCAP disable this define
+//#define SYMBIAN_WINSOCK_CONNECTIVITY
+#endif
+
+ class QtNetworkSettingsRecord {
+ public:
+ QtNetworkSettingsRecord() { }
+
+ QtNetworkSettingsRecord(const QString& recName, const QString& recVal)
+ : strRecordName(recName), strRecordValue(recVal) { }
+
+ QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other)
+ : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { }
+
+ ~QtNetworkSettingsRecord() { }
+
+ const QString& recordName() const { return strRecordName; }
+ const QString& recordValue() const { return strRecordValue; }
+
+ private:
+ QString strRecordName;
+ QString strRecordValue;
+ };
+
class QtNetworkSettings
{
public:
+
static QString serverLocalName()
{
- return QString("qt-test-server");
+#ifdef Q_OS_SYMBIAN
+ loadTestSettings();
+
+ if(QtNetworkSettings::entries.contains("server.localname")) {
+ QtNetworkSettingsRecord* entry = entries["server.localname"];
+ return entry->recordValue();
+ }
+#endif
+ return QString("qttest");
+ //return QString("aspiriniks");
+ //return QString("qt-test-server");
}
static QString serverDomainName()
{
- return QString("qt-test-net");
+#ifdef Q_OS_SYMBIAN
+ loadTestSettings();
+
+ if(QtNetworkSettings::entries.contains("server.domainname")) {
+ QtNetworkSettingsRecord* entry = entries["server.domainname"];
+ return entry->recordValue();
+ }
+#endif
+ return QString("it.local");
+ //return QString("troll.no");
}
static QString serverName()
{
+#ifdef Q_OS_SYMBIAN
+ loadTestSettings();
+#endif
return serverLocalName() + "." + serverDomainName();
}
static QString winServerName()
@@ -62,9 +122,192 @@ public:
}
static QString wildcardServerName()
{
- return "qt-test-server.wildcard.dev." + serverDomainName();
+ //return "qt-test-server.wildcard.dev." + serverDomainName();
+ return "qttest.wildcard.dev." + serverDomainName();
+ }
+ static const char *serverIP()
+ {
+#ifdef Q_OS_SYMBIAN
+ loadTestSettings();
+
+ if(QtNetworkSettings::entries.contains("server.ip")) {
+ QtNetworkSettingsRecord* entry = entries["server.ip"];
+ if(serverIp.isNull()) {
+ serverIp = entry->recordValue().toAscii();
+ }
+ return serverIp.data();
+ }
+#endif
+ return "10.10.14.172";
+ }
+
+ static QByteArray expectedReplyIMAP()
+ {
+#ifdef Q_OS_SYMBIAN
+ loadTestSettings();
+
+ if(QtNetworkSettings::entries.contains("imap.expectedreply")) {
+ QtNetworkSettingsRecord* entry = entries["imap.expectedreply"];
+ if(imapExpectedReply.isNull()) {
+ imapExpectedReply = entry->recordValue().toAscii();
+ imapExpectedReply.append('\r').append('\n');
+ }
+ return imapExpectedReply.data();
+ }
+#endif
+ /*QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " );
+ expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
+ expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");*/
+
+ QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4REV1] " );
+ expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
+ expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+
+ return expected;
+ }
+
+ static QByteArray expectedReplySSL()
+ {
+ loadTestSettings();
+
+ if(QtNetworkSettings::entries.contains("imap.expectedreplyssl")) {
+ QtNetworkSettingsRecord* entry = entries["imap.expectedreplyssl"];
+ if(imapExpectedReplySsl.isNull()) {
+ imapExpectedReplySsl = entry->recordValue().toAscii();
+ imapExpectedReplySsl.append('\r').append('\n');
+ }
+ return imapExpectedReplySsl.data();
+ } else {
+ QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " );
+ expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
+ expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ return expected;
+ }
+ }
+
+ static QByteArray expectedReplyFtp()
+ {
+ QByteArray expected( "220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n" );
+ return expected;
+ }
+
+#ifdef Q_OS_SYMBIAN
+ static void setDefaultIap()
+ {
+ loadDefaultIap();
+
+ struct ifreq ifReq;
+ if(entries.contains("iap.default")) {
+ QtNetworkSettingsRecord* entry = entries["iap.default"];
+ QByteArray tmp(entry->recordValue().toAscii());
+ strcpy( ifReq.ifr_name, tmp.data());
+ }
+ else // some default value
+ strcpy( ifReq.ifr_name, "Lab");
+
+ int err = setdefaultif( &ifReq );
+ if(err)
+ printf("Setting default IAP - '%s' failed: %d\n", ifReq.ifr_name, err);
+ else
+ printf("'%s' used as an default IAP\n", ifReq.ifr_name);
+ }
+#endif
+
+private:
+
+#ifdef Q_OS_SYMBIAN
+
+ static QHash<QString, QtNetworkSettingsRecord* > entries;
+ static bool bDefaultIapLoaded;
+ static bool bTestSettingsLoaded;
+ static QString iapFileFullPath;
+ static QByteArray serverIp;
+ static QByteArray imapExpectedReply;
+ static QByteArray imapExpectedReplySsl;
+
+ static bool loadDefaultIap() {
+ if(bDefaultIapLoaded)
+ return true;
+
+ QFile iapCfgFile(iapFileFullPath);
+
+ bool bFoundDefaultIapTag = false;
+
+ if (iapCfgFile.open(QFile::ReadOnly)) {
+ QTextStream input(&iapCfgFile);
+ QString line;
+ do {
+ line = input.readLine().trimmed();
+ if(line.startsWith(QString("#")))
+ continue; // comment found
+
+ if(line.contains(QString("[DEFAULT]"))) {
+ bFoundDefaultIapTag = true;
+ } else if(line.contains(QString("[")) && bFoundDefaultIapTag) {
+ break;
+ }
+
+ if(bFoundDefaultIapTag && line.contains("name")) {
+ int position = line.indexOf(QString("="));
+ position += QString("=").length();
+
+ //create record
+ QtNetworkSettingsRecord *entry =
+ new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() );
+ entries.insert(entry->recordName(), entry);
+ break;
+ }
+ } while (!line.isNull());
+ }
+
+ return bDefaultIapLoaded = bFoundDefaultIapTag;
}
+ static bool loadTestSettings() {
+ if(bTestSettingsLoaded)
+ return true;
+
+ QFile cfgFile(iapFileFullPath);
+ bool bFoundTestTag = false;
+
+ if (cfgFile.open(QFile::ReadOnly)) {
+ QTextStream input(&cfgFile);
+ QString line;
+ do {
+ line = input.readLine().trimmed();
+
+ if(line.startsWith(QString("#")) || line.length() == 0)
+ continue; // comment or empty line found
+
+ if(line.contains(QString("[TEST]"))) {
+ bFoundTestTag = true;
+ } else if(line.startsWith(QString("[")) && bFoundTestTag) {
+ bFoundTestTag = false;
+ break; // finished with test tag
+ }
+
+ if(bFoundTestTag) { // non-empty line
+ int position = line.indexOf(QString("="));
+
+ if(position <= 0) // not found
+ continue;
+
+ // found - extract
+
+ QString recname = line.mid(0, position - QString("=").length()).trimmed();
+ QString recval = line.mid(position + QString("=").length()).trimmed();
+
+ //create record
+ QtNetworkSettingsRecord *entry = new QtNetworkSettingsRecord(recname, recval);
+ entries.insert(entry->recordName(), entry);
+ }
+ } while (!line.isNull());
+ }
+
+ return bTestSettingsLoaded = true;
+ }
+#endif
+
#ifdef QT_NETWORK_LIB
static QHostAddress serverIP()
{
@@ -73,3 +316,18 @@ public:
#endif
};
+#ifdef Q_OS_SYMBIAN
+QHash<QString, QtNetworkSettingsRecord* > QtNetworkSettings::entries = QHash<QString, QtNetworkSettingsRecord* > ();
+bool QtNetworkSettings::bDefaultIapLoaded = false;
+bool QtNetworkSettings::bTestSettingsLoaded = false;
+QString QtNetworkSettings::iapFileFullPath = QString("C:\\Data\\iap.txt");
+QByteArray QtNetworkSettings::serverIp;
+QByteArray QtNetworkSettings::imapExpectedReply;
+QByteArray QtNetworkSettings::imapExpectedReplySsl;
+#endif
+
+#ifdef Q_OS_SYMBIAN
+#define Q_SET_DEFAULT_IAP QtNetworkSettings::setDefaultIap();
+#else
+#define Q_SET_DEFAULT_IAP
+#endif
diff --git a/tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro b/tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro
index 9e962d0976..772c833a7e 100644
--- a/tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro
+++ b/tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_patternistexamplefiletree.cpp
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro
index 90fc1664e0..4092fc8e23 100644
--- a/tests/auto/patternistexamples/patternistexamples.pro
+++ b/tests/auto/patternistexamples/patternistexamples.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_patternistexamples.cpp
CONFIG += qtestlib
-wince*: {
+wince*|symbian*: {
snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
snippets.path = patternist
widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
diff --git a/tests/auto/patternistheaders/patternistheaders.pro b/tests/auto/patternistheaders/patternistheaders.pro
index be93266016..fe4d670565 100644
--- a/tests/auto/patternistheaders/patternistheaders.pro
+++ b/tests/auto/patternistheaders/patternistheaders.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_patternistheaders.cpp
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/q3urloperator/copy.res/.gitattributes b/tests/auto/q3urloperator/copy.res/.gitattributes
new file mode 100644
index 0000000000..e04709aa2e
--- /dev/null
+++ b/tests/auto/q3urloperator/copy.res/.gitattributes
@@ -0,0 +1 @@
+rfc3252.txt -crlf
diff --git a/tests/auto/q_func_info/q_func_info.pro b/tests/auto/q_func_info/q_func_info.pro
index fa60affc43..b30e3fb857 100644
--- a/tests/auto/q_func_info/q_func_info.pro
+++ b/tests/auto/q_func_info/q_func_info.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_q_func_info.cpp
-QT -= gui
+QT = core
diff --git a/tests/auto/q_func_info/tst_q_func_info.cpp b/tests/auto/q_func_info/tst_q_func_info.cpp
index 4d74c27f53..c0307c3aed 100644
--- a/tests/auto/q_func_info/tst_q_func_info.cpp
+++ b/tests/auto/q_func_info/tst_q_func_info.cpp
@@ -41,7 +41,7 @@
#include <QString>
-#include <QTest>
+#include <QtTest/QtTest>
#include <QtDebug>
class tst_q_func_info : public QObject
diff --git a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
index 9bc660d41d..5ad1020478 100644
--- a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
+++ b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qabstractitemmodel.cpp
-
-#QT = core
-
-
+QT = core
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index 3a845e134d..69b310c484 100644
--- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
@@ -147,8 +147,10 @@ public:
inline QItemSelectionModel::SelectionFlags tst_selectionCommand(const QModelIndex &index,
const QEvent *event = 0) const
{ return selectionCommand(index, event); }
+#ifndef QT_NO_DRAGANDDROP
inline void tst_startDrag(Qt::DropActions supportedActions)
{ startDrag(supportedActions); }
+#endif
inline QStyleOptionViewItem tst_viewOptions() const
{ return viewOptions(); }
enum tst_State {
@@ -264,11 +266,12 @@ void tst_QAbstractItemView::getSetCheck()
// bool QAbstractItemView::dragEnabled()
// void QAbstractItemView::setDragEnabled(bool)
+#ifndef QT_NO_DRAGANDDROP
obj1->setDragEnabled(false);
QCOMPARE(false, obj1->dragEnabled());
obj1->setDragEnabled(true);
QCOMPARE(true, obj1->dragEnabled());
-
+#endif
// bool QAbstractItemView::alternatingRowColors()
// void QAbstractItemView::setAlternatingRowColors(bool)
obj1->setAlternatingRowColors(false);
@@ -437,6 +440,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
view->setTabKeyNavigation(true);
QCOMPARE(view->tabKeyNavigation(), true);
+#ifndef QT_NO_DRAGANDDROP
// setDropIndicatorShown
view->setDropIndicatorShown(false);
QCOMPARE(view->showDropIndicator(), false);
@@ -448,7 +452,8 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
QCOMPARE(view->dragEnabled(), false);
view->setDragEnabled(true);
QCOMPARE(view->dragEnabled(), true);
-
+#endif
+
// setAlternatingRowColors
view->setAlternatingRowColors(false);
QCOMPARE(view->alternatingRowColors(), false);
@@ -542,6 +547,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
view->tst_selectionCommand(QModelIndex(), 0);
+#ifndef QT_NO_DRAGANDDROP
if (!view->model())
view->tst_startDrag(Qt::CopyAction);
@@ -559,7 +565,8 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
QVERIFY(view->tst_state()==TestView::ExpandingState);
view->tst_setState(TestView::CollapsingState);
QVERIFY(view->tst_state()==TestView::CollapsingState);
-
+#endif
+
view->tst_startAutoScroll();
view->tst_stopAutoScroll();
view->tst_doAutoScroll();
diff --git a/tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro b/tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro
index 4b2e7b4646..5c501030c0 100644
--- a/tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro
+++ b/tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_qabstractmessagehandler.cpp
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
index cffadb05c9..11e340d4e5 100644
--- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
+++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
QT += network
SOURCES += tst_qabstractnetworkcache.cpp
-wince*: {
+wince*|symbian: {
testFiles.sources = tests
testFiles.path = .
DEPLOYMENT += testFiles
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index d7ee5b737c..ce33aadaab 100644
--- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -81,8 +81,12 @@ public:
: QNetworkDiskCache(parent)
, gotData(false)
{
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
- + QLatin1String("/cache/");
+#ifdef Q_OS_SYMBIAN
+ QString location = QLatin1String("./cache/");
+#else
+ QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+ + QLatin1String("/cache/");
+#endif
setCacheDirectory(location);
clear();
}
@@ -99,13 +103,15 @@ public:
tst_QAbstractNetworkCache::tst_QAbstractNetworkCache()
{
+ Q_SET_DEFAULT_IAP
+
QCoreApplication::setOrganizationName(QLatin1String("Trolltech"));
QCoreApplication::setApplicationName(QLatin1String("autotest_qabstractnetworkcache"));
QCoreApplication::setApplicationVersion(QLatin1String("1.0"));
}
tst_QAbstractNetworkCache::~tst_QAbstractNetworkCache()
-{
+{
}
static bool AlwaysTrue = true;
diff --git a/tests/auto/qabstracturiresolver/qabstracturiresolver.pro b/tests/auto/qabstracturiresolver/qabstracturiresolver.pro
index de9a36896e..0d76208760 100644
--- a/tests/auto/qabstracturiresolver/qabstracturiresolver.pro
+++ b/tests/auto/qabstracturiresolver/qabstracturiresolver.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
SOURCES += tst_qabstracturiresolver.cpp
HEADERS += TestURIResolver.h
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro b/tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro
index f6dca8b0f0..6bc0c59c50 100644
--- a/tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro
+++ b/tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_qabstractxmlforwarditerator.cpp
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro b/tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro
index ad3f2b2f0b..2bd2ba4589 100644
--- a/tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro
+++ b/tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_qabstractxmlreceiver.cpp
+QT = core
include (../xmlpatterns.pri)
diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp
index 34f2dfdfae..265932d569 100644
--- a/tests/auto/qaction/tst_qaction.cpp
+++ b/tests/auto/qaction/tst_qaction.cpp
@@ -236,7 +236,7 @@ void tst_QAction::setStandardKeys()
QList<QKeySequence> expected;
#ifdef Q_WS_MAC
expected << QKeySequence("CTRL+C");
-#elif defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
expected << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT");
#else
expected << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT");
diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index 904a62ace2..93a03db7ae 100644
--- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -3,13 +3,18 @@
######################################################################
TEMPLATE = app
+!symbian*: {
DEPENDPATH += .
INCLUDEPATH += .
-wince*:TARGET = ../desktopsettingsaware
+}
+wince*|symbian*:TARGET = ../desktopsettingsaware
+
# Input
SOURCES += main.cpp
CONFIG += qt warn_on create_prl link_prl
CONFIG -= app_bundle
+
+!symbian*: {
OBJECTS_DIR=.obj/debug-shared
MOC_DIR=.moc/debug-shared
-
+}
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index cda7940789..7c3de3cf7d 100644
--- a/tests/auto/qapplication/test/test.pro
+++ b/tests/auto/qapplication/test/test.pro
@@ -11,6 +11,14 @@ wince* {
DEPLOYMENT = additional deploy someTest
}
+symbian*: {
+ additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe
+ additional.path = desktopsettingsaware
+ someTest.sources = test.pro
+ someTest.path = test
+ DEPLOYMENT = additional deploy someTest
+}
+
win32 {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qapplication
diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp
index cee3125672..5e9c237e9c 100644
--- a/tests/auto/qapplication/tst_qapplication.cpp
+++ b/tests/auto/qapplication/tst_qapplication.cpp
@@ -56,6 +56,21 @@
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+// In Symbian, the PluginsPath doesn't specify the only absolute path; just the dir that can be found on any drive
+static void addExpectedSymbianPluginsPath(QStringList& expected)
+{
+ QString installPathPlugins = QDir::fromNativeSeparators(QLibraryInfo::location(QLibraryInfo::PluginsPath));
+ QFileInfoList driveList = QDir::drives();
+ QListIterator<QFileInfo> iter(driveList);
+ while (iter.hasNext()) {
+ QFileInfo testFi(iter.next().canonicalPath().append(installPathPlugins));
+ if (testFi.exists())
+ expected << testFi.canonicalFilePath();
+ }
+}
+#endif
+
class tst_QApplication : public QObject
{
Q_OBJECT
@@ -784,7 +799,13 @@ void tst_QApplication::libraryPaths()
QStringList actual = QApplication::libraryPaths();
actual.sort();
+#if defined(Q_OS_SYMBIAN)
+ QStringList expected;
+ addExpectedSymbianPluginsPath(expected);
+ expected << appDirPath;
+#else
QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList();
+#endif
expected.sort();
QVERIFY2(isPathListIncluded(actual, expected),
@@ -887,7 +908,11 @@ void tst_QApplication::libraryPaths_qt_plugin_path()
void tst_QApplication::libraryPaths_qt_plugin_path_2()
{
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_SYMBIAN
+ QByteArray validPath = "C:\\data";
+ QByteArray nonExistentPath = "Z:\\nonexistent";
+ QByteArray pluginPath = validPath + ";" + nonExistentPath;
+#elif defined(Q_OS_UNIX)
QByteArray validPath = QDir("/tmp").canonicalPath().toLatin1();
QByteArray nonExistentPath = "/nonexistent";
QByteArray pluginPath = validPath + ":" + nonExistentPath;
@@ -912,19 +937,25 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
QApplication app(argc, &argv0, QApplication::GuiServer);
// library path list should contain the default plus the one valid path
+#if defined(Q_OS_SYMBIAN)
+ // In Symbian, the PluginsPath doesn't specify the only absolute path; just the dir that can be found on any drive
+ QStringList expected;
+ addExpectedSymbianPluginsPath(expected);
+ expected << QDir(app.applicationDirPath()).canonicalPath()
+ << QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
+#else
QStringList expected =
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< QDir(app.applicationDirPath()).canonicalPath()
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
-#ifdef Q_OS_WINCE
+# ifdef Q_OS_WINCE
expected = QSet<QString>::fromList(expected).toList();
+# endif
#endif
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
-
- qputenv("QT_PLUGIN_PATH", QByteArray());
}
{
@@ -936,13 +967,19 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
// the environment variable here doesn't work
qputenv("QT_PLUGIN_PATH", pluginPath);
- // library path list should contain the default plus the one valid path
+ // library path list should contain the default
+#if defined(Q_OS_SYMBIAN)
+ QStringList expected;
+ addExpectedSymbianPluginsPath(expected);
+ expected << app.applicationDirPath();
+#else
QStringList expected =
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< app.applicationDirPath();
-#ifdef Q_OS_WINCE
+# ifdef Q_OS_WINCE
expected = QSet<QString>::fromList(expected).toList();
+# endif
#endif
QVERIFY(isPathListIncluded(app.libraryPaths(), expected));
@@ -1389,6 +1426,13 @@ void tst_QApplication::desktopSettingsAware()
testProcess.start("desktopsettingsaware/debug/desktopsettingsaware");
#elif defined(Q_OS_WIN)
testProcess.start("desktopsettingsaware/release/desktopsettingsaware");
+#elif defined(Q_OS_SYMBIAN)
+ testProcess.start("desktopsettingsaware");
+#if defined(Q_CC_NOKIAX86)
+ QEXPECT_FAIL("", "QProcess on Q_CC_NOKIAX86 cannot launch another Qt application, due to DLL conflicts.", Abort);
+ // TODO: Remove XFAIL, as soon as we can launch Qt applications from within Qt applications on Symbian
+ QVERIFY(testProcess.error() != QProcess::FailedToStart);
+#endif // defined(Q_CC_NOKIAX86)
#else
testProcess.start("desktopsettingsaware/desktopsettingsaware");
#endif
diff --git a/tests/auto/qatomicint/qatomicint.pro b/tests/auto/qatomicint/qatomicint.pro
index 26b5b90428..4a09d5f176 100644
--- a/tests/auto/qatomicint/qatomicint.pro
+++ b/tests/auto/qatomicint/qatomicint.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
-
SOURCES += tst_qatomicint.cpp
QT = core
-
-
diff --git a/tests/auto/qatomicpointer/qatomicpointer.pro b/tests/auto/qatomicpointer/qatomicpointer.pro
index d4e88f607f..d192bad5dc 100644
--- a/tests/auto/qatomicpointer/qatomicpointer.pro
+++ b/tests/auto/qatomicpointer/qatomicpointer.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qatomicpointer.cpp
QT = core
-
-
diff --git a/tests/auto/qautoptr/qautoptr.pro b/tests/auto/qautoptr/qautoptr.pro
index 505840907c..9eab0848d1 100644
--- a/tests/auto/qautoptr/qautoptr.pro
+++ b/tests/auto/qautoptr/qautoptr.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qautoptr.cpp
-QT -= gui
+QT = core
include(../xmlpatterns.pri)
diff --git a/tests/auto/qbitarray/qbitarray.pro b/tests/auto/qbitarray/qbitarray.pro
index 182b06ab22..ec110c62cd 100644
--- a/tests/auto/qbitarray/qbitarray.pro
+++ b/tests/auto/qbitarray/qbitarray.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qbitarray.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp
index ecdffdae41..12fbdc3ce6 100644
--- a/tests/auto/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/qbitarray/tst_qbitarray.cpp
@@ -43,7 +43,6 @@
#include <QtTest/QtTest>
#include <QtCore/QBuffer>
#include <QtCore/QDataStream>
-#include <iostream>
#include "qbitarray.h"
diff --git a/tests/auto/qbuffer/qbuffer.pro b/tests/auto/qbuffer/qbuffer.pro
index fc5842dce7..ea8365766b 100644
--- a/tests/auto/qbuffer/qbuffer.pro
+++ b/tests/auto/qbuffer/qbuffer.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qbuffer.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qbytearray/.gitattributes b/tests/auto/qbytearray/.gitattributes
new file mode 100644
index 0000000000..e04709aa2e
--- /dev/null
+++ b/tests/auto/qbytearray/.gitattributes
@@ -0,0 +1 @@
+rfc3252.txt -crlf
diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro
index f41c7ae125..d14534ba98 100644
--- a/tests/auto/qbytearray/qbytearray.pro
+++ b/tests/auto/qbytearray/qbytearray.pro
@@ -4,11 +4,16 @@ SOURCES += tst_qbytearray.cpp
QT = core
-wince*: {
+wince*|symbian: {
addFile.sources = rfc3252.txt
addFile.path = .
DEPLOYMENT += addFile
+}
+
+wince: {
DEFINES += SRCDIR=\\\"\\\"
+} symbian: {
+ TARGET.EPOCHEAPSIZE="0x100 0x800000"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 4da8c5c63b..c9d28f2873 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -53,6 +53,10 @@
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+#define SRCDIR ""
+#endif
+
class tst_QByteArray : public QObject
{
Q_OBJECT
@@ -959,7 +963,7 @@ void tst_QByteArray::toInt()
QCOMPARE( number, expectednumber );
}
-Q_DECLARE_METATYPE(qulonglong);
+Q_DECLARE_METATYPE(qulonglong)
void tst_QByteArray::toULong_data()
{
QTest::addColumn<QByteArray>("str");
@@ -969,8 +973,8 @@ void tst_QByteArray::toULong_data()
ulong LongMaxPlusOne = (ulong)LONG_MAX + 1;
QTest::newRow("LONG_MAX+1") << QString::number(LongMaxPlusOne).toLatin1() << 10 << LongMaxPlusOne << true;
- QTest::newRow("default") << QByteArray() << 10 << 0UL << FALSE;
- QTest::newRow("empty") << QByteArray("") << 10 << 0UL << FALSE;
+ QTest::newRow("default") << QByteArray() << 10 << 0UL << false;
+ QTest::newRow("empty") << QByteArray("") << 10 << 0UL << false;
QTest::newRow("ulong1") << QByteArray("3234567890") << 10 << 3234567890UL << true;
QTest::newRow("ulong2") << QByteArray("fFFfFfFf") << 16 << 0xFFFFFFFFUL << true;
}
@@ -995,8 +999,8 @@ void tst_QByteArray::toULongLong_data()
QTest::addColumn<qulonglong>("result");
QTest::addColumn<bool>("ok");
- QTest::newRow("default") << QByteArray() << 10 << (qulonglong)0 << FALSE;
- QTest::newRow("out of base bound") << QByteArray("c") << 10 << (qulonglong)0 << FALSE;
+ QTest::newRow("default") << QByteArray() << 10 << (qulonglong)0 << false;
+ QTest::newRow("out of base bound") << QByteArray("c") << 10 << (qulonglong)0 << false;
}
@@ -1138,12 +1142,12 @@ void tst_QByteArray::toFromHex()
void tst_QByteArray::toFromPercentEncoding()
{
QByteArray arr("Qt is great!");
-
+/*
QByteArray data = arr.toPercentEncoding();
QCOMPARE(QString(data), QString("Qt%20is%20great%21"));
QCOMPARE(QByteArray::fromPercentEncoding(data), arr);
-
- data = arr.toPercentEncoding("! ", "Qt");
+*/
+ QByteArray data = arr.toPercentEncoding("! ", "Qt");
QCOMPARE(QString(data), QString("%51%74 is grea%74!"));
QCOMPARE(QByteArray::fromPercentEncoding(data), arr);
diff --git a/tests/auto/qcache/qcache.pro b/tests/auto/qcache/qcache.pro
index d09320bf73..728b0b646f 100644
--- a/tests/auto/qcache/qcache.pro
+++ b/tests/auto/qcache/qcache.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qcache.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
index 617832bc0e..0c7a1c9105 100644
--- a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
+++ b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
@@ -200,7 +200,7 @@ void tst_QCalendarWidget::buttonClickCheck()
QTest::qWait(500);
QWidget *widget = qFindChild<QWidget *>(&object, "qt_calendar_calendarview");
QTest::mouseMove(widget);
- QTest::mouseClick(widget, Qt::LeftButton, 0, QPoint(), 50);
+ QTest::mouseClick(widget, Qt::LeftButton);
QCOMPARE(2006, object.yearShown());
object.setSelectedDate(selectedDate);
object.showSelectedDate();
diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro
index d8c53269d3..fca4ef687c 100644
--- a/tests/auto/qchar/qchar.pro
+++ b/tests/auto/qchar/qchar.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qchar.cpp
QT = core
-wince*: {
+wince*|symbian*: {
deploy.sources += NormalizationTest.txt
DEPLOYMENT = deploy
}
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index ba70cffb04..508eba1d9e 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -10,7 +10,7 @@ win32 {
}
}
-wince*: {
+wince*|symbian*: {
copier.sources = ../copier/copier.exe
copier.path = copier
paster.sources = ../paster/paster.exe
diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp
index 3a98153772..03b424f363 100644
--- a/tests/auto/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/qclipboard/tst_qclipboard.cpp
@@ -108,7 +108,7 @@ void tst_QClipboard::modes()
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup", SkipAll);
- const QString defaultMode = "deafult mode text;";
+ const QString defaultMode = "default mode text;";
clipboard->setText(defaultMode);
QCOMPARE(clipboard->text(), defaultMode);
@@ -195,7 +195,9 @@ void tst_QClipboard::copy_exit_paste()
#if defined Q_WS_X11 || defined Q_WS_QWS
QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ", SkipAll);
// ### It's still possible to test copy/paste - just keep the apps running
-#endif
+#elif defined (Q_OS_SYMBIAN) && defined (Q_CC_NOKIAX86)
+ QSKIP("emulator cannot launch multiple processes",SkipAll);
+#endif
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup", SkipAll);
const QStringList stringArgument = QStringList() << "Test string.";
diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp
index 998d27353b..df5813ed85 100644
--- a/tests/auto/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp
@@ -44,7 +44,9 @@
#include <qstandarditemmodel.h>
#include <qcolumnview.h>
#include "../../../src/gui/itemviews/qcolumnviewgrip_p.h"
+#ifndef Q_OS_SYMBIAN
#include "../../../src/gui/dialogs/qfilesystemmodel_p.h"
+#endif
#include <qdirmodel.h>
#include <qstringlistmodel.h>
#include <qdebug.h>
diff --git a/tests/auto/qcombobox/qcombobox.pro b/tests/auto/qcombobox/qcombobox.pro
index 60bf1c8ebd..f36a6fe622 100644
--- a/tests/auto/qcombobox/qcombobox.pro
+++ b/tests/auto/qcombobox/qcombobox.pro
@@ -2,5 +2,3 @@ load(qttest_p4)
SOURCES += tst_qcombobox.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-
-
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 2fff6d017c..620cd073da 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -1233,7 +1233,6 @@ void tst_QComboBox::insertItem()
testWidget->setEditable(true);
if (editable)
testWidget->setEditText("FOO");
-
#if defined (QT3_SUPPORT)
if (testQt3Support)
testWidget->insertItem(itemLabel, insertIndex);
@@ -1247,7 +1246,7 @@ void tst_QComboBox::insertItem()
QCOMPARE(testWidget->count(), initialItems.count() + 1);
QCOMPARE(testWidget->itemText(expectedIndex), itemLabel);
-
+
if (editable)
QCOMPARE(testWidget->currentText(), QString("FOO"));
}
@@ -1894,10 +1893,10 @@ void tst_QComboBox::itemListPosition()
//tests that the list is not out of the screen boundaries
//put the QApplication layout back
- qApp->setLayoutDirection(Qt::LeftToRight);
+ QApplication::setLayoutDirection(Qt::LeftToRight);
//we test QFontComboBox because it has the specific behaviour to set a fixed size
- //the the list view
+ //to the list view
QFontComboBox combo;
//the code to get the avaialbe screen space is copied from QComboBox code
@@ -1914,13 +1913,17 @@ void tst_QComboBox::itemListPosition()
screen = QApplication::desktop()->availableGeometry(scrNumber);
#endif
- combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo the the top-right corner
+ combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner
combo.show();
QTest::qWait(100); //wait because the window manager can move the window if there is a right panel
combo.showPopup();
QTest::qWait(100);
+#if defined(Q_WS_S60)
+ // Assuming that QtS60 style is used, here. But other ones would certainly also fail
+ QEXPECT_FAIL("", "QtS60Style does not yet position the combobox popup correctly", Continue);
+#endif
QVERIFY( combo.view()->window()->x() + combo.view()->window()->width() <= screen.x() + screen.width() );
}
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index b71cdc636d..738384dad1 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -58,9 +58,9 @@ class CsvCompleter : public QCompleter
Q_OBJECT
public:
CsvCompleter(QObject *parent = 0) : QCompleter(parent), csv(true) { }
-
- QString pathFromIndex(const QModelIndex& sourceIndex) const;
-
+
+ QString pathFromIndex(const QModelIndex& sourceIndex) const;
+
void setCsvCompletion(bool set) { csv = set; }
protected:
@@ -176,7 +176,7 @@ tst_QCompleter::~tst_QCompleter()
}
void tst_QCompleter::setSourceModel(ModelType type)
-{
+{
QString text;
QTreeWidgetItem *parent, *child;
treeWidget->clear();
@@ -282,7 +282,7 @@ void tst_QCompleter::csMatchingOnCsSortedModel_data()
for (int i = 0; i < 2; i++) {
if (i == 1)
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
-
+
// Plain text filter
QTest::newRow("()") << "" << "" << "P0" << "P0";
QTest::newRow("()F") << "" << "F" << "P0" << "P0";
@@ -299,7 +299,7 @@ void tst_QCompleter::csMatchingOnCsSortedModel_data()
QTest::newRow("(p)NNNN") << "p" << "NNNN" << "p4" << "p4";
QTest::newRow("(p1)") << "p1" << "" << "p1" << "p1";
QTest::newRow("(p11)") << "p11" << "" << "" << "";
-
+
// Tree filter
QTest::newRow("(P0,)") << "P0," << "" << "c0P0" << "P0,c0P0";
QTest::newRow("(P0,c)") << "P0,c" << "" << "c0P0" << "P0,c0P0";
@@ -333,7 +333,7 @@ void tst_QCompleter::ciMatchingOnCiSortedModel_data()
QTest::addColumn<QString>("completion");
QTest::addColumn<QString>("completionText");
- for (int i = 0; i < 2; i++) {
+ for (int i = 0; i < 2; i++) {
if (i == 1)
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
@@ -352,7 +352,7 @@ void tst_QCompleter::ciMatchingOnCiSortedModel_data()
QTest::newRow("(p1)") << "p1" << "" << "P1" << "P1";
QTest::newRow("(p1)N") << "p1" << "N" << "p1" << "p1";
QTest::newRow("(p11)") << "p11" << "" << "" << "";
-
+
//// Tree filter
QTest::newRow("(p0,)") << "p0," << "" << "c0P0" << "P0,c0P0";
QTest::newRow("(p0,c)") << "p0,c" << "" << "c0P0" << "P0,c0P0";
@@ -404,7 +404,7 @@ void tst_QCompleter::ciMatchingOnCsSortedModel_data()
QTest::newRow("(p1)") << "p1" << "" << "P1" << "P1";
QTest::newRow("(p1)N") << "p1" << "N" << "p1" << "p1";
QTest::newRow("(p11)") << "p11" << "" << "" << "";
-
+
// Tree filter
QTest::newRow("(p0,)") << "p0," << "" << "c0P0" << "P0,c0P0";
QTest::newRow("(p0,c)") << "p0,c" << "" << "c0P0" << "P0,c0P0";
@@ -456,7 +456,7 @@ void tst_QCompleter::csMatchingOnCiSortedModel_data()
QTest::newRow("(p)NNN") << "p" << "NNN" << "p3" << "p3";
QTest::newRow("(p1)") << "p1" << "" << "p1" << "p1";
QTest::newRow("(p11)") << "p11" << "" << "" << "";
-
+
//// Tree filter
QTest::newRow("(p0,)") << "p0," << "" << "c0p0" << "p0,c0p0";
QTest::newRow("(p0,c)") << "p0,c" << "" << "c0p0" << "p0,c0p0";
@@ -469,7 +469,7 @@ void tst_QCompleter::csMatchingOnCiSortedModel_data()
QTest::newRow("(p3,,c)") << "p3,,c" << "" << "" << "";
QTest::newRow("(p3,c0P3,)") << "p3,c0P3," << "" << "" << "";
QTest::newRow("(p,)") << "p," << "" << "" << "";
-
+
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
}
}
@@ -505,15 +505,18 @@ void tst_QCompleter::directoryModel_data()
#elif defined(Q_OS_WIN)
QTest::newRow("()") << "C" << "" << "C:" << "C:";
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
+#elif defined(Q_OS_SYMBIAN)
+ QTest::newRow("()") << "C" << "" << "C:" << "C:";
+ QTest::newRow("()") << "C:\\re" << "" << "resource" << "C:\\resource";
#elif defined (Q_OS_MAC)
QTest::newRow("()") << "" << "" << "/" << "/";
- QTest::newRow("(/a)") << "/a" << "" << "Applications" << "/Applications";
+ QTest::newRow("(/a)") << "/a" << "" << "Applications" << "/Applications";
QTest::newRow("(/d)") << "/d" << "" << "Developer" << "/Developer";
#else
QTest::newRow("()") << "" << "" << "/" << "/";
#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_OS_HPUX)
QTest::newRow("(/h)") << "/h" << "" << "home" << "/home";
-#endif
+#endif
QTest::newRow("(/et)") << "/et" << "" << "etc" << "/etc";
QTest::newRow("(/etc/passw)") << "/etc/passw" << "" << "passwd" << "/etc/passwd";
#endif
@@ -659,7 +662,7 @@ void tst_QCompleter::currentRow()
completer->setModelSorting(QCompleter::CaseInsensitivelySortedModel);
completer->setCaseSensitivity(Qt::CaseInsensitive);
setSourceModel(CASE_INSENSITIVELY_SORTED_MODEL);
-
+
// blank text
completer->setCompletionPrefix("");
QCOMPARE(completer->currentRow(), 0);
@@ -691,7 +694,7 @@ void tst_QCompleter::sortedEngineMapFromSource()
QModelIndex si1, si2, pi;
QAbstractItemModel *sourceModel = completer->model();
- const QAbstractProxyModel *completionModel =
+ const QAbstractProxyModel *completionModel =
qobject_cast<const QAbstractProxyModel *>(completer->completionModel());
// Fitering ON
@@ -762,7 +765,7 @@ void tst_QCompleter::unsortedEngineMapFromSource()
QModelIndex si, si2, si3, pi;
QAbstractItemModel *sourceModel = completer->model();
- const QAbstractProxyModel *completionModel =
+ const QAbstractProxyModel *completionModel =
qobject_cast<const QAbstractProxyModel *>(completer->completionModel());
si = sourceModel->index(6, completionColumn); // "P3"
@@ -844,7 +847,7 @@ void tst_QCompleter::historySearch()
completer->setCaseSensitivity(Qt::CaseSensitive);
setSourceModel(HISTORY_MODEL);
- const QAbstractProxyModel *completionModel =
+ const QAbstractProxyModel *completionModel =
qobject_cast<const QAbstractProxyModel *>(completer->completionModel());
// "p3,c3p3" and "p2,c4p2" are added in the tree root
@@ -1027,7 +1030,7 @@ void tst_QCompleter::dynamicSortOrder()
QCOMPARE(completer.completionCount(), 12);
completer.setCompletionPrefix("13");
QCOMPARE(completer.completionCount(), 2);
-
+
root->sortChildren(0, Qt::DescendingOrder);
completer.setCompletionPrefix("13");
QCOMPARE(completer.completionCount(), 2);
diff --git a/tests/auto/qcoreapplication/qcoreapplication.pro b/tests/auto/qcoreapplication/qcoreapplication.pro
index 64a4ad4134..27f5e58d6d 100644
--- a/tests/auto/qcoreapplication/qcoreapplication.pro
+++ b/tests/auto/qcoreapplication/qcoreapplication.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qcoreapplication.cpp
-
QT = core
-
-
diff --git a/tests/auto/qcryptographichash/qcryptographichash.pro b/tests/auto/qcryptographichash/qcryptographichash.pro
index 07d88574fa..aa9a7c49fd 100644
--- a/tests/auto/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/qcryptographichash/qcryptographichash.pro
@@ -1,6 +1,8 @@
load(qttest_p4)
-
SOURCES += tst_qcryptographichash.cpp
QT = core
-
+symbian*: {
+TARGET.EPOCSTACKSIZE =0x5000
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+}
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro
index 57d6804aab..b655db18c2 100644
--- a/tests/auto/qcssparser/qcssparser.pro
+++ b/tests/auto/qcssparser/qcssparser.pro
@@ -1,11 +1,14 @@
load(qttest_p4)
SOURCES += tst_cssparser.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += xml
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
-wince*: {
+wince*|symbian: {
addFiles.sources = testdata
addFiles.path = .
DEPLOYMENT += addFiles
}
+
diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp
index 7c4fac167a..28ba85ea6b 100644
--- a/tests/auto/qcssparser/tst_cssparser.cpp
+++ b/tests/auto/qcssparser/tst_cssparser.cpp
@@ -98,7 +98,7 @@ void tst_CssParser::scanner_data()
QTest::addColumn<QString>("input");
QTest::addColumn<QString>("output");
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QDir d(SRCDIR);
#else
QDir d(QDir::current());
@@ -843,7 +843,7 @@ private:
QDomDocument doc;
};
-Q_DECLARE_METATYPE(QDomDocument);
+Q_DECLARE_METATYPE(QDomDocument)
void tst_CssParser::marginValue_data()
{
diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro
index 40231ea8bb..317c3bfc27 100644
--- a/tests/auto/qdatastream/qdatastream.pro
+++ b/tests/auto/qdatastream/qdatastream.pro
@@ -1,8 +1,10 @@
load(qttest_p4)
SOURCES += tst_qdatastream.cpp
+!symbian: {
cross_compile: DEFINES += SVGFILE=\\\"tests2.svg\\\"
else: DEFINES += SVGFILE=\\\"gearflowers.svg\\\"
+}
# for qpaintdevicemetrics.h
contains(QT_CONFIG, qt3support):QT += qt3support
@@ -14,7 +16,14 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else {
+} else:symbian {
+ # SRCDIR and SVGFILE defined in code in symbian
+ addFiles.sources = datastream.q42 tests2.svg
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+ TARGET.EPOCHEAPSIZE = 1000000 10000000
+ DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
+}else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp
index d7ca7bc35c..544c8c314e 100644
--- a/tests/auto/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/qdatastream/tst_qdatastream.cpp
@@ -47,6 +47,13 @@
#endif
#include <QtSvg/QtSvg>
+#if defined(Q_OS_SYMBIAN)
+# define STRINGIFY(x) #x
+# define TOSTRING(x) STRINGIFY(x)
+# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
+#define SVGFILE "tests2.svg"
+#endif
+
Q_DECLARE_METATYPE(QBitArray)
Q_DECLARE_METATYPE(qint64)
@@ -2056,7 +2063,7 @@ static QRegion qRegionData(int index)
case 4: return QRegion(100, -100, 2048, 4096, QRegion::Rectangle);
case 5: return QRegion(-100, 100, 4096, 2048, QRegion::Rectangle);
case 6: return QRegion(0, 0, 0, 0, QRegion::Ellipse);
-#if !defined(Q_OS_UNIX) && !defined(Q_OS_WINCE) // all our Unix platforms use X regions.
+#if defined(Q_OS_SYMBIAN) || (!defined(Q_OS_UNIX) && !defined(Q_OS_WINCE)) // all our Unix platforms use X regions.
case 7: return QRegion(1, 2, 300, 400, QRegion::Ellipse);
case 8: return QRegion(100, 100, 1024, 768, QRegion::Ellipse);
case 9: return QRegion(-100, -100, 1024, 1024, QRegion::Ellipse);
@@ -2707,7 +2714,7 @@ void tst_QDataStream::status_charptr_QByteArray_data()
QTest::addColumn<int>("expectedStatus");
QTest::addColumn<QByteArray>("expectedString");
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
#ifdef QT3_SUPPORT
QByteArray oneMbMinus1(1024 * 1024 - 1);
#else
@@ -2725,7 +2732,7 @@ void tst_QDataStream::status_charptr_QByteArray_data()
QTest::newRow("size 3") << QByteArray("\x00\x00\x00\x03jkl", 7) << (int) QDataStream::Ok << QByteArray("jkl");
QTest::newRow("size 4") << QByteArray("\x00\x00\x00\x04jklm", 8) << (int) QDataStream::Ok << QByteArray("jklm");
QTest::newRow("size 4j") << QByteArray("\x00\x00\x00\x04jklmj", 8) << (int) QDataStream::Ok << QByteArray("jklm");
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTest::newRow("size 1MB-1") << QByteArray("\x00\x0f\xff\xff", 4) + oneMbMinus1 + QByteArray("j") << (int) QDataStream::Ok << oneMbMinus1;
QTest::newRow("size 1MB") << QByteArray("\x00\x10\x00\x00", 4) + oneMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << oneMbMinus1 + "j";
QTest::newRow("size 1MB+1") << QByteArray("\x00\x10\x00\x01", 4) + oneMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << oneMbMinus1 + "jk";
@@ -2745,7 +2752,7 @@ void tst_QDataStream::status_charptr_QByteArray_data()
QTest::newRow("badsize 2") << QByteArray("\x00\x00\x00\x02j", 5) << (int) QDataStream::ReadPastEnd << QByteArray();
QTest::newRow("badsize 3") << QByteArray("\x00\x00\x00\x03jk", 6) << (int) QDataStream::ReadPastEnd << QByteArray();
QTest::newRow("badsize 4") << QByteArray("\x00\x00\x00\x04jkl", 7) << (int) QDataStream::ReadPastEnd << QByteArray();
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTest::newRow("badsize 1MB") << QByteArray("\x00\x10\x00\x00", 4) + oneMbMinus1 << (int) QDataStream::ReadPastEnd << QByteArray();
QTest::newRow("badsize 1MB+1") << QByteArray("\x00\x10\x00\x01", 4) + oneMbMinus1 + QByteArray("j") << (int) QDataStream::ReadPastEnd << QByteArray();
QTest::newRow("badsize 3MB") << QByteArray("\x00\x30\x00\x00", 4) + threeMbMinus1 << (int) QDataStream::ReadPastEnd << QByteArray();
@@ -2819,7 +2826,7 @@ void tst_QDataStream::status_QString_data()
QTest::addColumn<int>("expectedStatus");
QTest::addColumn<QString>("expectedString");
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QString oneMbMinus1;
oneMbMinus1.resize(1024 * 1024 - 1);
for (int i = 0; i < oneMbMinus1.size(); ++i)
@@ -2837,7 +2844,7 @@ void tst_QDataStream::status_QString_data()
QTest::newRow("size 3") << QByteArray("\x00\x00\x00\x06\x00j\x00k\x00l", 10) << (int) QDataStream::Ok << QString("jkl");
QTest::newRow("size 4") << QByteArray("\x00\x00\x00\x08\x00j\x00k\x00l\x00m", 12) << (int) QDataStream::Ok << QString("jklm");
QTest::newRow("size 4j") << QByteArray("\x00\x00\x00\x08\x00j\x00k\x00l\x00mjj", 14) << (int) QDataStream::Ok << QString("jklm");
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTest::newRow("size 1MB-1") << QByteArray("\x00\x1f\xff\xfe", 4) + oneMbMinus1Data + QByteArray("jj") << (int) QDataStream::Ok << oneMbMinus1;
QTest::newRow("size 1MB") << QByteArray("\x00\x20\x00\x00", 4) + oneMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << oneMbMinus1 + "j";
QTest::newRow("size 1MB+1") << QByteArray("\x00\x20\x00\x02", 4) + oneMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << oneMbMinus1 + "jk";
@@ -2857,7 +2864,7 @@ void tst_QDataStream::status_QString_data()
QTest::newRow("badsize 2") << QByteArray("\x00\x00\x00\x04jj", 6) << (int) QDataStream::ReadPastEnd << QString();
QTest::newRow("badsize 3") << QByteArray("\x00\x00\x00\x06jjkk", 8) << (int) QDataStream::ReadPastEnd << QString();
QTest::newRow("badsize 4") << QByteArray("\x00\x00\x00\x08jjkkll", 10) << (int) QDataStream::ReadPastEnd << QString();
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTest::newRow("badsize 1MB") << QByteArray("\x00\x20\x00\x00", 4) + oneMbMinus1Data << (int) QDataStream::ReadPastEnd << QString();
QTest::newRow("badsize 1MB+1") << QByteArray("\x00\x20\x00\x02", 4) + oneMbMinus1Data + QByteArray("j") << (int) QDataStream::ReadPastEnd << QString();
QTest::newRow("badsize 3MB") << QByteArray("\x00\x60\x00\x00", 4) + threeMbMinus1Data << (int) QDataStream::ReadPastEnd << QString();
@@ -3086,9 +3093,22 @@ void tst_QDataStream::streamToAndFromQByteArray()
void tst_QDataStream::streamRealDataTypes()
{
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE)
+ // Note: Probably actually same 'qreal being typedeffed as float instead of double' issue as in Symbian
+ // instead of what CE skip message says.
QSKIP("Skipped on CE as it demands too much memory and fragments", SkipAll);
+#elif defined(Q_OS_SYMBIAN)
+ // qreal is typedeffed float in symbian instead of double like in most platforms, so reference stream
+ // gets corrupted. Basically this test is flawed, as one shouldn't use naked typedeffed types in
+ // streams that are meant to work cross-platform.
+ // As this test also tests other floating point using classes, we do not simply skip it, but work around
+ // the qreal issue by redefining qreal as double for the duration of this function.
+ // Note that streaming classes works because they do explicitly use double instead of qreal when
+ // writing/reading to/from stream.
+# define qreal double
+ qWarning("Note: streamRealDataTypes test redefines qreal as double in symbian!!!");
#endif
+
// Generate QPicture from SVG.
QSvgRenderer renderer(svgFile);
QVERIFY(renderer.isValid());
@@ -3206,6 +3226,9 @@ void tst_QDataStream::streamRealDataTypes()
QCOMPARE(cGrad, conicalBrush);
QCOMPARE(pen.widthF(), qreal(1.5));
}
+#if defined(Q_OS_SYMBIAN)
+ #undef qreal
+#endif
}
#ifdef QT3_SUPPORT
diff --git a/tests/auto/qdate/qdate.pro b/tests/auto/qdate/qdate.pro
index ea61c59b8c..6e2781b3d8 100644
--- a/tests/auto/qdate/qdate.pro
+++ b/tests/auto/qdate/qdate.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qdate.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 69d8a626ad..2f01d19a47 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -877,13 +877,13 @@ void tst_QDateTime::toTime_t_data()
QTest::addColumn<QString>("dateTimeStr");
QTest::addColumn<bool>("res");
- QTest::newRow( "data1" ) << str( 1800, 1, 1, 12, 0, 0 ) << FALSE;
- QTest::newRow( "data2" ) << str( 1969, 1, 1, 12, 0, 0 ) << FALSE;
- QTest::newRow( "data3" ) << str( 2002, 1, 1, 12, 0, 0 ) << TRUE;
- QTest::newRow( "data4" ) << str( 2002, 6, 1, 12, 0, 0 ) << TRUE;
- QTest::newRow( "data5" ) << QString("INVALID") << FALSE;
- QTest::newRow( "data6" ) << str( 2038, 1, 1, 12, 0, 0 ) << TRUE;
- QTest::newRow( "data7" ) << str( 2063, 4, 5, 12, 0, 0 ) << TRUE; // the day of First Contact
+ QTest::newRow( "data1" ) << str( 1800, 1, 1, 12, 0, 0 ) << false;
+ QTest::newRow( "data2" ) << str( 1969, 1, 1, 12, 0, 0 ) << false;
+ QTest::newRow( "data3" ) << str( 2002, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data4" ) << str( 2002, 6, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data5" ) << QString("INVALID") << false;
+ QTest::newRow( "data6" ) << str( 2038, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data7" ) << str( 2063, 4, 5, 12, 0, 0 ) << true; // the day of First Contact
QTest::newRow( "data8" ) << str( 2107, 1, 1, 12, 0, 0 )
<< bool( sizeof(uint) > 32 && sizeof(time_t) > 32 );
}
diff --git a/tests/auto/qdebug/qdebug.pro b/tests/auto/qdebug/qdebug.pro
index 57aac48e86..6e75a092e7 100644
--- a/tests/auto/qdebug/qdebug.pro
+++ b/tests/auto/qdebug/qdebug.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qdebug.cpp
-
QT = core
-
-
-
diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro
index 537b105bfa..3c96e85a38 100644
--- a/tests/auto/qdesktopservices/qdesktopservices.pro
+++ b/tests/auto/qdesktopservices/qdesktopservices.pro
@@ -5,4 +5,29 @@ TARGET = tst_qdesktopservices
include(../src/qdesktopservices.pri)
+symbian: {
+ dummy.sources = text\testfile.txt
+ dummy.path = .
+
+ text.sources = text\*
+ text.path = \data\others\
+
+ image.sources = image\*
+ image.path = \data\images\
+
+ audio.sources = audio\*
+ audio.path = \data\sounds\
+
+ video.sources = video\*
+ video.path = \data\videos\
+
+ install.sources = install\*
+ install.path = \data\installs\
+
+ DEPLOYMENT += image audio video install
+
+ # These are only needed for manual tests
+ #DEPLOYMENT += dummy text
+ }
+
diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
index 81b35ac1c9..467ae666e4 100644
--- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
@@ -45,6 +45,7 @@
#include <qdebug.h>
#include <qdesktopservices.h>
+//#define RUN_MANUAL_TESTS
//TESTED_CLASS=
//TESTED_FILES=
@@ -59,6 +60,17 @@ private slots:
void init();
void cleanup();
void openUrl();
+#ifdef Q_OS_SYMBIAN
+ // These test are manual ones, you need to check from device that
+ // correct system application is started with correct content
+ // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS
+ void openHttpUrl_data();
+ void openHttpUrl();
+ void openMailtoUrl_data();
+ void openMailtoUrl();
+ void openFileUrl_data();
+ void openFileUrl();
+#endif
void handlers();
void storageLocation_data();
void storageLocation();
@@ -97,6 +109,141 @@ void tst_qdesktopservices::openUrl()
#endif
}
+#ifdef Q_OS_SYMBIAN
+void tst_qdesktopservices::openHttpUrl_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<bool>("result");
+ QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true;
+ QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true;
+ QTest::newRow("BasicWithUserAndPw") << QUrl("http://s60prereleases:oslofjord@pepper.troll.no/s60prereleases/patches/") << true;
+ QTest::newRow("URL with space") << QUrl("http://www.manataka.org/Contents Page.html") << true;
+
+}
+
+void tst_qdesktopservices::openHttpUrl()
+{
+#ifndef RUN_MANUAL_TESTS
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+#endif
+
+ QFETCH(QUrl, url);
+ QFETCH(bool, result);
+ QCOMPARE(QDesktopServices::openUrl(url), result);
+ QTest::qWait(30000);
+}
+
+void tst_qdesktopservices::openMailtoUrl_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<bool>("result");
+
+ // http://en.wikipedia.org/wiki/E-mail_address
+ // RFC Valid e-mail addresses
+ QTest::newRow("Wiki valid email 1") << QUrl("mailto:abc@example.com") << true;
+ QTest::newRow("Wiki valid email 2") << QUrl("mailto:Abc@example.com") << true;
+ QTest::newRow("Wiki valid email 3") << QUrl("mailto:aBC@example.com") << true;
+ QTest::newRow("Wiki valid email 4") << QUrl("mailto:abc.123@example.com") << true;
+ QTest::newRow("Wiki valid email 5") << QUrl("mailto:1234567890@example.com") << true;
+ QTest::newRow("Wiki valid email 6") << QUrl("mailto:_______@example.com") << true;
+ QTest::newRow("Wiki valid email 7") << QUrl("mailto:abc+mailbox/department=shipping@example.com") << true;
+ // S60 email client considers the next URL invalid, even ity should be valid
+ QTest::newRow("Wiki valid email 8") << QUrl("mailto:!#$%&'*+-/=?^_`.{|}~@example.com") << true; // all of these characters are allowed
+ QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks
+ QTest::newRow("Wiki valid email 10") << QUrl("mailto:\"Fred \\\"quota\\\" Bloggs\"@example.com") << true; // however, quotes need escaping
+
+ // RFC invalid e-mail addresses
+ // These return true even though they are invalid, but check that user is notified about invalid URL in mail application
+ QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing
+ QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part
+ QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double
+ QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks
+ QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks
+
+ QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true;
+ QTest::newRow("BasicSeveralAddr") << QUrl("mailto:test@nokia.com,test2@nokia.com,test3@nokia.com") << true;
+ QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true;
+ QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true;
+
+ QTest::newRow("BasicAndCc") << QUrl("mailto:test@nokia.com?cc=mycc@address.com") << true;
+ QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true;
+ QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true;
+
+ // RFC examples, these are actually invalid because there is not host defined
+ // Check that user is notified about invalid URL in mail application
+ QTest::newRow("RFC2368 Example 1") << QUrl::fromEncoded("mailto:addr1%2C%20addr2") << true;
+ QTest::newRow("RFC2368 Example 2") << QUrl::fromEncoded("mailto:?to=addr1%2C%20addr2") << true;
+ QTest::newRow("RFC2368 Example 3") << QUrl("mailto:addr1?to=addr2") << true;
+
+ QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true;
+ QTest::newRow("RFC2368 Example 5") << QUrl("mailto:?to=joe@example.com&cc=bob@example.com&body=hello") << true;
+ QTest::newRow("RFC2368 Example 6") << QUrl("mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com") << true; // OpaqueData
+ QTest::newRow("RFC2368 Example 7") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index") << true;
+ QTest::newRow("RFC2368 Example 8") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue") << true;
+ QTest::newRow("RFC2368 Example 9") << QUrl("mailto:infobot@example.com?subject=current-issue") << true;
+ QTest::newRow("RFC2368 Example 10") << QUrl("mailto:chris@example.com") << true;
+
+ //QTest::newRow("RFC2368 Example 11 - illegal chars") << QUrl("mailto:joe@example.com?cc=bob@example.com?body=hello") << false;
+ QTest::newRow("RFC2368 Example 12") << QUrl::fromEncoded("mailto:gorby%25kremvax@example.com") << true; // encoded reserved chars '%'
+ QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?'
+}
+
+void tst_qdesktopservices::openMailtoUrl()
+{
+#ifndef RUN_MANUAL_TESTS
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+#endif
+
+ QFETCH(QUrl, url);
+ QFETCH(bool, result);
+ QCOMPARE(QDesktopServices::openUrl(url), result);
+}
+
+void tst_qdesktopservices::openFileUrl_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<bool>("result");
+
+ // Text files
+ QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true;
+ QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true;
+ QTest::newRow("text file") << QUrl("file:///c:/data/others/testfile.txt") << true;
+ QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true;
+
+ // Images
+ QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true;
+ QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true;
+ QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true;
+ QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true;
+
+ // Audio
+ QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true;
+ QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true;
+
+ // Video
+ QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true;
+
+ // Installs
+ QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true;
+
+ // Errors
+ QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false;
+}
+
+void tst_qdesktopservices::openFileUrl()
+{
+#ifndef RUN_MANUAL_TESTS
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+#endif
+
+ QFETCH(QUrl, url);
+ QFETCH(bool, result);
+ QCOMPARE(QDesktopServices::openUrl(url), result);
+ QTest::qWait(15000);
+}
+#endif
+
+
class MyUrlHandler : public QObject
{
Q_OBJECT
@@ -146,8 +293,64 @@ void tst_qdesktopservices::storageLocation_data()
void tst_qdesktopservices::storageLocation()
{
QFETCH(QDesktopServices::StandardLocation, location);
+#ifdef Q_OS_SYMBIAN
+ QString storageLocation = QDesktopServices::storageLocation(location);
+ QString displayName = QDesktopServices::displayName(location);
+ //qDebug( "displayName: %s", displayName );
+
+ storageLocation = storageLocation.toLower();
+ displayName = displayName.toLower();
+
+ QString drive = QDir::currentPath().left(2).toLower();
+ if( drive == "z:" )
+ drive = "c:";
+
+ switch(location) {
+ case QDesktopServices::DesktopLocation:
+ QCOMPARE( storageLocation, QString() );
+ break;
+ case QDesktopServices::DocumentsLocation:
+ QCOMPARE( storageLocation, drive + QString("/data") );
+ break;
+ case QDesktopServices::FontsLocation:
+ // Currently point always to ROM
+ QCOMPARE( storageLocation, QString("z:/resource/fonts") );
+ break;
+ case QDesktopServices::ApplicationsLocation:
+#ifdef Q_CC_NOKIAX86
+ QCOMPARE( storageLocation, QString("z:/sys/bin") );
+#else
+ QCOMPARE( storageLocation, drive + QString("/sys/bin") );
+#endif
+ break;
+ case QDesktopServices::MusicLocation:
+ QCOMPARE( storageLocation, drive + QString("/data/sounds") );
+ break;
+ case QDesktopServices::MoviesLocation:
+ QCOMPARE( storageLocation, drive + QString("/data/videos") );
+ break;
+ case QDesktopServices::PicturesLocation:
+ QCOMPARE( storageLocation, drive + QString("/data/images") );
+ break;
+ case QDesktopServices::TempLocation:
+ QCOMPARE( storageLocation, QDir::tempPath().toLower());
+ break;
+ case QDesktopServices::HomeLocation:
+ QCOMPARE( storageLocation, QDir::homePath().toLower());
+ break;
+ case QDesktopServices::DataLocation:
+ // Just check the folder not the drive
+ QCOMPARE( storageLocation.mid(2), QDir::currentPath().mid(2).toLower());
+ break;
+ default:
+ QCOMPARE( storageLocation, QString() );
+ break;
+ }
+
+#else
QDesktopServices::storageLocation(location);
QDesktopServices::displayName(location);
+#endif
}
diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro
index 404a1374fe..8fe5d839b0 100644
--- a/tests/auto/qdir/qdir.pro
+++ b/tests/auto/qdir/qdir.pro
@@ -8,6 +8,15 @@ wince*:{
QT = core
DEFINES += SRCDIR=\\\"\\\"
+} symbian:{
+ DirFiles.sources = testdir testdata searchdir resources entrylist types tst_qdir.cpp
+ DirFiles.path = .
+ DEPLOYMENT += DirFiles
+
+ QT = core
+ TARGET.CAPABILITY += AllFiles
+
+ DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
QT = core
contains(QT_CONFIG, qt3support):QT += qt3support
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 91ce5b3f42..19fee409fe 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -48,10 +48,13 @@
#include <qfileinfo.h>
#include <qregexp.h>
#include <qstringlist.h>
-
#include "../network-settings.h"
-
+#if defined(Q_OS_SYMBIAN)
+# define STRINGIFY(x) #x
+# define TOSTRING(x) STRINGIFY(x)
+# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
+#endif
//TESTED_CLASS=
//TESTED_FILES=
@@ -196,7 +199,7 @@ void tst_QDir::setPath_data()
QTest::addColumn<QString>("dir2");
QTest::newRow("data0") << QString(".") << QString("..");
-#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("data1") << QString("c:/") << QDir::currentPath();
#endif
}
@@ -293,7 +296,7 @@ void tst_QDir::exists_data()
QTest::newRow("simple dir") << SRCDIR "resources" << true;
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << true;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
@@ -303,7 +306,8 @@ void tst_QDir::exists_data()
QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
-
+#endif
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("This drive should exist") << "C:/" << true;
// find a non-existing drive and check if it does not exist
QFileInfoList drives = QFSFileEngine::drives();
@@ -339,7 +343,7 @@ void tst_QDir::isRelativePath_data()
QTest::addColumn<bool>("relative");
QTest::newRow("data0") << "../somedir" << true;
-#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("data1") << "C:/sOmedir" << false;
#endif
QTest::newRow("data2") << "somedir" << true;
@@ -536,17 +540,61 @@ void tst_QDir::entryList()
QFile::remove(SRCDIR "entrylist/brokenlink.lnk");
QFile::remove(SRCDIR "entrylist/brokenlink");
- // WinCE does not have . and .. in the directory listing
-#ifdef Q_OS_WINCE
+ // WinCE/Symbian does not have . and .. in the directory listing
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
expected.removeAll(".");
expected.removeAll("..");
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
// ### Sadly, this is a platform difference right now.
QFile::link(SRCDIR "entryList/file", SRCDIR "entrylist/linktofile.lnk");
QFile::link(SRCDIR "entryList/directory", SRCDIR "entrylist/linktodirectory.lnk");
QFile::link(SRCDIR "entryList/nothing", SRCDIR "entrylist/brokenlink.lnk");
+#elif defined(Q_OS_SYMBIAN)
+ // Symbian doesn't support links to directories
+ expected.removeAll("linktodirectory.lnk");
+
+ // Expecting failures from a couple of OpenC bugs. Do checks only once.
+ static int xFailChecked = false;
+ static int expectedFail1 = false;
+ static int expectedFail2 = false;
+
+ if (!expectedFail1) {
+ // Can't create link if file doesn't exist in symbian, so create file temporarily,
+ // But only if testing for
+ QFile tempFile(SRCDIR "entryList/nothing");
+ tempFile.open(QIODevice::WriteOnly);
+ tempFile.link(SRCDIR "entryList/brokenlink.lnk");
+ tempFile.remove();
+ }
+
+ if (!expectedFail2) {
+ QFile::link(SRCDIR "entryList/file", SRCDIR "entrylist/linktofile.lnk");
+ }
+
+ if (!xFailChecked) {
+ // ### Until OpenC supports stat correctly for symbolic links, expect them to fail.
+ expectedFail1 = QFileInfo(SRCDIR "entryList/brokenlink.lnk").exists();
+ expectedFail2 = !(QFileInfo(SRCDIR "entryList/linktofile.lnk").isFile());
+
+ QEXPECT_FAIL("", "OpenC bug, stat for broken links returns normally, when it should return error.", Continue);
+ QVERIFY(!expectedFail1);
+
+ QEXPECT_FAIL("", "OpenC bug, stat for file links doesn't indicate them as such.", Continue);
+ QVERIFY(!expectedFail2);
+ xFailChecked = true;
+ }
+
+ if (expectedFail1) {
+ expected.removeAll("brokenlink.lnk");
+ QFile::remove(SRCDIR "entrylist/brokenlink.lnk");
+ }
+
+ if (expectedFail2) {
+ expected.removeAll("linktofile.lnk");
+ QFile::remove(SRCDIR "entrylist/linktofile.lnk");
+ }
#else
QFile::link("file", SRCDIR "entrylist/linktofile.lnk");
QFile::link("directory", SRCDIR "entrylist/linktodirectory.lnk");
@@ -570,12 +618,16 @@ void tst_QDir::entryList()
// lock up. The actual result depends on the file system.
return;
}
-
for (int i=0; i<max; ++i)
QCOMPARE(actual[i], expected[i]);
QCOMPARE(actual.count(), expected.count());
+#if defined(Q_OS_SYMBIAN)
+ // Test cleanup on device requires setting the permissions back to normal
+ QFile(SRCDIR "entrylist/file").setPermissions(QFile::WriteUser | QFile::ReadUser);
+#endif
+
QFile::remove(SRCDIR "entrylist/writable");
QFile::remove(SRCDIR "entrylist/linktofile");
QFile::remove(SRCDIR "entrylist/linktodirectory");
@@ -591,7 +643,7 @@ void tst_QDir::entryListSimple_data()
QTest::addColumn<int>("countMin");
QTest::newRow("data2") << "do_not_expect_this_path_to_exist/" << 0;
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QTest::newRow("simple dir") << SRCDIR "resources" << 0;
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << 0;
#else
@@ -630,19 +682,28 @@ void tst_QDir::entryListWithSymLinks()
QDir dir;
dir.mkdir("myDir");
QFile("testfile.cpp").open(QIODevice::WriteOnly);
+#if !defined(Q_OS_SYMBIAN)
QVERIFY(QFile::link("myDir", "myLinkToDir.lnk"));
+#endif
QVERIFY(QFile::link("testfile.cpp", "myLinkToFile.lnk"));
{
QStringList entryList = QDir().entryList();
QVERIFY(entryList.contains("myDir"));
+#if !defined(Q_OS_SYMBIAN)
QVERIFY(entryList.contains("myLinkToDir.lnk"));
+#endif
QVERIFY(entryList.contains("myLinkToFile.lnk"));
}
{
QStringList entryList = QDir().entryList(QDir::Dirs);
QVERIFY(entryList.contains("myDir"));
+#if !defined(Q_OS_SYMBIAN)
QVERIFY(entryList.contains("myLinkToDir.lnk"));
+#endif
+#if defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "OpenC stat for symlinks is buggy.", Continue);
+#endif
QVERIFY(!entryList.contains("myLinkToFile.lnk"));
}
{
@@ -704,7 +765,7 @@ void tst_QDir::canonicalPath()
QFETCH(QString, canonicalPath);
QDir dir(path);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QCOMPARE(dir.canonicalPath().toLower(), canonicalPath.toLower());
#else
QCOMPARE(dir.canonicalPath(), canonicalPath);
@@ -759,7 +820,7 @@ void tst_QDir::current()
if (!currentDir.isEmpty()) {
QDir newCurrent = QDir::current();
QDir::setCurrent(oldDir);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower());
#else
QCOMPARE(newCurrent.absolutePath(), currentDir);
@@ -780,7 +841,7 @@ void tst_QDir::cd_data()
int index = appPath.lastIndexOf("/");
QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index);
QTest::newRow("noChange") << QDir::currentPath() << "." << true << appPath;
-#ifdef Q_OS_WIN // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root
QTest::newRow("absolute") << QDir::currentPath() << "/" << true << "/";
#else
QTest::newRow("absolute") << QDir::currentPath() << "/" << true << QDir::root().absolutePath();
@@ -859,7 +920,7 @@ tst_QDir::cleanPath_data()
QTest::newRow("data3") << QDir::cleanPath("../.") << "..";
QTest::newRow("data4") << QDir::cleanPath("../..") << "../..";
#if !defined(Q_OS_WINCE)
-#if defined Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QTest::newRow("data5") << "d:\\a\\bc\\def\\.." << "d:/a/bc";
QTest::newRow("data6") << "d:\\a\\bc\\def\\../../.." << "d:/";
#else
@@ -912,10 +973,12 @@ void tst_QDir::absolutePath_data()
QTest::addColumn<QString>("expectedPath");
QTest::newRow("0") << "/machine/share/dir1" << "/machine/share/dir1";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("1") << "\\machine\\share\\dir1" << "/machine/share/dir1";
+# if !defined(Q_OS_SYMBIAN)
QTest::newRow("2") << "//machine/share/dir1" << "//machine/share/dir1";
QTest::newRow("3") << "\\\\machine\\share\\dir1" << "//machine/share/dir1";
+# endif
QTest::newRow("4") << "c:/machine/share/dir1" << "c:/machine/share/dir1";
QTest::newRow("5") << "c:\\machine\\share\\dir1" << "c:/machine/share/dir1";
#endif
@@ -952,7 +1015,7 @@ void tst_QDir::relativeFilePath_data()
QTest::newRow("11") << "" << "" << "";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("12") << "C:/foo/bar" << "ding" << "ding";
QTest::newRow("13") << "C:/foo/bar" << "C:/ding/dong" << "../../ding/dong";
QTest::newRow("14") << "C:/foo/bar" << "/ding/dong" << "../../ding/dong";
@@ -971,10 +1034,12 @@ void tst_QDir::relativeFilePath_data()
QTest::newRow("22") << "C:" << "D:/" << "D:/";
QTest::newRow("23") << "C:/" << "D:" << "D:";
QTest::newRow("24") << "C:/" << "D:/" << "D:/";
+# if !defined(Q_OS_SYMBIAN)
QTest::newRow("25") << "C:/foo/bar" << "//anotherHost/foo/bar" << "//anotherHost/foo/bar";
QTest::newRow("26") << "//anotherHost/foo" << "//anotherHost/foo/bar" << "bar";
QTest::newRow("27") << "//anotherHost/foo" << "bar" << "bar";
QTest::newRow("28") << "//anotherHost/foo" << "C:/foo/bar" << "C:/foo/bar";
+# endif
#endif
}
@@ -1031,7 +1096,8 @@ void tst_QDir::rename()
QVERIFY(dir.rename("rename-test-renamed", "rename-test"));
#if defined(Q_OS_MAC)
QVERIFY(!dir.rename("rename-test", "/etc/rename-test-renamed"));
-#elif !defined(Q_OS_WIN) // on windows this is possible maybe make the test a bit better
+#elif !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+ // on windows/symbian this is possible - maybe make the test a bit better
QVERIFY(!dir.rename("rename-test", "/rename-test-renamed"));
#endif
QVERIFY(dir.remove("rename-test"));
@@ -1080,7 +1146,7 @@ void tst_QDir::dirName_data()
QTest::newRow("slash0") << "c:/winnt/system32" << "system32";
QTest::newRow("slash1") << "/winnt/system32" << "system32";
QTest::newRow("slash2") << "c:/winnt/system32/kernel32.dll" << "kernel32.dll";
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QTest::newRow("bslash0") << "c:\\winnt\\system32" << "system32";
QTest::newRow("bslash1") << "\\winnt\\system32" << "system32";
QTest::newRow("bslash2") << "c:\\winnt\\system32\\kernel32.dll" << "kernel32.dll";
@@ -1105,8 +1171,8 @@ void tst_QDir::operator_eq()
void tst_QDir::dotAndDotDot()
{
-#ifdef Q_OS_WINCE
- QSKIP("WinCE does not have . nor ..", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("WinCE and Symbian do not have . nor ..", SkipAll);
#endif
QDir dir(QString(SRCDIR "testdir/"));
QStringList entryList = dir.entryList(QDir::Dirs);
@@ -1147,7 +1213,7 @@ void tst_QDir::homePath()
#ifdef Q_OS_UNIX
if (strHome.length() > 1) // root dir = "/"
QVERIFY(!strHome.endsWith('/'));
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (strHome.length() > 3) // root dir = "c:/"; "//" is not really valid...
QVERIFY(!strHome.endsWith('/'));
#endif
@@ -1171,7 +1237,7 @@ void tst_QDir::tempPath()
#ifdef Q_OS_UNIX
if (path.length() > 1) // root dir = "/"
QVERIFY(!path.endsWith('/'));
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (path.length() > 3) // root dir = "c:/"; "//" is not really valid...
QVERIFY(!path.endsWith('/'));
#endif
@@ -1186,14 +1252,14 @@ void tst_QDir::rootPath()
QCOMPARE(path, dir.absolutePath());
QVERIFY(QDir::isAbsolutePath(path));
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QCOMPARE(path, QString("/"));
#endif
}
void tst_QDir::nativeSeparators()
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QCOMPARE(QDir::toNativeSeparators(QLatin1String("/")), QString("\\"));
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("/")), QString("/"));
diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro
index 2db6617585..ece886cbcb 100644
--- a/tests/auto/qdiriterator/qdiriterator.pro
+++ b/tests/auto/qdiriterator/qdiriterator.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qdiriterator.cpp
RESOURCES += qdiriterator.qrc
QT = core
-wince*: {
+wince*|symbian*: {
addFiles.sources = entrylist recursiveDirs foo
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index 6aa1d95ffb..af23625ac6 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -87,7 +87,7 @@ tst_QDirIterator::tst_QDirIterator()
QFile::remove("entrylist/directory/entrylist3.lnk");
QFile::remove("entrylist/directory/entrylist4.lnk");
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// ### Sadly, this is a platform difference right now.
QFile::link("entrylist/file", "entrylist/linktofile.lnk");
QFile::link("entrylist/directory", "entrylist/linktodirectory.lnk");
@@ -182,6 +182,11 @@ void tst_QDirIterator::iterateRelativeDirectory()
QFETCH(QStringList, nameFilters);
QFETCH(QStringList, entries);
+#if defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("no flags", "Symlink to directories is currently unsupported by Open C", Continue);
+ QEXPECT_FAIL("QDir::Subdirectories | QDir::FollowSymlinks", "Symlink to directories is currently unsupported by Open C", Continue);
+#endif // defined(Q_OS_SYMBIAN)
+
QDirIterator it(dirName, nameFilters, filters, flags);
QStringList iteratorList;
while (it.hasNext())
diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro
index 2bf07734e3..6b3a707d5c 100644
--- a/tests/auto/qdirmodel/qdirmodel.pro
+++ b/tests/auto/qdirmodel/qdirmodel.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qdirmodel.cpp
-wince*: {
+wince*|symbian: {
addit.sources = dirtest\test1\*
addit.path = dirtest\test1
tests.sources = test\*
@@ -9,8 +9,13 @@ wince*: {
sourceFile.sources = tst_qdirmodel.cpp
sourceFile.path = .
DEPLOYMENT += addit tests sourceFile
- DEFINES += SRCDIR=\\\"./\\\"
+}
+
+wince*: {
+ DEFINES += SRCDIR=\\\"./\\\"
+} symbian: {
+ DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp
index 2084535c0b..c4ff046183 100644
--- a/tests/auto/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp
@@ -50,6 +50,12 @@
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+# define STRINGIFY(x) #x
+# define TOSTRING(x) STRINGIFY(x)
+# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
+#endif
+
class tst_QDirModel : public QObject
{
Q_OBJECT
@@ -89,7 +95,7 @@ private slots:
void rmdir_data();
void rmdir();
-
+
void filePath();
void hidden();
@@ -292,7 +298,7 @@ void tst_QDirModel::mkdir_data()
QTest::newRow("nameWithSpace") << QString("ab cd") << true << 2;
QTest::newRow("emptyDirName") << QString("") << false << 1;
QTest::newRow("nullDirName") << QString() << false << 1;
-
+
/*
QTest::newRow("recursiveDirName") << QString("test2/test3") << false << false;
QTest::newRow("singleDotDirName") << QString("./test3") << true << true;
@@ -449,7 +455,7 @@ bool tst_QDirModel::rowsAboutToBeRemoved_cleanup(const QString &test_path)
QString path = QDir::currentPath() + "/" + test_path;
QDir dir(path, "*", QDir::SortFlags(QDir::Name|QDir::IgnoreCase), QDir::Files);
QStringList files = dir.entryList();
-
+
for (int i = 0; i < files.count(); ++i) {
if (!dir.remove(files.at(i))) {
qDebug() << "failed to remove file" << files.at(i);
@@ -481,14 +487,14 @@ void tst_QDirModel::rowsAboutToBeRemoved()
qRegisterMetaType<QModelIndex>("QModelIndex");
- // NOTE: QDirModel will call refres() when a file is removed. refresh() will reread the entire directory,
+ // NOTE: QDirModel will call refresh() when a file is removed. refresh() will reread the entire directory,
// and emit layoutAboutToBeChanged and layoutChange. So, instead of checking for
// rowsAboutToBeRemoved/rowsRemoved we check for layoutAboutToBeChanged/layoutChanged
QSignalSpy spy(&model, SIGNAL(layoutAboutToBeChanged()));
QModelIndex parent = model.index(test_path);
QVERIFY(parent.isValid());
-
+
// remove the file
{
QModelIndex index = model.index(remove_row, 0, parent);
@@ -580,6 +586,13 @@ void tst_QDirModel::filePath()
model.setResolveSymlinks(false);
QModelIndex index = model.index(SRCDIR "test.lnk");
QVERIFY(index.isValid());
+#if defined(Q_OS_SYMBIAN)
+ // Since model will force lowercase path in Symbian, make case insensitive compare
+ // Note: Windows should fail this, too, if test path has any uppercase letters.
+ QCOMPARE(model.filePath(index).toLower(), QString(SRCDIR).toLower() + "test.lnk");
+ model.setResolveSymlinks(true);
+ QCOMPARE(model.filePath(index).toLower(), QString(SRCDIR).toLower() + "tst_qdirmodel.cpp");
+#else
#ifndef Q_OS_WINCE
QString path = SRCDIR;
#else
@@ -588,6 +601,7 @@ void tst_QDirModel::filePath()
QCOMPARE(model.filePath(index), path + QString( "test.lnk"));
model.setResolveSymlinks(true);
QCOMPARE(model.filePath(index), path + QString( "tst_qdirmodel.cpp"));
+#endif
QFile::remove(SRCDIR "test.lnk");
}
@@ -596,14 +610,14 @@ void tst_QDirModel::task196768_sorting()
//this task showed that the persistent model indexes got corrupted when sorting
QString path = SRCDIR;
- QDirModel model;
+ QDirModel model;
QTreeView view;
QPersistentModelIndex index = model.index(path);
view.setModel(&model);
QModelIndex index2 = model.index(path);
QCOMPARE(index.data(), index2.data());
- view.setRootIndex(index);
+ view.setRootIndex(index);
index2 = model.index(path);
QCOMPARE(index.data(), index2.data());
view.setCurrentIndex(index);
diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro
index 5466dfa537..9a9bcbbea7 100644
--- a/tests/auto/qdom/qdom.pro
+++ b/tests/auto/qdom/qdom.pro
@@ -4,10 +4,12 @@ SOURCES += tst_qdom.cpp
QT = core xml
QT -= gui
-wince*: {
+wince*|symbian*: {
addFiles.sources = testdata doubleNamespaces.xml umlaut.xml
addFiles.path = .
DEPLOYMENT += addFiles
DEPLOYMENT_PLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
}
+
+symbian: TARGET.EPOCHEAPSIZE="0x100000 0x1000000"
diff --git a/tests/auto/qevent/qevent.pro b/tests/auto/qevent/qevent.pro
index 219f97e1a7..5c142996f1 100644
--- a/tests/auto/qevent/qevent.pro
+++ b/tests/auto/qevent/qevent.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qevent.cpp
QT = core
-
-
-
diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp
index d7e458bfed..a4017b8df0 100644
--- a/tests/auto/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/qeventloop/tst_qeventloop.cpp
@@ -54,6 +54,11 @@
#include <QTcpServer>
#include <QTcpSocket>
+#ifdef Q_OS_SYMBIAN
+#include <e32base.h>
+#include <unistd.h>
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -186,6 +191,10 @@ public slots:
void init();
void cleanup();
private slots:
+ // This test *must* run first. See the definition for why.
+ void onlySymbianActiveScheduler();
+ void symbianNestedActiveSchedulerLoop_data();
+ void symbianNestedActiveSchedulerLoop();
void processEvents();
void exec();
void exit();
@@ -213,6 +222,99 @@ void tst_QEventLoop::init()
void tst_QEventLoop::cleanup()
{ }
+class OnlySymbianActiveScheduler_helper : public QObject
+{
+ Q_OBJECT
+
+public:
+ OnlySymbianActiveScheduler_helper(int fd, QTimer *zeroTimer)
+ : fd(fd),
+ timerCount(0),
+ zeroTimer(zeroTimer),
+ zeroTimerCount(0),
+ notifierCount(0)
+ {
+ }
+ ~OnlySymbianActiveScheduler_helper() {}
+
+public slots:
+ void timerSlot()
+ {
+ // Let all the events occur twice so we know they reactivated after
+ // each occurrence.
+ if (++timerCount >= 2) {
+ // This will hopefully run last, so stop the active scheduler.
+ CActiveScheduler::Stop();
+ }
+ }
+ void zeroTimerSlot()
+ {
+ if (++zeroTimerCount >= 2) {
+ zeroTimer->stop();
+ }
+ }
+ void notifierSlot()
+ {
+ if (++notifierCount >= 2) {
+ char dummy;
+ ::read(fd, &dummy, 1);
+ }
+ }
+
+private:
+ int fd;
+ int timerCount;
+ QTimer *zeroTimer;
+ int zeroTimerCount;
+ int notifierCount;
+};
+
+void tst_QEventLoop::onlySymbianActiveScheduler() {
+#ifndef Q_OS_SYMBIAN
+ QSKIP("This is a Symbian-only test.", SkipAll);
+#else
+ // In here we try to use timers and sockets exclusively using the Symbian
+ // active scheduler and no processEvents().
+ // This test should therefore be run first, so that we can verify that
+ // the first occurrence of processEvents does not do any initalization that
+ // we depend on.
+
+ // Open up a pipe so we can test socket notifiers.
+ int pipeEnds[2];
+ if (::pipe(pipeEnds) != 0) {
+ QFAIL("Could not open pipe");
+ }
+ QSocketNotifier notifier(pipeEnds[0], QSocketNotifier::Read);
+ QSignalSpy notifierSpy(&notifier, SIGNAL(activated(int)));
+ char dummy = 1;
+ ::write(pipeEnds[1], &dummy, 1);
+
+ QTimer zeroTimer;
+ QSignalSpy zeroTimerSpy(&zeroTimer, SIGNAL(timeout()));
+ zeroTimer.setInterval(0);
+ zeroTimer.start();
+
+ QTimer timer;
+ QSignalSpy timerSpy(&timer, SIGNAL(timeout()));
+ timer.setInterval(2000); // Generous timeout or this test will fail if there is high load
+ timer.start();
+
+ OnlySymbianActiveScheduler_helper helper(pipeEnds[0], &zeroTimer);
+ connect(&notifier, SIGNAL(activated(int)), &helper, SLOT(notifierSlot()));
+ connect(&zeroTimer, SIGNAL(timeout()), &helper, SLOT(zeroTimerSlot()));
+ connect(&timer, SIGNAL(timeout()), &helper, SLOT(timerSlot()));
+
+ CActiveScheduler::Start();
+
+ ::close(pipeEnds[1]);
+ ::close(pipeEnds[0]);
+
+ QCOMPARE(notifierSpy.count(), 2);
+ QCOMPARE(zeroTimerSpy.count(), 2);
+ QCOMPARE(timerSpy.count(), 2);
+#endif
+}
+
void tst_QEventLoop::processEvents()
{
QSignalSpy spy1(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()));
@@ -512,7 +614,7 @@ void tst_QEventLoop::processEventsExcludeTimers()
// normal process events will send timers
eventLoop.processEvents(QEventLoop::X11ExcludeTimers);
-#ifndef Q_OS_UNIX
+#if !defined(Q_OS_UNIX) || defined(Q_OS_SYMBIAN)
QEXPECT_FAIL("", "X11ExcludeTimers only works on UN*X", Continue);
#endif
QCOMPARE(timerReceiver.gotTimerEvent, -1);
@@ -524,210 +626,163 @@ void tst_QEventLoop::processEventsExcludeTimers()
timerReceiver.gotTimerEvent = -1;
}
-QTEST_MAIN(tst_QEventLoop)
-#include "tst_qeventloop.moc"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#ifdef Q_OS_SYMBIAN
+class DummyActiveObject : public CActive
+{
+public:
+ DummyActiveObject(int levels);
+ ~DummyActiveObject();
+ void Start();
+protected:
+ void DoCancel();
+ void RunL();
+public:
+ bool succeeded;
+private:
+ RTimer m_rTimer;
+ int remainingLevels;
+};
+class ActiveSchedulerLoop : public QObject
+{
+public:
+ ActiveSchedulerLoop(int levels) : succeeded(false), timerId(-1), remainingLevels(levels) {}
+ ~ActiveSchedulerLoop() {}
+ void timerEvent(QTimerEvent *e);
+public:
+ bool succeeded;
+ int timerId;
+ int remainingLevels;
+};
+DummyActiveObject::DummyActiveObject(int levels)
+ : CActive(CActive::EPriorityStandard),
+ succeeded(false),
+ remainingLevels(levels)
+{
+ m_rTimer.CreateLocal();
+}
+DummyActiveObject::~DummyActiveObject()
+{
+ Cancel();
+ m_rTimer.Close();
+}
+void DummyActiveObject::DoCancel()
+{
+ m_rTimer.Cancel();
+}
+void DummyActiveObject::RunL()
+{
+ if (remainingLevels - 1 <= 0) {
+ ActiveSchedulerLoop loop(remainingLevels - 1);
+ loop.timerId = loop.startTimer(0);
+ QCoreApplication::processEvents();
+ succeeded = loop.succeeded;
+ } else {
+ succeeded = true;
+ }
+ CActiveScheduler::Stop();
+}
-// previous test
+void DummyActiveObject::Start()
+{
+ m_rTimer.After(iStatus, 100000); // 100 ms
+ SetActive();
+}
-#if 0
+void ActiveSchedulerLoop::timerEvent(QTimerEvent *e)
+{
+ Q_UNUSED(e);
+ DummyActiveObject *dummy = new(ELeave) DummyActiveObject(remainingLevels);
+ CActiveScheduler::Add(dummy);
-#include <qwidget.h>
+ dummy->Start();
-#ifdef Q_WS_WIN
-#include <windows.h>
-#endif
+ CActiveScheduler::Start();
+ succeeded = dummy->succeeded;
+ delete dummy;
-//TESTED_CLASS=
-//TESTED_FILES=
+ killTimer(timerId);
+}
-class EventHandlerWidget : public QWidget
+// We cannot trap panics when the test case fails, so run it in a different thread instead.
+class ActiveSchedulerThread : public QThread
{
public:
- EventHandlerWidget( QWidget* parent = 0, const char* name = 0 ) : QWidget( parent, name )
- {
- installEventFilter( this );
- recievedPaintEvent = FALSE;
- recievedMouseEvent = FALSE;
- }
- ~EventHandlerWidget() {}
-
- bool recievedPaintEvent;
- bool recievedMouseEvent;
+ ActiveSchedulerThread(QEventLoop::ProcessEventsFlag flags);
+ ~ActiveSchedulerThread();
protected:
- bool eventFilter( QObject* o, QEvent* e )
- {
- if ( e->type() == QEvent::Paint )
- recievedPaintEvent = TRUE;
- else if ( e->type() == QEvent::MouseButtonPress )
- recievedMouseEvent = TRUE;
- return QWidget::eventFilter( o, e );
- }
-};
+ void run();
-class InBetweenObject : public QObject
-{
- Q_OBJECT
public:
- InBetweenObject(QObject *parent, QObject *child)
- : QObject(parent), childObject(child)
- {
- childObject->setParent(this);
- ++instanceCounter;
- }
-
- ~InBetweenObject()
- {
- --instanceCounter;
- }
-
- static int instanceCounter;
-
-protected:
- void childEvent(QChildEvent *e)
- {
- if (e->removed() && e->child() == childObject) {
- deleteLater();
- }
- }
+ volatile bool succeeded;
private:
- QObject *childObject;
-};
-
-class ObjectContainer : public QObject
-{
-public:
- ObjectContainer(QObject *parent = 0)
- : QObject(parent)
- {
- }
-
-protected:
- void childEvent(QChildEvent *e)
- {
- if (e->inserted() && !::qobject_cast<InBetweenObject*>(e->child())) {
- InBetweenObject *inBetween = new InBetweenObject(this, e->child());
- }
- }
-};
-
-class tst_QEventLoop : public QObject
-{
- Q_OBJECT
-public:
- tst_QEventLoop();
- ~tst_QEventLoop();
-public slots:
- void init();
- void cleanup();
-private slots:
- void processEvents();
- void eventHandlerPostsEvent();
+ QEventLoop::ProcessEventsFlag m_flags;
};
-tst_QEventLoop::tst_QEventLoop()
+ActiveSchedulerThread::ActiveSchedulerThread(QEventLoop::ProcessEventsFlag flags)
+ : succeeded(false),
+ m_flags(flags)
{
}
-tst_QEventLoop::~tst_QEventLoop()
+ActiveSchedulerThread::~ActiveSchedulerThread()
{
}
-void tst_QEventLoop::init()
+void ActiveSchedulerThread::run()
{
-}
+ ActiveSchedulerLoop loop(2);
+ loop.timerId = loop.startTimer(0);
+ // It may panic in here if the active scheduler and the Qt loop don't go together.
+ QCoreApplication::processEvents(m_flags);
-void tst_QEventLoop::cleanup()
-{
+ succeeded = loop.succeeded;
}
+#endif // ifdef Q_OS_SYMBIAN
-
-void tst_QEventLoop::processEvents()
+void tst_QEventLoop::symbianNestedActiveSchedulerLoop_data()
{
- EventHandlerWidget *mainWidget = new EventHandlerWidget( 0 );
- mainWidget->show();
- qApp->setMainWidget( mainWidget );
-
-#ifdef Q_WS_WIN
- QEventLoop* eventLoop = qApp->eventLoop();
- eventLoop->processEvents( QEventLoop::AllEvents );
- QVERIFY( !eventLoop->hasPendingEvents() );
+ QTest::addColumn<int>("processEventFlags");
- // Make sure the flag is cleared first
- mainWidget->recievedPaintEvent = FALSE;
-#ifdef Q_WS_WIN
- InvalidateRect( mainWidget->winId(), 0, TRUE );
-#endif
- QVERIFY( !mainWidget->recievedPaintEvent );
- eventLoop->processEvents( QEventLoop::AllEvents );
- QVERIFY( mainWidget->recievedPaintEvent );
-
-#ifdef Q_WS_WIN
- // TODO: Hardcoded for now...
- LPARAM lParam = MAKELPARAM( 10, 10 );
- PostMessage( mainWidget->winId(), WM_LBUTTONDOWN, 0, lParam );
-#endif
-
- mainWidget->recievedMouseEvent = FALSE;
- eventLoop->processEvents( QEventLoop::ExcludeUserInput );
- QVERIFY( !mainWidget->recievedMouseEvent );
-#else
- QSKIP( "QEventLoop test is not implememented on X11 yet", SkipAll);
-#endif
+ QTest::newRow("AllEvents") << (int)QEventLoop::AllEvents;
+ QTest::newRow("WaitForMoreEvents") << (int)QEventLoop::WaitForMoreEvents;
}
-int InBetweenObject::instanceCounter = 0;
-
-void tst_QEventLoop::eventHandlerPostsEvent()
+/*
+ Before you start fiddling with this test, you should have a good understanding of how
+ Symbian active objects work. What the test does is to try to screw up the semaphore count
+ in the active scheduler to cause stray signals, by running the Qt event loop and the
+ active scheduler inside each other. Naturally, its attempts to do this should be futile!
+*/
+void tst_QEventLoop::symbianNestedActiveSchedulerLoop()
{
- ObjectContainer container;
-
- QObject *object = new QObject(&container);
- qApp->processEvents();
- qApp->processEvents();
-
- QCOMPARE(InBetweenObject::instanceCounter, 1);
+#ifndef Q_OS_SYMBIAN
+ QSKIP("This is a Symbian only test.", SkipAll);
+#else
+ QFETCH(int, processEventFlags);
- object->deleteLater();
+ ActiveSchedulerThread thread((QEventLoop::ProcessEventsFlag)processEventFlags);
+ thread.start();
+ thread.wait(2000);
- qApp->processEvents();
- QCOMPARE(InBetweenObject::instanceCounter, 0);
-};
+ QVERIFY(thread.succeeded);
+#endif
+}
QTEST_MAIN(tst_QEventLoop)
#include "tst_qeventloop.moc"
-
-#endif
diff --git a/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro b/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
index 3a221997aa..8a45aa27b2 100644
--- a/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
+++ b/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_qexplicitlyshareddatapointer.cpp
-QT-=gui
+QT = core
diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro
index 68f4c05265..b51eff6d7b 100644
--- a/tests/auto/qfile/test/test.pro
+++ b/tests/auto/qfile/test/test.pro
@@ -1,20 +1,26 @@
load(qttest_p4)
SOURCES += ../tst_qfile.cpp
+wince*|symbian:{
+ QT = core gui
+ files.sources += ..\dosfile.txt ..\noendofline.txt ..\testfile.txt \
+ ..\testlog.txt ..\two.dots.file ..\tst_qfile.cpp \
+ ..\Makefile ..\forCopying.txt ..\forRenaming.txt
+ files.path = .
+ resour.sources += ..\resources\file1.ext1
+ resour.path = resources
+
+ DEPLOYMENT = files resour
+}
+
wince*:{
-QT = core gui
-files.sources += ..\dosfile.txt ..\noendofline.txt ..\testfile.txt \
- ..\testlog.txt ..\two.dots.file ..\tst_qfile.cpp \
- ..\Makefile ..\forCopying.txt ..\forRenaming.txt
-files.path = .
-resour.sources += ..\resources
-resour.path = .
-
-DEPLOYMENT = files resour
-DEFINES += SRCDIR=\\\"\\\"
+ DEFINES += SRCDIR=\\\"\\\"
+} symbian: {
+ # don't define SRCDIR at all
+ TARGET.EPOCHEAPSIZE = 0x100000 0x3000000
} else {
-QT = core network
-DEFINES += SRCDIR=\\\"$$PWD/../\\\"
+ QT = core network
+ DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
RESOURCES += ../qfile.qrc ../rename-fallback.qrc
@@ -22,12 +28,12 @@ RESOURCES += ../qfile.qrc ../rename-fallback.qrc
TARGET = ../tst_qfile
win32 {
- CONFIG(debug, debug|release) {
- TARGET = ../../debug/tst_qfile
-} else {
- TARGET = ../../release/tst_qfile
- }
- LIBS+=-lole32 -luuid
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qfile
+ } else {
+ TARGET = ../../release/tst_qfile
+ }
+ LIBS+=-lole32 -luuid
}
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp
index 98e1859664..483e978406 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -50,7 +50,7 @@
#include <QDir>
#include <QFile>
#include <QFileInfo>
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
#include <QHostInfo>
#endif
#include <QProcess>
@@ -73,9 +73,12 @@
#endif
#include <stdio.h>
-
#include "../network-settings.h"
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
Q_DECLARE_METATYPE(QFile::FileError)
//TESTED_CLASS=
@@ -365,7 +368,10 @@ void tst_QFile::open()
QFile f( filename );
QFETCH( bool, ok );
-
+#if defined(Q_OS_SYMBIAN)
+ if (qstrcmp(QTest::currentDataTag(), "noreadfile") == 0)
+ QSKIP("Symbian does not support non-readable files", SkipSingle);
+#endif
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QEXPECT_FAIL("noreadfile", "Windows does not currently support non-readable files.", Abort);
#endif
@@ -577,8 +583,8 @@ void tst_QFile::readLineNullInLine()
void tst_QFile::readAllStdin()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Currently no stdin/out supported for Windows CE or Symbian", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
@@ -603,8 +609,8 @@ void tst_QFile::readAllStdin()
void tst_QFile::readLineStdin()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Currently no stdin/out supported for Windows CE or Symbian", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
@@ -646,7 +652,7 @@ void tst_QFile::readLineStdin()
void tst_QFile::readLineStdin_lineByLine()
{
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
@@ -774,7 +780,7 @@ void tst_QFile::ungetChar()
void tst_QFile::invalidFile_data()
{
QTest::addColumn<QString>("fileName");
-#ifndef Q_WS_WIN
+#if !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN)
QTest::newRow( "x11" ) << QString( "qwe//" );
#else
QTest::newRow( "colon1" ) << QString( "fail:invalid" );
@@ -844,6 +850,10 @@ void tst_QFile::permissions_data()
void tst_QFile::permissions()
{
+#if defined(Q_OS_SYMBIAN)
+ if (qstrcmp(QTest::currentDataTag(), "data0") == 0)
+ QSKIP("Symbian does not have execution permissions", SkipSingle);
+#endif
QFETCH(QString, file);
QFETCH(uint, perms);
QFETCH(bool, expected);
@@ -901,7 +911,11 @@ void tst_QFile::copyShouldntOverwrite()
QFile::remove("tst_qfile.cpy");
QFile file(SRCDIR "tst_qfile.cpp");
QVERIFY(file.copy("tst_qfile.cpy"));
+#if defined(Q_OS_SYMBIAN)
+ bool ok = QFile::setPermissions("tst_qfile.cpy", QFile::WriteUser);
+#else
bool ok = QFile::setPermissions("tst_qfile.cpy", QFile::WriteOther);
+#endif
QVERIFY(ok);
QVERIFY(!file.copy("tst_qfile.cpy"));
QFile::remove("tst_qfile.cpy");
@@ -998,6 +1012,9 @@ void tst_QFile::link()
void tst_QFile::linkToDir()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian does not support linking to directories", SkipAll);
+#endif
QFile::remove("myLinkToDir.lnk");
QDir dir;
dir.mkdir("myDir");
@@ -1033,8 +1050,7 @@ void tst_QFile::absolutePathLinkToRelativePath()
#else
QVERIFY(QFile::link("myDir/test.txt", "myDir/myLink.lnk"));
#endif
-
- QEXPECT_FAIL("", "Symlinking using relative paths is currently different on Windows and Unix", Continue);
+ QEXPECT_FAIL("", "Symlinking using relative paths is currently different on Windows and Unix/Symbian", Continue);
QCOMPARE(QFileInfo(QFile(QFileInfo("myDir/myLink.lnk").absoluteFilePath()).symLinkTarget()).absoluteFilePath(),
QFileInfo("myDir/test.txt").absoluteFilePath());
@@ -1047,7 +1063,15 @@ void tst_QFile::readBrokenLink()
{
QFile::remove("myLink2.lnk");
QFileInfo info1("file12");
+#if defined(Q_OS_SYMBIAN)
+ // In Symbian can't link to nonexisting file directly, so create the file temporarily
+ QFile tempFile("file12");
+ tempFile.open(QIODevice::WriteOnly);
+ tempFile.link("myLink2.lnk");
+ tempFile.remove();
+#else
QVERIFY(QFile::link("file12", "myLink2.lnk"));
+#endif
QFileInfo info2("myLink2.lnk");
QVERIFY(info2.isSymLink());
#ifdef Q_OS_WIN // on windows links are alway absolute
@@ -1271,7 +1295,7 @@ void tst_QFile::bufferedRead()
void tst_QFile::isSequential()
{
-#if defined (Q_OS_WIN)
+#if defined (Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QSKIP("Unix only test.", SkipAll);
#endif
@@ -1595,6 +1619,10 @@ void tst_QFile::longFileName()
QEXPECT_FAIL("244 chars", "Full pathname must be less than 260 chars", Abort);
QEXPECT_FAIL("244 chars to absolutepath", "Full pathname must be less than 260 chars", Abort);
#endif
+#elif defined(Q_OS_SYMBIAN)
+ if (qstrcmp(QTest::currentDataTag(), "244 chars") == 0 ||
+ qstrcmp(QTest::currentDataTag(), "244 chars to absolutepath") == 0 )
+ QSKIP("Symbian does not support path names exceeding 256 characters", SkipSingle);
#endif
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
QTextStream ts(&file);
@@ -1865,8 +1893,8 @@ void tst_QFile::writeLargeDataBlock()
// Generate a 64MB array with well defined contents.
QByteArray array;
-#if defined(Q_OS_WINCE)
- int resizeSize = 1024 * 1024; // WinCE does not have much space
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ int resizeSize = 1024 * 1024; // WinCE and Symbian do not have much space
#else
int resizeSize = 64 * 1024 * 1024;
#endif
@@ -2003,7 +2031,7 @@ void tst_QFile::rename_data()
QTest::newRow("a -> .") << QString("a") << QString(".") << false;
QTest::newRow("renamefile -> renamefile") << QString("renamefile") << QString("renamefile") << false;
QTest::newRow("renamefile -> Makefile") << QString("renamefile") << QString("Makefile") << false;
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QTest::newRow("renamefile -> /etc/renamefile") << QString("renamefile") << QString("/etc/renamefile") << false;
#endif
QTest::newRow("renamefile -> renamedfile") << QString("renamefile") << QString("renamedfile") << true;
@@ -2212,7 +2240,7 @@ void tst_QFile::readEof_data()
QTest::newRow("buffered") << SRCDIR "testfile.txt" << 0;
QTest::newRow("unbuffered") << SRCDIR "testfile.txt" << int(QIODevice::Unbuffered);
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QTest::newRow("sequential,buffered") << "/dev/null" << 0;
QTest::newRow("sequential,unbuffered") << "/dev/null" << int(QIODevice::Unbuffered);
#endif
@@ -2395,9 +2423,11 @@ void tst_QFile::map()
QVERIFY(file.open(QFile::ReadWrite));
memory = file.map(offset, size);
if (error != QFile::NoError) {
+
QVERIFY(file.error() != QFile::NoError);
return;
}
+
QCOMPARE(file.error(), error);
QVERIFY(memory);
memory[0] = 'Q';
@@ -2434,6 +2464,8 @@ void tst_QFile::map()
file.close();
+ // No permissions for user makes no sense in Symbian
+#if !defined(Q_OS_SYMBIAN)
// Change permissions on a file, just to confirm it would fail
QFile::Permissions originalPermissions = file.permissions();
QVERIFY(file.setPermissions(QFile::ReadOther));
@@ -2442,7 +2474,7 @@ void tst_QFile::map()
QCOMPARE(file.error(), QFile::PermissionsError);
QVERIFY(!memory);
QVERIFY(file.setPermissions(originalPermissions));
-
+#endif
QVERIFY(file.remove());
}
diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro
index 28a11baf5c..3c238eca53 100644
--- a/tests/auto/qfiledialog/qfiledialog.pro
+++ b/tests/auto/qfiledialog/qfiledialog.pro
@@ -6,10 +6,15 @@ load(qttest_p4)
SOURCES += tst_qfiledialog.cpp
-wince*: {
+wince*|symbian: {
addFiles.sources = *.cpp
addFiles.path = .
filesInDir.sources = *.pro
filesInDir.path = someDir
DEPLOYMENT += addFiles filesInDir
}
+
+symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+
+symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
+
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 689f73d058..f5bcfec3a2 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -300,6 +300,7 @@ void tst_QFiledialog::filesSelectedSignal()
fd.show();
QListView *listView = qFindChild<QListView*>(&fd, "listView");
QVERIFY(listView);
+
QModelIndex root = listView->rootIndex();
QTRY_COMPARE(listView->model()->rowCount(root) > 0, true);
QModelIndex file;
@@ -531,14 +532,14 @@ void tst_QFiledialog::completer()
if (input.startsWith(".."))
input.clear();
for (int ii = 0; ii < expectedFiles.count(); ++ii) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (expectedFiles.at(ii).startsWith(input,Qt::CaseInsensitive))
#else
if (expectedFiles.at(ii).startsWith(input))
#endif
++expected;
}
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN)
if (inputStartsWithRootPath)
expected++;
#endif
@@ -553,6 +554,9 @@ void tst_QFiledialog::completer()
//qDebug() << expectedFiles;
}
+
+ // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel
+ // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel.
QTRY_COMPARE(cModel->rowCount(), expected);
qDeleteAll(files);
}
@@ -916,8 +920,8 @@ void tst_QFiledialog::selectFiles()
QVERIFY(listView);
for (int i = 0; i < list.count(); ++i) {
fd.selectFile(fd.directory().path() + "/" + list.at(i));
-#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
- QEXPECT_FAIL("", "This test does not work on Mac or Windows", Abort);
+#if defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "This test does not work on Mac, Windows, or Symbian", Abort);
#endif
QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty());
toSelect.append(listView->selectionModel()->selectedRows().last());
@@ -1222,6 +1226,9 @@ void tst_QFiledialog::clearLineEdit()
fd.setDirectory(QDir::home());
QTest::qWait(1000);
+#ifdef QT_KEYPAD_NAVIGATION
+ list->setEditFocus(true);
+#endif
QTest::keyClick(list, Qt::Key_Down);
#ifndef Q_WS_MAC
QTest::keyClick(list, Qt::Key_Return);
@@ -1693,6 +1700,9 @@ void tst_QFiledialog::task233037_selectingDirectory()
fd.show();
QListView *list = qFindChild<QListView*>(&fd, "listView");
QTest::qWait(3000); // Wait for sort to settle (I need a signal).
+#ifdef QT_KEYPAD_NAVIGATION
+ list->setEditFocus(true);
+#endif
QTest::keyClick(list, Qt::Key_Down);
QTest::qWait(100);
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox*>(&fd, "buttonBox");
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 91b630d5dd..d46a83ba62 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -6,10 +6,11 @@ QT = core
RESOURCES += qfileinfo.qrc
-wince*: {
+wince*:|symbian*: {
deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp
res.sources = resources\file1 resources\file1.ext1 resources\file1.ext1.ext2
res.path = resources
DEPLOYMENT = deploy res
}
+symbian:TARGET.CAPABILITY=AllFiles
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 3d7e6f85d1..cc31029132 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -164,6 +164,7 @@ tst_QFileInfo::~tst_QFileInfo()
QFile::remove("brokenlink.lnk");
QFile::remove("link.lnk");
QFile::remove("file1");
+ QFile::remove("dummyfile");
}
// Testing get/set functions
@@ -180,6 +181,7 @@ void tst_QFileInfo::getSetCheck()
tst_QFileInfo::tst_QFileInfo()
{
+ Q_SET_DEFAULT_IAP
}
void tst_QFileInfo::isFile_data()
@@ -207,6 +209,7 @@ void tst_QFileInfo::isDir_data()
{
// create a broken symlink
QFile::remove("brokenlink.lnk");
+ QFile::remove("dummyfile");
QFile file3("dummyfile");
file3.open(QIODevice::WriteOnly);
if (file3.link("brokenlink.lnk")) {
@@ -228,10 +231,12 @@ void tst_QFileInfo::isDir_data()
QTest::newRow("broken link") << "brokenlink.lnk" << false;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("drive 1") << "c:" << true;
QTest::newRow("drive 2") << "c:/" << true;
//QTest::newRow("drive 2") << "t:s" << false;
+#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
@@ -255,7 +260,6 @@ void tst_QFileInfo::isRoot_data()
{
QTest::addColumn<QString>("path");
QTest::addColumn<bool>("expected");
-
QTest::newRow("data0") << QDir::currentPath() << false;
QTest::newRow("data1") << "/" << true;
QTest::newRow("data2") << ":/tst_qfileinfo/resources/" << false;
@@ -263,10 +267,11 @@ void tst_QFileInfo::isRoot_data()
QTest::newRow("simple dir") << "resources" << false;
QTest::newRow("simple dir with slash") << "resources/" << false;
-
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("drive 1") << "c:" << false;
QTest::newRow("drive 2") << "c:/" << true;
+#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << false;
@@ -333,7 +338,7 @@ void tst_QFileInfo::absolutePath_data()
QTest::addColumn<QString>("filename");
QString drivePrefix;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
drivePrefix = QDir::currentPath().left(2);
#endif
QTest::newRow("0") << "/machine/share/dir1/" << drivePrefix + "/machine/share/dir1" << "";
@@ -368,7 +373,7 @@ void tst_QFileInfo::absFilePath_data()
QTest::newRow("relativeFile") << "tmp.txt" << QDir::currentPath() + "/tmp.txt";
QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << QDir::currentPath() + "/" + "temp/tmp.txt";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QString curr = QDir::currentPath();
curr.remove(0, 2); // Make it a absolute path with no drive specifier: \depot\qt-4.2\tests\auto\qfileinfo
QTest::newRow(".") << curr << QDir::currentPath();
@@ -459,7 +464,7 @@ void tst_QFileInfo::fileName_data()
QTest::newRow("relativeFile") << "tmp.txt" << "tmp.txt";
QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << "tmp.txt";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QTest::newRow("absFilePath") << "c:\\home\\andy\\tmp.txt" << "tmp.txt";
#else
QTest::newRow("absFilePath") << "/home/andy/tmp.txt" << "tmp.txt";
@@ -657,8 +662,9 @@ void tst_QFileInfo::permission()
QFETCH(QString, file);
QFETCH(int, perms);
QFETCH(bool, expected);
+ QEXPECT_FAIL("data0", "No user based rights in Symbian OS - SOS needs platform security tests instead", Abort);
QFileInfo fi(file);
- QCOMPARE(fi.permission((QFile::Permissions)perms), expected);
+ QCOMPARE(fi.permission(QFile::Permissions(perms)), expected);
}
void tst_QFileInfo::size_data()
@@ -697,7 +703,7 @@ void tst_QFileInfo::compare_data()
<< QDir::currentPath() + QString::fromLatin1("/tst_qfileinfo.cpp") << true;
QTest::newRow("casesense1") << QString::fromLatin1("tst_qfileInfo.cpp")
<< QDir::currentPath() + QString::fromLatin1("/tst_qfileinfo.cpp")
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
<< true;
#else
<< false;
@@ -718,7 +724,7 @@ void tst_QFileInfo::consistent_data()
QTest::addColumn<QString>("file");
QTest::addColumn<QString>("expected");
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QTest::newRow("slashes") << QString::fromLatin1("\\a\\a\\a\\a") << QString::fromLatin1("/a/a/a/a");
#endif
QTest::newRow("ending slash") << QString::fromLatin1("/a/somedir/") << QString::fromLatin1("/a/somedir/");
@@ -769,6 +775,9 @@ void tst_QFileInfo::fileTimes()
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("longfile", "No long filenames on WinCE", Abort);
QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort);
+#elif defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("longfile", "Maximum total filepath cannot exceed 256 characters in Symbian", Abort);
+ QEXPECT_FAIL("longfile absolutepath", "Maximum total filepath cannot exceed 256 characters in Symbian", Abort);
#endif
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
QTextStream ts(&file);
@@ -817,6 +826,9 @@ void tst_QFileInfo::fileTimes()
#ifdef Q_OS_WINCE
QEXPECT_FAIL("simple", "WinCE only stores date of access data, not the time", Continue);
#endif
+#ifdef Q_OS_SYMBIAN
+ QEXPECT_FAIL("simple", "Symbian implementation of stat doesn't return read time right", Abort);
+#endif
QVERIFY(fileInfo.lastRead() > beforeRead);
QVERIFY(fileInfo.lastModified() > beforeWrite);
QVERIFY(fileInfo.lastModified() < beforeRead);
@@ -882,6 +894,7 @@ void tst_QFileInfo::isSymLink()
{
QFile::remove("link.lnk");
QFile::remove("brokenlink.lnk");
+ QFile::remove("dummyfile");
QFileInfo info1("tst_qfileinfo.cpp");
QVERIFY( !info1.isSymLink() );
@@ -895,11 +908,13 @@ void tst_QFileInfo::isSymLink()
QFile file3("dummyfile");
file3.open(QIODevice::WriteOnly);
if (file3.link("brokenlink.lnk")) {
+ // In Symbian ARMV5 builds, this will panic with KERN-EXEC 3 inside OpenC fclose() call
+ // in QFSFileEnginePrivate::closeFdFh(), if "dummyfile" exists prior calling to isSymLink
+ // and is not deleted at the beginning of isSymLink.
file3.remove();
QFileInfo info3("brokenlink.lnk");
QVERIFY( info3.isSymLink() );
}
-
}
void tst_QFileInfo::isHidden_data()
@@ -1011,6 +1026,10 @@ void tst_QFileInfo::brokenShortcut()
#ifdef Q_OS_UNIX
void tst_QFileInfo::isWritable()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("This is a UNIX only test - no passwd in Symbian OS", SkipAll);
+#endif
+
if (::getuid() == 0)
QVERIFY(QFileInfo("/etc/passwd").isWritable());
else
@@ -1020,10 +1039,17 @@ void tst_QFileInfo::isWritable()
void tst_QFileInfo::isExecutable()
{
+#ifdef Q_OS_SYMBIAN
+# if defined(Q_CC_NOKIAX86)
+ QSKIP("Impossible to implement reading/touching of application binaries in Symbian emulator", SkipAll);
+# endif
+ QString appPath = "c:/sys/bin/tst_qfileinfo.exe";
+#else
QString appPath = QCoreApplication::applicationDirPath();
appPath += "/tst_qfileinfo";
-#if defined(Q_OS_WIN)
+# if defined(Q_OS_WIN)
appPath += ".exe";
+# endif
#endif
QFileInfo fi(appPath);
QCOMPARE(fi.isExecutable(), true);
diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
index 89f3541ab3..e9d7272305 100644
--- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
+++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
@@ -6,4 +6,11 @@ include(../../../../modeltest/modeltest.pri)
SOURCES += tst_qfilesystemmodel.cpp
TARGET = tst_qfilesystemmodel
-
+symbian: {
+ HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
+
+ # need to deploy something to create the private directory
+ dummyDeploy.sources = tst_qfilesystemmodel.cpp
+ dummyDeploy.path = .
+ DEPLOYMENT += dummyDeploy
+}
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 59d57cee1f..963fccc954 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -47,7 +47,9 @@
#include <QTime>
#include <QStyle>
#include <QtGlobal>
-
+#if defined(Q_OS_SYMBIAN)
+# include <f32file.h>
+#endif
//TESTED_CLASS=
//TESTED_FILES=
@@ -63,6 +65,23 @@
} \
} while(0)
+#if defined(Q_OS_SYMBIAN)
+static HBufC* qt_QString2HBufCNewL(const QString& aString)
+{
+ HBufC *buffer;
+#ifdef QT_NO_UNICODE
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(aString.toLocal8Bit().constData()));
+ buffer = HBufC8::NewL(ptr.Length());
+ buffer->Des().Copy(ptr);
+#else
+ TPtrC16 ptr(reinterpret_cast<const TUint16*>(aString.utf16()));
+ buffer = HBufC16::NewL(ptr.Length());
+ buffer->Des().Copy(ptr);
+#endif
+ return buffer;
+}
+#endif
+
class tst_QFileSystemModel : public QObject {
Q_OBJECT
@@ -121,6 +140,9 @@ protected:
private:
QFileSystemModel *model;
QString flatDirTestPath;
+#if defined(Q_OS_SYMBIAN)
+ RFs rfs;
+#endif
};
tst_QFileSystemModel::tst_QFileSystemModel() : model(0)
@@ -131,10 +153,16 @@ tst_QFileSystemModel::tst_QFileSystemModel() : model(0)
qsrand(midnight.secsTo(QTime::currentTime()));
// generating unique temporary directory name
flatDirTestPath = QDir::temp().path() + '/' + QString("flatdirtest.") + QString::number(qrand());
+#if defined(Q_OS_SYMBIAN)
+ rfs.Connect();
+#endif
}
tst_QFileSystemModel::~tst_QFileSystemModel()
{
+#if defined(Q_OS_SYMBIAN)
+ rfs.Close();
+#endif
QString tmp = flatDirTestPath;
QDir dir(tmp);
if (dir.exists() && !dir.rmdir(tmp))
@@ -174,7 +202,7 @@ void tst_QFileSystemModel::cleanup()
void tst_QFileSystemModel::indexPath()
{
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
int depth = QDir::currentPath().count('/');
model->setRootPath(QDir::currentPath());
QTest::qWait(WAITTIME);
@@ -376,6 +404,12 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (initial_files.at(i)[0] == '.')
QProcess::execute(QString("attrib +h %1").arg(file.fileName()));
+#elif defined(Q_OS_SYMBIAN)
+ if (initial_files.at(i)[0] == '.') {
+ HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(file.fileName()));
+ rfs.SetAtt(*buffer, KEntryAttHidden, 0);
+ delete buffer;
+ }
#endif
//qDebug() << test_path + '/' + initial_files.at(i) << (QFile::exists(test_path + '/' + initial_files.at(i)));
}
@@ -560,7 +594,7 @@ void tst_QFileSystemModel::filters_data()
QTest::addColumn<int>("dirFilters");
QTest::addColumn<QStringList>("nameFilters");
QTest::addColumn<int>("rowCount");
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2;
QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1;
QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 3;
@@ -585,7 +619,12 @@ void tst_QFileSystemModel::filters_data()
QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 0;
QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() <<
(int)(QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 3;
+#if defined(Q_OS_SYMBIAN)
+ // Some symbian envs have a bug that causes "A" and ".A" to be considered same name in file system.
+ QTest::newRow("dir+file+hid-dot .D") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".D") <<
+#else
QTest::newRow("dir+file+hid-dot .A") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".A") <<
+#endif
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
QTest::newRow("dir+files+hid+dot A") << (QStringList() << "a" << "b" << "c") << (QStringList() << "AFolder") <<
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << (QStringList() << "A*") << 2;
@@ -849,7 +888,7 @@ void tst_QFileSystemModel::dirsBeforeFiles()
#endif
}
}
-
+
QTEST_MAIN(tst_QFileSystemModel)
#include "tst_qfilesystemmodel.moc"
diff --git a/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
index c4d1d6f680..8b8616acb8 100644
--- a/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
+++ b/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qfilesystemwatcher.cpp
QT = core
-
-
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 334accee77..9df483a874 100644
--- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -94,7 +94,7 @@ tst_QFileSystemWatcher::tst_QFileSystemWatcher()
if (inotify_init() != -1)
do_force_engines << "inotify";
#endif
-#elif defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_FREEBSD)
+#elif defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_FREEBSD) || defined(Q_OS_SYMBIAN)
// we have native engines for win32, macosx and freebsd
do_force_engines << "native";
#endif
@@ -312,6 +312,9 @@ void tst_QFileSystemWatcher::watchDirectory()
#ifdef Q_OS_WINCE
QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort);
+#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+ // Since native watcher is always used in real devices, this poller issue is irrelevant
+ QEXPECT_FAIL("poller", "Poller doesn't detect directory removal in RVCT builds", Abort);
#endif
QCOMPARE(changedSpy.count(), 2);
QCOMPARE(changedSpy.at(0).count(), 1);
diff --git a/tests/auto/qflags/qflags.pro b/tests/auto/qflags/qflags.pro
index 1e62db1f55..cd7f759b8b 100644
--- a/tests/auto/qflags/qflags.pro
+++ b/tests/auto/qflags/qflags.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qflags.cpp
-
QT = core
-
-
diff --git a/tests/auto/qfontdatabase/qfontdatabase.pro b/tests/auto/qfontdatabase/qfontdatabase.pro
index cee683990d..35811f1a97 100644
--- a/tests/auto/qfontdatabase/qfontdatabase.pro
+++ b/tests/auto/qfontdatabase/qfontdatabase.pro
@@ -1,8 +1,8 @@
load(qttest_p4)
SOURCES += tst_qfontdatabase.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince* {
+wince*|symbian {
additionalFiles.sources = FreeMono.ttf
additionalFiles.path = .
DEPLOYMENT += additionalFiles
diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
index 9c42b49021..a006462422 100644
--- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
@@ -45,9 +45,9 @@
#include <qfontdatabase.h>
-
-
-
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "."
+#endif
//TESTED_CLASS=
//TESTED_FILES=
@@ -191,6 +191,9 @@ void tst_QFontDatabase::addAppFont_data()
void tst_QFontDatabase::addAppFont()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP( "Symbian: Application fonts are not yet supported", SkipAll );
+#else
QFETCH(bool, useMemoryFont);
QSignalSpy fontDbChangedSpy(QApplication::instance(), SIGNAL(fontDatabaseChanged()));
@@ -239,7 +242,8 @@ void tst_QFontDatabase::addAppFont()
QVERIFY(QFontDatabase::removeApplicationFont(id));
QCOMPARE(fontDbChangedSpy.count(), 2);
- QVERIFY(db.families() == oldFamilies);
+ QVERIFY(db.families() == oldFamilies);¨
+#endif
}
QTEST_MAIN(tst_QFontDatabase)
diff --git a/tests/auto/qftp/.gitattributes b/tests/auto/qftp/.gitattributes
index d220f58303..e04709aa2e 100644
--- a/tests/auto/qftp/.gitattributes
+++ b/tests/auto/qftp/.gitattributes
@@ -1 +1 @@
-rfc3252.txt -cflf Unset
+rfc3252.txt -crlf
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index 84d8c19a08..c060296e7f 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -9,6 +9,11 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
+} else:symbian* {
+ addFiles.sources = rfc3252.txt
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+ TARGET.EPOCHEAPSIZE="0x100 0x1000000"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qftp/tst_qftp.cpp b/tests/auto/qftp/tst_qftp.cpp
index 7204a4c60d..0f6702cfca 100644
--- a/tests/auto/qftp/tst_qftp.cpp
+++ b/tests/auto/qftp/tst_qftp.cpp
@@ -51,11 +51,22 @@
#include <stdlib.h>
#include <QNetworkProxy>
+#ifndef TEST_QNETWORK_PROXY
+#define TEST_QNETWORK_PROXY
+#endif
#include "../network-settings.h"
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Application private dir is default serach path for files, so SRCDIR can be set to empty
+#define SRCDIR ""
+#endif
+
+
+
class tst_QFtp : public QObject
{
Q_OBJECT
@@ -178,11 +189,11 @@ const int bytesDone_init = -10;
tst_QFtp::tst_QFtp()
{
+ Q_SET_DEFAULT_IAP
}
tst_QFtp::~tst_QFtp()
-{
-
+{
}
void tst_QFtp::initTestCase_data()
@@ -190,10 +201,12 @@ void tst_QFtp::initTestCase_data()
QTest::addColumn<bool>("setProxy");
QTest::addColumn<int>("proxyType");
- QTest::newRow("WithoutProxy") << false << 0;
+ QTest::newRow("WithoutProxy") << false << 0;
+#ifdef TEST_QNETWORK_PROXY
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
//### doesn't work well yet.
//QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy);
+#endif
}
void tst_QFtp::initTestCase()
@@ -1144,7 +1157,7 @@ QDataStream &operator>>( QDataStream &s, FtpCommand &command )
}
Q_DECLARE_METATYPE(QList<FtpCommand>)
- void tst_QFtp::commandSequence_data()
+void tst_QFtp::commandSequence_data()
{
// some "constants"
QStringList argConnectToHost01;
@@ -1279,8 +1292,8 @@ void tst_QFtp::abort_data()
QTest::newRow( "get_fluke01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/bigfile") << QByteArray();
QTest::newRow( "get_fluke02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/rfc3252") << QByteArray();
- // Qt/CE test environment has to less memory for this test
-#if !defined(Q_OS_WINCE)
+ // Qt/CE and Symbian test environment has to less memory for this test
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QByteArray bigData( 10*1024*1024, 0 );
bigData.fill( 'B' );
@@ -1501,7 +1514,6 @@ void tst_QFtp::proxy()
void tst_QFtp::binaryAscii()
{
-
QString file = "asciifile%1.txt";
if(file.contains('%'))
@@ -1544,11 +1556,16 @@ void tst_QFtp::binaryAscii()
ResMapIt it2 = resultMap.find(QFtp::Get);
QVERIFY(it2 != resultMap.end());
QVERIFY(it2.value().success);
+/*
+#ifdef Q_OS_SYMBIAN
+ QVERIFY(getData.size() == putData.size());
+#else
+*/
// most modern ftp servers leave the file as it is by default
// (and do not remove the windows line ending), the -1 below could be
// deleted in the future
QVERIFY(getData.size() == putData.size()-1);
-
+//#endi
//////////////////////////////////////////////////////////////////
// cleanup (i.e. remove the file) -- this also tests the remove command
init();
@@ -2042,4 +2059,5 @@ void tst_QFtp::cdUpSlot(bool error)
}
QTEST_MAIN(tst_QFtp)
+
#include "tst_qftp.moc"
diff --git a/tests/auto/qgetputenv/qgetputenv.pro b/tests/auto/qgetputenv/qgetputenv.pro
index ed3eac937e..cbde2727a5 100644
--- a/tests/auto/qgetputenv/qgetputenv.pro
+++ b/tests/auto/qgetputenv/qgetputenv.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgetputenv.cpp
-
QT = core
-
-
-
diff --git a/tests/auto/qglobal/qglobal.pro b/tests/auto/qglobal/qglobal.pro
index 373061b25a..8f1e00a2cb 100644
--- a/tests/auto/qglobal/qglobal.pro
+++ b/tests/auto/qglobal/qglobal.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
-
SOURCES += tst_qglobal.cpp
QT = core
-
-
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index b8a5c8fbaa..6b8bc7095e 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -3,15 +3,18 @@ SOURCES += tst_qgraphicsscene.cpp
RESOURCES += images.qrc
win32:!wince*: LIBS += -lUser32
-!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince*: {
- DEFINES += SRCDIR=\\\".\\\"
+wince*!symbian*: {
rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
renderFiles.sources = testData\render\*
renderFiles.path = testData\render
DEPLOYMENT += rootFiles renderFiles
}
+wince*:{
+ DEFINES += SRCDIR=\\\".\\\"
+}
+symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index 0c5ebf6dbd..d020c105f3 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -58,6 +58,12 @@
#define Q_CHECK_PAINTEVENTS
#endif
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Current path (C:\private\<UID>) contains only ascii chars
+#define SRCDIR QDir::currentPath().append("\\").toAscii()
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -213,9 +219,11 @@ private slots:
void mouseEventPropagation_focus();
void mouseEventPropagation_doubleclick();
void mouseEventPropagation_mouseMove();
+#ifndef QT_NO_DRAGANDDROP
void dragAndDrop_simple();
void dragAndDrop_disabledOrInvisible();
void dragAndDrop_propagate();
+#endif
void render_data();
void render();
void contextMenuEvent();
@@ -2189,6 +2197,7 @@ private:
}
};
+#ifndef QT_NO_DRAGANDDROP
void tst_QGraphicsScene::dragAndDrop_simple()
{
DndTester *item = new DndTester(QRectF(-10, -10, 20, 20));
@@ -2478,6 +2487,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
QDropEvent dropEvent(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
QApplication::sendEvent(view.viewport(), &dropEvent);
}
+#endif
void tst_QGraphicsScene::render_data()
{
diff --git a/tests/auto/qgraphicsview/qgraphicsview.pro b/tests/auto/qgraphicsview/qgraphicsview.pro
index 5562f192cc..5e7e53da6e 100644
--- a/tests/auto/qgraphicsview/qgraphicsview.pro
+++ b/tests/auto/qgraphicsview/qgraphicsview.pro
@@ -2,4 +2,4 @@ load(qttest_p4)
SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-
+symbian:TARGET.EPOCHEAPSIZE = 1000000 10000000
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index db1e4c39eb..ddc2074522 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -2194,6 +2194,9 @@ void tst_QGraphicsView::viewportUpdateMode()
void tst_QGraphicsView::acceptDrops()
{
+#ifdef QT_NO_DRAGANDDROP
+ QSKIP("Drag'n drop disabled in this build", SkipAll);
+#else
QGraphicsView view;
// Excepted default behavior.
@@ -2227,6 +2230,7 @@ void tst_QGraphicsView::acceptDrops()
// Switching the view to not accept drops.
view.setAcceptDrops(false);
QVERIFY(!view.viewport()->acceptDrops());
+#endif
}
void tst_QGraphicsView::optimizationFlags()
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp
index 618cde4d7c..ec44f24e72 100644
--- a/tests/auto/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp
@@ -118,8 +118,8 @@ void tst_QGroupBox::setCheckable_data()
{
QTest::addColumn<bool>("checkable");
QTest::addColumn<bool>("expectedCheckable");
- QTest::newRow( "checkable_true" ) << TRUE << TRUE;
- QTest::newRow( "checkable_false" ) << FALSE << FALSE;
+ QTest::newRow( "checkable_true" ) << true << true;
+ QTest::newRow( "checkable_false" ) << false << false;
}
void tst_QGroupBox::setChecked_data()
@@ -127,9 +127,9 @@ void tst_QGroupBox::setChecked_data()
QTest::addColumn<bool>("checkable");
QTest::addColumn<bool>("checked");
QTest::addColumn<bool>("expectedChecked");
- QTest::newRow( "checkable_false_checked_true" ) << FALSE << TRUE << FALSE;
- QTest::newRow( "checkable_true_checked_true" ) << TRUE << TRUE << TRUE;
- QTest::newRow( "checkable_true_checked_false" ) << TRUE << FALSE << FALSE;
+ QTest::newRow( "checkable_false_checked_true" ) << false << true << false;
+ QTest::newRow( "checkable_true_checked_true" ) << true << true << true;
+ QTest::newRow( "checkable_true_checked_false" ) << true << false << false;
}
void tst_QGroupBox::setTitle()
@@ -172,116 +172,116 @@ void tst_QGroupBox::setChecked()
void tst_QGroupBox::enabledPropagation()
{
QGroupBox *testWidget = new QGroupBox(0);
- testWidget->setCheckable(TRUE);
- testWidget->setChecked(TRUE);
+ testWidget->setCheckable(true);
+ testWidget->setChecked(true);
QWidget* childWidget = new QWidget( testWidget );
childWidget->show();
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setDisabled( FALSE );
+ testWidget->setDisabled( false );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QWidget* grandChildWidget = new QWidget( childWidget );
QVERIFY( grandChildWidget->isEnabled() );
- testWidget->setDisabled( TRUE );
+ testWidget->setDisabled( true );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( FALSE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( false );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( TRUE );
- testWidget->setEnabled( FALSE );
- childWidget->setDisabled( TRUE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( true );
+ testWidget->setEnabled( false );
+ childWidget->setDisabled( true );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
// Reset state
- testWidget->setEnabled( TRUE );
- childWidget->setEnabled( TRUE );
- grandChildWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
+ childWidget->setEnabled( true );
+ grandChildWidget->setEnabled( true );
// Now check when it's disabled
- testWidget->setChecked(FALSE);
+ testWidget->setChecked(false);
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setDisabled( FALSE );
+ testWidget->setDisabled( false );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- testWidget->setDisabled( TRUE );
+ testWidget->setDisabled( true );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( FALSE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( false );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( TRUE );
- testWidget->setEnabled( FALSE );
- childWidget->setDisabled( TRUE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( true );
+ testWidget->setEnabled( false );
+ childWidget->setDisabled( true );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
// Reset state
- testWidget->setEnabled( TRUE );
- childWidget->setEnabled( TRUE );
- grandChildWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
+ childWidget->setEnabled( true );
+ grandChildWidget->setEnabled( true );
// Finally enable it again
- testWidget->setChecked(TRUE);
+ testWidget->setChecked(true);
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setDisabled( FALSE );
+ testWidget->setDisabled( false );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QVERIFY( grandChildWidget->isEnabled() );
- testWidget->setDisabled( TRUE );
+ testWidget->setDisabled( true );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( FALSE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( false );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( TRUE );
- testWidget->setEnabled( FALSE );
- childWidget->setDisabled( TRUE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( true );
+ testWidget->setEnabled( false );
+ childWidget->setDisabled( true );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 1c60fc20d8..6fedb824f7 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -1,7 +1,8 @@
load(qttest_p4)
SOURCES += tst_qhash.cpp
-
-
QT = core
-
+symbian*: {
+TARGET.EPOCSTACKSIZE =0x5000
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+}
diff --git a/tests/auto/qhash/tst_qhash.cpp b/tests/auto/qhash/tst_qhash.cpp
index f300eec8ae..5d6b91a53d 100644
--- a/tests/auto/qhash/tst_qhash.cpp
+++ b/tests/auto/qhash/tst_qhash.cpp
@@ -692,7 +692,7 @@ void tst_QHash::operator_eq()
QVERIFY(a == b);
QVERIFY(!(a != b));
-
+
a.insert(1,1);
b.insert(1,1);
QVERIFY(a == b);
@@ -714,7 +714,7 @@ void tst_QHash::operator_eq()
b.insert(-1, -1);
QVERIFY(a != b);
- QVERIFY(!(a == b));
+ QVERIFY(!(a == b));
}
{
@@ -760,7 +760,7 @@ void tst_QHash::operator_eq()
b.insert("willy", 1);
QVERIFY(a != b);
QVERIFY(!(a == b));
- }
+ }
}
void tst_QHash::compare()
@@ -974,7 +974,7 @@ void tst_QHash::rehash_isnt_quadratic()
// this test should be incredibly slow if rehash() is quadratic
for (int j = 0; j < 5; ++j) {
QHash<int, int> testHash;
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) // mobiles do not have infinite mem...
for (int i = 0; i < 50000; ++i)
#else
for (int i = 0; i < 500000; ++i)
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index 0c5bc59103..c3aca7a1c4 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -87,6 +87,8 @@
# endif
#endif
+#include "../network-settings.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -160,10 +162,11 @@ void tst_QHostInfo::staticInformation()
tst_QHostInfo::tst_QHostInfo()
{
+ Q_SET_DEFAULT_IAP
}
tst_QHostInfo::~tst_QHostInfo()
-{
+{
}
void tst_QHostInfo::initTestCase()
@@ -212,14 +215,21 @@ void tst_QHostInfo::lookupIPv4_data()
QTest::addColumn<QString>("addresses");
QTest::addColumn<int>("err");
+#ifdef Q_OS_SYMBIAN
+ // Test server lookup
+ QTest::newRow("lookup_01") << QtNetworkSettings::serverName() << QtNetworkSettings::serverIP() << int(QHostInfo::NoError);
+ QTest::newRow("literal_ip4") << QtNetworkSettings::serverIP() << QtNetworkSettings::serverIP() << int(QHostInfo::NoError);
+ QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError);
+#else
QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound);
QTest::newRow("lupinella_00") << "l" << lupinellaIp << int(QHostInfo::NoError);
- QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError);
+ QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError);
QTest::newRow("lupinella_02") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError);
QTest::newRow("lupinella_03") << "lupinella.trolltech.com" << lupinellaIp << int(QHostInfo::NoError);
QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError);
QTest::newRow("literal_ip4") << lupinellaIp << lupinellaIp << int(QHostInfo::NoError);
+#endif
QTest::newRow("notfound") << "this-name-does-not-exist-hopefully." << "" << int(QHostInfo::HostNotFound);
QTest::newRow("idn-ace") << "xn--alqualond-34a.troll.no" << "10.3.3.55" << int(QHostInfo::NoError);
@@ -383,10 +393,10 @@ protected:
void tst_QHostInfo::threadSafety()
{
const int nattempts = 5;
-#if !defined(Q_OS_WINCE)
- const int runs = 100;
-#else
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
const int runs = 10;
+#else
+ const int runs = 100;
#endif
LookupThread thr[nattempts];
for (int j = 0; j < runs; ++j) {
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index 9186140491..38569ba026 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -13,6 +13,14 @@ wince*: {
addFiles.path = .
DEPLOYMENT = addFiles webFiles cgi
DEFINES += SRCDIR=\\\"\\\"
+} else:symbian* {
+ webFiles.sources = webserver/*
+ webFiles.path = webserver
+ cgi.sources = webserver/cgi-bin/*
+ cgi.path = webserver/cgi-bin
+ addFiles.sources = rfc3252.txt trolltech
+ addFiles.path = .
+ DEPLOYMENT = addFiles webFiles cgi
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp
index 46bd8cd2a9..093bc1e4f3 100644
--- a/tests/auto/qhttp/tst_qhttp.cpp
+++ b/tests/auto/qhttp/tst_qhttp.cpp
@@ -57,11 +57,20 @@
# include <qsslsocket.h>
#endif
+#ifndef TEST_QNETWORK_PROXY
+#define TEST_QNETWORK_PROXY
+#endif
#include "../network-settings.h"
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// And underlying Open C have application private dir in default search path
+#define SRCDIR ""
+#endif
+
Q_DECLARE_METATYPE(QHttpResponseHeader)
class tst_QHttp : public QObject
@@ -140,9 +149,9 @@ private:
struct RequestResult
{
- QHttpRequestHeader req;
- QHttpResponseHeader resp;
- int success;
+ QHttpRequestHeader req;
+ QHttpResponseHeader resp;
+ int success;
};
QMap< int, RequestResult > resultMap;
typedef QMap<int,RequestResult>::Iterator ResMapIt;
@@ -176,6 +185,7 @@ const int bytesDone_init = -10;
tst_QHttp::tst_QHttp()
{
+ Q_SET_DEFAULT_IAP
}
tst_QHttp::~tst_QHttp()
@@ -188,7 +198,9 @@ void tst_QHttp::initTestCase_data()
QTest::addColumn<int>("proxyType");
QTest::newRow("WithoutProxy") << false << 0;
+#ifdef TEST_QNETWORK_PROXY
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
+#endif
}
void tst_QHttp::initTestCase()
@@ -317,7 +329,7 @@ void tst_QHttp::get_data()
QTest::newRow( QString("failprot_02_%1").arg(i).toLatin1() ) << QtNetworkSettings::serverName() << 80u
<< QString("qtest/rfc3252.txt") << 1 << 400 << QByteArray() << (bool)(i==1);
- // doc.trolltech.com uses transfer-encoding=chunked
+ //doc.trolltech.com uses transfer-encoding=chunked
/* doc.trolltech.com no longer seams to be using chuncked encodig.
QTest::newRow( QString("chunked_01_%1").arg(i).toLatin1() ) << QString("test.troll.no") << 80u
<< QString("/") << 1 << 200 << trolltech << (bool)(i==1);
@@ -344,47 +356,47 @@ void tst_QHttp::get()
addRequest( QHttpRequestHeader(), http->setHost( host, port ) );
if ( useIODevice ) {
- buf.open( QIODevice::WriteOnly );
- getId = http->get( path, &buf );
+ buf.open( QIODevice::WriteOnly );
+ getId = http->get( path, &buf );
} else {
- getId = http->get( path );
+ getId = http->get( path );
}
addRequest( QHttpRequestHeader(), getId );
QTestEventLoop::instance().enterLoop( 30 );
if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
+ QFAIL( "Network operation timed out" );
ResMapIt res = resultMap.find( getId );
QVERIFY( res != resultMap.end() );
if ( res.value().success!=1 && host=="www.ietf.org" ) {
- // The nightly tests fail from time to time. In order to make them more
- // stable, add some debug output that might help locate the problem (I
- // can't reproduce the problem in the non-nightly builds).
- qDebug( "Error %d: %s", http->error(), http->errorString().toLatin1().constData() );
+ // The nightly tests fail from time to time. In order to make them more
+ // stable, add some debug output that might help locate the problem (I
+ // can't reproduce the problem in the non-nightly builds).
+ qDebug( "Error %d: %s", http->error(), http->errorString().toLatin1().constData() );
}
QTEST( res.value().success, "success" );
if ( res.value().success ) {
- QTEST( res.value().resp.statusCode(), "statusCode" );
-
- QFETCH( QByteArray, res );
- if ( res.count() > 0 ) {
- if ( useIODevice ) {
- QCOMPARE(buf_ba, res);
- if ( bytesDoneRead != bytesDone_init )
- QVERIFY( (int)buf_ba.size() == bytesDoneRead );
- } else {
- QCOMPARE(readyRead_ba, res);
- if ( bytesDoneRead != bytesDone_init )
- QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
- }
- }
- QVERIFY( bytesTotalRead != bytesTotal_init );
- if ( bytesTotalRead > 0 )
- QVERIFY( bytesDoneRead == bytesTotalRead );
+ QTEST( res.value().resp.statusCode(), "statusCode" );
+
+ QFETCH( QByteArray, res );
+ if ( res.count() > 0 ) {
+ if ( useIODevice ) {
+ QCOMPARE(buf_ba, res);
+ if ( bytesDoneRead != bytesDone_init )
+ QVERIFY( (int)buf_ba.size() == bytesDoneRead );
+ } else {
+ QCOMPARE(readyRead_ba, res);
+ if ( bytesDoneRead != bytesDone_init )
+ QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
+ }
+ }
+ QVERIFY( bytesTotalRead != bytesTotal_init );
+ if ( bytesTotalRead > 0 )
+ QVERIFY( bytesDoneRead == bytesTotalRead );
} else {
- QVERIFY( !res.value().resp.isValid() );
+ QVERIFY( !res.value().resp.isValid() );
}
}
@@ -399,19 +411,22 @@ void tst_QHttp::head_data()
QTest::newRow( "path_01" ) << QtNetworkSettings::serverName() << 80u
<< QString("/qtest/rfc3252.txt") << 1 << 200 << 25962u;
+
QTest::newRow( "path_02" ) << QString("www.ietf.org") << 80u
<< QString("/rfc/rfc3252.txt") << 1 << 200 << 25962u;
QTest::newRow( "uri_01" ) << QtNetworkSettings::serverName() << 80u
<< QString("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << 1 << 200 << 25962u;
+
QTest::newRow( "uri_02" ) << QString("www.ietf.org") << 80u
- << QString("http://www.ietf.org/rfc/rfc3252.txt") << 1 << 200 << 25962u;
+ << QString("http://www.ietf.org/rfc/rfc3252.txt") << 1 << 200 << 25962u;
QTest::newRow( "fail_01" ) << QString("this-host-will-not-exist.") << 80u
- << QString("/qtest/rfc3252.txt") << 0 << 0 << 0u;
+ << QString("/qtest/rfc3252.txt") << 0 << 0 << 0u;
QTest::newRow( "failprot_01" ) << QtNetworkSettings::serverName() << 80u
<< QString("/t") << 1 << 404 << 0u;
+
QTest::newRow( "failprot_02" ) << QtNetworkSettings::serverName() << 80u
<< QString("qtest/rfc3252.txt") << 1 << 400 << 0u;
@@ -464,7 +479,7 @@ void tst_QHttp::head()
void tst_QHttp::post_data()
{
- QTest::addColumn<QString>("source");
+ QTest::addColumn<QString>("source");
QTest::addColumn<bool>("useIODevice");
QTest::addColumn<bool>("useProxy");
QTest::addColumn<QString>("host");
@@ -505,7 +520,7 @@ void tst_QHttp::post_data()
void tst_QHttp::post()
{
- QFETCH(QString, source);
+ QFETCH(QString, source);
QFETCH(bool, useIODevice);
QFETCH(bool, useProxy);
QFETCH(QString, host);
@@ -543,7 +558,7 @@ void tst_QHttp::post()
QTestEventLoop::instance().enterLoop( 30 );
if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
+ QFAIL( "Network operation timed out" );
ResMapIt res = resultMap.find(postId);
QVERIFY(res != resultMap.end());
@@ -602,7 +617,6 @@ void tst_QHttp::request_data()
QTest::newRow("proxy-post-data") << "rfc3252.txt" << false << true
<< QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
<< md5sum;
-
// the following test won't work. See task 185996
/*
QTest::newRow("proxy-post-device") << "rfc3252.txt" << true << true
@@ -667,7 +681,7 @@ void tst_QHttp::request()
QTestEventLoop::instance().enterLoop( 30 );
if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
+ QFAIL( "Network operation timed out" );
ResMapIt res = resultMap.find(*theId);
QVERIFY(res != resultMap.end());
@@ -777,7 +791,7 @@ void tst_QHttp::proxy()
QTestEventLoop::instance().enterLoop(30);
if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
+ QFAIL("Network operation timed out");
ResMapIt res = resultMap.find(getId);
QVERIFY(res != resultMap.end());
@@ -847,17 +861,17 @@ void tst_QHttp::proxy3()
// test QHttp::currentId() and QHttp::currentRequest()
#define CURRENTREQUEST_TEST \
{ \
- ResMapIt res = resultMap.find( http->currentId() ); \
- QVERIFY( res != resultMap.end() ); \
- if ( http->currentId() == getId ) { \
- QCOMPARE( http->currentRequest().method(), QString("GET") ); \
- } else if ( http->currentId() == headId ) { \
- QCOMPARE( http->currentRequest().method(), QString("HEAD") ); \
+ ResMapIt res = resultMap.find( http->currentId() ); \
+ QVERIFY( res != resultMap.end() ); \
+ if ( http->currentId() == getId ) { \
+ QCOMPARE( http->currentRequest().method(), QString("GET") ); \
+ } else if ( http->currentId() == headId ) { \
+ QCOMPARE( http->currentRequest().method(), QString("HEAD") ); \
} else if ( http->currentId() == postId ) { \
QCOMPARE( http->currentRequest().method(), QString("POST") ); \
- } else { \
- QVERIFY( headerAreEqual( http->currentRequest(), res.value().req ) ); \
- } \
+ } else { \
+ QVERIFY( headerAreEqual( http->currentRequest(), res.value().req ) ); \
+ } \
}
void tst_QHttp::requestStarted( int id )
@@ -872,9 +886,9 @@ void tst_QHttp::requestStarted( int id )
QVERIFY( !ids.isEmpty() );
QVERIFY( ids.first() == id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
QVERIFY( http->currentId() == id );
@@ -892,7 +906,7 @@ void tst_QHttp::requestFinished( int id, bool error )
{
#if defined( DUMP_SIGNALS )
qDebug( "%d:requestFinished( %d, %d ) -- errorString: '%s'",
- http->currentId(), id, (int)error, http->errorString().latin1() );
+ http->currentId(), id, (int)error, http->errorString().toAscii().data() );
#endif
// make sure that the requestStarted and requestFinished are nested correctly
QVERIFY( current_id == id );
@@ -901,17 +915,17 @@ void tst_QHttp::requestFinished( int id, bool error )
QVERIFY( !ids.isEmpty() );
QVERIFY( ids.first() == id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
if ( error ) {
- QVERIFY( http->error() != QHttp::NoError );
- ids.clear();
+ QVERIFY( http->error() != QHttp::NoError );
+ ids.clear();
} else {
- QVERIFY( http->error() == QHttp::NoError );
- ids.pop_front();
+ QVERIFY( http->error() == QHttp::NoError );
+ ids.pop_front();
}
QVERIFY( http->currentId() == id );
@@ -922,9 +936,9 @@ void tst_QHttp::requestFinished( int id, bool error )
QVERIFY( res != resultMap.end() );
QVERIFY( res.value().success == -1 );
if ( error )
- res.value().success = 0;
+ res.value().success = 0;
else
- res.value().success = 1;
+ res.value().success = 1;
}
void tst_QHttp::done( bool error )
@@ -940,11 +954,11 @@ void tst_QHttp::done( bool error )
QVERIFY( done_success == -1 );
if ( error ) {
- QVERIFY( http->error() != QHttp::NoError );
- done_success = 0;
+ QVERIFY( http->error() != QHttp::NoError );
+ done_success = 0;
} else {
- QVERIFY( http->error() == QHttp::NoError );
- done_success = 1;
+ QVERIFY( http->error() == QHttp::NoError );
+ done_success = 1;
}
QTestEventLoop::instance().exitLoop();
}
@@ -956,14 +970,14 @@ void tst_QHttp::stateChanged( int state )
#endif
QCOMPARE( http->currentId(), current_id );
if ( ids.count() > 0 )
- CURRENTREQUEST_TEST;
+ CURRENTREQUEST_TEST;
QVERIFY( state != cur_state );
QVERIFY( state == http->state() );
if ( state != QHttp::Unconnected && !connectionWithAuth ) {
- // make sure that the states are always emitted in the right order (for
- // this, we assume an ordering on the enum values, which they have at
- // the moment)
+ // make sure that the states are always emitted in the right order (for
+ // this, we assume an ordering on the enum values, which they have at
+ // the moment)
// connections with authentication will possibly reconnect, so ignore them
QVERIFY( cur_state < state );
}
@@ -980,13 +994,13 @@ void tst_QHttp::stateChanged( int state )
void tst_QHttp::responseHeaderReceived( const QHttpResponseHeader &header )
{
#if defined( DUMP_SIGNALS )
- qDebug( "%d: responseHeaderReceived(\n---{\n%s}---)", http->currentId(), header.toString().latin1() );
+ qDebug( "%d: responseHeaderReceived(\n---{\n%s}---)", http->currentId(), header.toString().toAscii().data() );
#endif
QCOMPARE( http->currentId(), current_id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
CURRENTREQUEST_TEST;
@@ -1000,25 +1014,25 @@ void tst_QHttp::readyRead( const QHttpResponseHeader & )
#endif
QCOMPARE( http->currentId(), current_id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
QVERIFY( cur_state == http->state() );
CURRENTREQUEST_TEST;
if ( QTest::currentTestFunction() != QLatin1String("bytesAvailable") ) {
- int oldSize = readyRead_ba.size();
- quint64 bytesAvail = http->bytesAvailable();
- QByteArray ba = http->readAll();
- QVERIFY( (quint64) ba.size() == bytesAvail );
- readyRead_ba.resize( oldSize + ba.size() );
- memcpy( readyRead_ba.data()+oldSize, ba.data(), ba.size() );
-
- if ( bytesTotalRead > 0 ) {
- QVERIFY( (int)readyRead_ba.size() <= bytesTotalRead );
- }
- QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
+ int oldSize = readyRead_ba.size();
+ quint64 bytesAvail = http->bytesAvailable();
+ QByteArray ba = http->readAll();
+ QVERIFY( (quint64) ba.size() == bytesAvail );
+ readyRead_ba.resize( oldSize + ba.size() );
+ memcpy( readyRead_ba.data()+oldSize, ba.data(), ba.size() );
+
+ if ( bytesTotalRead > 0 ) {
+ QVERIFY( (int)readyRead_ba.size() <= bytesTotalRead );
+ }
+ QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
}
}
@@ -1029,38 +1043,38 @@ void tst_QHttp::dataSendProgress( int done, int total )
#endif
QCOMPARE( http->currentId(), current_id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
QVERIFY( cur_state == http->state() );
CURRENTREQUEST_TEST;
if ( bytesTotalSend == bytesTotal_init ) {
- bytesTotalSend = total;
+ bytesTotalSend = total;
} else {
- QCOMPARE( bytesTotalSend, total );
+ QCOMPARE( bytesTotalSend, total );
}
QVERIFY( bytesTotalSend != bytesTotal_init );
QVERIFY( bytesDoneSend <= done );
bytesDoneSend = done;
if ( bytesTotalSend > 0 ) {
- QVERIFY( bytesDoneSend <= bytesTotalSend );
+ QVERIFY( bytesDoneSend <= bytesTotalSend );
}
if ( QTest::currentTestFunction() == QLatin1String("abort") ) {
- // ### it would be nice if we could specify in our testdata when to do
- // the abort
- if ( done >= total/100000 ) {
- if ( ids.count() != 1 ) {
- // do abort only once
- int tmpId = ids.first();
- ids.clear();
- ids << tmpId;
- http->abort();
- }
- }
+ // ### it would be nice if we could specify in our testdata when to do
+ // the abort
+ if ( done >= total/100000 ) {
+ if ( ids.count() != 1 ) {
+ // do abort only once
+ int tmpId = ids.first();
+ ids.clear();
+ ids << tmpId;
+ http->abort();
+ }
+ }
}
}
@@ -1071,38 +1085,38 @@ void tst_QHttp::dataReadProgress( int done, int total )
#endif
QCOMPARE( http->currentId(), current_id );
if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
+ QVERIFY( http->hasPendingRequests() );
} else {
- QVERIFY( !http->hasPendingRequests() );
+ QVERIFY( !http->hasPendingRequests() );
}
QVERIFY( cur_state == http->state() );
CURRENTREQUEST_TEST;
if ( bytesTotalRead == bytesTotal_init )
- bytesTotalRead = total;
+ bytesTotalRead = total;
else {
- QVERIFY( bytesTotalRead == total );
+ QVERIFY( bytesTotalRead == total );
}
QVERIFY( bytesTotalRead != bytesTotal_init );
QVERIFY( bytesDoneRead <= done );
bytesDoneRead = done;
if ( bytesTotalRead > 0 ) {
- QVERIFY( bytesDoneRead <= bytesTotalRead );
+ QVERIFY( bytesDoneRead <= bytesTotalRead );
}
if ( QTest::currentTestFunction() == QLatin1String("abort") ) {
- // ### it would be nice if we could specify in our testdata when to do
- // the abort
- if ( done >= total/100000 ) {
- if ( ids.count() != 1 ) {
- // do abort only once
- int tmpId = ids.first();
- ids.clear();
- ids << tmpId;
- http->abort();
- }
- }
+ // ### it would be nice if we could specify in our testdata when to do
+ // the abort
+ if ( done >= total/100000 ) {
+ if ( ids.count() != 1 ) {
+ // do abort only once
+ int tmpId = ids.first();
+ ids.clear();
+ ids << tmpId;
+ http->abort();
+ }
+ }
}
}
@@ -1111,21 +1125,21 @@ QHttp *tst_QHttp::newHttp(bool withAuth)
{
QHttp *nHttp = new QHttp( 0 );
connect( nHttp, SIGNAL(requestStarted(int)),
- SLOT(requestStarted(int)) );
+ SLOT(requestStarted(int)) );
connect( nHttp, SIGNAL(requestFinished(int,bool)),
- SLOT(requestFinished(int,bool)) );
+ SLOT(requestFinished(int,bool)) );
connect( nHttp, SIGNAL(done(bool)),
- SLOT(done(bool)) );
+ SLOT(done(bool)) );
connect( nHttp, SIGNAL(stateChanged(int)),
- SLOT(stateChanged(int)) );
+ SLOT(stateChanged(int)) );
connect( nHttp, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)),
- SLOT(responseHeaderReceived(const QHttpResponseHeader&)) );
+ SLOT(responseHeaderReceived(const QHttpResponseHeader&)) );
connect( nHttp, SIGNAL(readyRead(const QHttpResponseHeader&)),
- SLOT(readyRead(const QHttpResponseHeader&)) );
+ SLOT(readyRead(const QHttpResponseHeader&)) );
connect( nHttp, SIGNAL(dataSendProgress(int,int)),
- SLOT(dataSendProgress(int,int)) );
+ SLOT(dataSendProgress(int,int)) );
connect( nHttp, SIGNAL(dataReadProgress(int,int)),
- SLOT(dataReadProgress(int,int)) );
+ SLOT(dataReadProgress(int,int)) );
connectionWithAuth = withAuth;
return nHttp;
@@ -1143,9 +1157,9 @@ void tst_QHttp::addRequest( QHttpRequestHeader header, int id )
bool tst_QHttp::headerAreEqual( const QHttpHeader &h1, const QHttpHeader &h2 )
{
if ( !h1.isValid() )
- return !h2.isValid();
+ return !h2.isValid();
if ( !h2.isValid() )
- return !h1.isValid();
+ return !h1.isValid();
return h1.toString() == h2.toString();
}
@@ -1165,13 +1179,13 @@ void tst_QHttp::reconnect()
QTestEventLoop::instance().enterLoop(60);
if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
+ QFAIL("Network operation timed out");
QCOMPARE(reconnect_state_connect_count, 1);
QTestEventLoop::instance().enterLoop(60);
if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
+ QFAIL("Network operation timed out");
QCOMPARE(reconnect_state_connect_count, 2);
}
@@ -1212,12 +1226,12 @@ private slots:
socket->write("HTTP/1.1 404 Not found\r\n"
"content-length: 4\r\n\r\nabcd");
socket->disconnectFromHost();
- }
+ };
};
void tst_QHttp::unexpectedRemoteClose()
{
- QFETCH_GLOBAL(int, proxyType);
+ QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
// This test doesn't make sense for SOCKS5
return;
@@ -1228,7 +1242,11 @@ void tst_QHttp::unexpectedRemoteClose()
QCoreApplication::instance()->processEvents();
QEventLoop loop;
+#ifndef Q_OS_SYMBIAN
QTimer::singleShot(3000, &loop, SLOT(quit()));
+#else
+ QTimer::singleShot(30000, &loop, SLOT(quit()));
+#endif
QHttp http;
QObject::connect(&http, SIGNAL(done(bool)), &loop, SLOT(quit()));
@@ -1380,7 +1398,7 @@ void tst_QHttp::cachingProxyAndSsl()
void tst_QHttp::emptyBodyInReply()
{
// Note: if this test starts failing, please verify the date on the file
- // returned by Apache on http://fluke.troll.no/
+ // returned by Apache on http://netiks.troll.no/
// It is right now hard-coded to the date below
QHttp http;
http.setHost(QtNetworkSettings::serverName());
@@ -1458,8 +1476,9 @@ void tst_QHttp::connectionClose()
// Note: the servers might change too...
//
// This was added in response to bug 176822
+#ifndef Q_OS_SYMBIAN
QSKIP("This test is manual - read comments in the source code", SkipAll);
-
+#endif
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index b22397fb1e..98f9d209bf 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -49,6 +49,10 @@
class tst_QHttpNetworkConnection: public QObject
{
Q_OBJECT
+
+public:
+ tst_QHttpNetworkConnection();
+
public Q_SLOTS:
void finishedReply();
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail);
@@ -100,6 +104,10 @@ private Q_SLOTS:
};
+tst_QHttpNetworkConnection::tst_QHttpNetworkConnection()
+{
+ Q_SET_DEFAULT_IAP
+}
void tst_QHttpNetworkConnection::initTestCase()
{
@@ -199,8 +207,8 @@ void tst_QHttpNetworkConnection::get_data()
QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962;
QTest::newRow("success-external") << "http://" << "www.ietf.org" << "/rfc/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962;
- QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1 << 1023;
- QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1 << 956;
+ QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1 << 997 + QtNetworkSettings::serverName().size();
+ QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1 << 930 + QtNetworkSettings::serverName().size();
}
void tst_QHttpNetworkConnection::get()
@@ -367,7 +375,7 @@ void tst_QHttpNetworkConnection::post_data()
QTest::addColumn<int>("downloadSize");
QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/cgi-bin/echo.cgi" << ushort(80) << false << "7 bytes" << 200 << "OK" << 7 << 7;
- QTest::newRow("failure-internal") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << "Hello World" << 404 << "Not Found" << -1 << 1023;
+ QTest::newRow("failure-internal") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << "Hello World" << 404 << "Not Found" << -1 << 997 + QtNetworkSettings::serverName().size();
}
void tst_QHttpNetworkConnection::post()
@@ -410,8 +418,17 @@ void tst_QHttpNetworkConnection::post()
QCOMPARE(reply->statusCode(), statusCode);
QCOMPARE(reply->reasonPhrase(), statusString);
- QCOMPARE(reply->contentLength(), qint64(contentLength));
-
+
+ qint64 cLen = reply->contentLength();
+ if (cLen==-1) {
+ // HTTP 1.1 server may respond with chunked encoding and in that
+ // case contentLength is not present in reply -> verify that it is the case
+ QByteArray transferEnc = reply->headerField("Transfer-Encoding");
+ QCOMPARE(transferEnc, QByteArray("chunked"));
+ } else {
+ QCOMPARE(cLen, qint64(contentLength));
+ }
+
stopWatch.start();
QByteArray ba;
do {
@@ -424,6 +441,7 @@ void tst_QHttpNetworkConnection::post()
QVERIFY(reply->isFinished());
QCOMPARE(ba.size(), downloadSize);
+
delete reply;
}
diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 7eaf7c7e6e..3161873dd7 100644
--- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -139,13 +139,14 @@ public slots:
tst_QHttpSocketEngine::tst_QHttpSocketEngine()
{
+ Q_SET_DEFAULT_IAP
}
tst_QHttpSocketEngine::~tst_QHttpSocketEngine()
{
-
}
+
void tst_QHttpSocketEngine::init()
{
tmpSocket = 0;
@@ -305,11 +306,11 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
QVERIFY(!socketDevice.localAddress().isNull());
QVERIFY(socketDevice.localPort() > 0);
@@ -323,9 +324,9 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
array.resize(available);
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
- // Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ // Check that the greeting is what we expect it to be
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+
// Write a logout message
QByteArray array2 = "XXXX LOGOUT\r\n";
@@ -454,7 +455,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest()
// Read greeting
QVERIFY(socket.waitForReadyRead(5000));
QString s = socket.readLine();
- QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData());
// Write NOOP
QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8);
@@ -527,9 +528,11 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
}
// Read greeting
- QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
- QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
+ QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
+ QtNetworkSettings::expectedReplyIMAP().constData());
+
+
tcpSocketNonBlocking_data.clear();
tcpSocketNonBlocking_totalWritten = 0;
@@ -648,7 +651,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
QTime stopWatch;
stopWatch.start();
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QTestEventLoop::instance().enterLoop(240);
#else
QTestEventLoop::instance().enterLoop(60);
@@ -692,11 +695,11 @@ void tst_QHttpSocketEngine::passwordAuth()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password"));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -707,10 +710,10 @@ void tst_QHttpSocketEngine::passwordAuth()
QByteArray array;
array.resize(available);
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
-
+
// Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+
// Write a logout message
QByteArray array2 = "XXXX LOGOUT\r\n";
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index 19c13b70ca..df121b61d3 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -12,6 +12,13 @@ wince*: {
}
addPlugins.path = imageformats
DEPLOYMENT += addFiles addPlugins
+} else:symbian* {
+ addFiles.sources = icons
+ addFiles.path = .
+ addPlugins.sources = qico.dll
+ addPlugins.path = imageformats
+ DEPLOYMENT += addFiles addPlugins
+ DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qicoimageformat/tst_qticoimageformat.cpp b/tests/auto/qicoimageformat/tst_qticoimageformat.cpp
index 7d7f4acac3..89a0505bbd 100644
--- a/tests/auto/qicoimageformat/tst_qticoimageformat.cpp
+++ b/tests/auto/qicoimageformat/tst_qticoimageformat.cpp
@@ -42,6 +42,12 @@
#include <QtGui>
#include <QtCore>
+#if defined(Q_OS_SYMBIAN)
+# define STRINGIFY(x) #x
+# define TOSTRING(x) STRINGIFY(x)
+# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
+#endif
+
class tst_QtIcoImageFormat : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro
index c8d77e8571..982bc5a2d8 100644
--- a/tests/auto/qicon/qicon.pro
+++ b/tests/auto/qicon/qicon.pro
@@ -11,6 +11,13 @@ wince*:{
DEPLOYMENT += addFiles
DEPLOYMENT_PLUGIN += qsvg
DEFINES += SRCDIR=\\\".\\\"
+} else:symbian* {
+ QT += xml svg
+ addFiles.sources = *.png *.tga *.svg *.svgz
+ addFiles.path = .
+ plugins.sources = qsvgicon.dll
+ plugins.path = iconengines
+ DEPLOYMENT += addFiles plugins
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index 4e9a880b45..c7bee475dc 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -43,6 +43,10 @@
#include <QtTest/QtTest>
#include <qicon.h>
+
+#if defined(Q_OS_SYMBIAN)
+#define SRCDIR "."
+#endif
#include <qiconengine.h>
Q_DECLARE_METATYPE(QSize)
@@ -122,7 +126,6 @@ void tst_QIcon::actualSize_data()
QTest::newRow("resource10") << ":/rect.png" << QSize( 25, 50) << QSize( 20, 40);
const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/");
-
QTest::newRow("external0") << prefix + "image.png" << QSize(128, 128) << QSize(128, 128);
QTest::newRow("external1") << prefix + "image.png" << QSize( 64, 64) << QSize( 64, 64);
QTest::newRow("external2") << prefix + "image.png" << QSize( 32, 64) << QSize( 32, 32);
@@ -177,7 +180,6 @@ void tst_QIcon::actualSize2_data()
void tst_QIcon::actualSize2()
{
QIcon icon;
-
const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/");
icon.addPixmap(QPixmap(prefix + "image.png"));
@@ -236,7 +238,6 @@ void tst_QIcon::isNull() {
QVERIFY(!iconNoFileSuffix.actualSize(QSize(32, 32)).isValid());
const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/");
-
// test string constructor with existing file but unsupported format
QIcon iconUnsupportedFormat = QIcon(prefix + "image.tga");
QVERIFY(!iconUnsupportedFormat.isNull());
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index f10a488590..69d6f0f414 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -6,6 +6,13 @@ wince*: {
addImages.path = images
DEPLOYMENT += addImages
DEFINES += SRCDIR=\\\".\\\"
+} else:symbian* {
+ TARGET.EPOCHEAPSIZE = 0x200000 0x800000
+ addImages.sources = images/*
+ addImages.path = images
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += addImages imagePlugins
} else {
contains(QT_CONFIG, qt3support): QT += qt3support
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 88bbb50004..b6be5e64b4 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -51,8 +51,12 @@
#include <qpainter.h>
#include <private/qdrawhelper_p.h>
+
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
Q_DECLARE_METATYPE(QImage::Format)
@@ -260,8 +264,11 @@ void tst_QImage::formatHandlersInput_data()
{
QTest::addColumn<QString>("testFormat");
QTest::addColumn<QString>("testFile");
-
+ #ifdef Q_OS_SYMBIAN
+ const QString prefix = QLatin1String(SRCDIR) + "images/";
+ #else
const QString prefix = QLatin1String(SRCDIR) + "/images/";
+ #endif
// add a new line here when a file is added
QTest::newRow("ICO") << "ICO" << prefix + "image.ico";
@@ -280,7 +287,6 @@ void tst_QImage::formatHandlersInput()
{
QFETCH(QString, testFormat);
QFETCH(QString, testFile);
-
QList<QByteArray> formats = QImageReader::supportedImageFormats();
// qDebug("Image input formats : %s", formats.join(" | ").latin1());
@@ -292,7 +298,7 @@ void tst_QImage::formatHandlersInput()
}
}
if (formatSupported) {
-// qDebug(QImage::imageFormat(testFile));
+// qDebug(QImage::imageFormat(testFile));
QCOMPARE(testFormat.toLatin1().toLower(), QImageReader::imageFormat(testFile));
} else {
QString msg = "Format not supported : ";
@@ -1464,10 +1470,12 @@ void tst_QImage::smoothScale3()
void tst_QImage::smoothScaleBig()
{
-#ifndef Q_OS_WINCE
- int bigValue = 200000;
+#if defined(Q_OS_WINCE)
+ int bigValue = 2000;
+#elif defined(Q_OS_SYMBIAN)
+ int bigValue = 2000;
#else
- int bigValue = 2000;
+ int bigValue = 200000;
#endif
QImage tall(4, bigValue, QImage::Format_ARGB32);
tall.fill(0x0);
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index b1788236bf..4925498564 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -24,3 +24,13 @@ wince*: {
DEPLOYMENT += images imagePlugins
}
+symbian*: {
+ images.sources = images
+ images.path = .
+
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.path = imageformats
+
+ DEPLOYMENT += images imagePlugins
+}
+
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 384111155c..3da79f3cae 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -758,7 +758,9 @@ void tst_QImageReader::readFromDevice()
{
QFETCH(QString, fileName);
QFETCH(QByteArray, format);
-
+ #ifdef Q_OS_SYMBIAN
+ QSKIP("Symbian local sockets are not working", SkipAll);
+ #endif
QImage expectedImage(fileName, format);
QFile file(fileName);
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index e62c1a5917..5a2c9088bd 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -10,6 +10,12 @@ wince*: {
addFiles.path = images
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
+} else:symbian* {
+ addFiles.sources = images\*.*
+ addFiles.path = images
+ imagePlugins.sources = qjpeg.dll qtiff.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += addFiles imagePlugins
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
-} \ No newline at end of file
+}
diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp
index 878d398202..4688881841 100644
--- a/tests/auto/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp
@@ -52,6 +52,9 @@
#include <QPainter>
#include <QSet>
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage)
@@ -99,9 +102,11 @@ private slots:
void saveToTemporaryFile();
};
-
+#ifdef Q_OS_SYMBIAN
+static const QLatin1String prefix(SRCDIR "images/");
+#else
static const QLatin1String prefix(SRCDIR "/images/");
-
+#endif
static void initializePadding(QImage *image)
{
int effectiveBytesPerLine = (image->width() * image->depth() + 7) / 8;
@@ -269,7 +274,7 @@ void tst_QImageWriter::writeImage2_data()
#if defined QTEST_HAVE_TIFF
void tst_QImageWriter::largeTiff()
{
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QImage img(4096, 2048, QImage::Format_ARGB32);
QPainter p(&img);
@@ -295,6 +300,8 @@ void tst_QImageWriter::largeTiff()
QVERIFY(!img2.isNull());
QCOMPARE(img, img2);
+#else
+ QWARN("not tested on Symbian/WinCE");
#endif
}
#endif
diff --git a/tests/auto/qinputcontext/qinputcontext.pro b/tests/auto/qinputcontext/qinputcontext.pro
new file mode 100644
index 0000000000..b3ea8c276e
--- /dev/null
+++ b/tests/auto/qinputcontext/qinputcontext.pro
@@ -0,0 +1,2 @@
+load(qttest_p4)
+SOURCES += tst_qinputcontext.cpp
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp
new file mode 100644
index 0000000000..444b400914
--- /dev/null
+++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include "../../shared/util.h"
+
+#include <qinputcontext.h>
+#include <qlineedit.h>
+#include <qplaintextedit.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+
+class tst_QInputContext : public QObject
+{
+Q_OBJECT
+
+public:
+ tst_QInputContext() {}
+ virtual ~tst_QInputContext() {}
+
+public slots:
+ void initTestCase() {}
+ void cleanupTestCase() {}
+ void init() {}
+ void cleanup() {}
+private slots:
+ void maximumTextLength();
+ void filterMouseEvents();
+ void requestSoftwareInputPanel();
+ void closeSoftwareInputPanel();
+};
+
+void tst_QInputContext::maximumTextLength()
+{
+ QLineEdit le;
+
+ le.setMaxLength(15);
+ QVariant variant = le.inputMethodQuery(Qt::ImMaximumTextLength);
+ QVERIFY(variant.isValid());
+ QCOMPARE(variant.toInt(), 15);
+
+ QPlainTextEdit pte;
+ // For BC/historical reasons, QPlainTextEdit::inputMethodQuery is protected.
+ variant = static_cast<QWidget *>(&pte)->inputMethodQuery(Qt::ImMaximumTextLength);
+ QVERIFY(!variant.isValid());
+}
+
+class QFilterInputContext : public QInputContext
+{
+public:
+ QFilterInputContext() : lastType(QEvent::None) {}
+ ~QFilterInputContext() {}
+
+ QString identifierName() { return QString(); }
+ QString language() { return QString(); }
+
+ void reset() {}
+
+ bool isComposing() const { return false; }
+
+ bool filterEvent( const QEvent *event )
+ {
+ lastType = event->type();
+ return false;
+ }
+
+public:
+ QEvent::Type lastType;
+};
+
+void tst_QInputContext::filterMouseEvents()
+{
+ QLineEdit le;
+ le.show();
+ QApplication::setActiveWindow(&le);
+
+ QFilterInputContext *ic = new QFilterInputContext;
+ le.setInputContext(ic);
+ QTest::mouseClick(&le, Qt::LeftButton);
+
+ QCOMPARE(ic->lastType, QEvent::MouseButtonRelease);
+
+ le.setInputContext(0);
+}
+
+void tst_QInputContext::requestSoftwareInputPanel()
+{
+ QWidget w;
+ QLayout *layout = new QVBoxLayout;
+ QLineEdit *le1, *le2;
+ le1 = new QLineEdit;
+ le2 = new QLineEdit;
+ layout->addWidget(le1);
+ layout->addWidget(le2);
+ w.setLayout(layout);
+
+ QFilterInputContext *ic1, *ic2;
+ ic1 = new QFilterInputContext;
+ ic2 = new QFilterInputContext;
+ le1->setInputContext(ic1);
+ le2->setInputContext(ic2);
+
+ w.show();
+ QApplication::setActiveWindow(&w);
+
+ // Testing single click panel activation.
+ QApplication::setTwoClicksToRequestSIP(false);
+ QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QCOMPARE(ic2->lastType, QEvent::RequestSoftwareInputPanel);
+
+ // Testing double click panel activation.
+ QApplication::setTwoClicksToRequestSIP(true);
+ QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel);
+ QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QCOMPARE(ic1->lastType, QEvent::RequestSoftwareInputPanel);
+
+ // Testing right mouse button
+ QTest::mouseClick(le1, Qt::RightButton, Qt::NoModifier, QPoint(5, 5));
+ QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel);
+}
+
+void tst_QInputContext::closeSoftwareInputPanel()
+{
+ QWidget w;
+ QLayout *layout = new QVBoxLayout;
+ QLineEdit *le1, *le2;
+ QRadioButton *rb;
+ le1 = new QLineEdit;
+ le2 = new QLineEdit;
+ rb = new QRadioButton;
+ layout->addWidget(le1);
+ layout->addWidget(le2);
+ layout->addWidget(rb);
+ w.setLayout(layout);
+
+ QFilterInputContext *ic1, *ic2;
+ ic1 = new QFilterInputContext;
+ ic2 = new QFilterInputContext;
+ le1->setInputContext(ic1);
+ le2->setInputContext(ic2);
+
+ w.show();
+ QApplication::setActiveWindow(&w);
+
+ // Testing that panel doesn't close between two input methods aware widgets.
+ QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QVERIFY(ic2->lastType != QEvent::CloseSoftwareInputPanel);
+
+ // Testing that panel closes when focusing non-aware widget.
+ QTest::mouseClick(rb, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
+ QCOMPARE(ic2->lastType, QEvent::CloseSoftwareInputPanel);
+}
+
+QTEST_MAIN(tst_QInputContext)
+#include "tst_qinputcontext.moc"
diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro
index e2864e86bc..e695bf6843 100644
--- a/tests/auto/qiodevice/qiodevice.pro
+++ b/tests/auto/qiodevice/qiodevice.pro
@@ -9,6 +9,11 @@ wince*: {
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
!wince50standard-x86-msvc2005: DEFINES += WINCE_EMULATOR_TEST=1
+} else:symbian {
+ # SRCDIR defined in code in symbian
+ addFiles.sources = tst_qiodevice.cpp
+ addFiles.path = .
+ DEPLOYMENT += addFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
contains(QT_CONFIG, qt3support):QT += qt3support
diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index 367a2e0824..dee37dce0c 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -49,6 +49,10 @@
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
class tst_QIODevice : public QObject
{
Q_OBJECT
@@ -94,11 +98,11 @@ void tst_QIODevice::getSetCheck()
tst_QIODevice::tst_QIODevice()
{
+ Q_SET_DEFAULT_IAP
}
tst_QIODevice::~tst_QIODevice()
{
-
}
void tst_QIODevice::init()
@@ -120,7 +124,7 @@ void tst_QIODevice::constructing_QTcpSocket()
QVERIFY(!device->isOpen());
- socket.connectToHost(QtNetworkSettings::serverName(), 143);
+ socket.connectToHost(QtNetworkSettings::serverName(), 21);
QVERIFY(socket.waitForConnected(5000));
QVERIFY(device->isOpen());
@@ -136,6 +140,7 @@ void tst_QIODevice::constructing_QTcpSocket()
socket.close();
socket.connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket.waitForConnected(5000));
+ QVERIFY(device->isOpen());
while (!device->canReadLine())
QVERIFY(device->waitForReadyRead(5000));
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index c51f4c7242..962449c01a 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -4,6 +4,8 @@ TARGET = tst_qitemmodel
QT += sql
+symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+
# NOTE: The deployment of the sqldrivers is disabled on purpose.
# If we deploy the plugins, they are loaded twice when running
# the tests on the autotest system. In that case we run out of
diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp
index 3317c1de1d..907cabbc5b 100644
--- a/tests/auto/qitemview/tst_qitemview.cpp
+++ b/tests/auto/qitemview/tst_qitemview.cpp
@@ -256,7 +256,7 @@ void tst_QItemView::populate()
{
treeModel = new CheckerModel;
QModelIndex parent;
-#ifdef QT_ARCH_ARM
+#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN)
const int baseInsert = 4;
#else
const int baseInsert = 26;
@@ -354,18 +354,19 @@ void tst_QItemView::nonDestructiveBasicTest()
QCOMPARE(view->tabKeyNavigation(), false);
view->setTabKeyNavigation(true);
QCOMPARE(view->tabKeyNavigation(), true);
-
+#ifndef QT_NO_DRAGANDDROP
// setDropIndicatorShown
view->setDropIndicatorShown(false);
QCOMPARE(view->showDropIndicator(), false);
view->setDropIndicatorShown(true);
QCOMPARE(view->showDropIndicator(), true);
-
+
// setDragEnabled
view->setDragEnabled(false);
QCOMPARE(view->dragEnabled(), false);
view->setDragEnabled(true);
QCOMPARE(view->dragEnabled(), true);
+#endif
// setAlternatingRowColors
view->setAlternatingRowColors(false);
@@ -459,7 +460,7 @@ void tst_QItemView::spider()
view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll);
view->setModel(treeModel);
view->show();
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
srandom(0);
#else
srandom(time(0));
diff --git a/tests/auto/qkeyevent/tst_qkeyevent.cpp b/tests/auto/qkeyevent/tst_qkeyevent.cpp
index 804b8737ed..1548815b1e 100644
--- a/tests/auto/qkeyevent/tst_qkeyevent.cpp
+++ b/tests/auto/qkeyevent/tst_qkeyevent.cpp
@@ -86,7 +86,7 @@ private:
KeyEventWidget::KeyEventWidget( QWidget* parent, const char* name )
- : QWidget( parent ), recievedKeyPress( FALSE ), recievedKeyRelease( FALSE ),
+ : QWidget( parent ), recievedKeyPress( false ), recievedKeyRelease( false ),
lastKeyPress( 0 ), lastKeyRelease( 0 )
{
setObjectName(name);
@@ -94,6 +94,8 @@ KeyEventWidget::KeyEventWidget( QWidget* parent, const char* name )
KeyEventWidget::~KeyEventWidget()
{
+ delete lastKeyPress;
+ delete lastKeyRelease;
}
QKeyEvent* KeyEventWidget::getLastKeyPress()
@@ -108,14 +110,18 @@ QKeyEvent* KeyEventWidget::getLastKeyRelease()
void KeyEventWidget::keyPressEvent( QKeyEvent* e )
{
- lastKeyPress = e;
- recievedKeyPress = TRUE;
+ if (lastKeyPress)
+ delete lastKeyPress;
+ lastKeyPress = new QKeyEvent(*e);
+ recievedKeyPress = true;
}
void KeyEventWidget::keyReleaseEvent( QKeyEvent* e )
{
- lastKeyRelease = e;
- recievedKeyRelease = TRUE;
+ if (lastKeyRelease)
+ delete lastKeyRelease;
+ lastKeyRelease = new QKeyEvent(*e);
+ recievedKeyRelease = true;
}
tst_QKeyEvent::tst_QKeyEvent()
@@ -151,13 +157,13 @@ void tst_QKeyEvent::sendRecieveKeyEvents_data()
continue;
}
if ( a == Qt::Key_Backtab ) // Actually SHIFT+Tab
- QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << int(Qt::Key_Tab) << FALSE << "";
+ QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << int(Qt::Key_Tab) << false << "";
else
- QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << a << FALSE << "";
+ QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << a << false << "";
}
for ( a = Qt::Key_Space; a < Qt::Key_ydiaeresis; a++ ) {
- QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << a << TRUE << QString( QChar(a) );
+ QTest::newRow( QString("key - %1").arg( a ).toLatin1() ) << a << true << QString( QChar(a) );
}
}
@@ -168,13 +174,12 @@ void tst_QKeyEvent::standardKey()
void tst_QKeyEvent::sendRecieveKeyEvents()
{
- QSKIP( "Skipped while it is being worked on", SkipAll);
QFETCH( int, key );
QFETCH( bool, textExpected );
QFETCH( QString, text );
- testWidget->recievedKeyPress = FALSE;
+ testWidget->recievedKeyPress = false;
-#ifdef Q_WS_WIN
+#ifdef Q_WS_WIN
// Will be eaten by Windows system
if ( key == Qt::Key_Print )
return;
@@ -203,7 +208,37 @@ void tst_QKeyEvent::sendRecieveKeyEvents()
if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis )
return;
#endif // Q_WS_WIN
+
+#ifdef Q_OS_SYMBIAN
+ // Not supported on symbian
+ if ( key == Qt::Key_Print )
+ return;
+
+ // Not supported on symbian
+ if ( key == Qt::Key_SysReq )
+ return;
+
+ // Not supported on symbian
+ if ( key >= Qt::Key_F25 && key <= Qt::Key_Super_R )
+ return;
+ if ( key >= Qt::Key_Hyper_L && key <= Qt::Key_Hyper_R )
+ return;
+ if ( key == Qt::Key_Help )
+ return;
+ // Not sure on how to add support for these yet
+ if ( key >= Qt::Key_Direction_L && key <= Qt::Key_Direction_R )
+ return;
+
+ // Not supported on symbian
+ if ( key >= Qt::Key_Exclam && key <= Qt::Key_Slash )
+ return;
+ if ( key >= Qt::Key_Colon && key <= Qt::Key_At )
+ return;
+ if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis )
+ return;
+#endif // Q_WS_WIN
+
if ( key == Qt::Key_F1 )
return; // Ignore for the moment
@@ -214,7 +249,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents()
QCOMPARE( ke->key(), key );
if ( textExpected )
QCOMPARE( ke->text(), text );
- testWidget->recievedKeyRelease = FALSE;
+ testWidget->recievedKeyRelease = false;
QTest::keyRelease( testWidget, (Qt::Key)key );
while ( !testWidget->recievedKeyRelease )
qApp->processEvents();
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 8fcee367ed..943f0e1076 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -504,7 +504,7 @@ void tst_QKeySequence::translated()
QFETCH(QString, compKey);
#ifdef Q_WS_MAC
QSKIP("No need to translate modifiers on Mac OS X", SkipAll);
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QSKIP("No need to translate modifiers on WinCE", SkipAll);
#endif
diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro
index 141559efd7..c274b4a44e 100644
--- a/tests/auto/qlabel/qlabel.pro
+++ b/tests/auto/qlabel/qlabel.pro
@@ -3,11 +3,14 @@ SOURCES += tst_qlabel.cpp
wince*:{
DEFINES += SRCDIR=\\\"\\\"
+} !symbian {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+wince*|symbian {
addFiles.sources = *.png testdata
addFiles.path = .
DEPLOYMENT += addFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp
index 4580236880..6dc1aebbce 100644
--- a/tests/auto/qlabel/tst_qlabel.cpp
+++ b/tests/auto/qlabel/tst_qlabel.cpp
@@ -53,6 +53,9 @@
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR "."
+#endif
class Widget : public QWidget
{
diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro
index 0c69b11f9b..0dfe1e947f 100644
--- a/tests/auto/qlayout/qlayout.pro
+++ b/tests/auto/qlayout/qlayout.pro
@@ -6,7 +6,7 @@ load(qttest_p4)
SOURCES += tst_qlayout.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*: {
+wince*|symbian*: {
addFiles.sources = baseline
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qlibrary/lib/lib.pro b/tests/auto/qlibrary/lib/lib.pro
index 14b87837b0..25a50b5697 100644
--- a/tests/auto/qlibrary/lib/lib.pro
+++ b/tests/auto/qlibrary/lib/lib.pro
@@ -19,7 +19,7 @@ win32: {
copy /Y $(DESTDIR_TARGET) ..\system.trolltech.test.mylib.dll && \
copy /Y $(DESTDIR_TARGET) ..\mylib_noextension
}
-unix: {
+unix:!symbian: {
QMAKE_POST_LINK = cp -f $(DESTDIR)$(TARGET) ../libmylib.so2 && \
cp -f $(DESTDIR)$(TARGET) ../system.trolltech.test.mylib.so
}
@@ -27,4 +27,5 @@ unix: {
#no special install rule for the library used by test
INSTALLS =
+symbian: TARGET.CAPABILITY=ALL -TCB
diff --git a/tests/auto/qlibrary/lib/mylib.c b/tests/auto/qlibrary/lib/mylib.c
index 1366b7c6ba..5e98362ed5 100644
--- a/tests/auto/qlibrary/lib/mylib.c
+++ b/tests/auto/qlibrary/lib/mylib.c
@@ -1,6 +1,6 @@
#include <qglobal.h>
-#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) || defined(Q_OS_SYMBIAN)
#define LIB_EXPORT __declspec(dllexport)
#else
#define LIB_EXPORT
@@ -12,7 +12,7 @@
# define BORLAND_STDCALL
#endif
-LIB_EXPORT int BORLAND_STDCALL version()
+LIB_EXPORT int BORLAND_STDCALL mylibversion()
{
return 1;
}
diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro
index 718c5c6dac..724077a7d3 100644
--- a/tests/auto/qlibrary/lib2/lib2.pro
+++ b/tests/auto/qlibrary/lib2/lib2.pro
@@ -19,11 +19,28 @@ win32: {
QMAKE_POST_LINK = copy /Y ..\mylib2.dll ..\mylib.dl2 && \
copy /Y ..\mylib2.dll ..\system.trolltech.test.mylib.dll
}
-unix: {
+
+unix:!symbian: {
QMAKE_POST_LINK = cp -f $(DESTDIR)$(TARGET) ../libmylib.so2 && \
cp -f $(DESTDIR)$(TARGET) ../system.trolltech.test.mylib.so
}
+symbian-abld: {
+ TARGET.CAPABILITY=ALL -TCB
+ QMAKE_POST_LINK = \
+ copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \
+ copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \
+ IF NOT "$(PLATFORM)==WINSCW" copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2
+}
+
+symbian-sbsv2: {
+ TARGET.CAPABILITY=ALL -TCB
+ QMAKE_POST_LINK = \
+ $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dl2 && \
+ $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/system.trolltech.test.mylib.dll && \
+ if test $(PLATFORM) != WINSCW;then $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${PWD}/../tst/mylib.dl2; fi
+}
+
#no special install rule for the library used by test
INSTALLS =
diff --git a/tests/auto/qlibrary/lib2/mylib.c b/tests/auto/qlibrary/lib2/mylib.c
index dd90f0460c..4046f1f76a 100644
--- a/tests/auto/qlibrary/lib2/mylib.c
+++ b/tests/auto/qlibrary/lib2/mylib.c
@@ -1,6 +1,6 @@
#include <qglobal.h>
-#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)|| defined(Q_OS_SYMBIAN)
#define LIB_EXPORT __declspec(dllexport)
#else
#define LIB_EXPORT
@@ -12,7 +12,7 @@
# define BORLAND_STDCALL
#endif
-LIB_EXPORT int BORLAND_STDCALL version()
+LIB_EXPORT int BORLAND_STDCALL mylibversion()
{
return 2;
}
diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro
index f3e646ad0a..9ba49ee565 100644
--- a/tests/auto/qlibrary/qlibrary.pro
+++ b/tests/auto/qlibrary/qlibrary.pro
@@ -1,3 +1,4 @@
+QT -= gui
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = lib \
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index 67437a699d..06c2cd89ae 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -16,8 +16,18 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
+}else:symbian* {
+ binDep.sources = \
+ mylib.dll \
+ system.trolltech.test.mylib.dll
+ binDep.path = /sys/bin
+#mylib.dl2 nonstandard binary deployment will cause warning in emulator,
+#but it can be safely ignored.
+ custBinDep.sources = mylib.dl2
+ custBinDep.path = /sys/bin
+
+ DEPLOYMENT += binDep custBinDep
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
-
diff --git a/tests/auto/qlibrary/tst_qlibrary.cpp b/tests/auto/qlibrary/tst_qlibrary.cpp
index 3e7e3f3423..bf326be8c0 100644
--- a/tests/auto/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/qlibrary/tst_qlibrary.cpp
@@ -85,7 +85,7 @@
# define SUFFIX ".a"
# define PREFIX "lib"
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
# undef dll_VALID
# define dll_VALID true
# define SUFFIX ".dll"
@@ -100,8 +100,12 @@
static QString sys_qualifiedLibraryName(const QString &fileName)
{
+#if defined(Q_OS_SYMBIAN)
+ return PREFIX + fileName + SUFFIX;
+#else
QString currDir = QDir::currentPath();
return currDir + "/" + PREFIX + fileName + SUFFIX;
+#endif
}
//TESTED_CLASS=
@@ -187,13 +191,13 @@ void tst_QLibrary::version()
QFETCH( int, loadversion );
QFETCH( int, resultversion );
-#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN)
+#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
QString currDir = QDir::currentPath();
QLibrary library( currDir + QLatin1Char('/') + lib, loadversion );
bool ok = library.load();
QVERIFY(ok);
- VersionFunction fnVersion = (VersionFunction)library.resolve("version");
+ VersionFunction fnVersion = (VersionFunction)library.resolve("mylibversion");
QVERIFY(fnVersion);
QCOMPARE(fnVersion(), resultversion);
#else
@@ -209,7 +213,11 @@ void tst_QLibrary::load_data()
QTest::addColumn<QString>("lib");
QTest::addColumn<bool>("result");
+#if defined(Q_OS_SYMBIAN)
+ QString currDir;
+#else
QString currDir = QDir::currentPath();
+#endif
QTest::newRow( "ok00" ) << currDir + "/mylib" << (bool)true;
QTest::newRow( "notexist" ) << currDir + "/nolib" << (bool)false;
QTest::newRow( "badlibrary" ) << currDir + "/qlibrary.pro" << (bool)false;
@@ -218,7 +226,7 @@ void tst_QLibrary::load_data()
QTest::newRow("ok (libmylib ver. 1)") << currDir + "/libmylib" <<(bool)true;
#endif
-# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << (bool)true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << (bool)true;
QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << (bool)true;
@@ -248,7 +256,12 @@ void tst_QLibrary::unload_data()
QTest::addColumn<QString>("lib");
QTest::addColumn<bool>("result");
+#if defined(Q_OS_SYMBIAN)
+ QString currDir;
+#else
QString currDir = QDir::currentPath();
+#endif
+
QTest::newRow( "mylib" ) << currDir + "/mylib" << (bool)TRUE;
#ifdef Q_WS_MAC
if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_3)
@@ -274,8 +287,12 @@ void tst_QLibrary::unload()
void tst_QLibrary::unload_after_implicit_load()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll);
+#endif
+
QLibrary library( "./mylib" );
- void *p = library.resolve("version");
+ void *p = library.resolve("mylibversion");
QVERIFY(p); // Check if it was loaded
QVERIFY(library.isLoaded());
QVERIFY(library.unload());
@@ -289,14 +306,23 @@ void tst_QLibrary::resolve_data()
QTest::addColumn<QString>("symbol");
QTest::addColumn<bool>("goodPointer");
+#if defined(Q_OS_SYMBIAN)
+ QString currDir;
+#else
QString currDir = QDir::currentPath();
- QTest::newRow( "ok00" ) << currDir + "/mylib" << QString("version") << (bool)TRUE;
+#endif
+
+ QTest::newRow( "ok00" ) << currDir + "/mylib" << QString("mylibversion") << (bool)TRUE;
QTest::newRow( "bad00" ) << currDir + "/mylib" << QString("nosym") << (bool)FALSE;
QTest::newRow( "bad01" ) << currDir + "/nolib" << QString("nosym") << (bool)FALSE;
}
void tst_QLibrary::resolve()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll);
+#endif
+
typedef int (*testFunc)();
QFETCH( QString, lib );
QFETCH( QString, symbol );
@@ -347,7 +373,7 @@ void tst_QLibrary::isLibrary_data()
QTest::newRow("good (libmylib.so.1.0.0)") << QString("libmylib.so.1.0.0") << true;
QTest::newRow("bad (libmylib.1.0.0.foo)") << QString("libmylib.1.0.0.foo") << false;
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QTest::newRow("good (with many dots)" ) << "/system.trolltech.test.mylib.dll" << true;
#endif
}
@@ -367,10 +393,15 @@ void tst_QLibrary::errorString_data()
QTest::addColumn<bool>("success");
QTest::addColumn<QString>("errorString");
+#if defined(Q_OS_SYMBIAN)
+ QString currDir;
+#else
QString currDir = QDir::currentPath();
+
QString srcDir = SRCDIR;
if (srcDir.isEmpty())
srcDir = currDir;
+#endif
QTest::newRow("bad load()") << (int)Load << QString("nosuchlib") << false << QString("Cannot load library nosuchlib: .*");
QTest::newRow("call errorString() on QLibrary with no d-pointer (crashtest)") << (int)(Load | DontSetFileName) << QString() << false << QString("Unknown error");
@@ -385,6 +416,8 @@ void tst_QLibrary::errorString_data()
QTest::newRow("bad load() with .dll suffix") << (int)Load << QString("nosuchlib.dll") << false << QString("Cannot load library nosuchlib.dll: The specified module could not be found.");
// QTest::newRow("bad unload") << (int)Unload << QString("nosuchlib.dll") << false << QString("QLibrary::unload_sys: Cannot unload nosuchlib.dll (The specified module could not be found.)");
#elif defined Q_OS_MAC
+#elif defined Q_OS_SYMBIAN
+ QTest::newRow("load invalid file") << (int)Load << "tst_qlibrary.exe" << false << QString("Cannot load library.*");
#else
QTest::newRow("load invalid file") << (int)Load << srcDir + "/library_path/invalid.so" << false << QString("Cannot load library.*");
#endif
@@ -397,6 +430,13 @@ void tst_QLibrary::errorString()
QFETCH(bool, success);
QFETCH(QString, errorString);
+#if defined(Q_OS_SYMBIAN)
+ if ( success )
+ {
+ QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipSingle );
+ }
+#endif
+
QLibrary lib;
if (!(operation & DontSetFileName)) {
lib.setFileName(fileName);
@@ -415,7 +455,7 @@ void tst_QLibrary::errorString()
ok = lib.load();
QCOMPARE(ok, true);
if (success) {
- ok = lib.resolve("version");
+ ok = lib.resolve("mylibversion");
} else {
ok = lib.resolve("nosuchsymbol");
}
@@ -446,9 +486,14 @@ void tst_QLibrary::loadHints_data()
}
#endif
+#if defined(Q_OS_SYMBIAN)
+ QString currDir;
+#else
QString currDir = QDir::currentPath();
+#endif
+
lh |= QLibrary::ResolveAllSymbolsHint;
-# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << int(lh) << (bool)TRUE;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << int(lh) << (bool)TRUE;
QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << int(lh) << (bool)TRUE;
@@ -486,7 +531,6 @@ void tst_QLibrary::fileName_data()
QTest::addColumn<QString>("libName");
QTest::addColumn<QString>("expectedFilename");
- QString currDir = QDir::currentPath();
QTest::newRow( "ok02" ) << sys_qualifiedLibraryName(QLatin1String("mylib"))
<< sys_qualifiedLibraryName(QLatin1String("mylib"));
#ifdef Q_WS_WIN
@@ -518,7 +562,12 @@ void tst_QLibrary::fileName()
void tst_QLibrary::multipleInstancesForOneLibrary()
{
+#if defined(Q_OS_SYMBIAN)
+ QString lib = "/mylib";
+#else
QString lib = QDir::currentPath() + "/mylib";
+#endif
+
QLibrary lib1(lib);
QLibrary lib2(lib);
QCOMPARE(lib1.isLoaded(), false);
diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro
index ea15cfe375..1c4f21a6a0 100644
--- a/tests/auto/qline/qline.pro
+++ b/tests/auto/qline/qline.pro
@@ -1,6 +1,4 @@
load(qttest_p4)
-QT -= gui
SOURCES += tst_qline.cpp
-unix:!mac:LIBS+=-lm
-
-
+QT -= gui
+unix:!mac:!symbian*:LIBS+=-lm
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 34a64c8054..d9005180f5 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -220,10 +220,11 @@ private slots:
void setSelection_data();
void setSelection();
+#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
void paste();
-
+#endif
void maxLengthAndInputMask();
void returnPressedKeyEvent();
@@ -2749,6 +2750,7 @@ void tst_QLineEdit::setSelection()
QCOMPARE(testWidget->cursorPosition(), expectedCursor);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QLineEdit::cut()
{
#ifdef Q_WS_MAC
@@ -2829,7 +2831,7 @@ void tst_QLineEdit::paste()
{
DEPENDS_ON("cut");
}
-
+#endif
class InputMaskValidator : public QValidator
{
public:
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index c372475303..db114476ab 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -48,7 +48,9 @@
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
#include <qstringlistmodel.h>
+#ifndef Q_OS_SYMBIAN
#include <cmath>
+#endif
#include <math.h>
#include <QtGui/QScrollBar>
#include <QtGui/QDialog>
diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro
index b840e2dce9..32e242398b 100644
--- a/tests/auto/qlocale/test/test.pro
+++ b/tests/auto/qlocale/test/test.pro
@@ -29,3 +29,4 @@ wince*: {
DEPLOYMENT += addFiles
}
+
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index b8f7c225ee..97b14939a5 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -68,6 +68,11 @@ extern "C" DWORD GetThreadLocale(void) {
# include <stdlib.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+# include <e32std.h>
+# include <private/qcore_symbian_p.h>
+#endif
+
Q_DECLARE_METATYPE(qlonglong)
Q_DECLARE_METATYPE(QDate)
Q_DECLARE_METATYPE(QLocale::FormatType)
@@ -130,6 +135,9 @@ private slots:
void queryDateTime();
void queryMeasureSystem_data();
void queryMeasureSystem();
+#if defined(Q_OS_SYMBIAN)
+ void symbianSystemLocale();
+#endif
void ampm();
@@ -317,8 +325,8 @@ void tst_QLocale::ctor()
void tst_QLocale::emptyCtor()
{
-#ifdef Q_OS_WINCE
- QSKIP("Uses unsupported Windows CE QProcess functionality", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Uses unsupported Windows CE / Symbian QProcess functionality (std streams, env)", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
@@ -663,7 +671,7 @@ void tst_QLocale::testInfAndNan()
double nan = sqrt(-1.0);
#ifdef Q_OS_WIN
- // these causes INVALID floating point exception so we want to clare the status.
+ // these cause INVALID floating point exception so we want to clear the status.
_clear87();
#endif
@@ -1056,11 +1064,11 @@ void tst_QLocale::macDefaultLocale()
QTime utcTime = QDateTime::currentDateTime().toUTC().time();
int diff = currentTime.hour() - utcTime.hour();
-
+
// Check if local time and utc time are on opposite sides of the 24-hour wrap-around.
- if (diff < -12)
+ if (diff < -12)
diff += 24;
- if (diff > 12)
+ if (diff > 12)
diff -= 24;
const QString timeString = locale.toString(QTime(1,2,3), QLocale::LongFormat);
@@ -1739,7 +1747,7 @@ void tst_QLocale::systemMeasurementSystems()
// Theoretically, we could include HPUX in this test, but its setenv implementation
// stinks. It's called putenv, and it requires you to keep the variable you pass
// to it around forever.
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
QFETCH(QString, lcAllLocale);
QFETCH(QString, lcMeasurementLocale);
QFETCH(QString, langLocale);
@@ -1763,7 +1771,7 @@ void tst_QLocale::systemMeasurementSystems()
qputenv("LC_MEASUREMENT", oldLcMeasurement.toLocal8Bit());
qputenv("LANG", oldLang.toLocal8Bit());
#else
- QSKIP("Test doesn't work on Mac or Windows", SkipAll);
+ QSKIP("Test doesn't work on Mac, Windows or Symbian", SkipAll);
#endif
}
@@ -1861,7 +1869,7 @@ void tst_QLocale::queryMeasureSystem()
// Theoretically, we could include HPUX in this test, but its setenv implementation
// stinks. It's called putenv, and it requires you to keep the variable you pass
// to it around forever.
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
QFETCH(QString, lcAllLocale);
QFETCH(QString, lcMeasurementLocale);
QFETCH(QString, langLocale);
@@ -1885,7 +1893,7 @@ void tst_QLocale::queryMeasureSystem()
qputenv("LC_MEASUREMENT", oldLcMeasurement.toLocal8Bit());
qputenv("LANG", oldLang.toLocal8Bit());
#else
- QSKIP("Test doesn't work on Mac or Windows", SkipAll);
+ QSKIP("Test doesn't work on Mac, Windows or Symbian", SkipAll);
#endif
}
#endif // QT_NO_SYSTEMLOCALE
@@ -2002,5 +2010,64 @@ void tst_QLocale::standaloneMonthName()
QCOMPARE(ru.standaloneMonthName(1, QLocale::NarrowFormat), QString::fromUtf8("\320\257"));
}
+#if defined(Q_OS_SYMBIAN)
+void tst_QLocale::symbianSystemLocale()
+{
+# if defined(__SERIES60_31__)
+ QSKIP("S60 3.1 doesn't support system format properly", SkipAll);
+# else
+ // Simple test to verify that Symbian system locale works at all
+ const QSystemLocale locale;
+ TExtendedLocale s60Locale;
+ s60Locale.LoadSystemSettings();
+
+ TTime s60Date(_L("20090117:")); // Symbian offsets day and month from zero
+ QDate date(2009,2,18);
+
+ TPtrC s60DateFormat = s60Locale.GetShortDateFormatSpec();
+ QString dateFormat = locale.query(QSystemLocale::DateFormatShort, QVariant()).toString();
+
+#if 0
+ QTime nowTime = QTime::currentTime();
+ QDateTime nowDateTime = QDateTime::currentDateTime();
+ qDebug() << "locale.query(QSystemLocale::LanguageId)" << locale.query(QSystemLocale::LanguageId, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::CountryId)" << locale.query(QSystemLocale::CountryId, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DecimalPoint)" << locale.query(QSystemLocale::DecimalPoint, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::GroupSeparator)" << locale.query(QSystemLocale::GroupSeparator, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::ZeroDigit)" << locale.query(QSystemLocale::ZeroDigit, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::NegativeSign)" << locale.query(QSystemLocale::NegativeSign, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::PositiveSign)" << locale.query(QSystemLocale::PositiveSign, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DateFormatLong)" << locale.query(QSystemLocale::DateFormatLong, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DateFormatShort)" << locale.query(QSystemLocale::DateFormatShort, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::TimeFormatLong)" << locale.query(QSystemLocale::TimeFormatLong, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::TimeFormatShort)" << locale.query(QSystemLocale::TimeFormatShort, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DayNameLong)" << locale.query(QSystemLocale::DayNameLong, QVariant(1)).toString();
+ qDebug() << "locale.query(QSystemLocale::DayNameShort)" << locale.query(QSystemLocale::DayNameShort, QVariant(1)).toString();
+ qDebug() << "locale.query(QSystemLocale::MonthNameLong)" << locale.query(QSystemLocale::MonthNameLong, QVariant(2)).toString();
+ qDebug() << "locale.query(QSystemLocale::MonthNameShort)" << locale.query(QSystemLocale::MonthNameShort, QVariant(2)).toString();
+ qDebug() << "locale.query(QSystemLocale::DateToStringLong)" << locale.query(QSystemLocale::DateToStringLong, QVariant(date)).toString();
+ qDebug() << "locale.query(QSystemLocale::DateToStringShort)" << locale.query(QSystemLocale::DateToStringShort, QVariant(date)).toString();
+ qDebug() << "locale.query(QSystemLocale::TimeToStringLong)" << locale.query(QSystemLocale::TimeToStringLong, QVariant(nowTime)).toString();
+ qDebug() << "locale.query(QSystemLocale::TimeToStringShort)" << locale.query(QSystemLocale::TimeToStringShort, QVariant(nowTime)).toString();
+ qDebug() << "locale.query(QSystemLocale::DateTimeFormatLong)" << locale.query(QSystemLocale::DateTimeFormatLong, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DateTimeFormatShort)" << locale.query(QSystemLocale::DateTimeFormatShort, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::DateTimeToStringLong)" << locale.query(QSystemLocale::DateTimeToStringLong, QVariant(nowDateTime)).toString();
+ qDebug() << "locale.query(QSystemLocale::DateTimeToStringShort)" << locale.query(QSystemLocale::DateTimeToStringShort, QVariant(nowDateTime)).toString();
+ qDebug() << "locale.query(QSystemLocale::MeasurementSystem)" << locale.query(QSystemLocale::MeasurementSystem, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::AMText)" << locale.query(QSystemLocale::AMText, QVariant()).toString();
+ qDebug() << "locale.query(QSystemLocale::PMText)" << locale.query(QSystemLocale::PMText, QVariant()).toString();
+#endif
+
+ TBuf<50> s60FormattedDate;
+ TRAPD(err, s60Date.FormatL(s60FormattedDate, s60DateFormat));
+ QVERIFY(err == KErrNone);
+ QString s60FinalResult = qt_TDes2QStringL(s60FormattedDate);
+ QString finalResult = date.toString(dateFormat);
+
+ QCOMPARE(finalResult, s60FinalResult);
+# endif
+}
+#endif
+
QTEST_APPLESS_MAIN(tst_QLocale)
#include "tst_qlocale.moc"
diff --git a/tests/auto/qlocalsocket/lackey/main.cpp b/tests/auto/qlocalsocket/lackey/main.cpp
index 4ddb9c3fb2..077cc63d37 100644
--- a/tests/auto/qlocalsocket/lackey/main.cpp
+++ b/tests/auto/qlocalsocket/lackey/main.cpp
@@ -41,7 +41,7 @@
#include <qscriptengine.h>
-#include <QtGui/QtGui>
+ #include <QFile>
#include <QTest>
#include <qlocalsocket.h>
diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro
index 4df17deaad..0849453aac 100644
--- a/tests/auto/qlocalsocket/qlocalsocket.pro
+++ b/tests/auto/qlocalsocket/qlocalsocket.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = lackey test
-!wince*: SUBDIRS += example
+!wince*:!symbian*: SUBDIRS += example
diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro
index 7befdf91c1..c58bfeee4b 100644
--- a/tests/auto/qlocalsocket/test/test.pro
+++ b/tests/auto/qlocalsocket/test/test.pro
@@ -2,11 +2,14 @@ load(qttest_p4)
DEFINES += QLOCALSERVER_DEBUG
DEFINES += QLOCALSOCKET_DEBUG
-!wince*: {
- DEFINES += SRCDIR=\\\"$$PWD/../\\\"
-} else {
+
+symbian* {
+ # nothing
+} else:wince* {
DEFINES += QT_LOCALSOCKET_TCP
DEFINES += SRCDIR=\\\"../\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
QT = core network
@@ -24,7 +27,7 @@ CONFIG(debug_and_release) {
DESTDIR = ..
}
-wince* {
+wince* | symbian* {
additionalFiles.sources = ../lackey/lackey.exe
additionalFiles.path = lackey
scriptFiles.sources = ../lackey/scripts/*.js
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index deabda6bf0..5d73c984a0 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -47,9 +47,14 @@
#include <QtNetwork/qlocalserver.h>
#include "../../shared/util.h"
+#ifdef Q_OS_SYMBIAN
+ #include <unistd.h>
+#endif
//TESTED_CLASS=QLocalServer, QLocalSocket
//TESTED_FILES=network/socket/qlocalserver.cpp network/socket/qlocalsocket.cpp
-
+#ifdef Q_OS_SYMBIAN
+ #define SRCDIR ""
+#endif
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError)
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState)
@@ -103,6 +108,10 @@ private slots:
void debug();
+#ifdef Q_OS_SYMBIAN
+private:
+ void unlink(QString serverName);
+#endif
};
tst_QLocalSocket::tst_QLocalSocket()
@@ -285,6 +294,9 @@ void tst_QLocalSocket::listen()
QSignalSpy spyNewConnection(&server, SIGNAL(newConnection()));
QFETCH(QString, name);
+#ifdef Q_OS_SYMBIAN
+ unlink(name);
+#endif
QFETCH(bool, canListen);
QFETCH(bool, close);
QVERIFY2((server.listen(name) == canListen), server.errorString().toLatin1().constData());
@@ -335,7 +347,9 @@ void tst_QLocalSocket::listenAndConnect()
QFETCH(QString, name);
QFETCH(bool, canListen);
-
+#ifdef Q_OS_SYMBIAN
+ unlink(name);
+#endif
QCOMPARE(server.listen(name), canListen);
QTest::qWait(1000);
//QVERIFY(!server.errorString().isEmpty());
@@ -355,7 +369,7 @@ void tst_QLocalSocket::listenAndConnect()
QSignalSpy spyReadyRead(socket, SIGNAL(readyRead()));
socket->connectToServer(name);
-#ifdef QT_LOCALSOCKET_TCP
+#if defined(QT_LOCALSOCKET_TCP) || defined (Q_OS_SYMBIAN)
QTest::qWait(250);
#endif
@@ -458,6 +472,9 @@ void tst_QLocalSocket::sendData_data()
void tst_QLocalSocket::sendData()
{
QFETCH(QString, name);
+#ifdef Q_OS_SYMBIAN
+ unlink(name);
+#endif
QFETCH(bool, canListen);
LocalServer server;
@@ -476,8 +493,10 @@ void tst_QLocalSocket::sendData()
socket.connectToServer(name);
bool timedOut = true;
QCOMPARE(server.waitForNewConnection(3000, &timedOut), canListen);
-#ifdef QT_LOCALSOCKET_TCP
+#if defined(QT_LOCALSOCKET_TCP)
QTest::qWait(250);
+#elif defined(Q_OS_SYMBIAN)
+ QTest::qWait(10000);
#endif
QVERIFY(!timedOut);
QCOMPARE(spyConnected.count(), canListen ? 1 : 0);
@@ -486,7 +505,11 @@ void tst_QLocalSocket::sendData()
// test sending/receiving data
if (server.hasPendingConnections()) {
QString testLine = "test";
+#ifdef Q_OS_SYMBIAN
+ for (int i = 0; i < 25 * 1024; ++i)
+#else
for (int i = 0; i < 50000; ++i)
+#endif
testLine += "a";
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
@@ -530,7 +553,9 @@ void tst_QLocalSocket::fullPath()
{
QLocalServer server;
QString name = "qlocalsocket_pathtest";
-#if defined(QT_LOCALSOCKET_TCP)
+#if defined(Q_OS_SYMBIAN)
+ QString path = "";
+#elif defined(QT_LOCALSOCKET_TCP)
QString path = "QLocalServer";
#elif defined(Q_OS_WIN)
QString path = "\\\\.\\pipe\\";
@@ -544,6 +569,10 @@ void tst_QLocalSocket::fullPath()
LocalSocket socket;
socket.connectToServer(serverName);
+#if defined (Q_OS_SYMBIAN)
+ QTest::qWait(250);
+#endif
+
QCOMPARE(socket.serverName(), serverName);
QCOMPARE(socket.fullServerName(), serverName);
socket.disconnectFromServer();
@@ -567,6 +596,9 @@ void tst_QLocalSocket::hitMaximumConnections()
QFETCH(int, max);
LocalServer server;
QString name = "tst_localsocket";
+#ifdef Q_OS_SYMBIAN
+ unlink(name);
+#endif
server.setMaxPendingConnections(max);
QVERIFY2(server.listen(name), server.errorString().toLatin1().constData());
int connections = server.maxPendingConnections() + 1;
@@ -615,7 +647,7 @@ public:
|| socket.error() == QLocalSocket::ConnectionRefusedError)
&& tries < 1000);
if (tries == 0 && socket.state() != QLocalSocket::ConnectedState) {
- QVERIFY(socket.waitForConnected(3000));
+ QVERIFY(socket.waitForConnected(30000));
QVERIFY(socket.state() == QLocalSocket::ConnectedState);
}
@@ -645,7 +677,7 @@ public:
int done = clients;
while (done > 0) {
bool timedOut = true;
- QVERIFY(server.waitForNewConnection(3000, &timedOut));
+ QVERIFY(server.waitForNewConnection(30000, &timedOut));
QVERIFY(!timedOut);
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
@@ -680,20 +712,30 @@ void tst_QLocalSocket::threadedConnection_data()
void tst_QLocalSocket::threadedConnection()
{
+#ifdef Q_OS_SYMBIAN
+ unlink("qlocalsocket_threadtest");
+#endif
+
QFETCH(int, threads);
Server server;
+#if defined(Q_OS_SYMBIAN)
+ server.setStackSize(0x14000);
+#endif
server.clients = threads;
server.start();
QList<Client*> clients;
for (int i = 0; i < threads; ++i) {
clients.append(new Client());
+#if defined(Q_OS_SYMBIAN)
+ clients.last()->setStackSize(0x14000);
+#endif
clients.last()->start();
}
server.wait();
while (!clients.isEmpty()) {
- QVERIFY(clients.first()->wait(30000));
+ QVERIFY(clients.first()->wait(300000));
Client *client =clients.takeFirst();
client->terminate();
delete client;
@@ -716,7 +758,7 @@ void tst_QLocalSocket::processConnection_data()
*/
void tst_QLocalSocket::processConnection()
{
-#if defined(QT_NO_PROCESS)
+#if defined(QT_NO_PROCESS) || defined(Q_CC_NOKIAX86)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#else
QFETCH(int, processes);
@@ -771,6 +813,9 @@ void tst_QLocalSocket::longPath()
void tst_QLocalSocket::waitForDisconnect()
{
QString name = "tst_localsocket";
+#ifdef Q_OS_SYMBIAN
+ unlink(name);
+#endif
LocalServer server;
QVERIFY(server.listen(name));
LocalSocket socket;
@@ -822,6 +867,10 @@ void tst_QLocalSocket::removeServer()
void tst_QLocalSocket::recycleServer()
{
+#ifdef Q_OS_SYMBIAN
+ unlink("recycletest1");
+#endif
+
QLocalServer server;
QLocalSocket client;
@@ -848,6 +897,29 @@ void tst_QLocalSocket::debug()
qDebug() << QLocalSocket::ConnectionRefusedError << QLocalSocket::UnconnectedState;
}
+#ifdef Q_OS_SYMBIAN
+void tst_QLocalSocket::unlink(QString name)
+{
+ if(name.length() == 0)
+ return;
+
+ QString fullName;
+ // determine the full server path
+ if (name.startsWith(QLatin1Char('/'))) {
+ fullName = name;
+ } else {
+ fullName = QDir::cleanPath(QDir::tempPath());
+ fullName += QLatin1Char('/') + name;
+ fullName = QDir::toNativeSeparators(fullName);
+ }
+
+ int result = ::unlink(fullName.toUtf8().data());
+
+ if(result != 0) {
+ qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno);
+ }
+}
+#endif
QTEST_MAIN(tst_QLocalSocket)
#include "tst_qlocalsocket.moc"
diff --git a/tests/auto/qmainwindow/qmainwindow.pro b/tests/auto/qmainwindow/qmainwindow.pro
index b1cbd160bd..43d73ae252 100644
--- a/tests/auto/qmainwindow/qmainwindow.pro
+++ b/tests/auto/qmainwindow/qmainwindow.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
SOURCES += tst_qmainwindow.cpp
-
+# Symbian toolchain does not support correct include semantics
+symbian:INCPATH+=..\..\..\include\QtGui\private
diff --git a/tests/auto/qmap/qmap.pro b/tests/auto/qmap/qmap.pro
index 5b61272953..00b84d133d 100644
--- a/tests/auto/qmap/qmap.pro
+++ b/tests/auto/qmap/qmap.pro
@@ -3,6 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qmap.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 5b6e54c481..2ca04d1ceb 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -420,8 +420,11 @@ void tst_QMenu::overrideMenuAction()
QSKIP("On Mac, we need to create native key events to test menu action activation", SkipAll);
#elif defined(Q_OS_WINCE)
QSKIP("On Windows CE, we need to create native key events to test menu action activation", SkipAll);
+#elif defined(Q_OS_SYMBIAN)
+ QSKIP("On Symbian OS, we need to create native key events to test menu action activation", SkipAll);
#endif
- QAction *aQuit = new QAction("Quit", &w);
+
+ QAction *aQuit = new QAction("Quit", &w);
aQuit->setShortcut(QKeySequence("Ctrl+X"));
m->addAction(aQuit);
@@ -635,7 +638,11 @@ void tst_QMenu::activeSubMenuPosition()
main->setActiveAction(menuAction);
sub->setActiveAction(subAction);
+#ifdef Q_OS_SYMBIAN
+ main->popup(QPoint(50,200));
+#else
main->popup(QPoint(200,200));
+#endif
QVERIFY(main->isVisible());
QCOMPARE(main->activeAction(), menuAction);
diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro
index 51cf21d14d..a0a6420221 100644
--- a/tests/auto/qmenubar/qmenubar.pro
+++ b/tests/auto/qmenubar/qmenubar.pro
@@ -2,5 +2,5 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qmenubar.cpp
-contains(QT_CONFIG, qt3support):QT += qt3support
+contains(QT_CONFIG, qt3support):!symbian*:QT += qt3support
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 538e443eb2..2b3e5e39fd 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -460,6 +460,10 @@ void tst_QMenuBar::accel_noQt3()
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
#endif
+#ifdef Q_OS_SYMBIAN
+ QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll);
+#endif
+
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar_noQt3();
// QTest::keyClick( 0, Qt::Key_A, AltKey );
diff --git a/tests/auto/qmetatype/qmetatype.pro b/tests/auto/qmetatype/qmetatype.pro
index 20ec3b8bf6..a84d238aa4 100644
--- a/tests/auto/qmetatype/qmetatype.pro
+++ b/tests/auto/qmetatype/qmetatype.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qmetatype.cpp
-
QT = core
-
-
diff --git a/tests/auto/qmouseevent/tst_qmouseevent.cpp b/tests/auto/qmouseevent/tst_qmouseevent.cpp
index 49c76867db..aa6566e8da 100644
--- a/tests/auto/qmouseevent/tst_qmouseevent.cpp
+++ b/tests/auto/qmouseevent/tst_qmouseevent.cpp
@@ -205,7 +205,7 @@ void tst_QMouseEvent::checkMousePressEvent()
int buttons = button;
int modifiers = keyPressed;
- QTest::mousePress(testMouseWidget, (Qt::MouseButton)buttonPressed, (Qt::KeyboardModifiers)keyPressed);
+ QTest::mousePress(testMouseWidget, Qt::MouseButton(buttonPressed), Qt::KeyboardModifiers(keyPressed));
QVERIFY(testMouseWidget->mousePressEventRecieved);
QCOMPARE(testMouseWidget->mousePressButton, button);
QCOMPARE(testMouseWidget->mousePressButtons, buttons);
@@ -218,7 +218,7 @@ void tst_QMouseEvent::checkMousePressEvent()
QCOMPARE(testMouseWidget->mousePressStateAfter, stateAfter);
#endif
- QTest::mouseRelease(testMouseWidget, (Qt::MouseButton)buttonPressed, (Qt::KeyboardModifiers)keyPressed);
+ QTest::mouseRelease(testMouseWidget, Qt::MouseButton(buttonPressed), Qt::KeyboardModifiers(keyPressed));
}
void tst_QMouseEvent::checkMouseReleaseEvent_data()
@@ -251,7 +251,7 @@ void tst_QMouseEvent::checkMouseReleaseEvent()
int buttons = 0;
int modifiers = keyPressed;
- QTest::mouseClick(testMouseWidget, (Qt::MouseButton)buttonReleased, (Qt::KeyboardModifiers)keyPressed);
+ QTest::mouseClick(testMouseWidget, Qt::MouseButton(buttonReleased), Qt::KeyboardModifiers(keyPressed));
QVERIFY(testMouseWidget->mouseReleaseEventRecieved);
QCOMPARE(testMouseWidget->mouseReleaseButton, button);
QCOMPARE(testMouseWidget->mouseReleaseButtons, buttons);
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index 765966eee8..15f0c833bd 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -12,3 +12,13 @@ wince*: {
DEPLOYMENT += addFiles
}
+
+symbian*: {
+ addFiles.sources = animations\*
+ addFiles.path = animations
+ DEPLOYMENT += addFiles
+
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += imagePlugins
+} \ No newline at end of file
diff --git a/tests/auto/qmultiscreen/qmultiscreen.pro b/tests/auto/qmultiscreen/qmultiscreen.pro
index 810c05f7fc..fd42870968 100644
--- a/tests/auto/qmultiscreen/qmultiscreen.pro
+++ b/tests/auto/qmultiscreen/qmultiscreen.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qmultiscreen.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qmutex/qmutex.pro b/tests/auto/qmutex/qmutex.pro
index e52f947f98..bd24dcb35f 100644
--- a/tests/auto/qmutex/qmutex.pro
+++ b/tests/auto/qmutex/qmutex.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qmutex.cpp
QT = core
-
-
diff --git a/tests/auto/qmutexlocker/qmutexlocker.pro b/tests/auto/qmutexlocker/qmutexlocker.pro
index f9213082df..ff8a3da7eb 100644
--- a/tests/auto/qmutexlocker/qmutexlocker.pro
+++ b/tests/auto/qmutexlocker/qmutexlocker.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qmutexlocker.cpp
QT = core
-
-
diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
index 90276f20b9..e3f6c94909 100644
--- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
+++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
@@ -102,11 +102,11 @@ private slots:
tst_QNativeSocketEngine::tst_QNativeSocketEngine()
{
+ Q_SET_DEFAULT_IAP
}
tst_QNativeSocketEngine::~tst_QNativeSocketEngine()
{
-
}
void tst_QNativeSocketEngine::init()
@@ -153,14 +153,14 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
- const bool isConnected = socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
+ const bool isConnected = socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
if (!isConnected) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
}
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -173,7 +173,7 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
// Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
// Write a logout message
QByteArray array2 = "ZZZ LOGOUT\r\n";
@@ -204,6 +204,9 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP()
//---------------------------------------------------------------------------
void tst_QNativeSocketEngine::udpLoopbackTest()
{
+#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
+ QSKIP("Not working on Emulator without WinPCAP", SkipAll);
+#endif
QNativeSocketEngine udpSocket;
// Initialize device #1
@@ -252,6 +255,9 @@ void tst_QNativeSocketEngine::udpLoopbackTest()
//---------------------------------------------------------------------------
void tst_QNativeSocketEngine::udpIPv6LoopbackTest()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: IPv6 is not yet supported", SkipAll);
+#endif
QNativeSocketEngine udpSocket;
// Initialize device #1
@@ -303,7 +309,7 @@ void tst_QNativeSocketEngine::broadcastTest()
{
#ifdef Q_OS_AIX
QSKIP("Broadcast does not work on darko", SkipAll);
-#endif
+#endif
QNativeSocketEngine broadcastSocket;
// Initialize a regular Udp socket
@@ -395,7 +401,10 @@ void tst_QNativeSocketEngine::serverTest()
//---------------------------------------------------------------------------
void tst_QNativeSocketEngine::udpLoopbackPerformance()
-{
+{
+#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
+ QSKIP("Not working on Emulator without WinPCAP", SkipAll);
+#endif
QNativeSocketEngine udpSocket;
// Initialize device #1
@@ -553,7 +562,7 @@ void tst_QNativeSocketEngine::tooManySockets()
//---------------------------------------------------------------------------
void tst_QNativeSocketEngine::bind()
{
-#ifndef Q_OS_WIN
+#if !defined Q_OS_WIN && !defined Q_OS_SYMBIAN
QNativeSocketEngine binder;
QVERIFY(binder.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder.bind(QHostAddress::Any, 82));
@@ -567,7 +576,13 @@ void tst_QNativeSocketEngine::bind()
QNativeSocketEngine binder3;
QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder3.bind(QHostAddress::Any, 31180));
+
+#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
+ qDebug("On Symbian Emulator (WinSock) we get EADDRNOTAVAIL instead of EADDRINUSE");
+ QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError);
+#else
QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError);
+#endif
}
//---------------------------------------------------------------------------
diff --git a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp
index a246b041fa..a1bb573d1c 100644
--- a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -68,12 +68,14 @@ private slots:
tst_QNetworkInterface::tst_QNetworkInterface()
{
+ Q_SET_DEFAULT_IAP
}
tst_QNetworkInterface::~tst_QNetworkInterface()
{
}
+
void tst_QNetworkInterface::dump()
{
// This is for manual testing:
@@ -125,6 +127,10 @@ void tst_QNetworkInterface::loopbackIPv4()
void tst_QNetworkInterface::loopbackIPv6()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP( "Symbian: IPv6 is not yet supported", SkipAll );
+#else
+
QList<QHostAddress> all = QNetworkInterface::allAddresses();
bool loopbackfound = false;
@@ -138,6 +144,7 @@ void tst_QNetworkInterface::loopbackIPv6()
anyIPv6 = true;
QVERIFY(!anyIPv6 || loopbackfound);
+#endif
}
void tst_QNetworkInterface::localAddress()
diff --git a/tests/auto/qnetworkreply/.gitattributes b/tests/auto/qnetworkreply/.gitattributes
index f0cae990fc..80252cfd34 100644
--- a/tests/auto/qnetworkreply/.gitattributes
+++ b/tests/auto/qnetworkreply/.gitattributes
@@ -1,2 +1,3 @@
-rfc3252.txt -crlf
-bigfile -crlf
+rfc3252.txt -crlf
+bigfile -crlf
+resource -crlf
diff --git a/tests/auto/qnetworkreply/echo/echo.pro b/tests/auto/qnetworkreply/echo/echo.pro
index bf791ffc61..74b0bfcab3 100644
--- a/tests/auto/qnetworkreply/echo/echo.pro
+++ b/tests/auto/qnetworkreply/echo/echo.pro
@@ -3,4 +3,4 @@ QT = core
CONFIG -= app_bundle debug_and_release_target
CONFIG += console
-
+symbian:TARGET.CAPABILITY="ALL -TCB"
diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro
index 71f76a2987..593de8b6c0 100644
--- a/tests/auto/qnetworkreply/test/test.pro
+++ b/tests/auto/qnetworkreply/test/test.pro
@@ -10,7 +10,7 @@ win32 {
}
}
-DEFINES += SRCDIR=\\\"$$PWD/..\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/..\\\"
QT = core network
RESOURCES += ../qnetworkreply.qrc
@@ -20,3 +20,17 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
}
+
+symbian:{
+ addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+
+ # Symbian toolchain does not support correct include semantics
+ INCPATH+=..\..\..\..\include\QtNetwork\private
+ # bigfile test case requires more heap
+ TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+ TARGET.CAPABILITY="ALL -TCB"
+}
+
+
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index d651ce58b4..fe06563851 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -67,8 +67,16 @@
#include "private/qnetworkaccessmanager_p.h"
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Current path (C:\private\<UID>) contains only ascii chars
+//#define SRCDIR QDir::currentPath()
+#define SRCDIR "."
+#endif
+
#include "../network-settings.h"
+
Q_DECLARE_METATYPE(QNetworkReply*)
Q_DECLARE_METATYPE(QAuthenticator*)
Q_DECLARE_METATYPE(QNetworkProxy)
@@ -107,6 +115,7 @@ class tst_QNetworkReply: public QObject
public:
tst_QNetworkReply();
+ ~tst_QNetworkReply();
QString runSimpleRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request,
QNetworkReplyPtr &reply, const QByteArray &data = QByteArray());
@@ -688,6 +697,8 @@ protected:
tst_QNetworkReply::tst_QNetworkReply()
{
+ Q_SET_DEFAULT_IAP
+
testFileName = QDir::currentPath() + "/testfile";
#ifndef Q_OS_WINCE
uniqueExtension = QString("%1%2%3").arg((qulonglong)this).arg(rand()).arg((qulonglong)time(0));
@@ -695,7 +706,11 @@ tst_QNetworkReply::tst_QNetworkReply()
uniqueExtension = QString("%1%2").arg((qulonglong)this).arg(rand());
#endif
cookieJar = new MyCookieJar;
- manager.setCookieJar(cookieJar);
+ manager.setCookieJar(cookieJar);
+}
+
+tst_QNetworkReply::~tst_QNetworkReply()
+{
}
void tst_QNetworkReply::authenticationRequired(QNetworkReply*, QAuthenticator* auth)
@@ -858,7 +873,7 @@ void tst_QNetworkReply::invalidProtocol()
void tst_QNetworkReply::getFromData_data()
{
- QTest::addColumn<QString>("request");
+ QTest::addColumn<QString>("request");
QTest::addColumn<QByteArray>("expected");
QTest::addColumn<QString>("mimeType");
@@ -954,7 +969,7 @@ void tst_QNetworkReply::getFromData()
void tst_QNetworkReply::getFromFile()
{
- // create the file:
+ // create the file:
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
QVERIFY(file.open());
@@ -1006,7 +1021,7 @@ void tst_QNetworkReply::getFromFileSpecial_data()
void tst_QNetworkReply::getFromFileSpecial()
{
- QFETCH(QString, fileName);
+ QFETCH(QString, fileName);
QFETCH(QString, url);
// open the resource so we can find out its size
@@ -1036,7 +1051,7 @@ void tst_QNetworkReply::getFromFtp_data()
void tst_QNetworkReply::getFromFtp()
{
- QFETCH(QString, referenceName);
+ QFETCH(QString, referenceName);
QFETCH(QString, url);
QFile reference(referenceName);
@@ -1065,7 +1080,7 @@ void tst_QNetworkReply::getFromHttp_data()
void tst_QNetworkReply::getFromHttp()
{
- QFETCH(QString, referenceName);
+ QFETCH(QString, referenceName);
QFETCH(QString, url);
QFile reference(referenceName);
@@ -1103,7 +1118,7 @@ void tst_QNetworkReply::getErrors_data()
<< int(QNetworkReply::ContentOperationNotPermittedError) << 0 << true;
QTest::newRow("file-exist") << QUrl::fromLocalFile(QDir::currentPath() + "/this-file-doesnt-exist.txt").toString()
<< int(QNetworkReply::ContentNotFoundError) << 0 << true;
-#if !defined Q_OS_WIN
+#if !defined Q_OS_WIN && !defined(Q_OS_SYMBIAN)
QTest::newRow("file-is-wronly") << QUrl::fromLocalFile(wronlyFileName).toString()
<< int(QNetworkReply::ContentAccessDenied) << 0 << true;
#endif
@@ -1444,7 +1459,11 @@ void tst_QNetworkReply::ioGetFromFtp()
DataReader reader(reply);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(20);
+#else
+ QTestEventLoop::instance().enterLoop(10);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
@@ -1474,11 +1493,19 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse()
QSignalSpy spy(reply1, SIGNAL(finished()));
connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(20);
+#else
+ QTestEventLoop::instance().enterLoop(10);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
if (spy.count() == 0) {
connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(20);
+#else
+ QTestEventLoop::instance().enterLoop(10);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
}
@@ -2167,7 +2194,11 @@ void tst_QNetworkReply::ioGetWithManyProxies()
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
+#ifndef Q_OS_SYMBIAN
QTestEventLoop::instance().enterLoop(10);
+#else
+ QTestEventLoop::instance().enterLoop(60);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
@@ -2333,18 +2364,19 @@ void tst_QNetworkReply::ioPutToFileFromProcess_data()
void tst_QNetworkReply::ioPutToFileFromProcess()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
+#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
+ QSKIP("Currently no stdin/out supported for Windows CE / Symbian OS", SkipAll);
#endif
+
#ifdef Q_OS_WIN
if (qstrcmp(QTest::currentDataTag(), "small") == 0)
QSKIP("When passing a CR-LF-LF sequence through Windows stdio, it gets converted, "
"so this test fails. Disabled on Windows", SkipSingle);
#endif
+
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#else
-
QFile file(testFileName);
QUrl url = QUrl::fromLocalFile(file.fileName());
@@ -2560,7 +2592,6 @@ void tst_QNetworkReply::downloadPerformance()
{
// unlike the above function, this one tries to send as fast as possible
// and measures how fast it was.
-
TimedSender sender(5000);
QNetworkRequest request("debugpipe://127.0.0.1:" + QString::number(sender.serverPort()) + "/?bare=1");
QNetworkReplyPtr reply = manager.get(request);
@@ -2647,11 +2678,20 @@ void tst_QNetworkReply::downloadProgress()
QFETCH(int, loopCount);
for (int i = 1; i <= loopCount; ++i) {
+#ifdef Q_OS_SYMBIAN
+ if(i % 500 == 0) {
+ qWarning("iteration %d", i);
+ }
+#endif
sender->write(data);
QVERIFY2(sender->waitForBytesWritten(2000), "Network timeout");
spy.clear();
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(5);
+#else
QTestEventLoop::instance().enterLoop(2);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(spy.count() > 0);
@@ -2664,7 +2704,11 @@ void tst_QNetworkReply::downloadProgress()
delete sender;
spy.clear();
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(5);
+#else
QTestEventLoop::instance().enterLoop(2);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(spy.count() > 0);
@@ -2679,7 +2723,7 @@ void tst_QNetworkReply::uploadProgress_data()
}
void tst_QNetworkReply::uploadProgress()
-{
+{
QFETCH(QByteArray, data);
QTcpServer server;
QVERIFY(server.listen());
@@ -2797,7 +2841,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data()
void tst_QNetworkReply::receiveCookiesFromHttp()
{
- QFETCH(QString, cookieString);
+ QFETCH(QString, cookieString);
QByteArray data = cookieString.toLatin1() + '\n';
QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/set-cookie.cgi");
@@ -2950,7 +2994,13 @@ void tst_QNetworkReply::httpProxyCommands()
// wait for the finished signal
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(1);
+
+#ifdef Q_OS_SYMBIAN
+ QTestEventLoop::instance().enterLoop(5);
+#else
+ QTestEventLoop::instance().enterLoop(1);
+#endif
+
QVERIFY(!QTestEventLoop::instance().timeout());
//qDebug() << reply->error() << reply->errorString();
diff --git a/tests/auto/qnumeric/qnumeric.pro b/tests/auto/qnumeric/qnumeric.pro
index 317628477e..162f980f9c 100644
--- a/tests/auto/qnumeric/qnumeric.pro
+++ b/tests/auto/qnumeric/qnumeric.pro
@@ -3,5 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qnumeric.cpp
-
-
+QT = core
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index fb460732e6..ada4fcbd55 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -1153,7 +1153,7 @@ Q_DECLARE_METATYPE(PropertyObject::Priority)
void tst_QObject::threadSignalEmissionCrash()
{
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
int loopCount = 100;
#else
int loopCount = 1000;
@@ -1403,8 +1403,18 @@ void tst_QObject::moveToThread()
MoveToThreadObject *child = new MoveToThreadObject(object);
connect(object, SIGNAL(theSignal()), &thread, SLOT(quit()), Qt::DirectConnection);
+
+#if defined(Q_OS_SYMBIAN)
+ // Child timer will be registered after parent timer in the new
+ // thread, and 10ms is less than symbian timer resolution, so
+ // child->timerEventThread compare after thread.wait() will
+ // usually fail unless timers are farther apart.
+ child->startTimer(100);
+ object->startTimer(150);
+#else
child->startTimer(90);
object->startTimer(100);
+#endif
QCOMPARE(object->thread(), currentThread);
QCOMPARE(child->thread(), currentThread);
@@ -2390,6 +2400,9 @@ void tst_QObject::dynamicProperties()
void tst_QObject::recursiveSignalEmission()
{
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Emulator builds in Symbian do not support launching processes linking to Qt", SkipAll);
+#endif
QProcess proc;
proc.start("./signalbug");
QVERIFY(proc.waitForFinished());
diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro
index 9b2fec1243..b3bda37e12 100644
--- a/tests/auto/qobject/tst_qobject.pro
+++ b/tests/auto/qobject/tst_qobject.pro
@@ -10,3 +10,9 @@ wince*: {
DEPLOYMENT += addFiles
}
+symbian: {
+ addFiles.sources = signalbug.exe
+ addFiles.path = \sys\bin
+ DEPLOYMENT += addFiles
+}
+
diff --git a/tests/auto/qobjectrace/qobjectrace.pro b/tests/auto/qobjectrace/qobjectrace.pro
index 581c63f309..3339654beb 100644
--- a/tests/auto/qobjectrace/qobjectrace.pro
+++ b/tests/auto/qobjectrace/qobjectrace.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qobjectrace.cpp
-
QT = core
-
-
diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro
index 277039f0c4..1b3659d87e 100644
--- a/tests/auto/qpainter/qpainter.pro
+++ b/tests/auto/qpainter/qpainter.pro
@@ -1,12 +1,15 @@
load(qttest_p4)
contains(QT_CONFIG, qt3support): QT += qt3support
SOURCES += tst_qpainter.cpp
-wince*: {
- DEFINES += SRCDIR=\\\".\\\"
+wince*|symbian*: {
addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
addFiles.path = .
DEPLOYMENT += addFiles
-} else {
+}
+
+wince* {
+ DEFINES += SRCDIR=\\\".\\\"
+} !symbian {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 87f9c13f6f..b813d1d801 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -50,7 +50,7 @@
#include <qbitmap.h>
#include <qimage.h>
#include <limits.h>
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
#include <qprinter.h>
#include <math.h>
#ifdef QT3_SUPPORT
@@ -67,6 +67,10 @@
#include <qqueue.h>
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR "."
+#endif
+
Q_DECLARE_METATYPE(QLine)
Q_DECLARE_METATYPE(QRect)
Q_DECLARE_METATYPE(QSize)
@@ -524,8 +528,7 @@ void tst_QPainter::qt_format_text_boundingRect()
QCOMPARE(pbr, br);
}
#endif
-
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
{
QPrinter printer(QPrinter::HighResolution);
if (printer.printerName().isEmpty()) {
@@ -1421,7 +1424,7 @@ void tst_QPainter::drawPath2()
void tst_QPainter::drawPath3()
{
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QImage imgA(400, 400, QImage::Format_RGB32);
#else
QImage imgA(100, 100, QImage::Format_RGB32);
@@ -2958,7 +2961,7 @@ void tst_QPainter::monoImages()
}
}
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS)
+#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(Q_OS_SYMBIAN)
#include <fenv.h>
static const QString fpeExceptionString(int exception)
diff --git a/tests/auto/qpathclipper/qpathclipper.pro b/tests/auto/qpathclipper/qpathclipper.pro
index 675e4637db..a8d8152ef3 100644
--- a/tests/auto/qpathclipper/qpathclipper.pro
+++ b/tests/auto/qpathclipper/qpathclipper.pro
@@ -3,6 +3,6 @@ INCLUDEPATH += .
HEADERS += paths.h
SOURCES += tst_qpathclipper.cpp paths.cpp
-unix:!mac:LIBS+=-lm
+unix:!mac:!symbian*:LIBS+=-lm
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index e5dace4c1e..aa767aa8c6 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -8,7 +8,16 @@ wince*: {
task31722_1.path = convertFromImage/task31722_1
DEPLOYMENT += task31722_0 task31722_1
DEFINES += SRCDIR=\\\".\\\"
-} else {
+}
+symbian*:{
+ task31722_0.sources = convertFromImage/task31722_0/*
+ task31722_0.path = convertFromImage/task31722_0
+ task31722_1.sources = convertFromImage/task31722_1/*
+ task31722_1.path = convertFromImage/task31722_1
+ DEPLOYMENT += task31722_0 task31722_1
+ DEPLOYMENT_PLUGIN += qmng
+}
+else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
win32:LIBS += -lgdi32 -luser32
}
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index ba117d8957..493333bd0a 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -60,7 +60,9 @@
//TESTED_CLASS=
//TESTED_FILES=
-
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
Q_DECLARE_METATYPE(QImage::Format)
class tst_QPixmap : public QObject
@@ -270,8 +272,11 @@ void tst_QPixmap::convertFromImage_data()
{
QTest::addColumn<QImage>("img1");
QTest::addColumn<QImage>("img2");
-
+#ifdef Q_OS_SYMBIAN
+ const QString prefix = QLatin1String(SRCDIR) + "convertFromImage";
+#else
const QString prefix = QLatin1String(SRCDIR) + "/convertFromImage";
+#endif
{
QImage img1;
QImage img2;
@@ -818,9 +823,17 @@ void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
}
};
Thread thread;
+#if defined(Q_OS_SYMBIAN)
+ thread.setStackSize(0x10000);
+#endif
thread.start();
+#if defined(Q_OS_SYMBIAN)
+ QVERIFY(thread.wait(10000));
+#else
thread.wait();
#endif
+
+#endif // !defined(Q_WS_WIN)
}
void tst_QPixmap::refUnref()
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
index a0250fa774..6835c216ec 100644
--- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
@@ -87,24 +87,32 @@ public slots:
void cleanup();
private slots:
void getSetCheck();
+#ifndef QT_NO_CLIPBOARD
void clearMustNotChangeClipboard();
+#endif
void clearMustNotResetRootFrameMarginToDefault();
void paragSeparatorOnPlaintextAppend();
+#ifndef QT_NO_CLIPBOARD
void selectAllSetsNotSelection();
+#endif
void asciiTab();
void setDocument();
void emptyAppend();
void appendOnEmptyDocumentShouldReuseInitialParagraph();
void cursorPositionChanged();
void setTextCursor();
+#ifndef QT_NO_CLIPBOARD
void undoAvailableAfterPaste();
+#endif
void undoRedoAvailableRepetition();
void appendShouldNotTouchTheSelection();
void backspace();
void shiftBackspace();
void undoRedo();
void preserveCharFormatInAppend();
+#ifndef QT_NO_CLIPBOARD
void copyAndSelectAllInReadonly();
+#endif
void ctrlAltInput();
void noPropertiesOnDefaultTextEditCharFormat();
void setPlainTextShouldEmitTextChangedOnce();
@@ -118,13 +126,17 @@ private slots:
void undoRedoAfterSetContent();
void numPadKeyNavigation();
void moveCursor();
+#ifndef QT_NO_CLIPBOARD
void mimeDataReimplementations();
+#endif
void shiftEnterShouldInsertLineSeparator();
void selectWordsFromStringsContainingSeparators_data();
void selectWordsFromStringsContainingSeparators();
+#ifndef QT_NO_CLIPBOARD
void canPaste();
void copyAvailable_data();
void copyAvailable();
+#endif
void ensureCursorVisibleOnInitialShow();
void setTextInsideResizeEvent();
void colorfulAppend();
@@ -290,7 +302,7 @@ void tst_QPlainTextEdit::createSelection()
#endif
QCOMPARE(ed->textCursor().position(), 11);
}
-
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::clearMustNotChangeClipboard()
{
if (!nativeClipboardWorking())
@@ -301,6 +313,7 @@ void tst_QPlainTextEdit::clearMustNotChangeClipboard()
ed->clear();
QCOMPARE(QApplication::clipboard()->text(), txt);
}
+#endif
void tst_QPlainTextEdit::clearMustNotResetRootFrameMarginToDefault()
{
@@ -322,6 +335,7 @@ void tst_QPlainTextEdit::paragSeparatorOnPlaintextAppend()
QCOMPARE(cnt, 2);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::selectAllSetsNotSelection()
{
if (!QApplication::clipboard()->supportsSelection()) {
@@ -337,6 +351,7 @@ void tst_QPlainTextEdit::selectAllSetsNotSelection()
QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromAscii("foobar"));
}
+#endif
void tst_QPlainTextEdit::asciiTab()
{
@@ -466,6 +481,7 @@ void tst_QPlainTextEdit::setTextCursor()
QCOMPARE(spy.count(), 1);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::undoAvailableAfterPaste()
{
if (!nativeClipboardWorking())
@@ -479,6 +495,7 @@ void tst_QPlainTextEdit::undoAvailableAfterPaste()
QVERIFY(spy.count() >= 1);
QCOMPARE(ed->toPlainText(), txt);
}
+#endif
class UndoRedoRecorder : public QObject
{
@@ -657,6 +674,7 @@ void tst_QPlainTextEdit::preserveCharFormatInAppend()
QCOMPARE(cursor.block().text(), QString("third para"));
}
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::copyAndSelectAllInReadonly()
{
if (!nativeClipboardWorking())
@@ -687,6 +705,7 @@ void tst_QPlainTextEdit::copyAndSelectAllInReadonly()
QTest::keyClick(ed, Qt::Key_C, Qt::ControlModifier);
QCOMPARE(QApplication::clipboard()->text(), QString("Hello World"));
}
+#endif
void tst_QPlainTextEdit::ctrlAltInput()
{
@@ -903,6 +922,7 @@ void tst_QPlainTextEdit::implicitClear()
QVERIFY(ed->toPlainText().isEmpty());
}
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::copyAvailable_data()
{
QTest::addColumn<pairListType>("keystrokes");
@@ -1020,6 +1040,7 @@ void tst_QPlainTextEdit::copyAvailable()
QVERIFY2(variantSpyCopyAvailable.toBool() == copyAvailable.at(i), QString("Spied singnal: %1").arg(i).toLatin1());
}
}
+#endif
void tst_QPlainTextEdit::undoRedoAfterSetContent()
{
@@ -1085,6 +1106,7 @@ public:
};
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::mimeDataReimplementations()
{
MyTextEdit ed;
@@ -1121,6 +1143,7 @@ void tst_QPlainTextEdit::mimeDataReimplementations()
QCOMPARE(ed.canInsertCallCount, 1);
QCOMPARE(ed.insertCallCount, 1);
}
+#endif
void tst_QPlainTextEdit::shiftEnterShouldInsertLineSeparator()
{
@@ -1160,6 +1183,7 @@ void tst_QPlainTextEdit::selectWordsFromStringsContainingSeparators()
cursor.clearSelection();
}
+#ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::canPaste()
{
if (!nativeClipboardWorking())
@@ -1172,6 +1196,7 @@ void tst_QPlainTextEdit::canPaste()
ed->setTextInteractionFlags(Qt::NoTextInteraction);
QVERIFY(!ed->canPaste());
}
+#endif
void tst_QPlainTextEdit::ensureCursorVisibleOnInitialShow()
{
diff --git a/tests/auto/qplugin/debugplugin/debugplugin.pro b/tests/auto/qplugin/debugplugin/debugplugin.pro
index cb2ac34713..d0762fc101 100644
--- a/tests/auto/qplugin/debugplugin/debugplugin.pro
+++ b/tests/auto/qplugin/debugplugin/debugplugin.pro
@@ -5,3 +5,7 @@ SOURCES = main.cpp
QT = core
DESTDIR = ../plugins
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY=ALL -TCB
+}
diff --git a/tests/auto/qplugin/qplugin.pro b/tests/auto/qplugin/qplugin.pro
index 818bb0d2f8..aafcb36209 100644
--- a/tests/auto/qplugin/qplugin.pro
+++ b/tests/auto/qplugin/qplugin.pro
@@ -1,3 +1,4 @@
+QT = core
TEMPLATE = subdirs
win32 {
exists($$[QT_INSTALL_LIBS]/QtCore4.dll) {
diff --git a/tests/auto/qplugin/releaseplugin/releaseplugin.pro b/tests/auto/qplugin/releaseplugin/releaseplugin.pro
index 21177b80d1..ce66aaf7cb 100644
--- a/tests/auto/qplugin/releaseplugin/releaseplugin.pro
+++ b/tests/auto/qplugin/releaseplugin/releaseplugin.pro
@@ -5,3 +5,7 @@ SOURCES = main.cpp
QT = core
DESTDIR = ../plugins
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY=ALL -TCB
+}
diff --git a/tests/auto/qplugin/tst_qplugin.pro b/tests/auto/qplugin/tst_qplugin.pro
index aa5842a35e..0d9d809132 100644
--- a/tests/auto/qplugin/tst_qplugin.pro
+++ b/tests/auto/qplugin/tst_qplugin.pro
@@ -1,6 +1,7 @@
+load(qttest_p4)
+
SOURCES = tst_qplugin.cpp
QT = core
-CONFIG += qtestlib
wince*: {
plugins.sources = plugins/*
@@ -8,3 +9,8 @@ wince*: {
DEPLOYMENT += plugins
}
+symbian: {
+ rpDep.sources = releaseplugin.dll debugplugin.dll
+ rpDep.path = plugins
+ DEPLOYMENT += rpDep dpDep
+}
diff --git a/tests/auto/qpluginloader/lib/lib.pro b/tests/auto/qpluginloader/lib/lib.pro
index 7e842f2ef2..96a97325bb 100644
--- a/tests/auto/qpluginloader/lib/lib.pro
+++ b/tests/auto/qpluginloader/lib/lib.pro
@@ -12,4 +12,7 @@ win32-borland: DEFINES += WIN32_BORLAND
#no special install rule for the library used by test
INSTALLS =
+symbian: {
+ TARGET.CAPABILITY=ALL -TCB
+}
diff --git a/tests/auto/qpluginloader/qpluginloader.pro b/tests/auto/qpluginloader/qpluginloader.pro
index 50c17ed36d..382d6e4e91 100644
--- a/tests/auto/qpluginloader/qpluginloader.pro
+++ b/tests/auto/qpluginloader/qpluginloader.pro
@@ -1,9 +1,10 @@
+QT = core
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = lib \
theplugin \
tst
-!win32: !macx-*: SUBDIRS += almostplugin
+!win32: !macx-*: !symbian: SUBDIRS += almostplugin
TARGET = tst_qpluginloader
# no special install rule for subdir
diff --git a/tests/auto/qpluginloader/theplugin/theplugin.pro b/tests/auto/qpluginloader/theplugin/theplugin.pro
index d8d87b08c1..44b46b439f 100644
--- a/tests/auto/qpluginloader/theplugin/theplugin.pro
+++ b/tests/auto/qpluginloader/theplugin/theplugin.pro
@@ -5,3 +5,7 @@ SOURCES = theplugin.cpp
TARGET = $$qtLibraryTarget(theplugin)
DESTDIR = ../bin
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY=ALL -TCB
+}
diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro
index 5331f09d0c..f848bb1029 100644
--- a/tests/auto/qpluginloader/tst/tst.pro
+++ b/tests/auto/qpluginloader/tst/tst.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += ../tst_qpluginloader.cpp
TARGET = ../tst_qpluginloader
QT = core
+HEADERS += ../theplugin/plugininterface.h
win32 {
CONFIG(debug, debug|release) {
@@ -18,3 +19,12 @@ wince*: {
DEPLOYMENT += addFiles
}
+symbian: {
+ libDep.sources = mylib.dll
+ libDep.path = /sys/bin
+ pluginDep.sources = theplugin.dll
+ pluginDep.path = bin
+
+ DEPLOYMENT += libDep pluginDep
+}
+
diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp
index a003f5c57c..20ca997a3e 100644
--- a/tests/auto/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp
@@ -87,6 +87,12 @@
# endif
# define PREFIX ""
+#elif defined(Q_OS_SYMBIAN)
+# undef dll_VALID
+# define dll_VALID true
+# define SUFFIX ".dll"
+# define PREFIX ""
+
#else // all other Unix
# undef so_VALID
# define so_VALID true
@@ -210,7 +216,7 @@ void tst_QPluginLoader::errorString()
QVERIFY(loader.errorString() != unknown);
}
-#if !defined Q_OS_WIN && !defined Q_OS_MAC && !defined Q_OS_HPUX
+#if !defined Q_OS_WIN && !defined Q_OS_MAC && !defined Q_OS_HPUX && !defined Q_OS_SYMBIAN
{
QPluginLoader loader( sys_qualifiedLibraryName("almostplugin")); //a plugin with unresolved symbols
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
@@ -242,6 +248,11 @@ void tst_QPluginLoader::errorString()
QVERIFY(loader.instance() != static_cast<QObject*>(0));
QCOMPARE(loader.errorString(), unknown);
+ // Make sure that plugin really works
+ PluginInterface* theplugin = qobject_cast<PluginInterface*>(loader.instance());
+ QString pluginName = theplugin->pluginName();
+ QCOMPARE(pluginName, QLatin1String("Plugin ok"));
+
QCOMPARE(loader.unload(), true);
QCOMPARE(loader.errorString(), unknown);
}
diff --git a/tests/auto/qpoint/qpoint.pro b/tests/auto/qpoint/qpoint.pro
index 734fd3cdd4..8b006c2412 100644
--- a/tests/auto/qpoint/qpoint.pro
+++ b/tests/auto/qpoint/qpoint.pro
@@ -3,8 +3,5 @@
############################################################
load(qttest_p4)
-QT = core
-
SOURCES += tst_qpoint.cpp
-
-
+QT = core
diff --git a/tests/auto/qpointarray/qpointarray.pro b/tests/auto/qpointarray/qpointarray.pro
index d864337546..9ddbf75995 100644
--- a/tests/auto/qpointarray/qpointarray.pro
+++ b/tests/auto/qpointarray/qpointarray.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
SOURCES += tst_qpointarray.cpp
-unix:!mac:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qprocess/qprocess.pro b/tests/auto/qprocess/qprocess.pro
index 4600f026da..57d15ad135 100644
--- a/tests/auto/qprocess/qprocess.pro
+++ b/tests/auto/qprocess/qprocess.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+
SUBDIRS = testProcessCrash \
testProcessEcho \
testProcessEcho2 \
@@ -8,10 +9,7 @@ SUBDIRS = testProcessCrash \
testProcessOutput \
testProcessDeadWhileReading \
testProcessEOF \
- testSoftExit \
testProcessSpacesArgs/nospace.pro \
- testProcessSpacesArgs/onespace.pro \
- testProcessSpacesArgs/twospaces.pro \
testExitCodes \
testSpaceInName \
testGuiProcess \
@@ -19,6 +17,11 @@ SUBDIRS = testProcessCrash \
fileWriterProcess \
testSetWorkingDirectory
+!symbian: {
+SUBDIRS +=testProcessSpacesArgs/onespace.pro \
+ testProcessSpacesArgs/twospaces.pro \
+ testSoftExit
+}
win32:!wince*:SUBDIRS+=testProcessEchoGui
diff --git a/tests/auto/qprocess/test/test.pro b/tests/auto/qprocess/test/test.pro
index 3741e3c25b..82f91f89d5 100644
--- a/tests/auto/qprocess/test/test.pro
+++ b/tests/auto/qprocess/test/test.pro
@@ -18,7 +18,11 @@ win32: {
QT = core
-QT += network
+
+!symbian: {
+ QT += network
+}
+
embedded: QT += gui
wince*: {
@@ -47,3 +51,18 @@ wince*: {
DEPLOYMENT += addFiles
}
+symbian: {
+ binDep.sources = \
+ fileWriterProcess.exe \
+ testDetached.exe \
+ testExitCodes.exe \
+ testProcessCrash.exe \
+ testProcessEcho.exe \
+ testProcessNormal.exe \
+ testProcessOutput.exe \
+ nospace.exe \
+ testSpaceInName.exe
+ binDep.path = \sys\bin
+
+ DEPLOYMENT += binDep
+}
diff --git a/tests/auto/qprocess/testDetached/testDetached.pro b/tests/auto/qprocess/testDetached/testDetached.pro
index 6792ef4adf..319cfa6ff3 100644
--- a/tests/auto/qprocess/testDetached/testDetached.pro
+++ b/tests/auto/qprocess/testDetached/testDetached.pro
@@ -5,3 +5,6 @@ CONFIG -= app_bundle
INSTALLS =
DESTDIR = ./
+symbian*: {
+TARGET.EPOCSTACKSIZE =0x14000
+}
diff --git a/tests/auto/qprocess/testProcessOutput/main.cpp b/tests/auto/qprocess/testProcessOutput/main.cpp
index a2aa67f27d..9656887654 100644
--- a/tests/auto/qprocess/testProcessOutput/main.cpp
+++ b/tests/auto/qprocess/testProcessOutput/main.cpp
@@ -44,13 +44,23 @@
int main()
{
-#ifndef _WIN32_WCE
- for (int i=0; i<10240; i++) {
-#else //fprintf Output is very slow on Windows CE
+#if defined(__SYMBIAN32__)
+ // Printing to stdout messes up the out.txt, so open a file and print there.
+ FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","w+");
+ for (int i=0; i<200; i++) {
+ fprintf(file, "%d -this is a number\n", i);
+ fflush(file);
+ }
+ fclose(file);
+#else
+# if defined(_WIN32_WCE)
for (int i=0; i<240; i++) {
-#endif
+# else //fprintf Output is very slow on Windows CE/Symbian
+ for (int i=0; i<10240; i++) {
+# endif
fprintf(stdout, "%d -this is a number\n", i);
fflush(stderr);
}
+#endif
return 0;
}
diff --git a/tests/auto/qprocess/testProcessSpacesArgs/main.cpp b/tests/auto/qprocess/testProcessSpacesArgs/main.cpp
index fea074a811..5b63bcbd36 100644
--- a/tests/auto/qprocess/testProcessSpacesArgs/main.cpp
+++ b/tests/auto/qprocess/testProcessSpacesArgs/main.cpp
@@ -44,11 +44,21 @@
int main(int argc, char ** argv)
{
+#if defined(__SYMBIAN32__)
+ // Printing to stdout messes up the out.txt, so open a file and print there.
+ FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","w+");
+ for (int i = 0; i < argc; ++i) {
+ if (i)
+ fprintf(file, "|");
+ fprintf(file, argv[i]);
+ }
+ fclose(file);
+#else
for (int i = 0; i < argc; ++i) {
if (i)
printf("|");
printf(argv[i]);
}
-
+#endif
return 0;
}
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 801cce8479..2610af9394 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -47,7 +47,11 @@
#include <QtCore/QThread>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
+#include <QtCore/QMetaType>
+#if !defined(Q_OS_SYMBIAN)
+// Network test unnecessary?
#include <QtNetwork/QHostInfo>
+#endif
#include <stdlib.h>
#if defined(Q_OS_WIN)
@@ -154,7 +158,7 @@ protected slots:
void restartProcess();
void waitForReadyReadInAReadyReadSlotSlot();
void waitForBytesWrittenInABytesWrittenSlotSlot();
-
+
private:
QProcess *process;
qint64 bytesAvailable;
@@ -191,6 +195,12 @@ tst_QProcess::~tst_QProcess()
void tst_QProcess::init()
{
+#ifdef Q_OS_SYMBIAN
+ QString dirStr = QString::fromLatin1("c:\\logs");
+ QDir dir;
+ if (!dir.exists(dirStr))
+ dir.mkpath(dirStr);
+#endif
}
void tst_QProcess::cleanup()
@@ -246,8 +256,11 @@ void tst_QProcess::simpleStart()
QVERIFY(process->waitForStarted(5000));
QCOMPARE(process->state(), QProcess::Running);
#if defined(Q_OS_WINCE)
+ // Note: This actually seems incorrect, it will only exit the while loop when finishing fails
while (process->waitForFinished(5000))
{ }
+#elif defined(Q_OS_SYMBIAN)
+ QVERIFY(process->waitForFinished(5000));
#else
while (process->waitForReadyRead(5000))
{ }
@@ -373,6 +386,9 @@ void tst_QProcess::echoTest()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QFETCH(QByteArray, input);
@@ -431,6 +447,9 @@ void tst_QProcess::echoTest2()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
@@ -482,6 +501,9 @@ void tst_QProcess::echoTest_performance()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
#ifdef Q_OS_MAC
@@ -536,6 +558,9 @@ void tst_QProcess::echoTestGui()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
@@ -566,11 +591,14 @@ void tst_QProcess::batFiles()
#if defined(Q_OS_WINCE)
QSKIP("Batch files are not supported on Windows CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Batch files are not supported on Symbian", SkipAll);
+#endif
QFETCH(QString, batFile);
QFETCH(QByteArray, output);
QProcess proc;
-
+
proc.start(batFile, QStringList());
QVERIFY(proc.waitForFinished(5000));
@@ -636,6 +664,9 @@ void tst_QProcess::loopBackTest()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process = new QProcess;
#ifdef Q_OS_MAC
@@ -666,6 +697,9 @@ void tst_QProcess::readTimeoutAndThenCrash()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process = new QProcess;
#ifdef Q_OS_MAC
@@ -707,18 +741,30 @@ void tst_QProcess::waitForFinished()
process.start("testProcessOutput/testProcessOutput");
#endif
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QVERIFY(process.waitForFinished(5000));
#else
- QVERIFY(process.waitForFinished(15000));
+ QVERIFY(process.waitForFinished(30000));
#endif
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
-#if defined (Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+ // Symbian test outputs to a file, so check that
+ FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","r");
+ int retval = 0;
+ int count = 0;
+ while((int)(retval = fgetc(file) )!= EOF)
+ if (retval == '\n')
+ count++;
+ fclose(file);
+ QCOMPARE(count, 200);
+#else
+# if defined (Q_OS_WINCE)
QEXPECT_FAIL("", "Reading and writing to a process is not supported on Qt/CE", Continue);
-#endif
+# endif
QString output = process.readAll();
QCOMPARE(output.count("\n"), 10*1024);
+#endif
process.start("blurdybloop");
QVERIFY(!process.waitForFinished());
@@ -731,6 +777,9 @@ void tst_QProcess::deadWhileReading()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
@@ -756,6 +805,10 @@ void tst_QProcess::restartProcessDeadlock()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
+
// The purpose of this test is to detect whether restarting a
// process in the finished() connected slot causes a deadlock
// because of the way QProcessManager uses its locks.
@@ -793,6 +846,9 @@ void tst_QProcess::closeWriteChannel()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess more;
more.start("testProcessEOF/testProcessEOF");
@@ -822,6 +878,9 @@ void tst_QProcess::closeReadChannel()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
for (int i = 0; i < 10; ++i) {
QProcess::ProcessChannel channel1 = QProcess::StandardOutput;
@@ -859,6 +918,9 @@ void tst_QProcess::openModes()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess proc;
QVERIFY(!proc.isOpen());
@@ -909,6 +971,9 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess proc;
connect(&proc, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
@@ -945,6 +1010,9 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
//-----------------------------------------------------------------------------
void tst_QProcess::hardExit()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Killing started processes is not supported on Qt/Symbian due platform security", SkipAll);
+#endif
QProcess proc;
#if defined(Q_OS_MAC)
@@ -971,6 +1039,9 @@ void tst_QProcess::hardExit()
//-----------------------------------------------------------------------------
void tst_QProcess::softExit()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Terminating started processes is not supported on Qt/Symbian due platform security", SkipAll);
+#endif
QProcess proc;
proc.start("testSoftExit/testSoftExit");
@@ -992,7 +1063,7 @@ class SoftExitProcess : public QProcess
Q_OBJECT
public:
bool waitedForFinished;
-
+
SoftExitProcess(int n) : waitedForFinished(false), n(n), killing(false)
{
connect(this, SIGNAL(finished(int, QProcess::ExitStatus)),
@@ -1075,6 +1146,9 @@ void tst_QProcess::softExitInSlots()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QFETCH(QString, appName);
@@ -1094,6 +1168,9 @@ void tst_QProcess::mergedChannels()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
process.setReadChannelMode(QProcess::MergedChannels);
@@ -1124,11 +1201,14 @@ void tst_QProcess::forwardedChannels()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
process.setReadChannelMode(QProcess::ForwardedChannels);
QCOMPARE(process.readChannelMode(), QProcess::ForwardedChannels);
-
+
#ifdef Q_OS_MAC
process.start("testProcessEcho2/testProcessEcho2.app");
#else
@@ -1151,6 +1231,9 @@ void tst_QProcess::atEnd()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
@@ -1183,6 +1266,10 @@ public:
return exitCode;
}
+#if defined(Q_OS_SYMBIAN)
+ int serial;
+#endif
+
protected:
inline void run()
{
@@ -1194,11 +1281,21 @@ protected:
#ifdef Q_OS_MAC
process.start("testProcessEcho/testProcessEcho.app");
+#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // WINSCW builds in Symbian do not allow multiple processes to load Qt libraries,
+ // so use just a simple process instead of testDetached.
+ process.start("testProcessNormal");
+#elif defined(Q_OS_SYMBIAN)
+ // testDetached used because it does something, but doesn't take too long.
+ QFile infoFile(QString("c:\\logs\\detinfo%1").arg(serial));
+ QStringList args;
+ args << infoFile.fileName();
+ process.start("testDetached", args);
#else
process.start("testProcessEcho/testProcessEcho");
#endif
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QCOMPARE(process.write("abc\0", 4), qint64(4));
#endif
exitCode = exec();
@@ -1220,6 +1317,9 @@ void tst_QProcess::processInAThread()
{
for (int i = 0; i < 3; ++i) {
TestThread thread;
+#if defined(Q_OS_SYMBIAN)
+ thread.setStackSize(0x14000);
+#endif
thread.start();
QVERIFY(thread.wait(10000));
QCOMPARE(thread.code(), 0);
@@ -1229,11 +1329,24 @@ void tst_QProcess::processInAThread()
//-----------------------------------------------------------------------------
void tst_QProcess::processesInMultipleThreads()
{
+#if defined(Q_OS_SYMBIAN)
+ int serialCounter = 0;
+#endif
+
for (int i = 0; i < 10; ++i) {
TestThread thread1;
TestThread thread2;
TestThread thread3;
+#if defined(Q_OS_SYMBIAN)
+ thread1.serial = serialCounter++;
+ thread2.serial = serialCounter++;
+ thread3.serial = serialCounter++;
+
+ thread1.setStackSize(0x14000);
+ thread2.setStackSize(0x14000);
+ thread3.setStackSize(0x14000);
+#endif
thread1.start();
thread2.start();
thread3.start();
@@ -1259,14 +1372,26 @@ void tst_QProcess::waitForFinishedWithTimeout()
#ifdef Q_OS_MAC
process->start("testProcessEcho/testProcessEcho.app");
+#elif defined(Q_OS_SYMBIAN)
+ process->start("testProcessOutput");
#else
process->start("testProcessEcho/testProcessEcho");
#endif
+
+#if defined(Q_OS_SYMBIAN)
+ QVERIFY(process->waitForStarted(50));
+ QVERIFY(!process->waitForFinished(1));
+#else
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForFinished(1));
process->write("", 1);
+#endif
+
QVERIFY(process->waitForFinished());
+
+ delete process;
+ process = 0;
}
//-----------------------------------------------------------------------------
@@ -1275,6 +1400,9 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process = new QProcess(this);
connect(process, SIGNAL(readyRead()), this, SLOT(waitForReadyReadInAReadyReadSlotSlot()));
@@ -1294,7 +1422,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(spy.count(), 1);
-
+
process->disconnect();
QVERIFY(process->waitForFinished(5000));
QVERIFY(process->bytesAvailable() > bytesAvailable);
@@ -1308,6 +1436,9 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
bytesAvailable = process->bytesAvailable();
process->write("bar", 4);
@@ -1321,6 +1452,9 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process = new QProcess(this);
connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
@@ -1353,6 +1487,9 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
process->write("b");
QVERIFY(process->waitForBytesWritten(5000));
@@ -1411,18 +1548,20 @@ void tst_QProcess::spaceArgsTest()
QStringList programs;
programs << QString::fromLatin1("testProcessSpacesArgs/nospace")
+#if defined(Q_OS_SYMBIAN)
+ ; // Symbian toolchain doesn't like exes with spaces in the name
+#else
<< QString::fromLatin1("testProcessSpacesArgs/one space")
<< QString::fromLatin1("testProcessSpacesArgs/two space s");
+#endif
process = new QProcess(this);
for (int i = 0; i < programs.size(); ++i) {
-
QString program = programs.at(i);
-
process->start(program, args);
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QVERIFY(process->waitForStarted(5000));
QVERIFY(process->waitForFinished(5000));
#else
@@ -1430,10 +1569,19 @@ void tst_QProcess::spaceArgsTest()
QVERIFY(process->waitForFinished(10000));
#endif
-#if !defined(Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+ // Symbian test outputs to a file, so check that
+ FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","r");
+ char buf[256];
+ fgets(buf, 256, file);
+ fclose(file);
+ QStringList actual = QString::fromLatin1(buf).split("|");
+#elif !defined(Q_OS_WINCE)
QStringList actual = QString::fromLatin1(process->readAll()).split("|");
+#endif
+#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
- // not onterested in the program name, it might be different.
+ // not interested in the program name, it might be different.
actual.removeFirst();
QCOMPARE(actual, args);
@@ -1450,10 +1598,18 @@ void tst_QProcess::spaceArgsTest()
QVERIFY(process->waitForStarted(5000));
QVERIFY(process->waitForFinished(5000));
-#if !defined(Q_OS_WINCE)
+#if defined(Q_OS_SYMBIAN)
+ // Symbian test outputs to a file, so check that
+ file = fopen("c:\\logs\\qprocess_args_test.txt","r");
+ fgets(buf, 256, file);
+ fclose(file);
+ actual = QString::fromLatin1(buf).split("|");
+#elif !defined(Q_OS_WINCE)
actual = QString::fromLatin1(process->readAll()).split("|");
+#endif
+#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
- // not onterested in the program name, it might be different.
+ // not interested in the program name, it might be different.
actual.removeFirst();
QCOMPARE(actual, args);
@@ -1467,7 +1623,15 @@ void tst_QProcess::spaceArgsTest()
//-----------------------------------------------------------------------------
void tst_QProcess::exitCodeTest()
{
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // WINSCW builds in Symbian panic somewhere deep inside Symbian codes
+ // when eventdispather is deleted if too many test iterations are used.
+ // Reason for this is unclear.
+ // TODO: Remove special case when eventdispatcher is fixed.
+ for (int i = 0; i < 25; ++i) {
+#else
for (int i = 0; i < 255; ++i) {
+#endif
QProcess process;
process.start("testExitCodes/testExitCodes " + QString::number(i));
QVERIFY(process.waitForFinished(5000));
@@ -1489,10 +1653,10 @@ void tst_QProcess::failToStart()
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
-// Mac OS X and HP-UX have a really low defualt process limit (~100), so spawning
+// Mac OS X and HP-UX have a really low defualt process limit (~100), so spawning
// to many processes here will cause test failures later on.
#if defined Q_OS_HPUX
- const int attempts = 15;
+ const int attempts = 15;
#elif defined Q_OS_MAC
const int attempts = 15;
#else
@@ -1530,7 +1694,7 @@ void tst_QProcess::failToStart()
QCOMPARE(finishedSpy2.count(), 0);
int it = j * attempts + i + 1;
-
+
QCOMPARE(stateSpy.count(), it * 2);
QCOMPARE(qVariantValue<QProcess::ProcessState>(stateSpy.at(it * 2 - 2).at(0)), QProcess::Starting);
QCOMPARE(qVariantValue<QProcess::ProcessState>(stateSpy.at(it * 2 - 1).at(0)), QProcess::NotRunning);
@@ -1595,6 +1759,9 @@ void tst_QProcess::removeFileWhileProcessIsRunning()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QFile file("removeFile.txt");
QVERIFY(file.open(QFile::WriteOnly));
@@ -1617,7 +1784,7 @@ void tst_QProcess::removeFileWhileProcessIsRunning()
//-----------------------------------------------------------------------------
void tst_QProcess::systemEnvironment()
{
-#if defined (Q_OS_WINCE)
+#if defined (Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
// there is no concept of system variables on Windows CE as there is no console
QVERIFY(QProcess::systemEnvironment().isEmpty());
#else
@@ -1631,6 +1798,9 @@ void tst_QProcess::spaceInName()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
process.start("test Space In Name/testSpaceInName", QStringList());
QVERIFY(process.waitForStarted());
@@ -1641,7 +1811,10 @@ void tst_QProcess::spaceInName()
//-----------------------------------------------------------------------------
void tst_QProcess::lockupsInStartDetached()
{
+#if !defined(Q_OS_SYMBIAN)
+ // What exactly is this call supposed to achieve anyway?
QHostInfo::lookupHost(QString("something.invalid"), 0, 0);
+#endif
QProcess::execute("yjhbrty");
QProcess::startDetached("yjhbrty");
}
@@ -1652,6 +1825,9 @@ void tst_QProcess::atEnd2()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess process;
@@ -1677,7 +1853,7 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
// Start a program that doesn't exist, process events and then try to waitForReadyRead
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
-
+
QProcess process;
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy1(&process, SIGNAL(finished(int)));
@@ -1697,11 +1873,14 @@ void tst_QProcess::setStandardInputFile()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
static const char data[] = "A bunch\1of\2data\3\4\5\6\7...";
QProcess process;
QFile file("data");
-
+
QVERIFY(file.open(QIODevice::WriteOnly));
file.write(data, sizeof data);
file.close();
@@ -1713,7 +1892,7 @@ void tst_QProcess::setStandardInputFile()
process.start("testProcessEcho/testProcessEcho");
#endif
- QPROCESS_VERIFY(process, waitForFinished());
+ QPROCESS_VERIFY(process, waitForFinished());
QByteArray all = process.readAll();
QCOMPARE(all.size(), int(sizeof data) - 1); // testProcessEcho drops the ending \0
QVERIFY(all == data);
@@ -1753,6 +1932,9 @@ void tst_QProcess::setStandardOutputFile()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
static const char data[] = "Original data. ";
static const char testdata[] = "Test data.";
@@ -1784,7 +1966,7 @@ void tst_QProcess::setStandardOutputFile()
process.start("testProcessEcho2/testProcessEcho2");
#endif
process.write(testdata, sizeof testdata);
- QPROCESS_VERIFY(process,waitForFinished());
+ QPROCESS_VERIFY(process,waitForFinished());
// open the file again and verify the data
QVERIFY(file.open(QIODevice::ReadOnly));
@@ -1818,10 +2000,13 @@ void tst_QProcess::setStandardOutputProcess()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QProcess source;
QProcess sink;
-
+
QFETCH(bool, merged);
source.setReadChannelMode(merged ? QProcess::MergedChannels : QProcess::SeparateChannels);
source.setStandardOutputProcess(&sink);
@@ -1853,6 +2038,9 @@ void tst_QProcess::fileWriterProcess()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
QString stdinStr;
for (int i = 0; i < 5000; ++i)
@@ -1879,17 +2067,30 @@ void tst_QProcess::fileWriterProcess()
//-----------------------------------------------------------------------------
void tst_QProcess::detachedWorkingDirectoryAndPid()
{
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // WINSCW builds in Symbian do not allow multiple processes to load Qt libraries,
+ // so this test must be skipped.
+ QSKIP("Multiple processes loading Qt are not allowed in Qt/Symbian emulator.", SkipAll);
+#endif
qint64 pid;
#ifdef Q_OS_WINCE
QTest::qSleep(1000);
#endif
+#if defined(Q_OS_SYMBIAN)
+ // Symbian has no working directory support, so use logs dir as a shared directory
+ QFile infoFile(QLatin1String("c:\\logs\\detachedinfo.txt"));
+#else
QFile infoFile(QDir::currentPath() + QLatin1String("/detachedinfo.txt"));
+#endif
infoFile.remove();
QString workingDir = QDir::currentPath() + "/testDetached";
+
+#ifndef Q_OS_SYMBIAN
QVERIFY(QFile::exists(workingDir));
+#endif
QStringList args;
args << infoFile.fileName();
@@ -1913,6 +2114,9 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
qint64 actualPid = processIdString.toLongLong(&ok);
QVERIFY(ok);
+#if defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "Working directory is not supported on Qt/symbian", Continue);
+#endif
QCOMPARE(actualWorkingDir, workingDir);
QCOMPARE(actualPid, pid);
}
@@ -1923,8 +2127,11 @@ void tst_QProcess::switchReadChannels()
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
+#endif
const char data[] = "ABCD";
-
+
QProcess process;
#ifdef Q_OS_MAC
@@ -1942,7 +2149,7 @@ void tst_QProcess::switchReadChannels()
process.setReadChannel(QProcess::StandardError);
QCOMPARE(process.read(1), QByteArray(&data[i], 1));
}
-
+
process.ungetChar('D');
process.setReadChannel(QProcess::StandardOutput);
process.ungetChar('D');
@@ -1958,6 +2165,9 @@ void tst_QProcess::setWorkingDirectory()
#ifdef Q_OS_WINCE
QSKIP("Windows CE does not support working directory logic", SkipAll);
#endif
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian does not support working directory logic", SkipAll);
+#endif
process = new QProcess;
process->setWorkingDirectory("test");
#ifdef Q_OS_MAC
@@ -1990,13 +2200,22 @@ void tst_QProcess::startFinishStartFinish()
#else
process.start("testProcessOutput/testProcessOutput");
#endif
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QVERIFY(process.waitForReadyRead(10000));
QCOMPARE(QString::fromLatin1(process.readLine().trimmed()),
QString("0 -this is a number"));
#endif
if (process.state() != QProcess::NotRunning)
QVERIFY(process.waitForFinished(10000));
+#if defined(Q_OS_SYMBIAN)
+ // Symbian test outputs to a file, so check that
+ FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","r");
+ char buf[30];
+ fgets(buf, 30, file);
+ QCOMPARE(QString::fromLatin1(buf),
+ QString("0 -this is a number\n"));
+ fclose(file);
+#endif
}
}
diff --git a/tests/auto/qqueue/qqueue.pro b/tests/auto/qqueue/qqueue.pro
index f6561d3a09..ed489f9f81 100644
--- a/tests/auto/qqueue/qqueue.pro
+++ b/tests/auto/qqueue/qqueue.pro
@@ -3,5 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qqueue.cpp
-
-
+QT = core
diff --git a/tests/auto/qrand/qrand.pro b/tests/auto/qrand/qrand.pro
index 8f90fbc4a2..c868ed40fa 100644
--- a/tests/auto/qrand/qrand.pro
+++ b/tests/auto/qrand/qrand.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qrand.cpp
QT = core
-
-
diff --git a/tests/auto/qreadlocker/qreadlocker.pro b/tests/auto/qreadlocker/qreadlocker.pro
index 33b0987a28..5919102170 100644
--- a/tests/auto/qreadlocker/qreadlocker.pro
+++ b/tests/auto/qreadlocker/qreadlocker.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qreadlocker.cpp
QT = core
-
-
diff --git a/tests/auto/qreadwritelock/qreadwritelock.pro b/tests/auto/qreadwritelock/qreadwritelock.pro
index 2f75c641e4..4318b18178 100644
--- a/tests/auto/qreadwritelock/qreadwritelock.pro
+++ b/tests/auto/qreadwritelock/qreadwritelock.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qreadwritelock.cpp
QT = core
-
-
diff --git a/tests/auto/qrect/qrect.pro b/tests/auto/qrect/qrect.pro
index 16dd55086a..75940b3be7 100644
--- a/tests/auto/qrect/qrect.pro
+++ b/tests/auto/qrect/qrect.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qrect.cpp
QT = core
-
-
diff --git a/tests/auto/qrect/tst_qrect.cpp b/tests/auto/qrect/tst_qrect.cpp
index 7e8d9c3d11..51ef169c8d 100644
--- a/tests/auto/qrect/tst_qrect.cpp
+++ b/tests/auto/qrect/tst_qrect.cpp
@@ -321,17 +321,17 @@ void tst_QRect::isNull_data()
QTest::addColumn<QRect>("r");
QTest::addColumn<bool>("isNull");
- QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << TRUE;
- QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << FALSE;
- QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << FALSE;
- QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << FALSE;
- QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << FALSE;
- QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << TRUE; // Due to overflow
- QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << FALSE;
- QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << FALSE;
- QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << FALSE;
- QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << TRUE;
- QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << TRUE;
+ QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << true;
+ QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << false;
+ QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << false;
+ QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << false;
+ QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << false;
+ QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << true; // Due to overflow
+ QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << false;
+ QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << false;
+ QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << false;
+ QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << true;
+ QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << true;
}
void tst_QRect::isNull()
@@ -350,17 +350,17 @@ void tst_QRect::newIsEmpty_data()
QTest::addColumn<QRect>("r");
QTest::addColumn<bool>("isEmpty");
- QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << TRUE;
- QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << FALSE;
- QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << FALSE;
- QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << FALSE;
- QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << FALSE;
- QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << FALSE;
- QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << FALSE;
- QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << TRUE;
- QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << FALSE;
- QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << TRUE;
- QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << TRUE;
+ QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << true;
+ QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << false;
+ QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << false;
+ QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << false;
+ QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << false;
+ QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << false;
+ QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << false;
+ QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << true;
+ QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << false;
+ QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << true;
+ QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << true;
}
void tst_QRect::newIsEmpty()
@@ -383,17 +383,17 @@ void tst_QRect::newIsValid_data()
QTest::addColumn<QRect>("r");
QTest::addColumn<bool>("isValid");
- QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << FALSE;
- QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << TRUE;
- QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << TRUE;
- QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << TRUE;
- QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << TRUE;
- QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << TRUE;
- QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << TRUE;
- QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << FALSE;
- QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << TRUE;
- QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << FALSE;
- QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << FALSE;
+ QTest::newRow( "InvalidQRect" ) << getQRectCase( InvalidQRect ) << false;
+ QTest::newRow( "SmallestQRect" ) << getQRectCase( SmallestQRect ) << true;
+ QTest::newRow( "MiddleQRect" ) << getQRectCase( MiddleQRect ) << true;
+ QTest::newRow( "LargestQRect" ) << getQRectCase( LargestQRect ) << true;
+ QTest::newRow( "SmallestCoordQRect" ) << getQRectCase( SmallestCoordQRect ) << true;
+ QTest::newRow( "LargestCoordQRect" ) << getQRectCase( LargestCoordQRect ) << true;
+ QTest::newRow( "RandomQRect" ) << getQRectCase( RandomQRect ) << true;
+ QTest::newRow( "NegativeSizeQRect" ) << getQRectCase( NegativeSizeQRect ) << false;
+ QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << true;
+ QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << false;
+ QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << false;
}
void tst_QRect::newIsValid()
@@ -4177,28 +4177,28 @@ void tst_QRect::intersectsRect_data()
QTest::addColumn<QRect>("rect2");
QTest::addColumn<bool>("intersects");
- QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QRect( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QRect( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QRect( 2, 2, 10, 10) << TRUE;
- QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QRect(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QRect( 2, 2, 6, 6) << true;
+ QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QRect( 0, 0, 10, 10) << true;
+ QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QRect( 2, 2, 10, 10) << true;
+ QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QRect(20, 20, 10, 10) << false;
- QTest::newRow("test 05") << QRect(9, 9, -8, -8) << QRect( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 06") << QRect(9, 9, -8, -8) << QRect( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 07") << QRect(9, 9, -8, -8) << QRect( 2, 2, 10, 10) << TRUE;
- QTest::newRow("test 08") << QRect(9, 9, -8, -8) << QRect(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 05") << QRect(9, 9, -8, -8) << QRect( 2, 2, 6, 6) << true;
+ QTest::newRow("test 06") << QRect(9, 9, -8, -8) << QRect( 0, 0, 10, 10) << true;
+ QTest::newRow("test 07") << QRect(9, 9, -8, -8) << QRect( 2, 2, 10, 10) << true;
+ QTest::newRow("test 08") << QRect(9, 9, -8, -8) << QRect(20, 20, 10, 10) << false;
- QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QRect( 7, 7, -4, -4) << TRUE;
- QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QRect( 9, 9, -8, -8) << TRUE;
- QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QRect(11, 11, -8, -8) << TRUE;
- QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QRect(29, 29, -8, -8) << FALSE;
+ QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QRect( 7, 7, -4, -4) << true;
+ QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QRect( 9, 9, -8, -8) << true;
+ QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QRect(11, 11, -8, -8) << true;
+ QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QRect(29, 29, -8, -8) << false;
- QTest::newRow("test 13") << QRect() << QRect(10, 10, 10, 10) << FALSE;
- QTest::newRow("test 14") << QRect(10, 10, 10, 10) << QRect() << FALSE;
- QTest::newRow("test 15") << QRect() << QRect() << FALSE;
- QTest::newRow("test 16") << QRect(10, 10, 10, 10) << QRect(19, 15, 1, 5) << TRUE;
+ QTest::newRow("test 13") << QRect() << QRect(10, 10, 10, 10) << false;
+ QTest::newRow("test 14") << QRect(10, 10, 10, 10) << QRect() << false;
+ QTest::newRow("test 15") << QRect() << QRect() << false;
+ QTest::newRow("test 16") << QRect(10, 10, 10, 10) << QRect(19, 15, 1, 5) << true;
- QTest::newRow("test 17") << QRect(10, 10, 10, 10) << QRect(15, 19, 5, 1) << TRUE;
- QTest::newRow("test 18") << QRect(2, 0, 1, 652) << QRect(2, 0, 1, 652) << TRUE;
+ QTest::newRow("test 17") << QRect(10, 10, 10, 10) << QRect(15, 19, 5, 1) << true;
+ QTest::newRow("test 18") << QRect(2, 0, 1, 652) << QRect(2, 0, 1, 652) << true;
}
void tst_QRect::intersectsRect()
@@ -4216,28 +4216,28 @@ void tst_QRect::intersectsRectF_data()
QTest::addColumn<QRectF>("rect2");
QTest::addColumn<bool>("intersects");
- QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QRectF( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 10, 10) << TRUE;
- QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QRectF(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 6, 6) << true;
+ QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QRectF( 0, 0, 10, 10) << true;
+ QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 10, 10) << true;
+ QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QRectF(20, 20, 10, 10) << false;
- QTest::newRow("test 05") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 06") << QRectF(10, 10, -10, -10) << QRectF( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 07") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 10, 10) << TRUE;
- QTest::newRow("test 08") << QRectF(10, 10, -10, -10) << QRectF(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 05") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 6, 6) << true;
+ QTest::newRow("test 06") << QRectF(10, 10, -10, -10) << QRectF( 0, 0, 10, 10) << true;
+ QTest::newRow("test 07") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 10, 10) << true;
+ QTest::newRow("test 08") << QRectF(10, 10, -10, -10) << QRectF(20, 20, 10, 10) << false;
- QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QRectF( 8, 8, -6, -6) << TRUE;
- QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QRectF(10, 10, -10, -10) << TRUE;
- QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QRectF(12, 12, -10, -10) << TRUE;
- QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QRectF(30, 30, -10, -10) << FALSE;
+ QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QRectF( 8, 8, -6, -6) << true;
+ QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QRectF(10, 10, -10, -10) << true;
+ QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QRectF(12, 12, -10, -10) << true;
+ QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QRectF(30, 30, -10, -10) << false;
- QTest::newRow("test 13") << QRectF() << QRectF(10, 10, 10, 10) << FALSE;
- QTest::newRow("test 14") << QRectF(10, 10, 10, 10) << QRectF() << FALSE;
- QTest::newRow("test 15") << QRectF() << QRectF() << FALSE;
+ QTest::newRow("test 13") << QRectF() << QRectF(10, 10, 10, 10) << false;
+ QTest::newRow("test 14") << QRectF(10, 10, 10, 10) << QRectF() << false;
+ QTest::newRow("test 15") << QRectF() << QRectF() << false;
- QTest::newRow("test 16") << QRectF(0, 0, 10, 10) << QRectF(10, 10, 10, 10) << FALSE;
- QTest::newRow("test 17") << QRectF(0, 0, 10, 10) << QRectF(0, 10, 10, 10) << FALSE;
- QTest::newRow("test 18") << QRectF(0, 0, 10, 10) << QRectF(10, 0, 10, 10) << FALSE;
+ QTest::newRow("test 16") << QRectF(0, 0, 10, 10) << QRectF(10, 10, 10, 10) << false;
+ QTest::newRow("test 17") << QRectF(0, 0, 10, 10) << QRectF(0, 10, 10, 10) << false;
+ QTest::newRow("test 18") << QRectF(0, 0, 10, 10) << QRectF(10, 0, 10, 10) << false;
}
void tst_QRect::intersectsRectF()
@@ -4255,24 +4255,24 @@ void tst_QRect::containsRect_data()
QTest::addColumn<QRect>("rect2");
QTest::addColumn<bool>("contains");
- QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QRect( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QRect( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QRect( 2, 2, 10, 10) << FALSE;
- QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QRect(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QRect( 2, 2, 6, 6) << true;
+ QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QRect( 0, 0, 10, 10) << true;
+ QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QRect( 2, 2, 10, 10) << false;
+ QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QRect(20, 20, 10, 10) << false;
- QTest::newRow("test 05") << QRect(9, 9, -8, -8) << QRect( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 06") << QRect(9, 9, -8, -8) << QRect( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 07") << QRect(9, 9, -8, -8) << QRect( 2, 2, 10, 10) << FALSE;
- QTest::newRow("test 08") << QRect(9, 9, -8, -8) << QRect(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 05") << QRect(9, 9, -8, -8) << QRect( 2, 2, 6, 6) << true;
+ QTest::newRow("test 06") << QRect(9, 9, -8, -8) << QRect( 0, 0, 10, 10) << true;
+ QTest::newRow("test 07") << QRect(9, 9, -8, -8) << QRect( 2, 2, 10, 10) << false;
+ QTest::newRow("test 08") << QRect(9, 9, -8, -8) << QRect(20, 20, 10, 10) << false;
- QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QRect( 7, 7, -4, -4) << TRUE;
- QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QRect( 9, 9, -8, -8) << TRUE;
- QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QRect(11, 11, -8, -8) << FALSE;
- QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QRect(29, 29, -8, -8) << FALSE;
+ QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QRect( 7, 7, -4, -4) << true;
+ QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QRect( 9, 9, -8, -8) << true;
+ QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QRect(11, 11, -8, -8) << false;
+ QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QRect(29, 29, -8, -8) << false;
- QTest::newRow("test 13") << QRect(-1, 1, 10, 10) << QRect() << FALSE;
- QTest::newRow("test 14") << QRect() << QRect(0, 0, 10, 10) << FALSE;
- QTest::newRow("test 15") << QRect() << QRect() << FALSE;
+ QTest::newRow("test 13") << QRect(-1, 1, 10, 10) << QRect() << false;
+ QTest::newRow("test 14") << QRect() << QRect(0, 0, 10, 10) << false;
+ QTest::newRow("test 15") << QRect() << QRect() << false;
}
void tst_QRect::containsRect()
@@ -4290,24 +4290,24 @@ void tst_QRect::containsRectF_data()
QTest::addColumn<QRectF>("rect2");
QTest::addColumn<bool>("contains");
- QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QRectF( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 10, 10) << FALSE;
- QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QRectF(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 6, 6) << true;
+ QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QRectF( 0, 0, 10, 10) << true;
+ QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QRectF( 2, 2, 10, 10) << false;
+ QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QRectF(20, 20, 10, 10) << false;
- QTest::newRow("test 05") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 6, 6) << TRUE;
- QTest::newRow("test 06") << QRectF(10, 10, -10, -10) << QRectF( 0, 0, 10, 10) << TRUE;
- QTest::newRow("test 07") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 10, 10) << FALSE;
- QTest::newRow("test 08") << QRectF(10, 10, -10, -10) << QRectF(20, 20, 10, 10) << FALSE;
+ QTest::newRow("test 05") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 6, 6) << true;
+ QTest::newRow("test 06") << QRectF(10, 10, -10, -10) << QRectF( 0, 0, 10, 10) << true;
+ QTest::newRow("test 07") << QRectF(10, 10, -10, -10) << QRectF( 2, 2, 10, 10) << false;
+ QTest::newRow("test 08") << QRectF(10, 10, -10, -10) << QRectF(20, 20, 10, 10) << false;
- QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QRectF( 8, 8, -6, -6) << TRUE;
- QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QRectF(10, 10, -10, -10) << TRUE;
- QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QRectF(12, 12, -10, -10) << FALSE;
- QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QRectF(30, 30, -10, -10) << FALSE;
+ QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QRectF( 8, 8, -6, -6) << true;
+ QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QRectF(10, 10, -10, -10) << true;
+ QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QRectF(12, 12, -10, -10) << false;
+ QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QRectF(30, 30, -10, -10) << false;
- QTest::newRow("test 13") << QRectF(-1, 1, 10, 10) << QRectF() << FALSE;
- QTest::newRow("test 14") << QRectF() << QRectF(0, 0, 10, 10) << FALSE;
- QTest::newRow("test 15") << QRectF() << QRectF() << FALSE;
+ QTest::newRow("test 13") << QRectF(-1, 1, 10, 10) << QRectF() << false;
+ QTest::newRow("test 14") << QRectF() << QRectF(0, 0, 10, 10) << false;
+ QTest::newRow("test 15") << QRectF() << QRectF() << false;
}
void tst_QRect::containsRectF()
@@ -4326,35 +4326,35 @@ void tst_QRect::containsPoint_data()
QTest::addColumn<bool>("contains");
QTest::addColumn<bool>("containsProper");
- QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QPoint( 0, 0) << TRUE << FALSE;
- QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QPoint( 0, 10) << FALSE << FALSE;
- QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QPoint(10, 0) << FALSE << FALSE;
- QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QPoint(10, 10) << FALSE << FALSE;
- QTest::newRow("test 05") << QRect(0, 0, 10, 10) << QPoint( 0, 9) << TRUE << FALSE;
- QTest::newRow("test 06") << QRect(0, 0, 10, 10) << QPoint( 9, 0) << TRUE << FALSE;
- QTest::newRow("test 07") << QRect(0, 0, 10, 10) << QPoint( 9, 9) << TRUE << FALSE;
- QTest::newRow("test 08") << QRect(0, 0, 10, 10) << QPoint( 1, 0) << TRUE << FALSE;
- QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QPoint( 9, 1) << TRUE << FALSE;
- QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QPoint( 1, 1) << TRUE << TRUE;
- QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QPoint( 1, 8) << TRUE << TRUE;
- QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QPoint( 8, 8) << TRUE << TRUE;
-
- QTest::newRow("test 13") << QRect(9, 9, -8, -8) << QPoint( 0, 0) << TRUE << FALSE;
- QTest::newRow("test 14") << QRect(9, 9, -8, -8) << QPoint( 0, 10) << FALSE << FALSE;
- QTest::newRow("test 15") << QRect(9, 9, -8, -8) << QPoint(10, 0) << FALSE << FALSE;
- QTest::newRow("test 16") << QRect(9, 9, -8, -8) << QPoint(10, 10) << FALSE << FALSE;
- QTest::newRow("test 17") << QRect(9, 9, -8, -8) << QPoint( 0, 9) << TRUE << FALSE;
- QTest::newRow("test 18") << QRect(9, 9, -8, -8) << QPoint( 9, 0) << TRUE << FALSE;
- QTest::newRow("test 19") << QRect(9, 9, -8, -8) << QPoint( 9, 9) << TRUE << FALSE;
- QTest::newRow("test 20") << QRect(9, 9, -8, -8) << QPoint( 1, 0) << TRUE << FALSE;
- QTest::newRow("test 21") << QRect(9, 9, -8, -8) << QPoint( 9, 1) << TRUE << FALSE;
- QTest::newRow("test 22") << QRect(9, 9, -8, -8) << QPoint( 1, 1) << TRUE << TRUE;
- QTest::newRow("test 23") << QRect(9, 9, -8, -8) << QPoint( 1, 8) << TRUE << TRUE;
- QTest::newRow("test 24") << QRect(9, 9, -8, -8) << QPoint( 8, 8) << TRUE << TRUE;
-
- QTest::newRow("test 25") << QRect(-1, 1, 10, 10) << QPoint() << FALSE << FALSE;
- QTest::newRow("test 26") << QRect() << QPoint(1, 1) << FALSE << FALSE;
- QTest::newRow("test 27") << QRect() << QPoint() << FALSE << FALSE;
+ QTest::newRow("test 01") << QRect(0, 0, 10, 10) << QPoint( 0, 0) << true << false;
+ QTest::newRow("test 02") << QRect(0, 0, 10, 10) << QPoint( 0, 10) << false << false;
+ QTest::newRow("test 03") << QRect(0, 0, 10, 10) << QPoint(10, 0) << false << false;
+ QTest::newRow("test 04") << QRect(0, 0, 10, 10) << QPoint(10, 10) << false << false;
+ QTest::newRow("test 05") << QRect(0, 0, 10, 10) << QPoint( 0, 9) << true << false;
+ QTest::newRow("test 06") << QRect(0, 0, 10, 10) << QPoint( 9, 0) << true << false;
+ QTest::newRow("test 07") << QRect(0, 0, 10, 10) << QPoint( 9, 9) << true << false;
+ QTest::newRow("test 08") << QRect(0, 0, 10, 10) << QPoint( 1, 0) << true << false;
+ QTest::newRow("test 09") << QRect(0, 0, 10, 10) << QPoint( 9, 1) << true << false;
+ QTest::newRow("test 10") << QRect(0, 0, 10, 10) << QPoint( 1, 1) << true << true;
+ QTest::newRow("test 11") << QRect(0, 0, 10, 10) << QPoint( 1, 8) << true << true;
+ QTest::newRow("test 12") << QRect(0, 0, 10, 10) << QPoint( 8, 8) << true << true;
+
+ QTest::newRow("test 13") << QRect(9, 9, -8, -8) << QPoint( 0, 0) << true << false;
+ QTest::newRow("test 14") << QRect(9, 9, -8, -8) << QPoint( 0, 10) << false << false;
+ QTest::newRow("test 15") << QRect(9, 9, -8, -8) << QPoint(10, 0) << false << false;
+ QTest::newRow("test 16") << QRect(9, 9, -8, -8) << QPoint(10, 10) << false << false;
+ QTest::newRow("test 17") << QRect(9, 9, -8, -8) << QPoint( 0, 9) << true << false;
+ QTest::newRow("test 18") << QRect(9, 9, -8, -8) << QPoint( 9, 0) << true << false;
+ QTest::newRow("test 19") << QRect(9, 9, -8, -8) << QPoint( 9, 9) << true << false;
+ QTest::newRow("test 20") << QRect(9, 9, -8, -8) << QPoint( 1, 0) << true << false;
+ QTest::newRow("test 21") << QRect(9, 9, -8, -8) << QPoint( 9, 1) << true << false;
+ QTest::newRow("test 22") << QRect(9, 9, -8, -8) << QPoint( 1, 1) << true << true;
+ QTest::newRow("test 23") << QRect(9, 9, -8, -8) << QPoint( 1, 8) << true << true;
+ QTest::newRow("test 24") << QRect(9, 9, -8, -8) << QPoint( 8, 8) << true << true;
+
+ QTest::newRow("test 25") << QRect(-1, 1, 10, 10) << QPoint() << false << false;
+ QTest::newRow("test 26") << QRect() << QPoint(1, 1) << false << false;
+ QTest::newRow("test 27") << QRect() << QPoint() << false << false;
}
void tst_QRect::containsPoint()
@@ -4365,7 +4365,7 @@ void tst_QRect::containsPoint()
QFETCH(bool, containsProper);
QVERIFY(rect.contains(point) == contains);
- QVERIFY(rect.contains(point, TRUE) == containsProper);
+ QVERIFY(rect.contains(point, true) == containsProper);
}
void tst_QRect::containsPointF_data()
@@ -4374,37 +4374,37 @@ void tst_QRect::containsPointF_data()
QTest::addColumn<QPointF>("point");
QTest::addColumn<bool>("contains");
- QTest::newRow("test 27") << QRectF() << QPointF() << FALSE;
-
- QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QPointF( 0, 0) << TRUE;
- QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QPointF( 0, 10) << TRUE;
- QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QPointF(10, 0) << TRUE;
- QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QPointF(10, 10) << TRUE;
- QTest::newRow("test 05") << QRectF(0, 0, 10, 10) << QPointF( 0, 9) << TRUE;
- QTest::newRow("test 06") << QRectF(0, 0, 10, 10) << QPointF( 9, 0) << TRUE;
- QTest::newRow("test 07") << QRectF(0, 0, 10, 10) << QPointF( 9, 9) << TRUE;
- QTest::newRow("test 08") << QRectF(0, 0, 10, 10) << QPointF( 1, 0) << TRUE;
- QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QPointF( 9, 1) << TRUE;
- QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QPointF( 1, 1) << TRUE;
- QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QPointF( 1, 8) << TRUE;
- QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QPointF( 8, 8) << TRUE;
-
- QTest::newRow("test 13") << QRectF(10, 10, -10, -10) << QPointF( 0, 0) << TRUE;
- QTest::newRow("test 14") << QRectF(10, 10, -10, -10) << QPointF( 0, 10) << TRUE;
- QTest::newRow("test 15") << QRectF(10, 10, -10, -10) << QPointF(10, 0) << TRUE;
- QTest::newRow("test 16") << QRectF(10, 10, -10, -10) << QPointF(10, 10) << TRUE;
- QTest::newRow("test 17") << QRectF(10, 10, -10, -10) << QPointF( 0, 9) << TRUE;
- QTest::newRow("test 18") << QRectF(10, 10, -10, -10) << QPointF( 9, 0) << TRUE;
- QTest::newRow("test 19") << QRectF(10, 10, -10, -10) << QPointF( 9, 9) << TRUE;
- QTest::newRow("test 20") << QRectF(10, 10, -10, -10) << QPointF( 1, 0) << TRUE;
- QTest::newRow("test 21") << QRectF(10, 10, -10, -10) << QPointF( 9, 1) << TRUE;
- QTest::newRow("test 22") << QRectF(10, 10, -10, -10) << QPointF( 1, 1) << TRUE;
- QTest::newRow("test 23") << QRectF(10, 10, -10, -10) << QPointF( 1, 8) << TRUE;
- QTest::newRow("test 24") << QRectF(10, 10, -10, -10) << QPointF( 8, 8) << TRUE;
-
- QTest::newRow("test 25") << QRectF(-1, 1, 10, 10) << QPointF() << FALSE;
- QTest::newRow("test 26") << QRectF() << QPointF(1, 1) << FALSE;
- QTest::newRow("test 27") << QRectF() << QPointF() << FALSE;
+ QTest::newRow("test 27") << QRectF() << QPointF() << false;
+
+ QTest::newRow("test 01") << QRectF(0, 0, 10, 10) << QPointF( 0, 0) << true;
+ QTest::newRow("test 02") << QRectF(0, 0, 10, 10) << QPointF( 0, 10) << true;
+ QTest::newRow("test 03") << QRectF(0, 0, 10, 10) << QPointF(10, 0) << true;
+ QTest::newRow("test 04") << QRectF(0, 0, 10, 10) << QPointF(10, 10) << true;
+ QTest::newRow("test 05") << QRectF(0, 0, 10, 10) << QPointF( 0, 9) << true;
+ QTest::newRow("test 06") << QRectF(0, 0, 10, 10) << QPointF( 9, 0) << true;
+ QTest::newRow("test 07") << QRectF(0, 0, 10, 10) << QPointF( 9, 9) << true;
+ QTest::newRow("test 08") << QRectF(0, 0, 10, 10) << QPointF( 1, 0) << true;
+ QTest::newRow("test 09") << QRectF(0, 0, 10, 10) << QPointF( 9, 1) << true;
+ QTest::newRow("test 10") << QRectF(0, 0, 10, 10) << QPointF( 1, 1) << true;
+ QTest::newRow("test 11") << QRectF(0, 0, 10, 10) << QPointF( 1, 8) << true;
+ QTest::newRow("test 12") << QRectF(0, 0, 10, 10) << QPointF( 8, 8) << true;
+
+ QTest::newRow("test 13") << QRectF(10, 10, -10, -10) << QPointF( 0, 0) << true;
+ QTest::newRow("test 14") << QRectF(10, 10, -10, -10) << QPointF( 0, 10) << true;
+ QTest::newRow("test 15") << QRectF(10, 10, -10, -10) << QPointF(10, 0) << true;
+ QTest::newRow("test 16") << QRectF(10, 10, -10, -10) << QPointF(10, 10) << true;
+ QTest::newRow("test 17") << QRectF(10, 10, -10, -10) << QPointF( 0, 9) << true;
+ QTest::newRow("test 18") << QRectF(10, 10, -10, -10) << QPointF( 9, 0) << true;
+ QTest::newRow("test 19") << QRectF(10, 10, -10, -10) << QPointF( 9, 9) << true;
+ QTest::newRow("test 20") << QRectF(10, 10, -10, -10) << QPointF( 1, 0) << true;
+ QTest::newRow("test 21") << QRectF(10, 10, -10, -10) << QPointF( 9, 1) << true;
+ QTest::newRow("test 22") << QRectF(10, 10, -10, -10) << QPointF( 1, 1) << true;
+ QTest::newRow("test 23") << QRectF(10, 10, -10, -10) << QPointF( 1, 8) << true;
+ QTest::newRow("test 24") << QRectF(10, 10, -10, -10) << QPointF( 8, 8) << true;
+
+ QTest::newRow("test 25") << QRectF(-1, 1, 10, 10) << QPointF() << false;
+ QTest::newRow("test 26") << QRectF() << QPointF(1, 1) << false;
+ QTest::newRow("test 27") << QRectF() << QPointF() << false;
}
void tst_QRect::containsPointF()
diff --git a/tests/auto/qregexp/qregexp.pro b/tests/auto/qregexp/qregexp.pro
index 0712496e95..ac1cdea0ca 100644
--- a/tests/auto/qregexp/qregexp.pro
+++ b/tests/auto/qregexp/qregexp.pro
@@ -3,6 +3,3 @@ load(qttest_p4)
QT = core
SOURCES += tst_qregexp.cpp
-QT -= gui
-
-
diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp
index 999166e3da..efafbe466f 100644
--- a/tests/auto/qregexp/tst_qregexp.cpp
+++ b/tests/auto/qregexp/tst_qregexp.cpp
@@ -969,7 +969,7 @@ void tst_QRegExp::rainersSlowRegExpCopyBug()
{
// this test should take an extreme amount of time if QRegExp is broken
QRegExp original(email);
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
for (int i = 0; i < 100; ++i) {
#else
for (int i = 0; i < 100000; ++i) {
@@ -1022,7 +1022,7 @@ void Thread::run()
str += "abbbdekcz";
int x;
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
for (int j = 0; j < 100; ++j) {
#else
for (int j = 0; j < 10000; ++j) {
diff --git a/tests/auto/qregion/tst_qregion.cpp b/tests/auto/qregion/tst_qregion.cpp
index eba07f2667..003619b2ed 100644
--- a/tests/auto/qregion/tst_qregion.cpp
+++ b/tests/auto/qregion/tst_qregion.cpp
@@ -279,7 +279,7 @@ void tst_QRegion::emptyPolygonRegion_data()
QPolygon pa;
- QTest::newRow("no points") << pa << TRUE << 0 << QVector<QRect>();
+ QTest::newRow("no points") << pa << true << 0 << QVector<QRect>();
pa = QPolygon() << QPoint(10,10);
QTest::newRow("one point") << pa << true << 0 << QVector<QRect>();
pa = QPolygon() << QPoint(10,10) << QPoint(10,20);
@@ -381,7 +381,7 @@ void tst_QRegion::intersected_data()
QPolygon ps2(8);
ps1.putPoints(0,8, 20,20, 50,20, 50,100, 70,100, 70,20, 120,20, 120,200, 20, 200);
ps2.putPoints(0,8, 100,150, 140,150, 140,160, 160,160, 160,150, 200,150, 200,180, 100,180);
- QTest::newRow("task30716") << QRegion(ps1) << QRegion(ps2) << TRUE;
+ QTest::newRow("task30716") << QRegion(ps1) << QRegion(ps2) << true;
}
void tst_QRegion::intersected()
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index cdbbbd2622..f487b97c56 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -9,13 +9,13 @@ load(resources)
SOURCES += tst_resourceengine.cpp
RESOURCES += testqrc/test.qrc
-runtime_resource.target = runtime_resource.rcc
+runtime_resource.target = $$PWD/runtime_resource.rcc
runtime_resource.depends = $$PWD/testqrc/test.qrc
runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target}
QMAKE_EXTRA_TARGETS = runtime_resource
-ALL_DEPS += $${runtime_resource.target}
+PRE_TARGETDEPS += $${runtime_resource.target}
-wince*:{
+wince*|symbian*:{
deploy.sources += runtime_resource.rcc parentdir.txt
test.sources = testqrc/*
test.path = testqrc
@@ -34,7 +34,7 @@ wince*:{
testsub2.sources = testqrc/test/test/*
testsub2.path = testqrc/test/test
DEPLOYMENT = deploy test alias other search1 search2 sub testsub testsub2
- DEFINES += SRCDIR=\\\"\\\"
+ !symbian:DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qresourceengine/tst_resourceengine.cpp b/tests/auto/qresourceengine/tst_resourceengine.cpp
index 408b8107c3..037cbeb052 100644
--- a/tests/auto/qresourceengine/tst_resourceengine.cpp
+++ b/tests/auto/qresourceengine/tst_resourceengine.cpp
@@ -43,6 +43,10 @@
#include <QtTest/QtTest>
#include <QtCore>
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "."
+#endif
+
class tst_ResourceEngine: public QObject
{
Q_OBJECT
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index cf3ced33ea..599185cc71 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -2,9 +2,12 @@ load(qttest_p4)
QT += script
SOURCES += tst_qscriptengine.cpp
-wince*: {
+wince*|symbian*: {
addFiles.sources = script
addFiles.path = .
DEPLOYMENT += addFiles
}
+symbian: {
+ TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+}
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 5339fb4c0a..cd797d949c 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -233,7 +233,7 @@ void tst_QScriptEngine::newFunction()
QCOMPARE(fun.prototype().isValid(), true);
QCOMPARE(fun.prototype().isFunction(), true);
QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true);
-
+
QCOMPARE(fun.call().isNull(), true);
QCOMPARE(fun.construct().isObject(), true);
}
@@ -2453,7 +2453,7 @@ void tst_QScriptEngine::numberClass()
QCOMPARE(ctor.propertyFlags("MIN_VALUE"), flags);
QVERIFY(ctor.property("NaN").isNumber());
QCOMPARE(ctor.propertyFlags("NaN"), flags);
- QVERIFY(ctor.property("NEGATIVE_INFINITY").isNumber());
+ QVERIFY(ctor.property("NEGATIVE_INFINITY").isNumber());
QCOMPARE(ctor.propertyFlags("NEGATIVE_INFINITY"), flags);
QVERIFY(ctor.property("POSITIVE_INFINITY").isNumber());
QCOMPARE(ctor.propertyFlags("POSITIVE_INFINITY"), flags);
@@ -2676,7 +2676,7 @@ void tst_QScriptEngine::functionExpression()
" else\n"
" function baz() { return 'baz'; }\n"
" return (arg == 'bar') ? bar : baz;\n"
- "}");
+ "}");
QVERIFY(!eng.globalObject().property("bar").isValid());
QVERIFY(!eng.globalObject().property("baz").isValid());
QVERIFY(eng.evaluate("foo").isFunction());
diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
index b8109cc0b3..69ded3f213 100644
--- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
+++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
@@ -1,8 +1,8 @@
load(qttest_p4)
QT = core script
SOURCES += tst_qscriptjstestsuite.cpp
-
-wince*: {
+symbian:TARGET.EPOCHEAPSIZE = 0x020000 0xA00000
+wince*|symbian*: {
testFiles.sources = tests
testFiles.path = .
DEPLOYMENT += testFiles
diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
index fbb0ba5960..410fccadf6 100644
--- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
+++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
@@ -899,7 +899,7 @@ bool tst_Suite::isExcludedFile(const QString &fileName, QString *message) const
if (message)
*message = fileExclusions.at(i).second;
return true;
- }
+ }
}
return false;
}
diff --git a/tests/auto/qscriptqobject/qscriptqobject.pro b/tests/auto/qscriptqobject/qscriptqobject.pro
index e4e2b56cff..57eacfe187 100644
--- a/tests/auto/qscriptqobject/qscriptqobject.pro
+++ b/tests/auto/qscriptqobject/qscriptqobject.pro
@@ -2,4 +2,6 @@ load(qttest_p4)
QT += script
SOURCES += tst_qscriptqobject.cpp
-
+symbian: {
+ TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+}
diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
index 9b9dd163db..4d3e92d513 100644
--- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
+++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
@@ -54,6 +54,10 @@
struct CustomType
{
+#if defined (Q_CC_NOKIAX86)
+ // Compiler crash workaround
+ CustomType() {}
+#endif
QString string;
};
Q_DECLARE_METATYPE(CustomType)
@@ -2112,7 +2116,7 @@ void tst_QScriptExtQObject::findChild()
QCOMPARE(result.isNull(), true);
}
- {
+ {
QScriptValue result = m_engine->evaluate("myObject.findChild('myChildObject')");
QCOMPARE(result.isQObject(), true);
QCOMPARE(result.toQObject(), child);
diff --git a/tests/auto/qset/qset.pro b/tests/auto/qset/qset.pro
index 2656dafc89..05ad07d5e7 100644
--- a/tests/auto/qset/qset.pro
+++ b/tests/auto/qset/qset.pro
@@ -1,7 +1,8 @@
load(qttest_p4)
SOURCES += tst_qset.cpp
-
-
QT = core
-
+symbian*: {
+TARGET.EPOCSTACKSIZE =0x5000
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+}
diff --git a/tests/auto/qsettings/.gitattributes b/tests/auto/qsettings/.gitattributes
new file mode 100644
index 0000000000..a4ad8d7644
--- /dev/null
+++ b/tests/auto/qsettings/.gitattributes
@@ -0,0 +1,5 @@
+resourcefile.ini -crlf
+resourcefile2.ini -crlf
+resourcefile3.ini -crlf
+resourcefile4.ini -crlf
+resourcefile5.ini -crlf
diff --git a/tests/auto/qsettings/tst_qsettings.cpp b/tests/auto/qsettings/tst_qsettings.cpp
index c478c63e38..bc2416adce 100644
--- a/tests/auto/qsettings/tst_qsettings.cpp
+++ b/tests/auto/qsettings/tst_qsettings.cpp
@@ -52,7 +52,9 @@
#include <QtCore/QtDebug>
#include <QtCore/QString>
-#include <cctype>
+#if !defined(Q_OS_SYMBIAN)
+# include <cctype>
+#endif
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
// need for unlink on mingw
#include <io.h>
@@ -122,7 +124,7 @@ private slots:
void setPath();
void setDefaultFormat();
void dontCreateNeedlessPaths();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
void dontReorderIniKeysNeedlessly();
#endif
@@ -209,7 +211,7 @@ void tst_QSettings::getSetCheck()
Q_DECLARE_METATYPE(QSettings::Format)
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
static void removePath(const QString& _path)
{
QString path = _path;
@@ -356,9 +358,11 @@ void tst_QSettings::init()
QSettings(QSettings::SystemScope, "software.org").clear();
QSettings(QSettings::UserScope, "other.software.org").clear();
QSettings(QSettings::SystemScope, "other.software.org").clear();
+#elif defined(Q_OS_SYMBIAN)
+ removePath(settingsPath());
#endif
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
system(QString("chmod -R u+rw %1 2> /dev/null").arg(settingsPath()).toLatin1());
system(QString("rm -fr %1 2> /dev/null").arg(settingsPath()).toLatin1());
#endif
@@ -540,13 +544,13 @@ void tst_QSettings::ctor()
*/
QSettings settings5(format, QSettings::UserScope, "SoftWare.ORG", "killerApp");
if (format == QSettings::NativeFormat) {
-#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
#endif
} else {
-#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
@@ -713,8 +717,10 @@ void tst_QSettings::testErrorHandling_data()
void tst_QSettings::testErrorHandling()
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
QSKIP("Windows doesn't support most file modes, including read-only directories, so this test is moot.", SkipAll);
+#elif defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian/Open C doesn't support execute or write only file modes, or directory permissions, so this test is mostly moot.", SkipAll);
#else
QFETCH(int, filePerms);
QFETCH(int, dirPerms);
@@ -1491,7 +1497,7 @@ void tst_QSettings::sync()
// Now "some other app" will change other.software.org.ini
QString userConfDir = settingsPath("__user__") + QDir::separator();
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
unlink((userConfDir + "other.software.org.ini").toLatin1());
rename((userConfDir + "software.org.ini").toLatin1(),
(userConfDir + "other.software.org.ini").toLatin1());
@@ -3667,7 +3673,7 @@ void tst_QSettings::dontCreateNeedlessPaths()
QVERIFY(!fileInfo.dir().exists());
}
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
void tst_QSettings::dontReorderIniKeysNeedlessly()
{
#ifdef QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
diff --git a/tests/auto/qsharedmemory/lackey/scripts/producer.js b/tests/auto/qsharedmemory/lackey/scripts/producer.js
index 88b2b80905..e02cd8b7bb 100644
--- a/tests/auto/qsharedmemory/lackey/scripts/producer.js
+++ b/tests/auto/qsharedmemory/lackey/scripts/producer.js
@@ -15,6 +15,10 @@ if (!producer.create(size)) {
}
//print ("producer created and attached");
+QVERIFY(producer.lock());
+producer.set(0, 'Q');
+QVERIFY(producer.unlock());
+
var i = 0;
while(i < 5) {
QVERIFY(producer.lock(), "lock");
@@ -34,3 +38,7 @@ producer.set(0, 'E');
QVERIFY(producer.unlock());
//print ("producer done");
+
+// Sleep for a bit to let all consumers start, otherwise they will get stuck in the attach loop,
+// because at least in Symbian the shared memory will be destroyed if there are no active handles to it.
+producer.sleep(3000); \ No newline at end of file
diff --git a/tests/auto/qsharedmemory/src/qsystemlock_p.h b/tests/auto/qsharedmemory/src/qsystemlock_p.h
index 674c7b21fd..8c84ccf7d9 100644
--- a/tests/auto/qsharedmemory/src/qsystemlock_p.h
+++ b/tests/auto/qsharedmemory/src/qsystemlock_p.h
@@ -47,6 +47,7 @@
#include "qsystemlock.h"
#include "private/qsharedmemory_p.h"
+#include <sys/types.h>
#define MAX_LOCKS 64
diff --git a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp b/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp
index 5c46ce5857..d28185f8c5 100644
--- a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp
+++ b/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp
@@ -51,6 +51,7 @@
#include <fcntl.h>
#include <errno.h>
#include <sys/shm.h>
+#include <unistd.h>
#include <sys/sem.h>
// We have to define this as on some sem.h will have it
@@ -62,6 +63,25 @@ union qt_semun {
#define tr(x) QT_TRANSLATE_NOOP(QLatin1String("QSystemLock"), (x))
+#if defined(Q_OS_SYMBIAN)
+int createUnixKeyFile(const QString &fileName)
+{
+ if (QFile::exists(fileName))
+ return 0;
+
+ int fd = open(QFile::encodeName(fileName).constData(),
+ O_EXCL | O_CREAT | O_RDWR, 0640);
+ if (-1 == fd) {
+ if (errno == EEXIST)
+ return 0;
+ return -1;
+ } else {
+ close(fd);
+ }
+ return 1;
+}
+#endif
+
QSystemLockPrivate::QSystemLockPrivate() :
semaphore(-1), lockCount(0),
error(QSystemLock::NoError), unix_key(-1), createdFile(false), createdSemaphore(false)
@@ -105,7 +125,11 @@ key_t QSystemLockPrivate::handle()
}
// Create the file needed for ftok
+#if defined(Q_OS_SYMBIAN)
+ int built = createUnixKeyFile(fileName);
+#else
int built = QSharedMemoryPrivate::createUnixKeyFile(fileName);
+#endif
if (-1 == built)
return -1;
createdFile = (1 == built);
diff --git a/tests/auto/qsharedmemory/test/test.pro b/tests/auto/qsharedmemory/test/test.pro
index e294a756bf..779a942437 100644
--- a/tests/auto/qsharedmemory/test/test.pro
+++ b/tests/auto/qsharedmemory/test/test.pro
@@ -17,13 +17,19 @@ TARGET = ../tst_qsharedmemory
}
}
-wince*: {
+wince*:{
QT += gui script
addFiles.sources = ../lackey/lackey.exe ../lackey/scripts
addFiles.path = lackey
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
+}else:symbian*{
+QT += gui script
+addFiles.sources = ../lackey/scripts
+addFiles.path = /data/qsharedmemorytemp/lackey
+addBin.sources = lackey.exe
+addBin.path = /sys/bin
+DEPLOYMENT += addFiles addBin
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
-
diff --git a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
index f39b376697..3c63d9dd59 100644
--- a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
+++ b/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
@@ -49,8 +49,11 @@
#define EXISTING_SHARE "existing"
#define EXISTING_SIZE 1024
-Q_DECLARE_METATYPE(QSharedMemory::SharedMemoryError);
-Q_DECLARE_METATYPE(QSharedMemory::AccessMode);
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "c:/data/qsharedmemorytemp/"
+#endif
+Q_DECLARE_METATYPE(QSharedMemory::SharedMemoryError)
+Q_DECLARE_METATYPE(QSharedMemory::AccessMode)
class tst_QSharedMemory : public QObject
{
@@ -405,6 +408,9 @@ void tst_QSharedMemory::readOnly()
#ifdef Q_OS_WIN
QSKIP("This test opens a crash dialog on Windows", SkipSingle);
#endif
+#if defined (Q_OS_SYMBIAN)
+ QSKIP("Readonly shared memory is not supported in symbian", SkipAll);
+#endif
QString program = "./lackey/lackey";
QStringList arguments;
rememberKey("readonly_segfault");
@@ -527,7 +533,9 @@ void tst_QSharedMemory::simpleProducerConsumer()
char *get = (char*)consumer.data();
// On Windows CE you always have ReadWrite access. Thus
// ViewMapOfFile returns the same pointer
-#ifndef Q_OS_WINCE
+ // On Symbian, the address will always be same, as
+ // write protection of chunks is not currently supported by Symbian
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QVERIFY(put != get);
#endif
for (int i = 0; i < size; ++i) {
@@ -629,6 +637,11 @@ public:
QVERIFY(producer.lock());
memory[0] = 'E';
QVERIFY(producer.unlock());
+
+#if defined(Q_OS_SYMBIAN)
+ // Sleep a while to ensure that consumers start properly
+ QTest::qSleep(1000);
+#endif
}
private:
@@ -660,12 +673,18 @@ void tst_QSharedMemory::simpleThreadedProducerConsumer()
#endif
Producer p;
+#if defined(Q_OS_SYMBIAN)
+ p.setStackSize(0x14000);
+#endif
if (producerIsThread)
p.start();
QList<Consumer*> consumers;
for (int i = 0; i < threads; ++i) {
consumers.append(new Consumer());
+#if defined(Q_OS_SYMBIAN)
+ consumers.last()->setStackSize(0x14000);
+#endif
consumers.last()->start();
}
@@ -697,6 +716,9 @@ void tst_QSharedMemory::simpleProcessProducerConsumer_data()
*/
void tst_QSharedMemory::simpleProcessProducerConsumer()
{
+#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
+#endif
QFETCH(int, processes);
rememberKey("market");
@@ -710,6 +732,7 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
producer.setProcessChannelMode(QProcess::ForwardedChannels);
producer.start("./lackey/lackey", arguments);
producer.waitForStarted();
+ QVERIFY(producer.error() != QProcess::FailedToStart);
QList<QProcess*> consumers;
for (int i = 0; i < processes; ++i) {
@@ -730,7 +753,8 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
while (!consumers.isEmpty()) {
consumers.first()->waitForFinished(1000);
- if (consumers.first()->exitStatus() != QProcess::NormalExit ||
+ if (consumers.first()->state() == QProcess::Running ||
+ consumers.first()->exitStatus() != QProcess::NormalExit ||
consumers.first()->exitCode() != 0) {
consumerFailed = true;
}
diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp
index 50a53134a2..1e9629e37d 100644
--- a/tests/auto/qsharedpointer/externaltests.cpp
+++ b/tests/auto/qsharedpointer/externaltests.cpp
@@ -51,6 +51,10 @@
#include <QtCore/QDirIterator>
#include <QtCore/QDateTime>
+#ifdef Q_OS_SYMBIAN
+#define DEFAULT_MAKESPEC "X:/STLsupport/mkspecs/symbian-abld/"
+#endif
+
#ifndef DEFAULT_MAKESPEC
# error DEFAULT_MAKESPEC not defined
#endif
diff --git a/tests/auto/qsharedpointer/externaltests.pri b/tests/auto/qsharedpointer/externaltests.pri
index 717acac1f4..0ded149184 100644
--- a/tests/auto/qsharedpointer/externaltests.pri
+++ b/tests/auto/qsharedpointer/externaltests.pri
@@ -1,6 +1,7 @@
SOURCES += $$PWD/externaltests.cpp
cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /)
-DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
+!symbian:DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
embedded:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED
wince*:DEFINES += QTEST_CROSS_COMPILED
+symbian: DEFINES += QTEST_CROSS_COMPILED
diff --git a/tests/auto/qsharedpointer/qsharedpointer.pro b/tests/auto/qsharedpointer/qsharedpointer.pro
index e329803aed..4532260cb7 100644
--- a/tests/auto/qsharedpointer/qsharedpointer.pro
+++ b/tests/auto/qsharedpointer/qsharedpointer.pro
@@ -2,6 +2,6 @@ load(qttest_p4)
SOURCES += tst_qsharedpointer.cpp
QT = core
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
include(externaltests.pri)
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index a52bb3e604..3ae849d356 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -44,6 +44,10 @@
#include "externaltests.h"
#include <QtTest/QtTest>
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "."
+#endif
+
class tst_QSharedPointer: public QObject
{
Q_OBJECT
diff --git a/tests/auto/qsidebar/qsidebar.pro b/tests/auto/qsidebar/qsidebar.pro
index bfcaab7eea..b1fba732c8 100644
--- a/tests/auto/qsidebar/qsidebar.pro
+++ b/tests/auto/qsidebar/qsidebar.pro
@@ -5,4 +5,4 @@ include(../../src/qfiledialog.pri)
SOURCES += tst_qsidebar.cpp
TARGET = tst_qsidebar
-
+symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
diff --git a/tests/auto/qsignalspy/qsignalspy.pro b/tests/auto/qsignalspy/qsignalspy.pro
index 172bdadbb6..4bc4a7b751 100644
--- a/tests/auto/qsignalspy/qsignalspy.pro
+++ b/tests/auto/qsignalspy/qsignalspy.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qsignalspy.cpp
-
QT = core
-
-
diff --git a/tests/auto/qsize/qsize.pro b/tests/auto/qsize/qsize.pro
index dddfa56974..14786b8b35 100644
--- a/tests/auto/qsize/qsize.pro
+++ b/tests/auto/qsize/qsize.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qsize.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qsizef/qsizef.pro b/tests/auto/qsizef/qsizef.pro
index c1288f6c98..703d721545 100644
--- a/tests/auto/qsizef/qsizef.pro
+++ b/tests/auto/qsizef/qsizef.pro
@@ -1,4 +1,3 @@
load(qttest_p4)
SOURCES += tst_qsizef.cpp
-
-
+QT = core
diff --git a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
index 241e5dd388..bb88f422c1 100644
--- a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
+++ b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
@@ -57,6 +57,7 @@ public:
private slots:
void unexpectedDisconnection();
+ void mixingWithTimers();
};
tst_QSocketNotifier::tst_QSocketNotifier()
@@ -69,9 +70,10 @@ tst_QSocketNotifier::~tst_QSocketNotifier()
class UnexpectedDisconnectTester : public QObject
{
Q_OBJECT
+ int sequence;
+
public:
QNativeSocketEngine *readEnd1, *readEnd2;
- int sequence;
UnexpectedDisconnectTester(QNativeSocketEngine *s1, QNativeSocketEngine *s2)
: readEnd1(s1), readEnd2(s2), sequence(0)
@@ -84,18 +86,25 @@ public:
connect(notifier2, SIGNAL(activated(int)), SLOT(handleActivated()));
}
+ const int getSequence() {
+ return sequence;
+ }
+
+ void incSequence() {
+ ++sequence;
+ }
+
public slots:
void handleActivated()
{
char data1[1], data2[1];
- ++sequence;
- if (sequence == 1) {
+ incSequence();
+ if (getSequence() == 1) {
// read from both ends
(void) readEnd1->read(data1, sizeof(data1));
(void) readEnd2->read(data2, sizeof(data2));
emit finished();
- } else if (sequence == 2) {
- // we should never get here
+ } else if (getSequence() == 2) {
QCOMPARE(readEnd2->read(data2, sizeof(data2)), qint64(-2));
QVERIFY(readEnd2->isValid());
}
@@ -155,9 +164,12 @@ void tst_QSocketNotifier::unexpectedDisconnection()
writeEnd2->flush();
UnexpectedDisconnectTester tester(&readEnd1, &readEnd2);
- QEventLoop eventLoop;
- connect(&tester, SIGNAL(finished()), &eventLoop, SLOT(quit()));
- eventLoop.exec();
+
+ do {
+ // we have to wait until sequence value changes
+ // as any event can make us jump out processing
+ QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
+ } while(tester.getSequence() <= 0);
QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState);
QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState);
@@ -165,7 +177,7 @@ void tst_QSocketNotifier::unexpectedDisconnection()
qWarning("### Windows returns 1 activation, Unix returns 2.");
QCOMPARE(tester.sequence, 1);
#else
- QCOMPARE(tester.sequence, 2);
+ QCOMPARE(tester.getSequence(), 2);
#endif
readEnd1.close();
@@ -175,5 +187,67 @@ void tst_QSocketNotifier::unexpectedDisconnection()
server.close();
}
+class MixingWithTimersHelper : public QObject
+{
+ Q_OBJECT
+
+public:
+ MixingWithTimersHelper(QTimer *timer, QTcpServer *server);
+
+ bool timerActivated;
+ bool socketActivated;
+
+private slots:
+ void timerFired();
+ void socketFired();
+};
+
+MixingWithTimersHelper::MixingWithTimersHelper(QTimer *timer, QTcpServer *server)
+{
+ timerActivated = false;
+ socketActivated = false;
+
+ connect(timer, SIGNAL(timeout()), SLOT(timerFired()));
+ connect(server, SIGNAL(newConnection()), SLOT(socketFired()));
+}
+
+void MixingWithTimersHelper::timerFired()
+{
+ timerActivated = true;
+}
+
+void MixingWithTimersHelper::socketFired()
+{
+ socketActivated = true;
+}
+
+void tst_QSocketNotifier::mixingWithTimers()
+{
+ QTimer timer;
+ timer.setInterval(0);
+ timer.start();
+
+ QTcpServer server;
+ QVERIFY(server.listen(QHostAddress::LocalHost, 0));
+
+ MixingWithTimersHelper helper(&timer, &server);
+
+ QCoreApplication::processEvents();
+
+ QCOMPARE(helper.timerActivated, true);
+ QCOMPARE(helper.socketActivated, false);
+
+ helper.timerActivated = false;
+ helper.socketActivated = false;
+
+ QTcpSocket socket;
+ socket.connectToHost(server.serverAddress(), server.serverPort());
+
+ QCoreApplication::processEvents();
+
+ QCOMPARE(helper.timerActivated, true);
+ QCOMPARE(helper.socketActivated, true);
+}
+
QTEST_MAIN(tst_QSocketNotifier)
#include <tst_qsocketnotifier.moc>
diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
index 2949ee2826..87f23a7381 100644
--- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
@@ -9,5 +9,7 @@ MOC_DIR=tmp
QT = core network
+# Symbian toolchain does not support correct include semantics
+symbian:INCPATH+=..\..\..\include\QtNetwork\private
diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
index f501e785d0..2083b263df 100644
--- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -147,11 +147,11 @@ private slots:
tst_QSocks5SocketEngine::tst_QSocks5SocketEngine()
{
+ Q_SET_DEFAULT_IAP
}
tst_QSocks5SocketEngine::~tst_QSocks5SocketEngine()
{
-
}
void tst_QSocks5SocketEngine::init()
@@ -302,7 +302,7 @@ void tst_QSocks5SocketEngine::errorTest()
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)),
&QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(5);
+ QTestEventLoop::instance().enterLoop(10);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(int(socket.error()), expectedError);
@@ -319,11 +319,11 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -336,8 +336,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
// Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
// Write a logout message
QByteArray array2 = "XXXX LOGOUT\r\n";
@@ -529,6 +528,10 @@ void tst_QSocks5SocketEngine::serverTest()
//---------------------------------------------------------------------------
void tst_QSocks5SocketEngine::udpTest()
{
+#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
+ QSKIP("UDP works bads on non WinPCAP emulator setting", SkipAll);
+#endif
+
QSocks5SocketEngine udpSocket;
// Initialize device #1
@@ -593,7 +596,7 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest()
// Read greeting
QVERIFY(socket.waitForReadyRead(5000));
QString s = socket.readLine();
- QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData());
// Write NOOP
QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8);
@@ -666,9 +669,10 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
}
// Read greeting
- QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
- QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
+ QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
+ QtNetworkSettings::expectedReplyIMAP().constData());
+
tcpSocketNonBlocking_data.clear();
tcpSocketNonBlocking_totalWritten = 0;
@@ -690,7 +694,6 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
-
// Read response
QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), "1 OK Completed\r\n");
@@ -787,7 +790,7 @@ void tst_QSocks5SocketEngine::downloadBigFile()
QTime stopWatch;
stopWatch.start();
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QTestEventLoop::instance().enterLoop(60);
#else
QTestEventLoop::instance().enterLoop(180);
@@ -831,14 +834,15 @@ void tst_QSocks5SocketEngine::passwordAuth()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password"));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ // Connect to imap.trolltech.com's IP
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) {
+ if (!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143)) {
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
}
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -850,10 +854,9 @@ void tst_QSocks5SocketEngine::passwordAuth()
array.resize(available);
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
- // Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
+ // Check that the greeting is what we expect it to be
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+
// Write a logout message
QByteArray array2 = "XXXX LOGOUT\r\n";
QVERIFY(socketDevice.write(array2.data(),
@@ -898,16 +901,16 @@ void tst_QSocks5SocketEngine::passwordAuth2()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081));
socketDevice.setReceiver(this);
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
while (socketDevice.state() == QAbstractSocket::ConnectingState) {
QVERIFY(socketDevice.waitForWrite());
- socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
+ socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
}
if (socketDevice.state() != QAbstractSocket::ConnectedState)
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QVERIFY(socketDevice.peerAddress() == QHostAddress(QtNetworkSettings::serverIP()));
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -919,10 +922,9 @@ void tst_QSocks5SocketEngine::passwordAuth2()
array.resize(available);
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
- // Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(),
- "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
+ // Check that the greeting is what we expect it to be
+ QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+
// Write a logout message
QByteArray array2 = "XXXX LOGOUT\r\n";
QVERIFY(socketDevice.write(array2.data(),
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index 20c60980de..75da2e64bb 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsound.cpp
-wince*: {
+wince*|symbian*: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
} \ No newline at end of file
diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro
index 99f27b4592..86d02b5857 100644
--- a/tests/auto/qsplitter/qsplitter.pro
+++ b/tests/auto/qsplitter/qsplitter.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsplitter.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*: {
+wince*|symbian*: {
addFiles.sources = extradata.txt setSizes3.dat
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro
index 2c0e337eed..6660f42f1d 100644
--- a/tests/auto/qsql/qsql.pro
+++ b/tests/auto/qsql/qsql.pro
@@ -8,3 +8,11 @@ contains(QT_CONFIG, qt3support): QT += qt3support
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
}
+
+symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}
diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro
index 534a2d3c4e..d4d049a3a1 100644
--- a/tests/auto/qsqldatabase/qsqldatabase.pro
+++ b/tests/auto/qsqldatabase/qsqldatabase.pro
@@ -16,5 +16,14 @@ wince*: {
DEPLOYMENT += testData
}
-
+symbian {
+ TARGET.EPOCHEAPSIZE=5000 5000000
+ TARGET.EPOCSTACKSIZE=50000
+
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 4fa3dc4cc7..66cf81f7a1 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1058,6 +1058,7 @@ void tst_QSqlDatabase::recordMySQL()
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
+#ifdef QT3_SUPPORT
if ( major >5 || ( major == 5 && minor > 0) || ( major == 5 && minor == 0 && revision >= 15) ) {
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc ")));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv ")));
diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro
index 570c88e145..855e72028a 100644
--- a/tests/auto/qsqlerror/qsqlerror.pro
+++ b/tests/auto/qsqlerror/qsqlerror.pro
@@ -7,4 +7,10 @@ QT = core sql
SOURCES += tst_qsqlerror.cpp
-
+symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}
diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro
index 04875fdd71..022d73f211 100644
--- a/tests/auto/qsqlfield/qsqlfield.pro
+++ b/tests/auto/qsqlfield/qsqlfield.pro
@@ -3,5 +3,11 @@ SOURCES += tst_qsqlfield.cpp
QT += sql
-
+symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}
diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro
index d70ede36b3..031377555c 100644
--- a/tests/auto/qsqlquery/qsqlquery.pro
+++ b/tests/auto/qsqlquery/qsqlquery.pro
@@ -12,3 +12,11 @@ wince*: {
plugFiles.path = .
DEPLOYMENT += plugFiles
}
+
+symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}
diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
index 669db6e2ba..7aa78a1d98 100644
--- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
+++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
@@ -5,7 +5,13 @@ QT += sql
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
-} else {
+}else:symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}else {
win32:LIBS += -lws2_32
}
diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro
index 819ae59f79..db92c09399 100644
--- a/tests/auto/qsqlrecord/qsqlrecord.pro
+++ b/tests/auto/qsqlrecord/qsqlrecord.pro
@@ -1,6 +1,16 @@
load(qttest_p4)
SOURCES += tst_qsqlrecord.cpp
+symbian {
+contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+}
+
+TARGET.EPOCSTACKSIZE=50000
+TARGET.EPOCHEAPSIZE=50000 5000000
+}
QT += sql
diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
index a35a56ca33..6d7795b74b 100644
--- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
+++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
@@ -7,7 +7,13 @@ wince*: {
plugFiles.sources = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
-} else {
+}else:symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}else {
win32-g++ {
LIBS += -lws2_32
} else:win32 {
diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro
index cf5fbea3cb..f7043ccc26 100644
--- a/tests/auto/qsqltablemodel/qsqltablemodel.pro
+++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro
@@ -7,7 +7,13 @@ wince*: {
plugFiles.sources = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
-} else {
+}else:symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}else {
win32:LIBS += -lws2_32
}
diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro
index 23aa5988f8..05c84e2680 100644
--- a/tests/auto/qsqlthread/qsqlthread.pro
+++ b/tests/auto/qsqlthread/qsqlthread.pro
@@ -8,7 +8,13 @@ wince*: {
plugFiles.sources = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
-} else {
+}else:symbian {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+}else {
win32:LIBS += -lws2_32
}
diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro
index f3f7adbc3e..b237f2e5e9 100644
--- a/tests/auto/qsslcertificate/qsslcertificate.pro
+++ b/tests/auto/qsslcertificate/qsslcertificate.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qsslcertificate.cpp
!wince*:win32:LIBS += -lws2_32
-QT += network
+QT = core network
TARGET = tst_qsslcertificate
@@ -14,13 +14,14 @@ win32 {
}
}
-wince*: {
+wince*|symbian: {
certFiles.sources = certificates more-certificates
certFiles.path = .
DEPLOYMENT += certFiles
+}
+
+wince*: {
DEFINES += SRCDIR=\\\".\\\"
-} else {
+} else:!symbian {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
-
-
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
index 6f50fc456d..6993033f7c 100644
--- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
@@ -45,6 +45,12 @@
#include <qsslkey.h>
#include <qsslsocket.h>
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Current path (C:\private\<UID>) contains only ascii chars
+#define SRCDIR QDir::currentPath().toAscii()
+#endif
+
class tst_QSslCertificate : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qsslcipher/qsslcipher.pro b/tests/auto/qsslcipher/qsslcipher.pro
index 8a99274592..6eae588155 100644
--- a/tests/auto/qsslcipher/qsslcipher.pro
+++ b/tests/auto/qsslcipher/qsslcipher.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qsslcipher.cpp
!wince*:win32:LIBS += -lws2_32
-QT += network
+QT = core network
TARGET = tst_qsslcipher
diff --git a/tests/auto/qsslerror/qsslerror.pro b/tests/auto/qsslerror/qsslerror.pro
index 1385d2e4fa..ee5872b98c 100644
--- a/tests/auto/qsslerror/qsslerror.pro
+++ b/tests/auto/qsslerror/qsslerror.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qsslerror.cpp
!wince*:win32:LIBS += -lws2_32
-QT += network
+QT = core network
TARGET = tst_qsslerror
diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro
index 5cab3d584c..32138f84f9 100644
--- a/tests/auto/qsslkey/qsslkey.pro
+++ b/tests/auto/qsslkey/qsslkey.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qsslkey.cpp
!wince*:win32:LIBS += -lws2_32
-QT += network
+QT = core network
TARGET = tst_qsslkey
@@ -14,11 +14,14 @@ win32 {
}
}
-wince*: {
+wince*|symbian: {
keyFiles.sources = keys
keyFiles.path = .
DEPLOYMENT += keyFiles
+}
+
+wince*: {
DEFINES += SRCDIR=\\\".\\\"
-} else {
+} else:!symbian {
DEFINES+= SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qsslkey/tst_qsslkey.cpp b/tests/auto/qsslkey/tst_qsslkey.cpp
index 06f90134cc..93bf7fde3d 100644
--- a/tests/auto/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/qsslkey/tst_qsslkey.cpp
@@ -47,6 +47,12 @@
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qnetworkproxy.h>
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Current path (C:\private\<UID>) contains only ascii chars
+#define SRCDIR QDir::currentPath().toAscii()
+#endif
+
class tst_QSslKey : public QObject
{
Q_OBJECT
@@ -101,7 +107,7 @@ tst_QSslKey::tst_QSslKey()
#ifdef Q_WS_MAC
// applicationDirPath() points to a path inside the app bundle on Mac.
QDir dir(qApp->applicationDirPath() + QLatin1String("/../../../keys"));
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN) || defined (Q_OS_SYMBIAN)
QDir dir(SRCDIR + QLatin1String("/keys")); // prefer this way to avoid ifdeffery and support shadow builds?
#else
QDir dir(qApp->applicationDirPath() + QLatin1String("/keys"));
diff --git a/tests/auto/qsslsocket/certs/aspiriniks.ca.crt b/tests/auto/qsslsocket/certs/aspiriniks.ca.crt
new file mode 100644
index 0000000000..36436b6248
--- /dev/null
+++ b/tests/auto/qsslsocket/certs/aspiriniks.ca.crt
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDnDCCAoQCCQDV3otC4hs2KTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMC
+Tk8xDTALBgNVBAgTBE9zbG8xDTALBgNVBAcTBE9zbG8xDzANBgNVBAoTBlRUIEFT
+QTEOMAwGA1UECxMFUVQgU1cxHDAaBgNVBAMTE2FzcGlyaW5pa3MudHJvbGwubm8x
+IzAhBgkqhkiG9w0BCQEWFGFiYWJpY0B0cm9sbHRlY2guY29tMB4XDTA4MTEwMTA4
+NTcyOFoXDTA5MTEwMTA4NTcyOFowgY8xCzAJBgNVBAYTAk5PMQ0wCwYDVQQIEwRP
+c2xvMQ0wCwYDVQQHEwRPc2xvMQ8wDQYDVQQKEwZUVCBBU0ExDjAMBgNVBAsTBVFU
+IFNXMRwwGgYDVQQDExNhc3BpcmluaWtzLnRyb2xsLm5vMSMwIQYJKoZIhvcNAQkB
+FhRhYmFiaWNAdHJvbGx0ZWNoLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBAMV2bMD1DN3DMgbxU3DXw2i7EWGDXcWjTDtdHvqgIb+9nHqo3MJSrzJy
+qgEPoOsXqswMla9wDPZAsWv5gVAmVSqpy2lfEgfY7LaSHiGD75seF7zIy+CxREHW
+DofHXpJGGJpBCZEKQt2HfHu3+yAYNPucN78tWNZAcPbUg5tfxMZeepRimAZNIxBI
+93SDrl/f9Ka7hvPSzUQsnp8hfdpHlFPFznKfD6yPrjxgz2mT9efavJ4DhtyIa4m+
+paiX515CidDz4A8CFxKZbYvuqq1ilibF/si2so9VhALC77ZcAJP1IMuT8T+WUCxq
+skJqiSCncl0Hgr+ba8MDGF9UQYowgjMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
+KcJuNUHvjB8ok3cnTmQEeF0LPPkgj28Tqb5TFB8xpVfRI+wvTYsHsmGdOKCgYJ3a
+7VflIsr63ojG8/rXK8H/cx2o2f2Hr3liJdi1UnoLDDRjBqGGz7JNuMreYokPvIbm
+eP01mVyK4PO2iYRwHUIAw5eeB1vMWKX2z95MupD+HRLtmGyaLALg8aQxj5N84Ewl
+eU2PQfhv8A1wj7aL17kfEUxDerQ1kUzlThJMV1J8Dl0l4C9N8evQkelROJU00i46
+oJikA8BW6EpgbnGyNyyj5Loy4wLPKew9nTS8MCJ5xPMQc0urbY/VzuOeUK7WQof7
+xOFSsRAVyQv+yqgmcZMCtg==
+-----END CERTIFICATE-----
diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro
index c29fc68ed2..f2888663dd 100644
--- a/tests/auto/qsslsocket/qsslsocket.pro
+++ b/tests/auto/qsslsocket/qsslsocket.pro
@@ -21,7 +21,13 @@ win32 {
}
}
-wince*: {
+
+symbian:{
+ DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
+ TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+ TARGET.CAPABILITY="ALL -TCB"
+}
+wince*|symbian: {
certFiles.sources = certs ssl.tar.gz
certFiles.path = .
DEPLOYMENT += certFiles
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 0aa93fe95b..59857e5956 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -190,7 +190,9 @@ protected slots:
}
void untrustedWorkaroundSlot(const QList<QSslError> &errors)
{
- if (errors.size() == 1 && errors.first().error() == QSslError::CertificateUntrusted)
+ if (errors.size() == 1 &&
+ (errors.first().error() == QSslError::CertificateUntrusted ||
+ errors.first().error() == QSslError::SelfSignedCertificate))
socket->ignoreSslErrors();
}
@@ -212,11 +214,11 @@ tst_QSslSocket::tst_QSslSocket()
qRegisterMetaType<QAbstractSocket::SocketError>("QAbstractSocket::SocketError");
qRegisterMetaType<QAbstractSocket::SocketState>("QSslSocket::SslMode");
#endif
+ Q_SET_DEFAULT_IAP
}
tst_QSslSocket::~tst_QSslSocket()
-{
-
+{
}
enum ProxyTests {
@@ -236,13 +238,13 @@ void tst_QSslSocket::initTestCase_data()
QTest::addColumn<bool>("setProxy");
QTest::addColumn<int>("proxyType");
- QTest::newRow("WithoutProxy") << false << 0;
+ //QTest::newRow("WithoutProxy") << false << 0;
#ifdef TEST_QNETWORK_PROXY
QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy);
- QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic);
+ //QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic);
- QTest::newRow("WithHttpProxy") << true << int(HttpProxy);
- QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic);
+ //QTest::newRow("WithHttpProxy") << true << int(HttpProxy);
+ //QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic);
// uncomment the line below when NTLM works
// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm);
#endif
@@ -420,8 +422,10 @@ void tst_QSslSocket::simpleConnect()
enterLoop(10);
// Entered connecting state
+#ifndef Q_OS_SYMBIAN
QCOMPARE(socket.state(), QAbstractSocket::ConnectingState);
QCOMPARE(connectedSpy.count(), 0);
+#endif
QCOMPARE(hostFoundSpy.count(), 1);
QCOMPARE(disconnectedSpy.count(), 0);
enterLoop(10);
@@ -489,8 +493,7 @@ void tst_QSslSocket::simpleConnectWithIgnore()
if (!socket.canReadLine())
enterLoop(10);
- QCOMPARE(socket.readAll(), QByteArray("* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"));
-
+ QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL());
socket.disconnectFromHost();
}
@@ -498,18 +501,21 @@ void tst_QSslSocket::sslErrors_data()
{
QTest::addColumn<QString>("host");
QTest::addColumn<int>("port");
- QTest::addColumn<SslErrorList>("expected");
-
- QTest::newRow(qPrintable(QtNetworkSettings::serverLocalName()))
- << QtNetworkSettings::serverLocalName()
- << 993
- << (SslErrorList() << QSslError::HostNameMismatch
- << QSslError::SelfSignedCertificate);
-
- QTest::newRow("imap.trolltech.com")
- << "imap.trolltech.com"
- << 993
- << (SslErrorList() << QSslError::SelfSignedCertificateInChain);
+ QTest::addColumn<SslErrorList>("errors");
+
+ QTest::newRow(QtNetworkSettings::serverName().toAscii() + " port443") << QtNetworkSettings::serverName() << 443
+ << (SslErrorList()
+ << QSslError::UnableToGetLocalIssuerCertificate
+ << QSslError::CertificateUntrusted
+ << QSslError::UnableToVerifyFirstCertificate
+ );
+ QTest::newRow(QtNetworkSettings::serverName().toAscii() + " port993") << QtNetworkSettings::serverName() << 993
+ << (SslErrorList()
+ << QSslError::HostNameMismatch
+ << QSslError::SelfSignedCertificate
+ );
+ // TODO: Should we have QtNetworkSettings::serverName alias
+ // in order that we could test with different host name
}
void tst_QSslSocket::sslErrors()
@@ -522,15 +528,17 @@ void tst_QSslSocket::sslErrors()
socket->connectToHostEncrypted(host, port);
socket->waitForEncrypted(5000);
- SslErrorList output;
- foreach (QSslError error, socket->sslErrors())
- output << error.error();
+ SslErrorList list;
+ foreach (QSslError error, socket->sslErrors()) {
+ //printf("error = %s\n", error.errorString().toAscii().data());
+ list << error.error();
+ }
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
if (output.last() == QSslError::CertificateUntrusted)
output.takeLast();
#endif
- QCOMPARE(output, expected);
+ QCOMPARE(list, errors);
}
void tst_QSslSocket::addCaCertificate()
@@ -576,16 +584,16 @@ void tst_QSslSocket::connectToHostEncrypted()
QSslSocketPtr socket = newSocket();
this->socket = socket;
-
- QVERIFY(socket->addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")));
+ QVERIFY(socket->addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")));
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
- connect(&socket, SIGNAL(sslErrors(QList<QSslError>)),
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
// This should pass unconditionally when using fluke's CA certificate.
+ // or use untrusted certificate workaround
QVERIFY2(socket->waitForEncrypted(10000), qPrintable(socket->errorString()));
socket->disconnectFromHost();
@@ -650,10 +658,9 @@ void tst_QSslSocket::peerCertificateChain()
QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
QVERIFY(caCertificates.count() == 1);
-
socket->addCaCertificates(caCertificates);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
- connect(&socket, SIGNAL(sslErrors(QList<QSslError>)),
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
@@ -714,7 +721,7 @@ void tst_QSslSocket::protocol()
// qDebug() << "certs:" << certs.at(0).issuerInfo(QSslCertificate::CommonName);
socket->setCaCertificates(certs);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
- connect(&socket, SIGNAL(sslErrors(QList<QSslError>)),
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
@@ -907,11 +914,24 @@ void tst_QSslSocket::waitForConnectedEncryptedReadyRead()
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
+#ifdef Q_OS_SYMBIAN
QVERIFY(socket->waitForConnected(10000));
QVERIFY(socket->waitForEncrypted(10000));
+
+ // dont forget to login
+ QCOMPARE((int) socket->write("USER ftptest\r\n"), 14);
+ QCOMPARE((int) socket->write("PASS ftP2Ptf\r\n"), 14);
+
QVERIFY(socket->waitForReadyRead(10000));
QVERIFY(!socket->peerCertificate().isNull());
QVERIFY(!socket->peerCertificateChain().isEmpty());
+#else
+ QVERIFY(socket->waitForConnected(10000));
+ QVERIFY(socket->waitForEncrypted(10000));
+ QVERIFY(socket->waitForReadyRead(10000));
+ QVERIFY(!socket->peerCertificate().isNull());
+ QVERIFY(!socket->peerCertificateChain().isEmpty());
+#endif
}
void tst_QSslSocket::startClientEncryption()
@@ -1014,7 +1034,7 @@ void tst_QSslSocket::wildcard()
// responds with the wildcard, and QSslSocket should accept that as a
// valid connection. This was broken in 4.3.0.
QSslSocketPtr socket = newSocket();
- socket->addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
+ socket->addCaCertificates(QLatin1String("certs/aspiriniks.ca.crt"));
this->socket = socket;
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
@@ -1257,7 +1277,11 @@ protected:
// delayed acceptance:
QTest::qSleep(100);
- server.waitForNewConnection(2000);
+#ifndef Q_OS_SYMBIAN
+ bool ret = server.waitForNewConnection(2000);
+#else
+ bool ret = server.waitForNewConnection(20000);
+#endif
// delayed start of encryption
QTest::qSleep(100);
@@ -1457,6 +1481,10 @@ void tst_QSslSocket::disconnectFromHostWhenConnecting()
// we did not call close, so the socket must be still open
QVERIFY(socket->isOpen());
QCOMPARE(socket->bytesToWrite(), qint64(0));
+
+ // dont forget to login
+ QCOMPARE((int) socket->write("USER ftptest\r\n"), 14);
+
}
void tst_QSslSocket::disconnectFromHostWhenConnected()
@@ -1464,12 +1492,27 @@ void tst_QSslSocket::disconnectFromHostWhenConnected()
QSslSocketPtr socket = newSocket();
socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
socket->ignoreSslErrors();
+#ifndef Q_OS_SYMBIAN
QVERIFY(socket->waitForEncrypted(5000));
+#else
+ QVERIFY(socket->waitForEncrypted(10000));
+#endif
socket->write("XXXX LOGOUT\r\n");
QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
socket->disconnectFromHost();
QCOMPARE(socket->state(), QAbstractSocket::ClosingState);
- QVERIFY(socket->waitForDisconnected(5000));
+#ifdef Q_OS_SYMBIAN
+ // I don't understand how socket->waitForDisconnected can work on other platforms
+ // since socket->write will end to:
+ // QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection);
+ // In order that _q_flushWriteBuffer will be called the eventloop need to run
+ // If we just call waitForDisconnected, which blocks the whole thread how that can happen?
+ connect(socket, SIGNAL(disconnected()), this, SLOT(exitLoop()));
+ enterLoop(5);
+ QVERIFY(!timeout());
+#else
+ QVERIFY(socket->waitForDisconnected(5000));
+#endif
QCOMPARE(socket->bytesToWrite(), qint64(0));
}
@@ -1496,6 +1539,12 @@ void tst_QSslSocket::resetProxy()
socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
QVERIFY(! socket.waitForConnected(10000));
+ // dont forget to login
+ QCOMPARE((int) socket.write("USER ftptest\r\n"), 14);
+ QCOMPARE((int) socket.write("PASS password\r\n"), 15);
+
+ enterLoop(10);
+
// now the other way round:
// set the nonsense proxy and make sure the connection does not work,
// and then set the right proxy and make sure it works
diff --git a/tests/auto/qstandarditem/tst_qstandarditem.cpp b/tests/auto/qstandarditem/tst_qstandarditem.cpp
index ab90d000ca..933ee9e886 100644
--- a/tests/auto/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/qstandarditem/tst_qstandarditem.cpp
@@ -291,12 +291,14 @@ void tst_QStandardItem::getSetFlags()
item.setTristate(true);
QVERIFY(item.isTristate());
QVERIFY(item.flags() & Qt::ItemIsTristate);
+#ifndef QT_NO_DRAGANDDROP
item.setDragEnabled(true);
QVERIFY(item.isDragEnabled());
QVERIFY(item.flags() & Qt::ItemIsDragEnabled);
item.setDropEnabled(true);
QVERIFY(item.isDropEnabled());
QVERIFY(item.flags() & Qt::ItemIsDropEnabled);
+#endif
QVERIFY(item.isEnabled());
item.setEnabled(false);
@@ -318,6 +320,7 @@ void tst_QStandardItem::getSetFlags()
item.setTristate(false);
QVERIFY(!item.isTristate());
QVERIFY(!(item.flags() & Qt::ItemIsTristate));
+#ifndef QT_NO_DRAGANDDROP
QVERIFY(item.isDragEnabled());
item.setDragEnabled(false);
QVERIFY(!item.isDragEnabled());
@@ -326,6 +329,7 @@ void tst_QStandardItem::getSetFlags()
item.setDropEnabled(false);
QVERIFY(!item.isDropEnabled());
QVERIFY(!(item.flags() & Qt::ItemIsDropEnabled));
+#endif
item.setCheckable(false);
item.setCheckState(Qt::Checked);
diff --git a/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 84bda92ee3..a53032365d 100644
--- a/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -1387,7 +1387,9 @@ void tst_QStandardItemModel::rootItemFlags()
QCOMPARE(model.invisibleRootItem()->flags() , f);
QCOMPARE(model.invisibleRootItem()->flags() , model.flags(QModelIndex()));
+#ifndef QT_NO_DRAGANDDROP
model.invisibleRootItem()->setDropEnabled(false);
+#endif
QCOMPARE(model.invisibleRootItem()->flags() , Qt::ItemIsEnabled);
QCOMPARE(model.invisibleRootItem()->flags() , model.flags(QModelIndex()));
}
@@ -1523,7 +1525,9 @@ void tst_QStandardItemModel::treeDragAndDrop()
view.setModel(&model);
view.expandAll();
view.show();
+#ifndef QT_NO_DRAGANDDROP
view.setDragDropMode(QAbstractItemView::InternalMove);
+#endif
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
QItemSelectionModel *selection = view.selectionModel();
diff --git a/tests/auto/qstl/qstl.pro b/tests/auto/qstl/qstl.pro
index 07cc314eed..5c9987496c 100644
--- a/tests/auto/qstl/qstl.pro
+++ b/tests/auto/qstl/qstl.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qstl.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qstring/qstring.pro b/tests/auto/qstring/qstring.pro
index 02253c214b..ed758c634b 100644
--- a/tests/auto/qstring/qstring.pro
+++ b/tests/auto/qstring/qstring.pro
@@ -1,11 +1,8 @@
load(qttest_p4)
SOURCES += tst_qstring.cpp
-QT -= gui
+symbian:LIBS += -llibm
QT = core
DEFINES += QT_NO_CAST_TO_ASCII
-
-
-
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp
index 1263a417f1..e9c12c64cc 100644
--- a/tests/auto/qstring/tst_qstring.cpp
+++ b/tests/auto/qstring/tst_qstring.cpp
@@ -446,48 +446,48 @@ void tst_QString::replace_string_data()
QTest::addColumn<QString>("result" );
QTest::addColumn<bool>("bcs" );
- QTest::newRow( "rem00" ) << QString("") << QString("") << QString("") << QString("") << TRUE;
- QTest::newRow( "rem01" ) << QString("A") << QString("") << QString("") << QString("A") << TRUE;
- QTest::newRow( "rem02" ) << QString("A") << QString("A") << QString("") << QString("") << TRUE;
- QTest::newRow( "rem03" ) << QString("A") << QString("B") << QString("") << QString("A") << TRUE;
- QTest::newRow( "rem04" ) << QString("AA") << QString("A") << QString("") << QString("") << TRUE;
- QTest::newRow( "rem05" ) << QString("AB") << QString("A") << QString("") << QString("B") << TRUE;
- QTest::newRow( "rem06" ) << QString("AB") << QString("B") << QString("") << QString("A") << TRUE;
- QTest::newRow( "rem07" ) << QString("AB") << QString("C") << QString("") << QString("AB") << TRUE;
- QTest::newRow( "rem08" ) << QString("ABA") << QString("A") << QString("") << QString("B") << TRUE;
- QTest::newRow( "rem09" ) << QString("ABA") << QString("B") << QString("") << QString("AA") << TRUE;
- QTest::newRow( "rem10" ) << QString("ABA") << QString("C") << QString("") << QString("ABA") << TRUE;
- QTest::newRow( "rem11" ) << QString("banana") << QString("an") << QString("") << QString("ba") << TRUE;
- QTest::newRow( "rem12" ) << QString("") << QString("A") << QString("") << QString("") << TRUE;
- QTest::newRow( "rem13" ) << QString("") << QString("A") << QString() << QString("") << TRUE;
- QTest::newRow( "rem14" ) << QString() << QString("A") << QString("") << QString() << TRUE;
- QTest::newRow( "rem15" ) << QString() << QString("A") << QString() << QString() << TRUE;
- QTest::newRow( "rem16" ) << QString() << QString("") << QString("") << QString("") << TRUE;
- QTest::newRow( "rem17" ) << QString("") << QString() << QString("") << QString("") << TRUE;
- QTest::newRow( "rem18" ) << QString("a") << QString("a") << QString("") << QString("") << FALSE;
- QTest::newRow( "rem19" ) << QString("A") << QString("A") << QString("") << QString("") << FALSE;
- QTest::newRow( "rem20" ) << QString("a") << QString("A") << QString("") << QString("") << FALSE;
- QTest::newRow( "rem21" ) << QString("A") << QString("a") << QString("") << QString("") << FALSE;
- QTest::newRow( "rem22" ) << QString("Alpha beta") << QString("a") << QString("") << QString("lph bet") << FALSE;
-
- QTest::newRow( "rep00" ) << QString("ABC") << QString("B") << QString("-") << QString("A-C") << TRUE;
- QTest::newRow( "rep01" ) << QString("$()*+.?[\\]^{|}") << QString("$()*+.?[\\]^{|}") << QString("X") << QString("X") << TRUE;
- QTest::newRow( "rep02" ) << QString("ABCDEF") << QString("") << QString("X") << QString("XAXBXCXDXEXFX") << TRUE;
- QTest::newRow( "rep03" ) << QString("") << QString("") << QString("X") << QString("X") << TRUE;
- QTest::newRow( "rep04" ) << QString("a") << QString("a") << QString("b") << QString("b") << FALSE;
- QTest::newRow( "rep05" ) << QString("A") << QString("A") << QString("b") << QString("b") << FALSE;
- QTest::newRow( "rep06" ) << QString("a") << QString("A") << QString("b") << QString("b") << FALSE;
- QTest::newRow( "rep07" ) << QString("A") << QString("a") << QString("b") << QString("b") << FALSE;
- QTest::newRow( "rep08" ) << QString("a") << QString("a") << QString("a") << QString("a") << FALSE;
- QTest::newRow( "rep09" ) << QString("A") << QString("A") << QString("a") << QString("a") << FALSE;
- QTest::newRow( "rep10" ) << QString("a") << QString("A") << QString("a") << QString("a") << FALSE;
- QTest::newRow( "rep11" ) << QString("A") << QString("a") << QString("a") << QString("a") << FALSE;
- QTest::newRow( "rep12" ) << QString("Alpha beta") << QString("a") << QString("o") << QString("olpho beto") << FALSE;
- QTest::newRow( "rep13" ) << QString() << QString("") << QString("A") << QString("A") << TRUE;
- QTest::newRow( "rep14" ) << QString("") << QString() << QString("A") << QString("A") << TRUE;
- QTest::newRow( "rep15" ) << QString("fooxbarxbazxblub") << QString("x") << QString("yz") << QString("fooyzbaryzbazyzblub") << TRUE;
- QTest::newRow( "rep16" ) << QString("fooxbarxbazxblub") << QString("x") << QString("z") << QString("foozbarzbazzblub") << TRUE;
- QTest::newRow( "rep17" ) << QString("fooxybarxybazxyblub") << QString("xy") << QString("z") << QString("foozbarzbazzblub") << TRUE;
+ QTest::newRow( "rem00" ) << QString("") << QString("") << QString("") << QString("") << true;
+ QTest::newRow( "rem01" ) << QString("A") << QString("") << QString("") << QString("A") << true;
+ QTest::newRow( "rem02" ) << QString("A") << QString("A") << QString("") << QString("") << true;
+ QTest::newRow( "rem03" ) << QString("A") << QString("B") << QString("") << QString("A") << true;
+ QTest::newRow( "rem04" ) << QString("AA") << QString("A") << QString("") << QString("") << true;
+ QTest::newRow( "rem05" ) << QString("AB") << QString("A") << QString("") << QString("B") << true;
+ QTest::newRow( "rem06" ) << QString("AB") << QString("B") << QString("") << QString("A") << true;
+ QTest::newRow( "rem07" ) << QString("AB") << QString("C") << QString("") << QString("AB") << true;
+ QTest::newRow( "rem08" ) << QString("ABA") << QString("A") << QString("") << QString("B") << true;
+ QTest::newRow( "rem09" ) << QString("ABA") << QString("B") << QString("") << QString("AA") << true;
+ QTest::newRow( "rem10" ) << QString("ABA") << QString("C") << QString("") << QString("ABA") << true;
+ QTest::newRow( "rem11" ) << QString("banana") << QString("an") << QString("") << QString("ba") << true;
+ QTest::newRow( "rem12" ) << QString("") << QString("A") << QString("") << QString("") << true;
+ QTest::newRow( "rem13" ) << QString("") << QString("A") << QString() << QString("") << true;
+ QTest::newRow( "rem14" ) << QString() << QString("A") << QString("") << QString() << true;
+ QTest::newRow( "rem15" ) << QString() << QString("A") << QString() << QString() << true;
+ QTest::newRow( "rem16" ) << QString() << QString("") << QString("") << QString("") << true;
+ QTest::newRow( "rem17" ) << QString("") << QString() << QString("") << QString("") << true;
+ QTest::newRow( "rem18" ) << QString("a") << QString("a") << QString("") << QString("") << false;
+ QTest::newRow( "rem19" ) << QString("A") << QString("A") << QString("") << QString("") << false;
+ QTest::newRow( "rem20" ) << QString("a") << QString("A") << QString("") << QString("") << false;
+ QTest::newRow( "rem21" ) << QString("A") << QString("a") << QString("") << QString("") << false;
+ QTest::newRow( "rem22" ) << QString("Alpha beta") << QString("a") << QString("") << QString("lph bet") << false;
+
+ QTest::newRow( "rep00" ) << QString("ABC") << QString("B") << QString("-") << QString("A-C") << true;
+ QTest::newRow( "rep01" ) << QString("$()*+.?[\\]^{|}") << QString("$()*+.?[\\]^{|}") << QString("X") << QString("X") << true;
+ QTest::newRow( "rep02" ) << QString("ABCDEF") << QString("") << QString("X") << QString("XAXBXCXDXEXFX") << true;
+ QTest::newRow( "rep03" ) << QString("") << QString("") << QString("X") << QString("X") << true;
+ QTest::newRow( "rep04" ) << QString("a") << QString("a") << QString("b") << QString("b") << false;
+ QTest::newRow( "rep05" ) << QString("A") << QString("A") << QString("b") << QString("b") << false;
+ QTest::newRow( "rep06" ) << QString("a") << QString("A") << QString("b") << QString("b") << false;
+ QTest::newRow( "rep07" ) << QString("A") << QString("a") << QString("b") << QString("b") << false;
+ QTest::newRow( "rep08" ) << QString("a") << QString("a") << QString("a") << QString("a") << false;
+ QTest::newRow( "rep09" ) << QString("A") << QString("A") << QString("a") << QString("a") << false;
+ QTest::newRow( "rep10" ) << QString("a") << QString("A") << QString("a") << QString("a") << false;
+ QTest::newRow( "rep11" ) << QString("A") << QString("a") << QString("a") << QString("a") << false;
+ QTest::newRow( "rep12" ) << QString("Alpha beta") << QString("a") << QString("o") << QString("olpho beto") << false;
+ QTest::newRow( "rep13" ) << QString() << QString("") << QString("A") << QString("A") << true;
+ QTest::newRow( "rep14" ) << QString("") << QString() << QString("A") << QString("A") << true;
+ QTest::newRow( "rep15" ) << QString("fooxbarxbazxblub") << QString("x") << QString("yz") << QString("fooyzbaryzbazyzblub") << true;
+ QTest::newRow( "rep16" ) << QString("fooxbarxbazxblub") << QString("x") << QString("z") << QString("foozbarzbazzblub") << true;
+ QTest::newRow( "rep17" ) << QString("fooxybarxybazxyblub") << QString("xy") << QString("z") << QString("foozbarzbazzblub") << true;
}
void tst_QString::replace_regexp_data()
@@ -958,68 +958,68 @@ void tst_QString::indexOf_data()
QTest::addColumn<bool>("bcs" );
QTest::addColumn<int>("resultpos" );
- QTest::newRow( "data0" ) << QString("abc") << QString("a") << 0 << TRUE << 0;
- QTest::newRow( "data1" ) << QString("abc") << QString("a") << 0 << FALSE << 0;
- QTest::newRow( "data2" ) << QString("abc") << QString("A") << 0 << TRUE << -1;
- QTest::newRow( "data3" ) << QString("abc") << QString("A") << 0 << FALSE << 0;
- QTest::newRow( "data4" ) << QString("abc") << QString("a") << 1 << TRUE << -1;
- QTest::newRow( "data5" ) << QString("abc") << QString("a") << 1 << FALSE << -1;
- QTest::newRow( "data6" ) << QString("abc") << QString("A") << 1 << TRUE << -1;
- QTest::newRow( "data7" ) << QString("abc") << QString("A") << 1 << FALSE << -1;
- QTest::newRow( "data8" ) << QString("abc") << QString("b") << 0 << TRUE << 1;
- QTest::newRow( "data9" ) << QString("abc") << QString("b") << 0 << FALSE << 1;
- QTest::newRow( "data10" ) << QString("abc") << QString("B") << 0 << TRUE << -1;
- QTest::newRow( "data11" ) << QString("abc") << QString("B") << 0 << FALSE << 1;
- QTest::newRow( "data12" ) << QString("abc") << QString("b") << 1 << TRUE << 1;
- QTest::newRow( "data13" ) << QString("abc") << QString("b") << 1 << FALSE << 1;
- QTest::newRow( "data14" ) << QString("abc") << QString("B") << 1 << TRUE << -1;
- QTest::newRow( "data15" ) << QString("abc") << QString("B") << 1 << FALSE << 1;
- QTest::newRow( "data16" ) << QString("abc") << QString("b") << 2 << TRUE << -1;
- QTest::newRow( "data17" ) << QString("abc") << QString("b") << 2 << FALSE << -1;
-
- QTest::newRow( "data20" ) << QString("ABC") << QString("A") << 0 << TRUE << 0;
- QTest::newRow( "data21" ) << QString("ABC") << QString("A") << 0 << FALSE << 0;
- QTest::newRow( "data22" ) << QString("ABC") << QString("a") << 0 << TRUE << -1;
- QTest::newRow( "data23" ) << QString("ABC") << QString("a") << 0 << FALSE << 0;
- QTest::newRow( "data24" ) << QString("ABC") << QString("A") << 1 << TRUE << -1;
- QTest::newRow( "data25" ) << QString("ABC") << QString("A") << 1 << FALSE << -1;
- QTest::newRow( "data26" ) << QString("ABC") << QString("a") << 1 << TRUE << -1;
- QTest::newRow( "data27" ) << QString("ABC") << QString("a") << 1 << FALSE << -1;
- QTest::newRow( "data28" ) << QString("ABC") << QString("B") << 0 << TRUE << 1;
- QTest::newRow( "data29" ) << QString("ABC") << QString("B") << 0 << FALSE << 1;
- QTest::newRow( "data30" ) << QString("ABC") << QString("b") << 0 << TRUE << -1;
- QTest::newRow( "data31" ) << QString("ABC") << QString("b") << 0 << FALSE << 1;
- QTest::newRow( "data32" ) << QString("ABC") << QString("B") << 1 << TRUE << 1;
- QTest::newRow( "data33" ) << QString("ABC") << QString("B") << 1 << FALSE << 1;
- QTest::newRow( "data34" ) << QString("ABC") << QString("b") << 1 << TRUE << -1;
- QTest::newRow( "data35" ) << QString("ABC") << QString("b") << 1 << FALSE << 1;
- QTest::newRow( "data36" ) << QString("ABC") << QString("B") << 2 << TRUE << -1;
- QTest::newRow( "data37" ) << QString("ABC") << QString("B") << 2 << FALSE << -1;
-
- QTest::newRow( "data40" ) << QString("aBc") << QString("bc") << 0 << TRUE << -1;
- QTest::newRow( "data41" ) << QString("aBc") << QString("Bc") << 0 << TRUE << 1;
- QTest::newRow( "data42" ) << QString("aBc") << QString("bC") << 0 << TRUE << -1;
- QTest::newRow( "data43" ) << QString("aBc") << QString("BC") << 0 << TRUE << -1;
- QTest::newRow( "data44" ) << QString("aBc") << QString("bc") << 0 << FALSE << 1;
- QTest::newRow( "data45" ) << QString("aBc") << QString("Bc") << 0 << FALSE << 1;
- QTest::newRow( "data46" ) << QString("aBc") << QString("bC") << 0 << FALSE << 1;
- QTest::newRow( "data47" ) << QString("aBc") << QString("BC") << 0 << FALSE << 1;
- QTest::newRow( "data48" ) << QString("AbC") << QString("bc") << 0 << TRUE << -1;
- QTest::newRow( "data49" ) << QString("AbC") << QString("Bc") << 0 << TRUE << -1;
- QTest::newRow( "data50" ) << QString("AbC") << QString("bC") << 0 << TRUE << 1;
- QTest::newRow( "data51" ) << QString("AbC") << QString("BC") << 0 << TRUE << -1;
- QTest::newRow( "data52" ) << QString("AbC") << QString("bc") << 0 << FALSE << 1;
- QTest::newRow( "data53" ) << QString("AbC") << QString("Bc") << 0 << FALSE << 1;
-
- QTest::newRow( "data54" ) << QString("AbC") << QString("bC") << 0 << FALSE << 1;
- QTest::newRow( "data55" ) << QString("AbC") << QString("BC") << 0 << FALSE << 1;
- QTest::newRow( "data56" ) << QString("AbC") << QString("BC") << 1 << FALSE << 1;
- QTest::newRow( "data57" ) << QString("AbC") << QString("BC") << 2 << FALSE << -1;
+ QTest::newRow( "data0" ) << QString("abc") << QString("a") << 0 << true << 0;
+ QTest::newRow( "data1" ) << QString("abc") << QString("a") << 0 << false << 0;
+ QTest::newRow( "data2" ) << QString("abc") << QString("A") << 0 << true << -1;
+ QTest::newRow( "data3" ) << QString("abc") << QString("A") << 0 << false << 0;
+ QTest::newRow( "data4" ) << QString("abc") << QString("a") << 1 << true << -1;
+ QTest::newRow( "data5" ) << QString("abc") << QString("a") << 1 << false << -1;
+ QTest::newRow( "data6" ) << QString("abc") << QString("A") << 1 << true << -1;
+ QTest::newRow( "data7" ) << QString("abc") << QString("A") << 1 << false << -1;
+ QTest::newRow( "data8" ) << QString("abc") << QString("b") << 0 << true << 1;
+ QTest::newRow( "data9" ) << QString("abc") << QString("b") << 0 << false << 1;
+ QTest::newRow( "data10" ) << QString("abc") << QString("B") << 0 << true << -1;
+ QTest::newRow( "data11" ) << QString("abc") << QString("B") << 0 << false << 1;
+ QTest::newRow( "data12" ) << QString("abc") << QString("b") << 1 << true << 1;
+ QTest::newRow( "data13" ) << QString("abc") << QString("b") << 1 << false << 1;
+ QTest::newRow( "data14" ) << QString("abc") << QString("B") << 1 << true << -1;
+ QTest::newRow( "data15" ) << QString("abc") << QString("B") << 1 << false << 1;
+ QTest::newRow( "data16" ) << QString("abc") << QString("b") << 2 << true << -1;
+ QTest::newRow( "data17" ) << QString("abc") << QString("b") << 2 << false << -1;
+
+ QTest::newRow( "data20" ) << QString("ABC") << QString("A") << 0 << true << 0;
+ QTest::newRow( "data21" ) << QString("ABC") << QString("A") << 0 << false << 0;
+ QTest::newRow( "data22" ) << QString("ABC") << QString("a") << 0 << true << -1;
+ QTest::newRow( "data23" ) << QString("ABC") << QString("a") << 0 << false << 0;
+ QTest::newRow( "data24" ) << QString("ABC") << QString("A") << 1 << true << -1;
+ QTest::newRow( "data25" ) << QString("ABC") << QString("A") << 1 << false << -1;
+ QTest::newRow( "data26" ) << QString("ABC") << QString("a") << 1 << true << -1;
+ QTest::newRow( "data27" ) << QString("ABC") << QString("a") << 1 << false << -1;
+ QTest::newRow( "data28" ) << QString("ABC") << QString("B") << 0 << true << 1;
+ QTest::newRow( "data29" ) << QString("ABC") << QString("B") << 0 << false << 1;
+ QTest::newRow( "data30" ) << QString("ABC") << QString("b") << 0 << true << -1;
+ QTest::newRow( "data31" ) << QString("ABC") << QString("b") << 0 << false << 1;
+ QTest::newRow( "data32" ) << QString("ABC") << QString("B") << 1 << true << 1;
+ QTest::newRow( "data33" ) << QString("ABC") << QString("B") << 1 << false << 1;
+ QTest::newRow( "data34" ) << QString("ABC") << QString("b") << 1 << true << -1;
+ QTest::newRow( "data35" ) << QString("ABC") << QString("b") << 1 << false << 1;
+ QTest::newRow( "data36" ) << QString("ABC") << QString("B") << 2 << true << -1;
+ QTest::newRow( "data37" ) << QString("ABC") << QString("B") << 2 << false << -1;
+
+ QTest::newRow( "data40" ) << QString("aBc") << QString("bc") << 0 << true << -1;
+ QTest::newRow( "data41" ) << QString("aBc") << QString("Bc") << 0 << true << 1;
+ QTest::newRow( "data42" ) << QString("aBc") << QString("bC") << 0 << true << -1;
+ QTest::newRow( "data43" ) << QString("aBc") << QString("BC") << 0 << true << -1;
+ QTest::newRow( "data44" ) << QString("aBc") << QString("bc") << 0 << false << 1;
+ QTest::newRow( "data45" ) << QString("aBc") << QString("Bc") << 0 << false << 1;
+ QTest::newRow( "data46" ) << QString("aBc") << QString("bC") << 0 << false << 1;
+ QTest::newRow( "data47" ) << QString("aBc") << QString("BC") << 0 << false << 1;
+ QTest::newRow( "data48" ) << QString("AbC") << QString("bc") << 0 << true << -1;
+ QTest::newRow( "data49" ) << QString("AbC") << QString("Bc") << 0 << true << -1;
+ QTest::newRow( "data50" ) << QString("AbC") << QString("bC") << 0 << true << 1;
+ QTest::newRow( "data51" ) << QString("AbC") << QString("BC") << 0 << true << -1;
+ QTest::newRow( "data52" ) << QString("AbC") << QString("bc") << 0 << false << 1;
+ QTest::newRow( "data53" ) << QString("AbC") << QString("Bc") << 0 << false << 1;
+
+ QTest::newRow( "data54" ) << QString("AbC") << QString("bC") << 0 << false << 1;
+ QTest::newRow( "data55" ) << QString("AbC") << QString("BC") << 0 << false << 1;
+ QTest::newRow( "data56" ) << QString("AbC") << QString("BC") << 1 << false << 1;
+ QTest::newRow( "data57" ) << QString("AbC") << QString("BC") << 2 << false << -1;
#if 0
- QTest::newRow( "null-in-null") << QString() << QString() << 0 << FALSE << 0;
- QTest::newRow( "empty-in-null") << QString() << QString("") << 0 << FALSE << 0;
- QTest::newRow( "null-in-empty") << QString("") << QString() << 0 << FALSE << 0;
- QTest::newRow( "empty-in-empty") << QString("") << QString("") << 0 << FALSE << 0;
+ QTest::newRow( "null-in-null") << QString() << QString() << 0 << false << 0;
+ QTest::newRow( "empty-in-null") << QString() << QString("") << 0 << false << 0;
+ QTest::newRow( "null-in-empty") << QString("") << QString() << 0 << false << 0;
+ QTest::newRow( "empty-in-empty") << QString("") << QString("") << 0 << false << 0;
#endif
@@ -1027,21 +1027,21 @@ void tst_QString::indexOf_data()
s1 += QChar(0xb5);
QString s2;
s2 += QChar(0x3bc);
- QTest::newRow( "data58" ) << s1 << s2 << 0 << FALSE << 3;
+ QTest::newRow( "data58" ) << s1 << s2 << 0 << false << 3;
s2.prepend("C");
- QTest::newRow( "data59" ) << s1 << s2 << 0 << FALSE << 2;
+ QTest::newRow( "data59" ) << s1 << s2 << 0 << false << 2;
QString veryBigHaystack(500, 'a');
veryBigHaystack += 'B';
- QTest::newRow("BoyerMooreStressTest") << veryBigHaystack << veryBigHaystack << 0 << TRUE << 0;
- QTest::newRow("BoyerMooreStressTest2") << veryBigHaystack + 'c' << veryBigHaystack << 0 << TRUE << 0;
- QTest::newRow("BoyerMooreStressTest3") << 'c' + veryBigHaystack << veryBigHaystack << 0 << TRUE << 1;
- QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << TRUE << -1;
- QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << TRUE << -1;
- QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << TRUE << -1;
- QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << TRUE << -1;
+ QTest::newRow("BoyerMooreStressTest") << veryBigHaystack << veryBigHaystack << 0 << true << 0;
+ QTest::newRow("BoyerMooreStressTest2") << veryBigHaystack + 'c' << veryBigHaystack << 0 << true << 0;
+ QTest::newRow("BoyerMooreStressTest3") << 'c' + veryBigHaystack << veryBigHaystack << 0 << true << 1;
+ QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << true << -1;
- QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << FALSE << 0;
+ QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << false << 0;
}
@@ -1470,11 +1470,11 @@ void tst_QString::leftJustified()
QString n;
QVERIFY(!n.leftJustified(3).isNull());
- QCOMPARE(a.leftJustified(4,' ',TRUE),(QString)"ABC ");
- QCOMPARE(a.leftJustified(3,' ',TRUE),(QString)"ABC");
- QCOMPARE(a.leftJustified(2,' ',TRUE),(QString)"AB");
- QCOMPARE(a.leftJustified(1,' ',TRUE),(QString)"A");
- QCOMPARE(a.leftJustified(0,' ',TRUE),(QString)"");
+ QCOMPARE(a.leftJustified(4,' ',true),(QString)"ABC ");
+ QCOMPARE(a.leftJustified(3,' ',true),(QString)"ABC");
+ QCOMPARE(a.leftJustified(2,' ',true),(QString)"AB");
+ QCOMPARE(a.leftJustified(1,' ',true),(QString)"A");
+ QCOMPARE(a.leftJustified(0,' ',true),(QString)"");
}
void tst_QString::rightJustified()
@@ -1491,12 +1491,12 @@ void tst_QString::rightJustified()
QString n;
QVERIFY(!n.rightJustified(3).isNull());
- QCOMPARE(a.rightJustified(4,'-',TRUE),(QString)"-ABC");
- QCOMPARE(a.rightJustified(4,' ',TRUE),(QString)" ABC");
- QCOMPARE(a.rightJustified(3,' ',TRUE),(QString)"ABC");
- QCOMPARE(a.rightJustified(2,' ',TRUE),(QString)"AB");
- QCOMPARE(a.rightJustified(1,' ',TRUE),(QString)"A");
- QCOMPARE(a.rightJustified(0,' ',TRUE),(QString)"");
+ QCOMPARE(a.rightJustified(4,'-',true),(QString)"-ABC");
+ QCOMPARE(a.rightJustified(4,' ',true),(QString)" ABC");
+ QCOMPARE(a.rightJustified(3,' ',true),(QString)"ABC");
+ QCOMPARE(a.rightJustified(2,' ',true),(QString)"AB");
+ QCOMPARE(a.rightJustified(1,' ',true),(QString)"A");
+ QCOMPARE(a.rightJustified(0,' ',true),(QString)"");
QCOMPARE(a,(QString)"ABC");
}
@@ -2498,10 +2498,10 @@ void tst_QString::toULong_data()
QTest::addColumn<ulong>("result" );
QTest::addColumn<bool>("ok" );
- QTest::newRow( "default" ) << QString() << 10 << 0UL << FALSE;
- QTest::newRow( "empty" ) << QString("") << 10 << 0UL << FALSE;
- QTest::newRow( "ulong1" ) << QString("3234567890") << 10 << 3234567890UL << TRUE;
- QTest::newRow( "ulong2" ) << QString("fFFfFfFf") << 16 << 0xFFFFFFFFUL << TRUE;
+ QTest::newRow( "default" ) << QString() << 10 << 0UL << false;
+ QTest::newRow( "empty" ) << QString("") << 10 << 0UL << false;
+ QTest::newRow( "ulong1" ) << QString("3234567890") << 10 << 3234567890UL << true;
+ QTest::newRow( "ulong2" ) << QString("fFFfFfFf") << 16 << 0xFFFFFFFFUL << true;
}
void tst_QString::toULong()
@@ -2524,16 +2524,16 @@ void tst_QString::toLong_data()
QTest::addColumn<long>("result" );
QTest::addColumn<bool>("ok" );
- QTest::newRow( "default" ) << QString() << 10 << 0L << FALSE;
- QTest::newRow( "empty" ) << QString("") << 10 << 0L << FALSE;
- QTest::newRow( "normal" ) << QString("7fFFfFFf") << 16 << 0x7fFFfFFfL << TRUE;
- QTest::newRow( "long_max" ) << QString("2147483647") << 10 << 2147483647L << TRUE;
+ QTest::newRow( "default" ) << QString() << 10 << 0L << false;
+ QTest::newRow( "empty" ) << QString("") << 10 << 0L << false;
+ QTest::newRow( "normal" ) << QString("7fFFfFFf") << 16 << 0x7fFFfFFfL << true;
+ QTest::newRow( "long_max" ) << QString("2147483647") << 10 << 2147483647L << true;
if (sizeof(long) == 4) {
- QTest::newRow( "long_max+1" ) << QString("2147483648") << 10 << 0L << FALSE;
- QTest::newRow( "long_min-1" ) << QString("-80000001") << 16 << 0L << FALSE;
+ QTest::newRow( "long_max+1" ) << QString("2147483648") << 10 << 0L << false;
+ QTest::newRow( "long_min-1" ) << QString("-80000001") << 16 << 0L << false;
}
- QTest::newRow( "negative" ) << QString("-7fffffff") << 16 << -0x7fffffffL << TRUE;
-// QTest::newRow( "long_min" ) << QString("-80000000") << 16 << 0x80000000uL << TRUE;
+ QTest::newRow( "negative" ) << QString("-7fffffff") << 16 << -0x7fffffffL << true;
+// QTest::newRow( "long_min" ) << QString("-80000000") << 16 << 0x80000000uL << true;
}
void tst_QString::toLong()
@@ -2637,33 +2637,33 @@ void tst_QString::toDouble_data()
QTest::addColumn<double>("result" );
QTest::addColumn<bool>("result_ok" );
- QTest::newRow( "ok00" ) << QString("0.000000000931322574615478515625") << 0.000000000931322574615478515625 << (bool)TRUE;
- QTest::newRow( "ok01" ) << QString(" 123.45") << 123.45 << (bool)TRUE;
+ QTest::newRow( "ok00" ) << QString("0.000000000931322574615478515625") << 0.000000000931322574615478515625 << true;
+ QTest::newRow( "ok01" ) << QString(" 123.45") << 123.45 << true;
- QTest::newRow( "ok02" ) << QString("0.1e10") << 0.1e10 << (bool)TRUE;
- QTest::newRow( "ok03" ) << QString("0.1e-10") << 0.1e-10 << (bool)TRUE;
+ QTest::newRow( "ok02" ) << QString("0.1e10") << 0.1e10 << true;
+ QTest::newRow( "ok03" ) << QString("0.1e-10") << 0.1e-10 << true;
- QTest::newRow( "ok04" ) << QString("1e10") << 1.0e10 << (bool)TRUE;
- QTest::newRow( "ok05" ) << QString("1e+10") << 1.0e10 << (bool)TRUE;
- QTest::newRow( "ok06" ) << QString("1e-10") << 1.0e-10 << (bool)TRUE;
+ QTest::newRow( "ok04" ) << QString("1e10") << 1.0e10 << true;
+ QTest::newRow( "ok05" ) << QString("1e+10") << 1.0e10 << true;
+ QTest::newRow( "ok06" ) << QString("1e-10") << 1.0e-10 << true;
- QTest::newRow( "ok07" ) << QString(" 1e10") << 1.0e10 << (bool)TRUE;
- QTest::newRow( "ok08" ) << QString(" 1e+10") << 1.0e10 << (bool)TRUE;
- QTest::newRow( "ok09" ) << QString(" 1e-10") << 1.0e-10 << (bool)TRUE;
+ QTest::newRow( "ok07" ) << QString(" 1e10") << 1.0e10 << true;
+ QTest::newRow( "ok08" ) << QString(" 1e+10") << 1.0e10 << true;
+ QTest::newRow( "ok09" ) << QString(" 1e-10") << 1.0e-10 << true;
- QTest::newRow( "ok10" ) << QString("1.") << 1.0 << (bool)TRUE;
- QTest::newRow( "ok11" ) << QString(".1") << 0.1 << (bool)TRUE;
+ QTest::newRow( "ok10" ) << QString("1.") << 1.0 << true;
+ QTest::newRow( "ok11" ) << QString(".1") << 0.1 << true;
- QTest::newRow( "wrong00" ) << QString("123.45 ") << 123.45 << (bool)TRUE;
- QTest::newRow( "wrong01" ) << QString(" 123.45 ") << 123.45 << (bool)TRUE;
+ QTest::newRow( "wrong00" ) << QString("123.45 ") << 123.45 << true;
+ QTest::newRow( "wrong01" ) << QString(" 123.45 ") << 123.45 << true;
- QTest::newRow( "wrong02" ) << QString("aa123.45aa") << 0.0 << (bool)FALSE;
- QTest::newRow( "wrong03" ) << QString("123.45aa") << 0.0 << (bool)FALSE;
- QTest::newRow( "wrong04" ) << QString("123erf") << 0.0 << (bool)FALSE;
+ QTest::newRow( "wrong02" ) << QString("aa123.45aa") << 0.0 << false;
+ QTest::newRow( "wrong03" ) << QString("123.45aa") << 0.0 << false;
+ QTest::newRow( "wrong04" ) << QString("123erf") << 0.0 << false;
- QTest::newRow( "wrong05" ) << QString("abc") << 0.0 << (bool)FALSE;
- QTest::newRow( "wrong06" ) << QString() << 0.0 << (bool)FALSE;
- QTest::newRow( "wrong07" ) << QString("") << 0.0 << (bool)FALSE;
+ QTest::newRow( "wrong05" ) << QString("abc") << 0.0 << false;
+ QTest::newRow( "wrong06" ) << QString() << 0.0 << false;
+ QTest::newRow( "wrong07" ) << QString("") << 0.0 << false;
}
void tst_QString::toDouble()
diff --git a/tests/auto/qstringlist/qstringlist.pro b/tests/auto/qstringlist/qstringlist.pro
index b2ad23db4a..aee074bad3 100644
--- a/tests/auto/qstringlist/qstringlist.pro
+++ b/tests/auto/qstringlist/qstringlist.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
SOURCES += tst_qstringlist.cpp
-
-
QT = core
-
-
diff --git a/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp
index 27d961eebd..82d55aebb3 100644
--- a/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -46,7 +46,6 @@
#include <qmap.h>
#include <qstringlistmodel.h>
#include <qstringlist.h>
-#include <iostream>
#include <qlistview.h>
#include "qmodellistener.h"
#include <qstringlistmodel.h>
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 71ee2e6a41..f9fed698c4 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -1,10 +1,13 @@
load(qttest_p4)
+TARGET.EPOCHEAPSIZE = 0x200000 0x800000
SOURCES += tst_qstyle.cpp
wince*: {
addPixmap.sources = task_25863.png
addPixmap.path = .
DEPLOYMENT += addPixmap
+} else:symbian* {
+ addPixmap.sources = task_25863.png
+ addPixmap.path = .
+ DEPLOYMENT += addPixmap
}
-
-
diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp
index cb30f83791..e020f9e5b6 100644
--- a/tests/auto/qstyle/tst_qstyle.cpp
+++ b/tests/auto/qstyle/tst_qstyle.cpp
@@ -70,6 +70,10 @@
#include <qlineedit.h>
#include <qmdiarea.h>
+#if defined(Q_OS_SYMBIAN)
+#define SRCDIR "."
+#endif
+
#include <QCleanlooksStyle>
#ifdef Q_WS_MAC
@@ -99,10 +103,14 @@ static bool qt_wince_is_smartphone() {
}
#endif
+#ifdef Q_WS_S60
+#include <qs60style.h>
+#endif
+
#include <qwidget.h>
//TESTED_CLASS=
-//TESTED_FILES=gui/styles/qstyle.h gui/styles/qstyle.cpp gui/styles/qplastiquestyle.cpp gui/styles/qwindowsstyle.cpp gui/styles/qwindowsxpstyle.cpp gui/styles/qwindowsvistastyle.cpp gui/styles/qmotifstyle.cpp
+//TESTED_FILES=gui/styles/qstyle.h gui/styles/qstyle.cpp gui/styles/qplastiquestyle.cpp gui/styles/qwindowsstyle.cpp gui/styles/qwindowsxpstyle.cpp gui/styles/qwindowsvistastyle.cpp gui/styles/qmotifstyle.cpp gui/styles/qs60style.cpp
class tst_QStyle : public QObject
{
@@ -130,12 +138,13 @@ private slots:
void testMacStyle();
void testWindowsCEStyle();
void testWindowsMobileStyle();
+ void testS60Style();
void testStyleFactory();
void pixelMetric();
void progressBarChangeStyle();
void defaultFont();
private:
- void lineUpLayoutTest(QStyle *);
+ void lineUpLayoutTest(QStyle *);
QWidget *testWidget;
};
@@ -198,10 +207,10 @@ void tst_QStyle::testStyleFactory()
QVERIFY(keys.contains("Motif"));
#endif
#ifdef Q_WS_WIN
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP &&
+ if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP &&
QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)
QVERIFY(keys.contains("WindowsXP"));
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA &&
+ if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA &&
QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)
QVERIFY(keys.contains("WindowsVista"));
#endif
@@ -217,7 +226,12 @@ void tst_QStyle::drawItemPixmap()
{
testWidget->resize(300, 300);
testWidget->show();
+#if defined(Q_OS_SYMBIAN)
+ const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/");
+ QPixmap p(prefix+"task_25863.png", "PNG");
+#else
QPixmap p("task_25863.png", "PNG");
+#endif
QPixmap actualPix = QPixmap::grabWidget(testWidget);
QVERIFY(pixmapsAreEqual(&actualPix,&p));
testWidget->hide();
@@ -229,17 +243,17 @@ void tst_QStyle::testAllFunctions(QStyle *style)
opt.init(testWidget);
testWidget->setStyle(style);
-
+
//Tests styleHint with default arguments for potential crashes
for ( int hint = 0 ; hint < int(QStyle::SH_Menu_Mask); ++hint) {
style->styleHint(QStyle::StyleHint(hint));
style->styleHint(QStyle::StyleHint(hint), &opt, testWidget);
}
-
+
//Tests pixelMetric with default arguments for potential crashes
for ( int pm = 0 ; pm < int(QStyle::PM_LayoutVerticalSpacing); ++pm) {
style->pixelMetric(QStyle::PixelMetric(pm));
- style->pixelMetric(QStyle::PixelMetric(pm), &opt, testWidget);
+ style->pixelMetric(QStyle::PixelMetric(pm), &opt, testWidget);
}
//Tests drawControl with default arguments for potential crashes
@@ -255,7 +269,7 @@ void tst_QStyle::testAllFunctions(QStyle *style)
QPainter painter(&surface);
QStyleOptionComboBox copt1;
copt1.init(testWidget);
-
+
QStyleOptionGroupBox copt2;
copt2.init(testWidget);
QStyleOptionSizeGrip copt3;
@@ -306,7 +320,7 @@ void tst_QStyle::testAllFunctions(QStyle *style)
style->itemPixmapRect(QRect(0, 0, 100, 100), Qt::AlignHCenter, QPixmap(200, 200));
style->itemTextRect(QFontMetrics(qApp->font()), QRect(0, 0, 100, 100), Qt::AlignHCenter, true, QString("Test"));
-
+
testScrollBarSubControls(style);
}
@@ -321,6 +335,12 @@ void tst_QStyle::testScrollBarSubControls(QStyle *style)
scrollBar.show();
const QStyleOptionSlider opt = qt_qscrollbarStyleOption(&scrollBar);
foreach (int subControl, QList<int>() << 1 << 2 << 4 << 8) {
+
+#ifdef Q_WS_S60
+// in s60style add line and sub line have been removed.
+ if (subControl == QStyle::SC_ScrollBarAddLine || subControl == QStyle::SC_ScrollBarSubLine )
+ continue;
+#endif
QRect sr = testWidget->style()->subControlRect(QStyle::CC_ScrollBar, &opt,
QStyle::SubControl(subControl), &scrollBar);
QVERIFY(sr.isNull() == false);
@@ -405,7 +425,7 @@ void comparePixmap(const QString &filename, const QPixmap &pixmap)
void tst_QStyle::testPainting(QStyle *style, const QString &platform)
{
//Test Menu
- QString fileName = "images/" + platform + "/menu.png";
+ QString fileName = "images/" + platform + "/menu.png";
QMenu menu;
menu.setStyle(style);
menu.show();
@@ -414,7 +434,7 @@ void tst_QStyle::testPainting(QStyle *style, const QString &platform)
QPixmap pixmap = QPixmap::grabWidget(&menu);
comparePixmap(fileName, pixmap);
- //Push button
+ //Push button
fileName = "images/" + platform + "/button.png";
QPushButton button("OK");
button.setStyle(style);
@@ -423,7 +443,7 @@ void tst_QStyle::testPainting(QStyle *style, const QString &platform)
button.hide();
comparePixmap(fileName, pixmap);
- //Push button
+ //Push button
fileName = "images/" + platform + "/radiobutton.png";
QRadioButton radiobutton("Check");
radiobutton.setStyle(style);
@@ -453,7 +473,7 @@ void tst_QStyle::testPainting(QStyle *style, const QString &platform)
spinbox.hide();
comparePixmap(fileName, pixmap);
QLocale::setDefault(QLocale::system());
-
+
//Slider
fileName = "images/" + platform + "/slider.png";
QSlider slider;
@@ -532,6 +552,16 @@ void tst_QStyle::testWindowsMobileStyle()
#endif
}
+void tst_QStyle::testS60Style()
+ {
+#if defined(Q_WS_S60)
+ QS60Style cstyle;
+ testAllFunctions(&cstyle);
+#else
+ QSKIP("No S60Style style", SkipAll);
+#endif
+ }
+
// Helper class...
MyWidget::MyWidget( QWidget* parent, const char* name )
@@ -616,9 +646,9 @@ void tst_QStyle::pixelMetric()
void tst_QStyle::progressBarChangeStyle()
{
#if !defined(QT_NO_STYLE_PLASTIQUE) && !defined(QT_NO_STYLE_WINDOWS)
- //test a crashing situation (task 143530)
+ //test a crashing situation (task 143530)
//where changing the styles and deleting a progressbar would crash
-
+
QWindowsStyle style1;
QPlastiqueStyle style2;
@@ -635,35 +665,55 @@ void tst_QStyle::progressBarChangeStyle()
QTest::qWait(100);
//before the correction, there would be a crash here
+#elif !defined(QT_NO_STYLE_S60) && !defined(QT_NO_STYLE_WINDOWS)
+ //test a crashing situation (task 143530)
+ //where changing the styles and deleting a progressbar would crash
+
+ QWindowsStyle style1;
+ QS60Style style2;
+
+ QProgressBar *progress=new QProgressBar;
+ progress->setStyle(&style1);
+
+ progress->show();
+
+ progress->setStyle(&style2);
+
+ QTest::qWait(100);
+ delete progress;
+
+ QTest::qWait(100);
+
+ //before the correction, there would be a crash here
#else
- QSKIP("Either style Plastique or Windows missing", SkipAll);
+ QSKIP("Either style Plastique or Windows or S60 missing", SkipAll);
#endif
}
void tst_QStyle::lineUpLayoutTest(QStyle *style)
{
- QWidget widget;
- QHBoxLayout layout;
- QFont font;
- font.setPointSize(9); //Plastique is lined up for odd numbers...
- widget.setFont(font);
- QSpinBox spinbox(&widget);
- QLineEdit lineedit(&widget);
- QComboBox combo(&widget);
- combo.setEditable(true);
- layout.addWidget(&spinbox);
- layout.addWidget(&lineedit);
- layout.addWidget(&combo);
- widget.setLayout(&layout);
+ QWidget widget;
+ QHBoxLayout layout;
+ QFont font;
+ font.setPointSize(9); //Plastique is lined up for odd numbers...
+ widget.setFont(font);
+ QSpinBox spinbox(&widget);
+ QLineEdit lineedit(&widget);
+ QComboBox combo(&widget);
+ combo.setEditable(true);
+ layout.addWidget(&spinbox);
+ layout.addWidget(&lineedit);
+ layout.addWidget(&combo);
+ widget.setLayout(&layout);
widget.setStyle(style);
// propagate the style.
foreach (QWidget *w, qFindChildren<QWidget *>(&widget))
w->setStyle(style);
- widget.show();
+ widget.show();
QTest::qWait( 500 );
- QVERIFY(qAbs(spinbox.height() - lineedit.height()) <= 1);
- QVERIFY(qAbs(spinbox.height() - combo.height()) <= 1);
+ QVERIFY(qAbs(spinbox.height() - lineedit.height()) <= 1);
+ QVERIFY(qAbs(spinbox.height() - combo.height()) <= 1);
}
void tst_QStyle::defaultFont()
diff --git a/tests/auto/qsvggenerator/qsvggenerator.pro b/tests/auto/qsvggenerator/qsvggenerator.pro
index 1eb72b3302..450bcd3714 100644
--- a/tests/auto/qsvggenerator/qsvggenerator.pro
+++ b/tests/auto/qsvggenerator/qsvggenerator.pro
@@ -7,11 +7,14 @@ QT += svg xml
SOURCES += tst_qsvggenerator.cpp
-wince*: {
+wince*|symbian {
addFiles.sources = referenceSvgs
addFiles.path = .
DEPLOYMENT += addFiles
+}
+
+wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else {
+} !symbian {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
index a1aad59cf2..e9bbb9913b 100644
--- a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
+++ b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
@@ -55,6 +55,10 @@
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
class tst_QSvgGenerator : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qsvgrenderer/qsvgrenderer.pro b/tests/auto/qsvgrenderer/qsvgrenderer.pro
index 120d9f0ed0..8cfbcceed3 100644
--- a/tests/auto/qsvgrenderer/qsvgrenderer.pro
+++ b/tests/auto/qsvgrenderer/qsvgrenderer.pro
@@ -8,7 +8,7 @@ QT += svg
SOURCES += tst_qsvgrenderer.cpp
RESOURCES += resources.qrc
-wince*: {
+wince*|symbian {
addFiles.sources = *.svg *.svgz
addFiles.path = .
diff --git a/tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
index 4a26df68d5..5f6ce5f993 100644
--- a/tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
+++ b/tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
@@ -146,7 +146,7 @@ public:
};
QT_BEGIN_NAMESPACE
-static bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs)
+bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs)
{
return lhs.start == rhs.start
&& lhs.length == rhs.length
diff --git a/tests/auto/qsysinfo/qsysinfo.pro b/tests/auto/qsysinfo/qsysinfo.pro
index 917c281f29..e822fec7e8 100644
--- a/tests/auto/qsysinfo/qsysinfo.pro
+++ b/tests/auto/qsysinfo/qsysinfo.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
-
SOURCES += tst_qsysinfo.cpp
QT = core
diff --git a/tests/auto/qsystemsemaphore/test/test.pro b/tests/auto/qsystemsemaphore/test/test.pro
index 62ea054adc..b8d3a4ac8f 100644
--- a/tests/auto/qsystemsemaphore/test/test.pro
+++ b/tests/auto/qsystemsemaphore/test/test.pro
@@ -18,7 +18,7 @@ win32 {
RESOURCES += ../files.qrc
wince*: {
-# this test calls lackkey, which then again depends on QtScript.
+# this test calls lackey, which then again depends on QtScript.
# let's add it here so that it gets deployed easily
QT += script
lackey.sources = ../../qsharedmemory/lackey/lackey.exe
@@ -27,3 +27,12 @@ lackey.path = ../qsharedmemory/lackey
DEPLOYMENT += lackey
}
+symbian: {
+# this test calls lackey, which then again depends on QtScript.
+# let's add it here so that it gets deployed easily
+QT += script
+
+lackey.sources = ../../qsharedmemory/lackey/lackey.exe
+lackey.path = /sys/bin
+DEPLOYMENT += lackey
+}
diff --git a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
index 43ef509e9c..363a994fc4 100644
--- a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
+++ b/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
@@ -185,6 +185,9 @@ void tst_QSystemSemaphore::complexacquire()
void tst_QSystemSemaphore::basicProcesses()
{
+#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
+#endif
QSystemSemaphore sem("store", 0, QSystemSemaphore::Create);
QStringList acquireArguments = QStringList() << acquire_js();
@@ -201,6 +204,7 @@ void tst_QSystemSemaphore::basicProcesses()
acquire.kill();
release.start(LACKYLOC "/lackey", releaseArguments);
acquire.waitForFinished(5000);
+ release.waitForFinished(5000);
QVERIFY(acquire.state() == QProcess::NotRunning);
}
@@ -216,6 +220,9 @@ void tst_QSystemSemaphore::processes_data()
void tst_QSystemSemaphore::processes()
{
+#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
+#endif
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QFETCH(int, processes);
@@ -242,7 +249,7 @@ void tst_QSystemSemaphore::processes()
void tst_QSystemSemaphore::undo()
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QSKIP("This test only checks a unix behavior", SkipSingle);
#endif
@@ -264,9 +271,11 @@ void tst_QSystemSemaphore::undo()
void tst_QSystemSemaphore::initialValue()
{
+#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
+#endif
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
-
QStringList acquireArguments = QStringList() << acquire_js();
QStringList releaseArguments = QStringList() << release_js();
QProcess acquire;
@@ -286,6 +295,7 @@ void tst_QSystemSemaphore::initialValue()
release.start(LACKYLOC "/lackey", releaseArguments);
acquire.waitForFinished(10000);
+ release.waitForFinished(10000);
QVERIFY(acquire.state()== QProcess::NotRunning);
}
QTEST_MAIN(tst_QSystemSemaphore)
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index 31722de73b..7cf708cac3 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -370,7 +370,7 @@ void tst_QTabBar::tabButton()
tabbar.setTabButton(0, position, button);
- QCOMPARE(tabbar.tabButton(0, position), static_cast<const QWidget *>(button));
+ QCOMPARE(tabbar.tabButton(0, position), static_cast<QWidget *>(button));
QTRY_VERIFY(!button->isHidden());
QVERIFY(tabbar.tabButton(0, otherSide) == 0);
QCOMPARE(button->parent(), static_cast<QObject *>(&tabbar));
diff --git a/tests/auto/qtableview/qtableview.pro b/tests/auto/qtableview/qtableview.pro
index 2368a568fb..72099d45c2 100644
--- a/tests/auto/qtableview/qtableview.pro
+++ b/tests/auto/qtableview/qtableview.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
+TARGET.EPOCHEAPSIZE = 0x200000 0x800000
SOURCES += tst_qtableview.cpp
-
diff --git a/tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
index 4320318c01..cbfa48e0b2 100644
--- a/tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
+++ b/tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
@@ -42,7 +42,7 @@
#include <QCoreApplication>
#include <QList>
#include <QLinkedList>
-#include <QTest>
+#include <QtTest/QtTest>
#include "../qtconcurrentmap/functions.h"
#include "../qfuture/versioncheck.h"
diff --git a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 50da773614..f01cf086eb 100644
--- a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -65,7 +65,7 @@ struct TestIterator
int i;
};
-#include <iterator>
+#include <qiterator.h>
namespace std {
template <>
struct iterator_traits<TestIterator>
diff --git a/tests/auto/qtcpserver/crashingServer/main.cpp b/tests/auto/qtcpserver/crashingServer/main.cpp
index 7b9a0d528a..d632eb7878 100644
--- a/tests/auto/qtcpserver/crashingServer/main.cpp
+++ b/tests/auto/qtcpserver/crashingServer/main.cpp
@@ -53,15 +53,15 @@ int main(int argc, char *argv[])
return 1;
}
-#if !defined(Q_OS_WINCE)
- printf("Listening\n");
- fflush(stdout);
-#else
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QFile file(QLatin1String("/test_signal.txt"));
file.open(QIODevice::WriteOnly);
file.write("Listening\n");
file.flush();
file.close();
+#else
+ printf("Listening\n");
+ fflush(stdout);
#endif
server.waitForNewConnection(5000);
diff --git a/tests/auto/qtcpserver/test/test.pro b/tests/auto/qtcpserver/test/test.pro
index 3ca854f641..bdeaa92d8a 100644
--- a/tests/auto/qtcpserver/test/test.pro
+++ b/tests/auto/qtcpserver/test/test.pro
@@ -12,6 +12,12 @@ wince*: {
}
}
+symbian {
+ crashApp.sources = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe
+ crashApp.path = .
+ DEPLOYMENT += crashApp
+}
+
TARGET = ../tst_qtcpserver
win32 {
diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp
index 4fd1827fae..199886b540 100644
--- a/tests/auto/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp
@@ -39,8 +39,9 @@
**
****************************************************************************/
-
-#ifdef _WIN32
+// Just to get Q_OS_SYMBIAN
+#include <qglobal.h>
+#if defined(_WIN32) && !defined(Q_OS_SYMBIAN)
#include <winsock2.h>
#else
#include <sys/types.h>
@@ -129,11 +130,11 @@ void tst_QTcpServer::getSetCheck()
tst_QTcpServer::tst_QTcpServer()
{
+ Q_SET_DEFAULT_IAP
}
tst_QTcpServer::~tst_QTcpServer()
-{
-
+{
}
void tst_QTcpServer::initTestCase_data()
@@ -232,6 +233,9 @@ void tst_QTcpServer::clientServerLoop()
//----------------------------------------------------------------------------------
void tst_QTcpServer::ipv6Server()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: IPv6 is not yet supported", SkipAll);
+#endif
//### need to enter the event loop for the server to get the connection ?? ( windows)
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 8944)) {
@@ -316,6 +320,9 @@ void tst_QTcpServer::ipv4LoopbackPerformanceTest()
//----------------------------------------------------------------------------------
void tst_QTcpServer::ipv6LoopbackPerformanceTest()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: IPv6 is not yet supported", SkipAll);
+#endif
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 0)) {
QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError);
@@ -517,6 +524,7 @@ private:
//----------------------------------------------------------------------------------
void tst_QTcpServer::waitForConnectionTest()
{
+
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
#ifdef TEST_QNETWORK_PROXY
@@ -528,7 +536,7 @@ void tst_QTcpServer::waitForConnectionTest()
}
QTcpSocket findLocalIpSocket;
- findLocalIpSocket.connectToHost(QtNetworkSettings::serverName(), 21);
+ findLocalIpSocket.connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(findLocalIpSocket.waitForConnected(2000));
QTcpServer server;
@@ -541,10 +549,10 @@ void tst_QTcpServer::waitForConnectionTest()
ThreadConnector connector(findLocalIpSocket.localAddress(), server.serverPort());
connector.start();
-#if !defined(Q_OS_WINCE)
- QVERIFY(server.waitForNewConnection(3000, &timeout));
-#else
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QVERIFY(server.waitForNewConnection(9000, &timeout));
+#else
+ QVERIFY(server.waitForNewConnection(3000, &timeout));
#endif
QVERIFY(!timeout);
}
@@ -604,7 +612,11 @@ protected:
{
// how a user woulddo it (qabstractsocketengine is not public)
unsigned long arg = 0;
-#ifdef Q_OS_WIN
+#if defined(Q_OS_SYMBIAN)
+ arg = fcntl(socketDescriptor, F_GETFL, NULL);
+ arg &= (~O_NONBLOCK);
+ ok = ::fcntl(socketDescriptor, F_SETFL, arg) != -1;
+#elif defined(Q_OS_WIN)
ok = ::ioctlsocket(socketDescriptor, FIONBIO, &arg) == 0;
::closesocket(socketDescriptor);
#else
@@ -616,6 +628,10 @@ protected:
void tst_QTcpServer::addressReusable()
{
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ QSKIP("Symbian: Emulator does not support process launching", SkipAll );
+#endif
+
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#else
@@ -629,7 +645,7 @@ void tst_QTcpServer::addressReusable()
}
#endif
}
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QString signalName = QString::fromLatin1("/test_signal.txt");
QFile::remove(signalName);
// The crashingServer process will crash once it gets a connection.
@@ -677,9 +693,7 @@ void tst_QTcpServer::setNewSocketDescriptorBlocking()
QTcpSocket socket;
socket.connectToHost(QHostAddress::LocalHost, server.serverPort());
-
QVERIFY(server.waitForNewConnection(5000));
-
QVERIFY(server.ok);
}
@@ -692,7 +706,7 @@ void tst_QTcpServer::invalidProxy_data()
QTest::addColumn<int>("expectedError");
QString fluke = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
- QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << fluke << 21
+ QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << fluke << 143
<< int(QAbstractSocket::UnsupportedSocketOperationError);
QTest::newRow("http-proxy") << int(QNetworkProxy::HttpProxy) << fluke << 3128
<< int(QAbstractSocket::UnsupportedSocketOperationError);
diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro
index 6924309720..f18b471747 100644
--- a/tests/auto/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/qtcpsocket/qtcpsocket.pro
@@ -2,4 +2,4 @@ TEMPLATE = subdirs
!wince*: SUBDIRS = test stressTest
-wince*: SUBDIRS = test
+wince* | symbian* : SUBDIRS = test
diff --git a/tests/auto/qtcpsocket/test/test.pro b/tests/auto/qtcpsocket/test/test.pro
index fecbf112fd..5d6c3b1ca2 100644
--- a/tests/auto/qtcpsocket/test/test.pro
+++ b/tests/auto/qtcpsocket/test/test.pro
@@ -10,7 +10,9 @@ wince*: {
}
QT += network
-DEFINES += TEST_QNETWORK_PROXY
+symbian: TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+
+#DEFINES += TEST_QNETWORK_PROXY
TARGET = tst_qtcpsocket
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index 1e7cc48ca7..da3f19a057 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -40,7 +40,10 @@
****************************************************************************/
-#ifdef _WIN32
+// Just to get Q_OS_SYMBIAN
+#include <qglobal.h>
+
+#if defined(_WIN32) && !defined(Q_OS_SYMBIAN)
#include <winsock2.h>
#else
#include <sys/types.h>
@@ -76,9 +79,10 @@
#include <QTimer>
#include <QDebug>
#ifndef TEST_QNETWORK_PROXY
-#define TEST_QNETWORK_PROXY
+//#define TEST_QNETWORK_PROXY
#endif
-#ifdef TEST_QNETWORK_PROXY
+#if defined(TEST_QNETWORK_PROXY) || defined (Q_CC_RVCT)
+// RVCT compiles also unused inline methods
# include <QNetworkProxy>
#endif
@@ -247,6 +251,7 @@ int tst_QTcpSocket::loopLevel = 0;
tst_QTcpSocket::tst_QTcpSocket()
{
+ Q_SET_DEFAULT_IAP
tmpSocket = 0;
}
@@ -899,8 +904,12 @@ void tst_QTcpSocket::disconnectWhileConnecting()
socket->disconnectFromHost();
}
- connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+ connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+#ifndef Q_OS_SYMBIAN
enterLoop(10);
+#else
+ enterLoop(30);
+#endif
QVERIFY2(!timeout(), "Network timeout");
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
@@ -935,7 +944,7 @@ public:
: server(0), ok(false), quit(false)
{ }
- ~ReceiverThread() { wait(); delete server; }
+ ~ReceiverThread() { /*delete server;*/ terminate(); wait(); }
bool listen()
{
@@ -960,7 +969,11 @@ protected:
QTcpSocket *socket = server->nextPendingConnection();
while (!quit) {
+#ifndef Q_OS_SYMBIAN
if (socket->waitForDisconnected(500))
+#else
+ if (socket->waitForDisconnected(1000))
+#endif
break;
if (socket->error() != QAbstractSocket::SocketTimeoutError)
return;
@@ -1008,7 +1021,11 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
socket->disconnectFromHost();
}
+#ifndef Q_OS_SYMBIAN
QVERIFY2(socket->waitForDisconnected(10000), "Network timeout");
+#else
+ QVERIFY2(socket->waitForDisconnected(20000), "Network timeout");
+#endif
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
@@ -1054,7 +1071,11 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
// let anything queued happen
QEventLoop loop;
+#ifndef Q_OS_SYMBIAN
QTimer::singleShot(50, &loop, SLOT(quit()));
+#else
+ QTimer::singleShot(500, &loop, SLOT(quit()));
+#endif
loop.exec();
// recheck
@@ -1159,13 +1180,13 @@ void tst_QTcpSocket::readLine()
QVERIFY(socket->waitForReadyRead(10000));
char buffer[1024];
- QCOMPARE(socket->readLine(buffer, sizeof(buffer)), qint64(161));
+ int expectedReplySize = QtNetworkSettings::expectedReplyIMAP().size();
+ ASSERT(expectedReplySize >= 3);
+ QCOMPARE(socket->readLine(buffer, sizeof(buffer)), qint64(expectedReplySize));
- // * OK fluke Cyrus IMAP4 v2.2.12 server ready__
-// // 01234567890123456789012345678901234567890123456789
- QCOMPARE((int) buffer[159], (int) '\r');
- QCOMPARE((int) buffer[160], (int) '\n');
- QCOMPARE((int) buffer[161], (int) '\0');
+ QCOMPARE((int) buffer[expectedReplySize-2], (int) '\r');
+ QCOMPARE((int) buffer[expectedReplySize-1], (int) '\n');
+ QCOMPARE((int) buffer[expectedReplySize], (int) '\0');
QCOMPARE(socket->write("1 NOOP\r\n"), qint64(8));
@@ -1203,7 +1224,7 @@ void tst_QTcpSocket::readLineString()
QVERIFY(socket->waitForReadyRead(10000));
QByteArray arr = socket->readLine();
- QCOMPARE(arr, expected);
+ QCOMPARE(arr, QtNetworkSettings::expectedReplyIMAP());
delete socket;
}
@@ -1431,9 +1452,7 @@ void tst_QTcpSocket::socketInAThread()
TestThread thread;
thread.start();
QVERIFY(thread.wait(15000));
- QCOMPARE(thread.data(),
-// QByteArray("220 (vsFTPd 2.0.4)\r\n221 Goodbye.\r\n"));
- QByteArray("220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n"));
+ QCOMPARE(thread.data(), QtNetworkSettings::expectedReplyFtp());
}
}
@@ -1453,12 +1472,9 @@ void tst_QTcpSocket::socketsInThreads()
QVERIFY(thread3.wait(15000));
QVERIFY(thread1.wait(15000));
- QCOMPARE(thread1.data(),
- QByteArray("220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n"));
- QCOMPARE(thread2.data(),
- QByteArray("220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n"));
- QCOMPARE(thread3.data(),
- QByteArray("220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n"));
+ QCOMPARE(thread1.data(),QtNetworkSettings::expectedReplyFtp());
+ QCOMPARE(thread2.data(),QtNetworkSettings::expectedReplyFtp());
+ QCOMPARE(thread3.data(),QtNetworkSettings::expectedReplyFtp());
}
}
@@ -1715,7 +1731,6 @@ public slots:
#ifndef Q_OS_WIN
void tst_QTcpSocket::waitForConnectedInHostLookupSlot2()
{
-
Foo foo;
QPushButton top("Go", 0);
top.show();
@@ -1729,7 +1744,7 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2()
QFAIL("Network timeout");
QVERIFY(foo.attemptedToConnect);
- QCOMPARE(foo.count, 1);
+ QCOMPARE(foo.count, 1);
}
#endif
@@ -1749,7 +1764,16 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead()
QCOMPARE(readyReadSpy.count(), 1);
QString s = socket->readLine();
- QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+#ifdef TEST_QNETWORK_PROXY
+ QNetworkProxy::ProxyType proxyType = QNetworkProxy::applicationProxy().type();
+ if(proxyType == QNetworkProxy::NoProxy) {
+ QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4REV1] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ } else {
+ QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ }
+#else
+ QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+#endif
QCOMPARE(socket->bytesAvailable(), qint64(0));
QCoreApplication::instance()->processEvents();
@@ -1967,6 +1991,8 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
{
#if defined(Q_OS_WINCE)
QSKIP("stressTest subprocess needs Qt3Support", SkipAll);
+#elif defined( Q_OS_SYMBIAN )
+ QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll);
#else
QFETCH(QString, client);
QFETCH(QString, server);
@@ -2181,11 +2207,13 @@ void tst_QTcpSocket::invalidProxy_data()
QTest::newRow("no-such-host-http") << int(QNetworkProxy::HttpProxy)
<< "this-host-will-never-exist.troll.no" << 3128 << false
<< int(QAbstractSocket::ProxyNotFoundError);
-
+#if !defined(Q_OS_SYMBIAN)
+ //QSKIP("On Symbian Emulator not clear what to expect + server settings", SkipAll);
QTest::newRow("http-on-socks5") << int(QNetworkProxy::HttpProxy) << fluke << 1080 << false
<< int(QAbstractSocket::ProxyConnectionClosedError);
QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << fluke << 3128 << false
<< int(QAbstractSocket::SocketTimeoutError);
+#endif
}
void tst_QTcpSocket::invalidProxy()
@@ -2341,5 +2369,6 @@ void tst_QTcpSocket::proxyFactory()
}
#endif
+
QTEST_MAIN(tst_QTcpSocket)
#include "tst_qtcpsocket.moc"
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index 2daa0f6dc8..8cae64e0eb 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -182,7 +182,7 @@ void tst_QTemporaryFile::fileName()
QVERIFY(QFile::exists(fileName));
// Get path to the temp file, whithout the file name.
QString absoluteFilePath = QFileInfo(fileName).absolutePath();
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
absoluteFilePath = absoluteFilePath.toLower();
absoluteTempPath = absoluteTempPath.toLower();
#endif
@@ -316,7 +316,7 @@ void tst_QTemporaryFile::openOnRootDrives()
void tst_QTemporaryFile::stressTest()
{
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
// 200 is still ok, first colision happens after ~30
const int iterations = 200;
#else
diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp
index c9206cec58..cc91b885f2 100644
--- a/tests/auto/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/qtextblock/tst_qtextblock.cpp
@@ -115,7 +115,7 @@ void tst_QTextBlock::fragmentOverBlockBoundaries()
QVERIFY(doc);
// Block separators are always a fragment of their self. Thus:
// |Hello|\b|World|\b|
-#ifndef Q_WS_WIN
+#if !defined(Q_WS_WIN) && !defined(Q_WS_S60)
QVERIFY(doc->d_func()->fragmentMap().numNodes() == 4);
#endif
diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
index 4d2ff010df..cba5a74c84 100644
--- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -1,9 +1,10 @@
load(qttest_p4)
+QT = core
HEADERS +=
SOURCES += tst_qtextboundaryfinder.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*:{
+wince*|symbian*:{
addFiles.sources = data
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
index 0886dbdc74..ebe7303081 100644
--- a/tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
+++ b/tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
@@ -48,6 +48,9 @@
//TESTED_CLASS=
//TESTED_FILES=gui/text/qtextlayout.h corelib/tools/qtextboundaryfinder.cpp
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "$$PWD"
+#endif
class tst_QTextBoundaryFinder : public QObject
{
diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro
index 6da3bfb78e..e159a3cb47 100644
--- a/tests/auto/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/qtextbrowser/qtextbrowser.pro
@@ -1,11 +1,11 @@
load(qttest_p4)
SOURCES += tst_qtextbrowser.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian*:DEFINES += SRCDIR=\\\"$$PWD\\\"
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*: {
+wince*|symbian*: {
addFiles.sources = *.html
addFiles.path = .
addDir.sources = subdir/*
diff --git a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
index f0b8f2c165..dbe71df472 100644
--- a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
@@ -52,6 +52,10 @@
//TESTED_CLASS=
//TESTED_FILES=
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
class TestBrowser : public QTextBrowser
{
public:
@@ -545,6 +549,9 @@ void tst_QTextBrowser::focusIndicator()
QVERIFY(browser->textCursor().hasSelection());
QCOMPARE(browser->textCursor().selectedText(), QString("Link to second page"));
+#ifdef QT_KEYPAD_NAVIGATION
+ browser->setEditFocus(true);
+#endif
QTest::keyClick(browser, Qt::Key_Enter);
QVERIFY(!browser->textCursor().hasSelection());
@@ -594,6 +601,9 @@ void tst_QTextBrowser::focusHistory()
QVERIFY(browser->textCursor().hasSelection());
QCOMPARE(browser->textCursor().selectedText(), QString("Link to second page"));
+#ifdef QT_KEYPAD_NAVIGATION
+ browser->setEditFocus(true);
+#endif
QTest::keyClick(browser, Qt::Key_Enter);
QVERIFY(!browser->textCursor().hasSelection());
@@ -650,6 +660,9 @@ void tst_QTextBrowser::urlEncoding()
QSignalSpy spy(browser, SIGNAL(anchorClicked(const QUrl &)));
+#ifdef QT_KEYPAD_NAVIGATION
+ browser->setEditFocus(true);
+#endif
QTest::keyClick(browser, Qt::Key_Enter);
QCOMPARE(spy.count(), 1);
diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro
index e52bb7a610..69cd1dd5d0 100644
--- a/tests/auto/qtextcodec/test/test.pro
+++ b/tests/auto/qtextcodec/test/test.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
TARGET = ../tst_qtextcodec
SOURCES += ../tst_qtextcodec.cpp
-wince*: {
+wince*|symbian {
addFiles.sources = ../*.txt
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index cf4135bba8..ff4b4bbefc 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -45,6 +45,7 @@
#include <qtextcodec.h>
#include <qfile.h>
#include <qtextdocument.h>
+#include <time.h>
#include <qprocess.h>
class tst_QTextCodec : public QObject
@@ -272,7 +273,7 @@ void tst_QTextCodec::codecForLocale()
QTextCodec *codec = QTextCodec::codecForLocale();
QVERIFY(codec != 0);
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX)
// get a time string that is locale-encoded
QByteArray originalLocaleEncodedTimeString;
originalLocaleEncodedTimeString.resize(1024);
@@ -304,7 +305,6 @@ void tst_QTextCodec::codecForLocale()
}
if (!codec2) {
QSKIP("Could not find a codec that is not already the codecForLocale()", SkipAll);
- return;
}
// set it, codecForLocale() should return it now
@@ -1622,6 +1622,7 @@ void tst_QTextCodec::utfHeaders_data()
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel"))
<< true;
+
QTest::newRow("utf32 bom be")
<< QByteArray("UTF-32")
<< 0
diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro
index 142dd47222..02f5dcb9b6 100644
--- a/tests/auto/qtextedit/qtextedit.pro
+++ b/tests/auto/qtextedit/qtextedit.pro
@@ -5,12 +5,15 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtextedit.cpp
-wince* {
- DEFINES += SRCDIR=\\\"./\\\"
+wince*|symbian*: {
addImages.sources = fullWidthSelection/*
addImages.path = fullWidthSelection
DEPLOYMENT += addImages
-} else {
+}
+
+wince* {
+ DEFINES += SRCDIR=\\\"./\\\"
+} !symbian {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp
index e61ff7b011..0c7ecfb498 100644
--- a/tests/auto/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/qtextedit/tst_qtextedit.cpp
@@ -73,6 +73,11 @@ Q_DECLARE_METATYPE(QList<bool>);
#include <Carbon/Carbon.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#undef QT3_SUPPORT
+#endif
+
bool nativeClipboardWorking()
{
@@ -110,13 +115,17 @@ private slots:
void autoBulletList1();
void autoBulletList2();
void preserveCharFormatAfterNewline();
+#ifndef QT_NO_CLIPBOARD
void clearMustNotChangeClipboard();
+#endif
void clearMustNotResetRootFrameMarginToDefault();
void clearShouldPreserveTheCurrentCharFormat();
void clearShouldClearExtraSelections();
void paragSeparatorOnPlaintextAppend();
void layoutingLoop();
+#ifndef QT_NO_CLIPBOARD
void selectAllSetsNotSelection();
+#endif
void asciiTab();
void setDocument();
void setDocument_shared();
@@ -129,7 +138,9 @@ private slots:
#endif
void cursorPositionChanged();
void setTextCursor();
+#ifndef QT_NO_CLIPBOARD
void undoAvailableAfterPaste();
+#endif
void undoRedoAvailableRepetition();
void appendShouldUseCurrentFormat();
void appendShouldNotTouchTheSelection();
@@ -137,7 +148,9 @@ private slots:
void shiftBackspace();
void undoRedo();
void preserveCharFormatInAppend();
+#ifndef QT_NO_CLIPBOARD
void copyAndSelectAllInReadonly();
+#endif
void ctrlAltInput();
void noPropertiesOnDefaultTextEditCharFormat();
void setPlainTextShouldUseCurrentCharFormat();
@@ -152,14 +165,18 @@ private slots:
void undoRedoAfterSetContent();
void numPadKeyNavigation();
void moveCursor();
+#ifndef QT_NO_CLIPBOARD
void mimeDataReimplementations();
+#endif
void ctrlEnterShouldInsertLineSeparator_NOT();
void shiftEnterShouldInsertLineSeparator();
void selectWordsFromStringsContainingSeparators_data();
void selectWordsFromStringsContainingSeparators();
+#ifndef QT_NO_CLIPBOARD
void canPaste();
void copyAvailable_data();
void copyAvailable();
+#endif
void ensureCursorVisibleOnInitialShow();
void setHtmlInsideResizeEvent();
void colorfulAppend();
@@ -471,6 +488,7 @@ void tst_QTextEdit::createSelection()
QCOMPARE(ed->textCursor().position(), 11);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::clearMustNotChangeClipboard()
{
if (!nativeClipboardWorking())
@@ -481,6 +499,7 @@ void tst_QTextEdit::clearMustNotChangeClipboard()
ed->clear();
QCOMPARE(QApplication::clipboard()->text(), txt);
}
+#endif
void tst_QTextEdit::clearMustNotResetRootFrameMarginToDefault()
{
@@ -544,6 +563,7 @@ void tst_QTextEdit::layoutingLoop()
QVERIFY(callsToSetPageSize < 10);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::selectAllSetsNotSelection()
{
if (!QApplication::clipboard()->supportsSelection()) {
@@ -559,7 +579,7 @@ void tst_QTextEdit::selectAllSetsNotSelection()
QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromAscii("foobar"));
}
-
+#endif
void tst_QTextEdit::asciiTab()
{
QTextEdit edit;
@@ -569,6 +589,7 @@ void tst_QTextEdit::asciiTab()
QCOMPARE(edit.toPlainText().at(0), QChar('\t'));
}
+
void tst_QTextEdit::setDocument()
{
QTextDocument *document = new QTextDocument(ed);
@@ -769,6 +790,7 @@ void tst_QTextEdit::setTextCursor()
QCOMPARE(spy.count(), 1);
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::undoAvailableAfterPaste()
{
if (!nativeClipboardWorking())
@@ -782,6 +804,7 @@ void tst_QTextEdit::undoAvailableAfterPaste()
QVERIFY(spy.count() >= 1);
QCOMPARE(ed->toPlainText(), txt);
}
+#endif
class UndoRedoRecorder : public QObject
{
@@ -988,6 +1011,7 @@ void tst_QTextEdit::preserveCharFormatInAppend()
QCOMPARE(cursor.block().text(), QString("third para"));
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::copyAndSelectAllInReadonly()
{
if (!nativeClipboardWorking())
@@ -1018,6 +1042,7 @@ void tst_QTextEdit::copyAndSelectAllInReadonly()
QTest::keyClick(ed, Qt::Key_C, Qt::ControlModifier);
QCOMPARE(QApplication::clipboard()->text(), QString("Hello World"));
}
+#endif
void tst_QTextEdit::ctrlAltInput()
{
@@ -1257,6 +1282,7 @@ void tst_QTextEdit::implicitClear()
QVERIFY(ed->toPlainText().isEmpty());
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::copyAvailable_data()
{
QTest::addColumn<pairListType>("keystrokes");
@@ -1374,6 +1400,7 @@ void tst_QTextEdit::copyAvailable()
QVERIFY2(variantSpyCopyAvailable.toBool() == copyAvailable.at(i), QString("Spied singnal: %1").arg(i).toLatin1());
}
}
+#endif
void tst_QTextEdit::undoRedoAfterSetContent()
{
@@ -1439,6 +1466,7 @@ public:
};
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::mimeDataReimplementations()
{
MyTextEdit ed;
@@ -1475,6 +1503,7 @@ void tst_QTextEdit::mimeDataReimplementations()
QCOMPARE(ed.canInsertCallCount, 1);
QCOMPARE(ed.insertCallCount, 1);
}
+#endif
void tst_QTextEdit::ctrlEnterShouldInsertLineSeparator_NOT()
{
@@ -1526,6 +1555,7 @@ void tst_QTextEdit::selectWordsFromStringsContainingSeparators()
cursor.clearSelection();
}
+#ifndef QT_NO_CLIPBOARD
void tst_QTextEdit::canPaste()
{
if (!nativeClipboardWorking())
@@ -1538,6 +1568,7 @@ void tst_QTextEdit::canPaste()
ed->setTextInteractionFlags(Qt::NoTextInteraction);
QVERIFY(!ed->canPaste());
}
+#endif
void tst_QTextEdit::ensureCursorVisibleOnInitialShow()
{
diff --git a/tests/auto/qtextlayout/qtextlayout.pro b/tests/auto/qtextlayout/qtextlayout.pro
index 2da4d8a784..381f09e5e9 100644
--- a/tests/auto/qtextlayout/qtextlayout.pro
+++ b/tests/auto/qtextlayout/qtextlayout.pro
@@ -3,4 +3,7 @@ HEADERS +=
SOURCES += tst_qtextlayout.cpp
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
+symbian {
+ TARGET.EPOCHEAPSIZE = 100000 20000000
+}
diff --git a/tests/auto/qtextodfwriter/qtextodfwriter.pro b/tests/auto/qtextodfwriter/qtextodfwriter.pro
index 3c40d67c9c..2689894dad 100644
--- a/tests/auto/qtextodfwriter/qtextodfwriter.pro
+++ b/tests/auto/qtextodfwriter/qtextodfwriter.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
SOURCES += tst_qtextodfwriter.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private
diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
index f92e30f55e..642588e676 100644
--- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -47,6 +47,10 @@
#include <QBuffer>
#include <QDebug>
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "."
+#endif
+
#include <private/qtextodfwriter_p.h>
class tst_QTextOdfWriter : public QObject
diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro
index bae7717aa1..b24708c86f 100644
--- a/tests/auto/qtextstream/test/test.pro
+++ b/tests/auto/qtextstream/test/test.pro
@@ -17,15 +17,20 @@ contains(QT_CONFIG, qt3support):QT += qt3support
QT = core network
-wince*: {
+wince*|symbian: {
addFiles.sources = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp
addFiles.path = .
res.sources = ../resources
res.path = .
DEPLOYMENT += addFiles
+}
+
+wince*: {
DEFINES += SRCDIR=\\\"\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/../\\\"
+}else:symbian {
+ # Symbian can't define SRCDIR meaningfully here
+}else {
+ DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp
index 358b4b6024..d70f6780f6 100644
--- a/tests/auto/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/qtextstream/tst_qtextstream.cpp
@@ -41,7 +41,7 @@
/*-*-encoding:latin1-*-*/
-#include <iostream>
+//#include <iostream>
//using namespace std;
#include <QtTest/QtTest>
@@ -76,6 +76,10 @@ QT_END_NAMESPACE
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
class tst_QTextStream : public QObject
{
Q_OBJECT
@@ -472,7 +476,7 @@ tst_QTextStream::tst_QTextStream()
}
tst_QTextStream::~tst_QTextStream()
-{
+{
}
void tst_QTextStream::init()
@@ -1228,7 +1232,11 @@ void tst_QTextStream::stillOpenWhenAtEnd()
#endif
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 143);
+#if defined(Q_OS_SYMBIAN)
+ QVERIFY(socket.waitForReadyRead(30000));
+#else
QVERIFY(socket.waitForReadyRead(5000));
+#endif
QTextStream stream2(&socket);
while (!stream2.readLine().isNull()) {}
@@ -1471,8 +1479,8 @@ void tst_QTextStream::pos2()
// ------------------------------------------------------------------------------
void tst_QTextStream::readStdin()
{
-#ifdef Q_OS_WINCE
- QSKIP("Qt/CE has no stdin/out", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("stdinProcess/stdinProcess");
@@ -1497,8 +1505,8 @@ void tst_QTextStream::readStdin()
// ------------------------------------------------------------------------------
void tst_QTextStream::readAllFromStdin()
{
-#ifdef Q_OS_WINCE
- QSKIP("Qt/CE has no stdin/out", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
@@ -1518,8 +1526,8 @@ void tst_QTextStream::readAllFromStdin()
// ------------------------------------------------------------------------------
void tst_QTextStream::readLineFromStdin()
{
-#ifdef Q_OS_WINCE
- QSKIP("Qt/CE has no stdin/out", SkipAll);
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
@@ -4279,7 +4287,7 @@ void tst_QTextStream::int_write_with_locale()
// like QTEST_APPLESS_MAIN, but initialising the locale on Unix
int main(int argc, char *argv[])
{
-#ifdef Q_OS_UNIX
+#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
extern bool qt_locale_initialized;
::setlocale(LC_ALL, "");
qt_locale_initialized = true;
diff --git a/tests/auto/qthread/qthread.pro b/tests/auto/qthread/qthread.pro
index c4d4f2a55e..4ea8fe543f 100644
--- a/tests/auto/qthread/qthread.pro
+++ b/tests/auto/qthread/qthread.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthread.cpp
QT = core
-
-
+symbian*:LIBS += -llibpthread
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp
index 235d63b7a0..239328e518 100644
--- a/tests/auto/qthread/tst_qthread.cpp
+++ b/tests/auto/qthread/tst_qthread.cpp
@@ -892,7 +892,7 @@ void tst_QThread::stressTest()
while (t.elapsed() < one_minute) {
Current_Thread t;
t.start();
- t.wait();
+ t.wait(one_minute);
}
}
diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro
index f4f57009ab..376ba654d6 100644
--- a/tests/auto/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/qthreadstorage/qthreadstorage.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthreadstorage.cpp
QT = core
-
-
+symbian*:LIBS += -llibpthread
diff --git a/tests/auto/qtime/qtime.pro b/tests/auto/qtime/qtime.pro
index 93fc74cf97..88277a001f 100644
--- a/tests/auto/qtime/qtime.pro
+++ b/tests/auto/qtime/qtime.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
-
SOURCES += tst_qtime.cpp
QT = core
-
-
diff --git a/tests/auto/qtimeline/qtimeline.pro b/tests/auto/qtimeline/qtimeline.pro
index 57d67a8373..78204552e5 100644
--- a/tests/auto/qtimeline/qtimeline.pro
+++ b/tests/auto/qtimeline/qtimeline.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
QT = core
SOURCES += tst_qtimeline.cpp
-
-
+QT = core
diff --git a/tests/auto/qtimer/qtimer.pro b/tests/auto/qtimer/qtimer.pro
index a16035fd19..79ae7dbd0b 100644
--- a/tests/auto/qtimer/qtimer.pro
+++ b/tests/auto/qtimer/qtimer.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
QT = core
SOURCES += tst_qtimer.cpp
-
-
+QT = core
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index bffb4f24da..0051a9b1e2 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -84,6 +84,8 @@ private slots:
void deleteLaterOnQTimer(); // long name, don't want to shadow QObject::deleteLater()
void moveToThread();
void restartedTimerFiresTooSoon();
+ void timerFiresOnlyOncePerProcessEvents_data();
+ void timerFiresOnlyOncePerProcessEvents();
};
class TimerHelper : public QObject
@@ -248,7 +250,7 @@ void tst_QTimer::livelock()
#if defined(Q_OS_MAC)
QEXPECT_FAIL("zero timer", "Posted events source are handled AFTER timers", Continue);
QEXPECT_FAIL("non-zero timer", "Posted events source are handled AFTER timers", Continue);
-#elif defined(Q_OS_UNIX)
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QEXPECT_FAIL("zero timer", "", Continue);
QEXPECT_FAIL("non-zero timer", "", Continue);
#elif defined(Q_OS_WIN)
@@ -480,6 +482,55 @@ void tst_QTimer::restartedTimerFiresTooSoon()
QVERIFY(object.eventLoop.exec() == 0);
}
+class LongLastingSlotClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ LongLastingSlotClass(QTimer *timer) : count(0), timer(timer) {}
+
+public slots:
+ void longLastingSlot()
+ {
+ // Don't use timers for this, because we are testing them.
+ QTime time;
+ time.start();
+ while (time.elapsed() < 200) {
+ for (int c = 0; c < 100000; c++) {} // Mindless looping.
+ }
+ if (++count >= 2) {
+ timer->stop();
+ }
+ }
+
+public:
+ int count;
+ QTimer *timer;
+};
+
+void tst_QTimer::timerFiresOnlyOncePerProcessEvents_data()
+{
+ QTest::addColumn<int>("interval");
+ QTest::newRow("zero timer") << 0;
+ QTest::newRow("non-zero timer") << 10;
+}
+
+void tst_QTimer::timerFiresOnlyOncePerProcessEvents()
+{
+ QFETCH(int, interval);
+
+ QTimer t;
+ LongLastingSlotClass longSlot(&t);
+ t.start(interval);
+ connect(&t, SIGNAL(timeout()), &longSlot, SLOT(longLastingSlot()));
+ // Loop because there may be other events pending.
+ while (longSlot.count == 0) {
+ QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
+ }
+
+ QCOMPARE(longSlot.count, 1);
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
\
diff --git a/tests/auto/qtransform/qtransform.pro b/tests/auto/qtransform/qtransform.pro
index 7cba3dbb52..298feb2034 100644
--- a/tests/auto/qtransform/qtransform.pro
+++ b/tests/auto/qtransform/qtransform.pro
@@ -2,6 +2,6 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qtransform.cpp
-unix:!mac:LIBS+=-lm
+unix:!mac:!symbian*:LIBS+=-lm
diff --git a/tests/auto/qtransformedscreen/qtransformedscreen.pro b/tests/auto/qtransformedscreen/qtransformedscreen.pro
index 6914054de3..39e3700591 100644
--- a/tests/auto/qtransformedscreen/qtransformedscreen.pro
+++ b/tests/auto/qtransformedscreen/qtransformedscreen.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
SOURCES += tst_qtransformedscreen.cpp
+QT = core
embedded:!contains(gfx-drivers, transformed) {
LIBS += ../../../plugins/gfxdrivers/libqgfxtransformed.so
diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro
index 0d67f707ab..30ffc1c25d 100644
--- a/tests/auto/qtranslator/qtranslator.pro
+++ b/tests/auto/qtranslator/qtranslator.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qtranslator.cpp
-wince*: {
+wince*|symbian*: {
addFiles.sources = hellotr_la.qm msgfmt_from_po.qm
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 655ea4eb5a..3612f2e495 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -51,7 +51,9 @@
//TESTED_FILES=
Q_DECLARE_METATYPE(QModelIndex)
+#ifndef QT_NO_DRAGANDDROP
Q_DECLARE_METATYPE(QAbstractItemView::DragDropMode)
+#endif
Q_DECLARE_METATYPE(QAbstractItemView::EditTriggers)
Q_DECLARE_METATYPE(QAbstractItemView::EditTrigger)
@@ -137,11 +139,13 @@ private slots:
void alternatingRowColors();
void currentIndex_data();
void currentIndex();
+#ifndef QT_NO_DRAGANDDROP
void dragDropMode_data();
void dragDropMode();
void dragDropModeFromDragEnabledAndAcceptDrops_data();
void dragDropModeFromDragEnabledAndAcceptDrops();
void dragDropOverwriteMode();
+#endif
void editTriggers_data();
void editTriggers();
void hasAutoScroll();
@@ -465,9 +469,11 @@ void tst_QTreeView::construction()
// QAbstractItemView properties
QVERIFY(!view.alternatingRowColors());
QCOMPARE(view.currentIndex(), QModelIndex());
+#ifndef QT_NO_DRAGANDDROP
QCOMPARE(view.dragDropMode(), QAbstractItemView::NoDragDrop);
QVERIFY(!view.dragDropOverwriteMode());
QVERIFY(!view.dragEnabled());
+#endif
QCOMPARE(view.editTriggers(), QAbstractItemView::EditKeyPressed | QAbstractItemView::DoubleClicked);
QVERIFY(view.hasAutoScroll());
QCOMPARE(view.horizontalScrollMode(), QAbstractItemView::ScrollPerPixel);
@@ -486,7 +492,9 @@ void tst_QTreeView::construction()
QCOMPARE(view.selectionBehavior(), QAbstractItemView::SelectRows);
QCOMPARE(view.selectionMode(), QAbstractItemView::SingleSelection);
QVERIFY(!view.selectionModel());
+#ifndef QT_NO_DRAGANDDROP
QVERIFY(view.showDropIndicator());
+#endif
QCOMPARE(view.QAbstractItemView::sizeHintForColumn(-1), -1); // <- protected in QTreeView
QCOMPARE(view.QAbstractItemView::sizeHintForColumn(0), -1); // <- protected in QTreeView
QCOMPARE(view.QAbstractItemView::sizeHintForColumn(1), -1); // <- protected in QTreeView
@@ -593,12 +601,13 @@ void tst_QTreeView::currentIndex()
// ### Test child and grandChild indexes.
}
+#ifndef QT_NO_DRAGANDDROP
+
void tst_QTreeView::dragDropMode_data()
{
QTest::addColumn<QAbstractItemView::DragDropMode>("dragDropMode");
QTest::addColumn<bool>("acceptDrops");
QTest::addColumn<bool>("dragEnabled");
-
QTest::newRow("NoDragDrop") << QAbstractItemView::NoDragDrop << false << false;
QTest::newRow("DragOnly") << QAbstractItemView::DragOnly << false << true;
QTest::newRow("DropOnly") << QAbstractItemView::DropOnly << true << false;
@@ -693,6 +702,7 @@ void tst_QTreeView::dragDropOverwriteMode()
// QTableWidget, from their reimplementations of dropMimeData(). Hard to
// test.
}
+#endif
void tst_QTreeView::editTriggers_data()
{
diff --git a/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
index e4572c02d1..fa16c9d8b4 100644
--- a/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
+++ b/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
@@ -925,7 +925,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags()
QFETCH(int, iteratorflags);
QFETCH(QStringList, matches);
- QTreeWidgetItemIterator it(testWidget, (QTreeWidgetItemIterator::IteratorFlags)iteratorflags);
+ QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
it+=start;
int iMatch = 0;
while (*it && iMatch < matches.count()) {
@@ -1000,7 +1000,7 @@ void tst_QTreeWidgetItemIterator::plus_eq()
QFETCH(int, iteratorflags);
QFETCH(QString, expecteditem);
- QTreeWidgetItemIterator it(testWidget, (QTreeWidgetItemIterator::IteratorFlags)iteratorflags);
+ QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
it+=start;
it+=addition;
QTreeWidgetItem *item = *it;
@@ -1033,7 +1033,7 @@ void tst_QTreeWidgetItemIterator::minus_eq()
QFETCH(int, iteratorflags);
QFETCH(QString, expecteditem);
- QTreeWidgetItemIterator it(testWidget, (QTreeWidgetItemIterator::IteratorFlags)iteratorflags);
+ QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
it+=start;
it-=subtraction;
QTreeWidgetItem *item = *it;
@@ -1112,10 +1112,10 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
}
}
- QTreeWidgetItemIterator it(&tw, (QTreeWidgetItemIterator::IteratorFlags)iteratorflags);
+ QTreeWidgetItemIterator it(&tw, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
it+=expecteditemindex;
QTreeWidgetItem *item = 0;
- QTreeWidgetItemIterator itRemove(&tw, (QTreeWidgetItemIterator::IteratorFlags)iteratorflags);
+ QTreeWidgetItemIterator itRemove(&tw, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
itRemove+=removeindex;
item = *itRemove;
QVERIFY(item);
diff --git a/tests/auto/qtwidgets/qtwidgets.pro b/tests/auto/qtwidgets/qtwidgets.pro
index ad5e7acc18..b762acb434 100644
--- a/tests/auto/qtwidgets/qtwidgets.pro
+++ b/tests/auto/qtwidgets/qtwidgets.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
+symbian*:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
SOURCES += tst_qtwidgets.cpp mainwindow.cpp
HEADERS += mainwindow.h
diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro
index 2444dac816..2e0a020543 100644
--- a/tests/auto/qudpsocket/test/test.pro
+++ b/tests/auto/qudpsocket/test/test.pro
@@ -15,7 +15,7 @@ win32 {
DESTDIR = ../
}
-wince*: {
+wince*|symbian*: {
addApp.sources = ../clientserver/clientserver.exe
addApp.path = clientserver
DEPLOYMENT += addApp
diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp
index e79be38804..621acbb4d3 100644
--- a/tests/auto/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp
@@ -105,11 +105,11 @@ protected slots:
tst_QUdpSocket::tst_QUdpSocket()
{
+ Q_SET_DEFAULT_IAP
}
tst_QUdpSocket::~tst_QUdpSocket()
{
-
}
void tst_QUdpSocket::initTestCase_data()
@@ -207,7 +207,7 @@ void tst_QUdpSocket::broadcasting()
#ifdef TEST_QNETWORK_PROXY
QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
- QSKIP("With socks5 Broadcast is not supported.", SkipAll);
+ QSKIP("With socks5 Broadcast is not supported.", SkipSingle);
}
#endif
}
@@ -228,7 +228,7 @@ void tst_QUdpSocket::broadcasting()
for (int j = 0; j < 100; ++j) {
broadcastSocket.writeDatagram(message[i], strlen(message[i]),
- QHostAddress::Broadcast, 5000);
+ QHostAddress::Broadcast, 5000);
QTestEventLoop::instance().enterLoop(15);
if (QTestEventLoop::instance().timeout()) {
#if defined(Q_OS_FREEBSD)
@@ -320,6 +320,9 @@ void tst_QUdpSocket::ipv6Loop_data()
void tst_QUdpSocket::ipv6Loop()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian IPv6 is not yet supported", SkipAll);
+#endif
QFETCH(QByteArray, peterMessage);
QFETCH(QByteArray, paulMessage);
QFETCH(bool, success);
@@ -479,6 +482,22 @@ void tst_QUdpSocket::writeDatagram()
void tst_QUdpSocket::performance()
{
+#if defined(Q_OS_SYMBIAN)
+ // Large packets seems not to go through on Symbian
+ // Reason might be also fragmentation due to VPN connection etc
+
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH_GLOBAL(int, proxyType);
+
+ int arrSize = 8192;
+ if (setProxy && proxyType == QNetworkProxy::Socks5Proxy)
+ arrSize = 1024;
+
+ QByteArray arr(arrSize, '@');
+#else
+ QByteArray arr(8192, '@');
+#endif // Q_OS_SYMBIAN
+
QUdpSocket server;
QVERIFY2(server.bind(), server.errorString().toLatin1().constData());
@@ -488,15 +507,13 @@ void tst_QUdpSocket::performance()
QUdpSocket client;
client.connectToHost(serverAddress, server.localPort());
-
- QByteArray arr(8192, '@');
-
+
QTime stopWatch;
stopWatch.start();
qint64 nbytes = 0;
while (stopWatch.elapsed() < 5000) {
- for (int i = 0; i < 100; ++i) {
+ for (int i = 0; i < 100; ++i) {
if (client.write(arr.data(), arr.size()) > 0) {
do {
nbytes += server.readDatagram(arr.data(), arr.size());
@@ -508,6 +525,14 @@ void tst_QUdpSocket::performance()
float secs = stopWatch.elapsed() / 1000.0;
qDebug("\t%.2fMB/%.2fs: %.2fMB/s", float(nbytes / (1024.0*1024.0)),
secs, float(nbytes / (1024.0*1024.0)) / secs);
+
+#if defined(Q_OS_SYMBIAN)
+ if(nbytes == 0) {
+ qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK");
+ qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect");
+ }
+#endif
+
}
void tst_QUdpSocket::bindMode()
@@ -526,8 +551,49 @@ void tst_QUdpSocket::bindMode()
QVERIFY2(socket.bind(), socket.errorString().toLatin1().constData());
QUdpSocket socket2;
QVERIFY(!socket2.bind(socket.localPort()));
-
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_SYMBIAN)
+
+ //RPRocess me;
+ if(RProcess().HasCapability(ECapabilityNetworkControl)) {
+ qDebug("Test executed *with* NetworkControl capability");
+ // In Symbian OS ReuseAddressHint together with NetworkControl capability
+ // gives application *always* right to bind to port. I.e. it does not matter
+ // if first socket was bound with any bind flag. Since autotests in Symbian
+ // are currently executed with ALL -TCB rights, this path is the one executed.
+ QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
+ socket.close();
+ socket2.close();
+
+ QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
+ QVERIFY(!socket2.bind(socket.localPort()));
+ QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData());
+ socket.close();
+ socket2.close();
+
+ QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData());
+ QVERIFY(!socket2.bind(socket.localPort()));
+ QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
+ socket.close();
+ socket2.close();
+ } else {
+ qDebug("Test executed *without* NetworkControl capability");
+ // If we don't have NetworkControl capability, attempt to bind already bound
+ // address will *always* fail. I.e. it does not matter if first socket was
+ // bound with any bind flag.
+ QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
+ socket.close();
+
+ QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
+ QVERIFY(!socket2.bind(socket.localPort()));
+ QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData());
+ socket.close();
+
+ QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData());
+ QVERIFY(!socket2.bind(socket.localPort()));
+ QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
+ socket.close();
+ }
+#elif defined(Q_OS_UNIX)
QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
socket.close();
QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
@@ -535,6 +601,7 @@ void tst_QUdpSocket::bindMode()
socket2.close();
QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData());
#else
+
// Depending on the user's privileges, this or will succeed or
// fail. Admins are allowed to reuse the address, but nobody else.
if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData())
@@ -554,13 +621,16 @@ void tst_QUdpSocket::writeDatagramToNonExistingPeer_data()
QTest::addColumn<bool>("bind");
QTest::addColumn<QHostAddress>("peerAddress");
QHostAddress localhost(QHostAddress::LocalHost);
+#if !defined(Q_OS_SYMBIAN)
QHostAddress remote = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first();
+#endif
QTest::newRow("localhost-unbound") << false << localhost;
QTest::newRow("localhost-bound") << true << localhost;
-
+#if !defined(Q_OS_SYMBIAN)
QTest::newRow("remote-unbound") << false << remote;
QTest::newRow("remote-bound") << true << remote;
+#endif
}
void tst_QUdpSocket::writeDatagramToNonExistingPeer()
@@ -583,11 +653,14 @@ void tst_QUdpSocket::writeToNonExistingPeer_data()
{
QTest::addColumn<QHostAddress>("peerAddress");
QHostAddress localhost(QHostAddress::LocalHost);
+#if !defined(Q_OS_SYMBIAN)
QHostAddress remote = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first();
-
+#endif
// write (required to be connected)
QTest::newRow("localhost") << localhost;
+#if !defined(Q_OS_SYMBIAN)
QTest::newRow("remote") << remote;
+#endif
}
void tst_QUdpSocket::writeToNonExistingPeer()
@@ -638,8 +711,8 @@ void tst_QUdpSocket::writeToNonExistingPeer()
void tst_QUdpSocket::outOfProcessConnectedClientServerTest()
{
-#if defined(Q_OS_WINCE)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE.", SkipAll);
+#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
+ QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE and Symbian).", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
@@ -698,8 +771,8 @@ void tst_QUdpSocket::outOfProcessConnectedClientServerTest()
void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest()
{
-#if defined(Q_OS_WINCE)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE.", SkipAll);
+#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
+ QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE and Symbian).", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
@@ -780,4 +853,4 @@ void tst_QUdpSocket::zeroLengthDatagram()
}
QTEST_MAIN(tst_QUdpSocket)
-#include "tst_qudpsocket.moc"
+#include "test/tmp/tst_qudpsocket.moc"
diff --git a/tests/auto/qudpsocket/udpServer/udpServer.pro b/tests/auto/qudpsocket/udpServer/udpServer.pro
index f04833c9a1..7438d40fb0 100644
--- a/tests/auto/qudpsocket/udpServer/udpServer.pro
+++ b/tests/auto/qudpsocket/udpServer/udpServer.pro
@@ -3,4 +3,5 @@ QT = core network
CONFIG -= app_bundle
CONFIG += console
+symbian:TARGET.CAPABILITY="ALL -TCB"
diff --git a/tests/auto/qurl/qurl.pro b/tests/auto/qurl/qurl.pro
index c3b1543a92..72c93bc696 100644
--- a/tests/auto/qurl/qurl.pro
+++ b/tests/auto/qurl/qurl.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qurl.cpp
-
-QT -= gui
-
-
+QT = core
diff --git a/tests/auto/quuid/quuid.pro b/tests/auto/quuid/quuid.pro
index 6f3f9f21a5..f7608fa377 100644
--- a/tests/auto/quuid/quuid.pro
+++ b/tests/auto/quuid/quuid.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
QT = core
SOURCES += tst_quuid.cpp
-
-
-
diff --git a/tests/auto/qvariant/qvariant.pro b/tests/auto/qvariant/qvariant.pro
index 747b6c3d93..2c9c8d76b1 100644
--- a/tests/auto/qvariant/qvariant.pro
+++ b/tests/auto/qvariant/qvariant.pro
@@ -1,6 +1,5 @@
load(qttest_p4)
SOURCES += tst_qvariant.cpp
-
QT += network
contains(QT_CONFIG, qt3support): QT += qt3support
diff --git a/tests/auto/qvarlengtharray/qvarlengtharray.pro b/tests/auto/qvarlengtharray/qvarlengtharray.pro
index 20bf7b7b6b..7a02790578 100644
--- a/tests/auto/qvarlengtharray/qvarlengtharray.pro
+++ b/tests/auto/qvarlengtharray/qvarlengtharray.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
QT = core
SOURCES += tst_qvarlengtharray.cpp
-
-
+QT = core
diff --git a/tests/auto/qvector/qvector.pro b/tests/auto/qvector/qvector.pro
index 81382729d4..4ff389c5e8 100644
--- a/tests/auto/qvector/qvector.pro
+++ b/tests/auto/qvector/qvector.pro
@@ -1,6 +1,4 @@
load(qttest_p4)
QT = core
SOURCES += tst_qvector.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
index 1e0136f4cb..ce3ac1ec6e 100644
--- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
@@ -47,6 +47,12 @@
#include <qthread.h>
#include <qwaitcondition.h>
+#if defined(Q_OS_SYMBIAN)
+// Symbian Open C has a bug that causes very short waits to fail sometimes
+#define COND_WAIT_TIME 50
+#else
+#define COND_WAIT_TIME 1
+#endif
//TESTED_CLASS=
@@ -283,8 +289,8 @@ void tst_QWaitCondition::wait_QReadWriteLock()
int x;
for (int i = 0; i < iterations; ++i) {
{
- QReadWriteLock readWriteLock;
- QWaitCondition waitCondition;
+ QReadWriteLock readWriteLock;
+ QWaitCondition waitCondition;
readWriteLock.lockForRead();
@@ -297,8 +303,8 @@ void tst_QWaitCondition::wait_QReadWriteLock()
readWriteLock.unlock();
}
- {
- QReadWriteLock readWriteLock;
+ {
+ QReadWriteLock readWriteLock;
QWaitCondition waitCondition;
readWriteLock.lockForWrite();
@@ -320,7 +326,12 @@ void tst_QWaitCondition::wait_QReadWriteLock()
thread[x].readWriteLock.lockForRead();
thread[x].start();
// wait for thread to start
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_WINSCW)
+ // Symbian emulator startup simultaneously with this thread causes additional delay
+ QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000));
+#else
QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000));
+#endif
thread[x].readWriteLock.unlock();
}
@@ -448,7 +459,7 @@ void tst_QWaitCondition::wakeOne()
QMutex mutex;
QWaitCondition cond;
- // QMutex
+ // QMutex
wake_Thread thread[ThreadCount];
bool thread_exited[ThreadCount];
@@ -460,9 +471,9 @@ void tst_QWaitCondition::wakeOne()
thread[x].start();
// wait for thread to start
QVERIFY(thread[x].started.wait(&mutex, 1000));
- // make sure wakeups are not queued... if nothing is
- // waiting at the time of the wakeup, nothing happens
- QVERIFY(!thread[x].dummy.wait(&mutex, 1));
+ // make sure wakeups are not queued... if nothing is
+ // waiting at the time of the wakeup, nothing happens
+ QVERIFY(!thread[x].dummy.wait(&mutex, 1));
}
mutex.unlock();
@@ -472,18 +483,18 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
mutex.lock();
cond.wakeOne();
- QVERIFY(!cond.wait(&mutex, 1));
- QVERIFY(!thread[x].dummy.wait(&mutex, 1));
+ QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME));
+ QVERIFY(!thread[x].dummy.wait(&mutex, 1));
mutex.unlock();
int exited = 0;
for (int y = 0; y < ThreadCount; ++y) {
- if (thread_exited[y])
- continue;
- if (thread[y].wait(exited > 0 ? 1 : 1000)) {
- thread_exited[y] = TRUE;
- ++exited;
- }
+ if (thread_exited[y])
+ continue;
+ if (thread[y].wait(exited > 0 ? 1 : 1000)) {
+ thread_exited[y] = TRUE;
+ ++exited;
+ }
}
QCOMPARE(exited, 1);
@@ -492,11 +503,11 @@ void tst_QWaitCondition::wakeOne()
QCOMPARE(wake_Thread::count, 0);
- // QReadWriteLock
- QReadWriteLock readWriteLock;
- wake_Thread_2 rwthread[ThreadCount];
+ // QReadWriteLock
+ QReadWriteLock readWriteLock;
+ wake_Thread_2 rwthread[ThreadCount];
- readWriteLock.lockForWrite();
+ readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
@@ -504,9 +515,9 @@ void tst_QWaitCondition::wakeOne()
rwthread[x].start();
// wait for thread to start
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
- // make sure wakeups are not queued... if nothing is
- // waiting at the time of the wakeup, nothing happens
- QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
+ // make sure wakeups are not queued... if nothing is
+ // waiting at the time of the wakeup, nothing happens
+ QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
}
readWriteLock.unlock();
@@ -516,18 +527,18 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
readWriteLock.lockForWrite();
cond.wakeOne();
- QVERIFY(!cond.wait(&readWriteLock, 1));
- QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
+ QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME));
+ QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
readWriteLock.unlock();
int exited = 0;
for (int y = 0; y < ThreadCount; ++y) {
- if (thread_exited[y])
- continue;
- if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
- thread_exited[y] = TRUE;
- ++exited;
- }
+ if (thread_exited[y])
+ continue;
+ if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
+ thread_exited[y] = TRUE;
+ ++exited;
+ }
}
QCOMPARE(exited, 1);
@@ -554,9 +565,9 @@ void tst_QWaitCondition::wakeOne()
thread[x].start();
// wait for thread to start
QVERIFY(thread[x].started.wait(&mutex, 1000));
- // make sure wakeups are not queued... if nothing is
- // waiting at the time of the wakeup, nothing happens
- QVERIFY(!thread[x].dummy.wait(&mutex, 1));
+ // make sure wakeups are not queued... if nothing is
+ // waiting at the time of the wakeup, nothing happens
+ QVERIFY(!thread[x].dummy.wait(&mutex, 1));
}
mutex.unlock();
@@ -567,19 +578,19 @@ void tst_QWaitCondition::wakeOne()
mutex.lock();
cond.wakeOne();
cond.wakeOne();
- QVERIFY(!cond.wait(&mutex, 1));
- QVERIFY(!thread[x].dummy.wait(&mutex, 1));
- QVERIFY(!thread[x + 1].dummy.wait(&mutex, 1));
+ QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME));
+ QVERIFY(!thread[x].dummy.wait(&mutex, 1));
+ QVERIFY(!thread[x + 1].dummy.wait(&mutex, 1));
mutex.unlock();
int exited = 0;
for (int y = 0; y < ThreadCount; ++y) {
- if (thread_exited[y])
- continue;
- if (thread[y].wait(exited > 0 ? 1 : 1000)) {
- thread_exited[y] = TRUE;
- ++exited;
- }
+ if (thread_exited[y])
+ continue;
+ if (thread[y].wait(exited > 0 ? 1 : 1000)) {
+ thread_exited[y] = TRUE;
+ ++exited;
+ }
}
QCOMPARE(exited, 2);
@@ -600,9 +611,9 @@ void tst_QWaitCondition::wakeOne()
rwthread[x].start();
// wait for thread to start
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
- // make sure wakeups are not queued... if nothing is
- // waiting at the time of the wakeup, nothing happens
- QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
+ // make sure wakeups are not queued... if nothing is
+ // waiting at the time of the wakeup, nothing happens
+ QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
}
readWriteLock.unlock();
@@ -613,19 +624,19 @@ void tst_QWaitCondition::wakeOne()
readWriteLock.lockForWrite();
cond.wakeOne();
cond.wakeOne();
- QVERIFY(!cond.wait(&readWriteLock, 1));
- QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
- QVERIFY(!rwthread[x + 1].dummy.wait(&readWriteLock, 1));
+ QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME));
+ QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1));
+ QVERIFY(!rwthread[x + 1].dummy.wait(&readWriteLock, 1));
readWriteLock.unlock();
int exited = 0;
for (int y = 0; y < ThreadCount; ++y) {
- if (thread_exited[y])
- continue;
- if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
- thread_exited[y] = TRUE;
- ++exited;
- }
+ if (thread_exited[y])
+ continue;
+ if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
+ thread_exited[y] = TRUE;
+ ++exited;
+ }
}
QCOMPARE(exited, 2);
@@ -643,7 +654,7 @@ void tst_QWaitCondition::wakeAll()
QMutex mutex;
QWaitCondition cond;
- // QMutex
+ // QMutex
wake_Thread thread[ThreadCount];
mutex.lock();
@@ -661,7 +672,7 @@ void tst_QWaitCondition::wakeAll()
// wake up all threads at once
mutex.lock();
cond.wakeAll();
- QVERIFY(!cond.wait(&mutex, 1));
+ QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME));
mutex.unlock();
int exited = 0;
@@ -673,8 +684,8 @@ void tst_QWaitCondition::wakeAll()
QCOMPARE(exited, ThreadCount);
QCOMPARE(wake_Thread::count, 0);
- // QReadWriteLock
- QReadWriteLock readWriteLock;
+ // QReadWriteLock
+ QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
readWriteLock.lockForWrite();
@@ -692,10 +703,10 @@ void tst_QWaitCondition::wakeAll()
// wake up all threads at once
readWriteLock.lockForWrite();
cond.wakeAll();
- QVERIFY(!cond.wait(&readWriteLock, 1));
+ QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME));
readWriteLock.unlock();
- exited = 0;
+ exited = 0;
for (x = 0; x < ThreadCount; ++x) {
if (rwthread[x].wait(1000))
++exited;
diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro
index d394400e4a..59c1753751 100644
--- a/tests/auto/qwidget/qwidget.pro
+++ b/tests/auto/qwidget/qwidget.pro
@@ -14,4 +14,8 @@ LIBS += -framework Security -framework AppKit
OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
}
-!wince*:win32: LIBS += -luser32 -lgdi32
+symbian {
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+}
+
+!wince*:!symbian:win32: LIBS += -luser32 -lgdi32
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 5afaebf1f3..95dc12b9ff 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -68,6 +68,13 @@
#include <qmainwindow.h>
#include <QtGui/qpaintengine.h>
+#ifdef Q_WS_S60
+#include <avkon.hrh> // EEikStatusPaneUidTitle
+#include <akntitle.h> // CAknTitlePane
+#include <akncontext.h> // CAknContextPane
+#include <eikspane.h> // CEikStatusPane
+#endif
+
#ifdef Q_WS_QWS
# include <qscreen_qws.h>
#endif
@@ -1073,6 +1080,9 @@ void tst_QWidget::enabledPropagation()
void tst_QWidget::acceptDropsPropagation()
{
+#ifdef QT_NO_DRAGANDDROP
+ QSKIP("Drag'n drop disabled in this build", SkipAll);
+#else
QWidget *childWidget = new QWidget(testWidget);
childWidget->show();
QVERIFY(!testWidget->acceptDrops());
@@ -1116,6 +1126,7 @@ void tst_QWidget::acceptDropsPropagation()
QVERIFY(childWidget->acceptDrops());
QVERIFY(!grandChildWidget->acceptDrops());
QVERIFY(grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered));
+#endif
}
void tst_QWidget::isEnabledTo()
@@ -1403,7 +1414,7 @@ void tst_QWidget::mapFromAndTo()
subWindow2->setGeometry(75, 75, 100, 100);
subSubWindow->setGeometry(10, 10, 10, 10);
-#ifndef Q_OS_WINCE //still no proper minimizing
+#if !defined (Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) //still no proper minimizing
//update visibility
if (windowMinimized) {
if (!windowHidden) {
@@ -1796,6 +1807,9 @@ void tst_QWidget::windowState()
pos = QPoint(10,10);
size = QSize(100,100);
}
+#elif defined(Q_WS_S60)
+ QPoint pos = QPoint(10,10);
+ QSize size = QSize(100,100);
#else
const QPoint pos(500, 500);
const QSize size(200, 200);
@@ -1910,7 +1924,7 @@ void tst_QWidget::showMaximized()
layouted.showNormal();
QVERIFY(!(layouted.windowState() & Qt::WindowMaximized));
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined(Q_WS_S60)
//embedded may choose a different size to fit on the screen.
QCOMPARE(layouted.size(), layouted.sizeHint());
#endif
@@ -1951,6 +1965,13 @@ void tst_QWidget::showMaximized()
QVERIFY(widget.isMaximized());
}
+ {
+ QWidget widget;
+ widget.setGeometry(0, 0, 10, 10);
+ widget.showMaximized();
+ QVERIFY(widget.size().width() > 20 && widget.size().height() > 20);
+ }
+
#ifdef QT3_SUPPORT
#if !defined(Q_WS_QWS)
//embedded respects max/min sizes by design -- maybe wrong design, but that's the way it is now.
@@ -2002,7 +2023,7 @@ void tst_QWidget::showFullScreen()
layouted.showNormal();
QVERIFY(!(layouted.windowState() & Qt::WindowFullScreen));
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined (Q_WS_S60)
//embedded may choose a different size to fit on the screen.
QCOMPARE(layouted.size(), layouted.sizeHint());
#endif
@@ -3336,6 +3357,9 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
+#if defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
+#endif
QCOMPARE(QApplication::widgetAt(100,100)->objectName(), w1->objectName());
QCOMPARE(QApplication::widgetAt(101,101)->objectName(), w2->objectName());
@@ -3351,6 +3375,9 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
+#if defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
+#endif
QVERIFY(QApplication::widgetAt(100,100) == w1);
QVERIFY(QApplication::widgetAt(101,101) == w2);
@@ -3410,6 +3437,34 @@ QString textPropertyToString(Display *display, XTextProperty& text_prop)
#endif
+#if defined(Q_WS_S60)
+// Returns the application's status pane control, if not present returns NULL.
+static CCoeControl* GetStatusPaneControl( TInt aPaneId )
+{
+ const TUid paneUid = { aPaneId };
+
+ CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+ if (statusPane && statusPane->PaneCapabilities(paneUid).IsPresent()){
+ CCoeControl* control = NULL;
+ // ControlL shouldn't leave because the pane is present
+ TRAPD(err, control = statusPane->ControlL(paneUid));
+ return err != KErrNone ? NULL : control;
+ }
+ return NULL;
+}
+// Returns the application's title pane, if not present returns NULL.
+static CAknTitlePane* TitlePane()
+{
+ return static_cast<CAknTitlePane*>(GetStatusPaneControl(EEikStatusPaneUidTitle));
+}
+
+// Returns the application's title pane, if not present returns NULL.
+static CAknContextPane* ContextPane()
+{
+ return static_cast<CAknContextPane*>(GetStatusPaneControl(EEikStatusPaneUidContext));
+}
+#endif
+
static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::WindowNoState)
{
QString vTitle;
@@ -3472,6 +3527,13 @@ static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::W
if (win)
vTitle = win->caption();
}
+#elif defined (Q_WS_S60)
+ CAknTitlePane* titlePane = TitlePane();
+ if(titlePane)
+ {
+ const TDesC* nTitle = titlePane->Text();
+ vTitle = QString::fromUtf16(nTitle->Ptr(), nTitle->Length());
+ }
#endif
return vTitle;
@@ -3502,6 +3564,9 @@ void tst_QWidget::windowTitle()
void tst_QWidget::windowIconText()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("Symbian/S60 windows don't have window icon text", SkipAll);
+#endif
QWidget widget(0);
widget.setWindowTitle("Application Name");
@@ -5293,7 +5358,7 @@ void tst_QWidget::moveChild()
QCOMPARE(pos, child.pos());
QCOMPARE(parent.r, QRegion(oldGeometry) - child.geometry());
-#ifndef Q_WS_MAC
+#if !defined(Q_WS_MAC)
// should be scrolled in backingstore
QCOMPARE(child.r, QRegion());
#endif
@@ -6031,7 +6096,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -6126,7 +6191,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -6221,7 +6286,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -7182,7 +7247,7 @@ void tst_QWidget::repaintWhenChildDeleted()
}
#endif
ColorWidget w(0, Qt::red);
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_WS_S60)
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
@@ -7216,7 +7281,7 @@ void tst_QWidget::repaintWhenChildDeleted()
void tst_QWidget::hideOpaqueChildWhileHidden()
{
ColorWidget w(0, Qt::red);
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_WS_S60)
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
@@ -8091,7 +8156,12 @@ void tst_QWidget::customDpi()
custom->logicalDpiX();
QCOMPARE(custom->metricCallCount, 1);
child->logicalDpiX();
+#ifdef Q_WS_S60
+ // QWidget::metric is not recursive on Symbian
+ QCOMPARE(custom->metricCallCount, 1);
+#else
QCOMPARE(custom->metricCallCount, 2);
+#endif
delete topLevel;
}
@@ -8932,8 +9002,8 @@ void tst_QWidget::toplevelLineEditFocus()
#endif
QTest::qWait(200);
- QCOMPARE(QApplication::activeWindow(), &w);
- QCOMPARE(QApplication::focusWidget(), &w);
+ QCOMPARE(QApplication::activeWindow(), (QWidget*)&w);
+ QCOMPARE(QApplication::focusWidget(), (QWidget*)&w);
}
QTEST_MAIN(tst_QWidget)
diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
index f23db05fef..9c35d40d97 100644
--- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
+++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
@@ -152,6 +152,8 @@ void tst_QWindowSurface::flushOutsidePaintEvent()
qt_x11_wait_for_window_manager(&w);
#elif defined(Q_WS_QWS)
QApplication::sendPostedEvents(); //for the glib event loop
+#elif defined(Q_WS_S60)
+ QTest::qWait(5000);
#endif
VERIFY_COLOR(w.geometry(), w.color);
w.reset();
diff --git a/tests/auto/qwineventnotifier/qwineventnotifier.pro b/tests/auto/qwineventnotifier/qwineventnotifier.pro
index d985df6ff1..0c8bd2bd94 100644
--- a/tests/auto/qwineventnotifier/qwineventnotifier.pro
+++ b/tests/auto/qwineventnotifier/qwineventnotifier.pro
@@ -1,6 +1,3 @@
load(qttest_p4)
SOURCES += tst_qwineventnotifier.cpp
-
QT = core
-
-
diff --git a/tests/auto/qwizard/qwizard.pro b/tests/auto/qwizard/qwizard.pro
index 867ab9c4be..a22e45cf19 100644
--- a/tests/auto/qwizard/qwizard.pro
+++ b/tests/auto/qwizard/qwizard.pro
@@ -5,5 +5,6 @@ SOURCES += tst_qwizard.cpp
#SOURCES += /home/jasplin/dev/research/qwizard/src/qwizard.cpp
#HEADERS += /home/jasplin/dev/research/qwizard/src/qwizard.h
RESOURCES = qwizard.qrc
+TARGET.EPOCHEAPSIZE = 0x200000 0xF00000
diff --git a/tests/auto/qwmatrix/qwmatrix.pro b/tests/auto/qwmatrix/qwmatrix.pro
index d2ecd496c3..58ea706158 100644
--- a/tests/auto/qwmatrix/qwmatrix.pro
+++ b/tests/auto/qwmatrix/qwmatrix.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
SOURCES += tst_qwmatrix.cpp
-unix:!mac:LIBS+=-lm
+unix:!mac:!symbian*:LIBS+=-lm
diff --git a/tests/auto/qwritelocker/qwritelocker.pro b/tests/auto/qwritelocker/qwritelocker.pro
index 42cdd4593f..acae4efb28 100644
--- a/tests/auto/qwritelocker/qwritelocker.pro
+++ b/tests/auto/qwritelocker/qwritelocker.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qwritelocker.cpp
QT = core
-
-
diff --git a/tests/auto/qwsembedwidget/qwsembedwidget.pro b/tests/auto/qwsembedwidget/qwsembedwidget.pro
index 3ee12a3dc5..bd3c32c981 100644
--- a/tests/auto/qwsembedwidget/qwsembedwidget.pro
+++ b/tests/auto/qwsembedwidget/qwsembedwidget.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qwsembedwidget.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qwsinputmethod/qwsinputmethod.pro b/tests/auto/qwsinputmethod/qwsinputmethod.pro
index 9721acce57..69cce78704 100644
--- a/tests/auto/qwsinputmethod/qwsinputmethod.pro
+++ b/tests/auto/qwsinputmethod/qwsinputmethod.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qwsinputmethod.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qwswindowsystem/qwswindowsystem.pro b/tests/auto/qwswindowsystem/qwswindowsystem.pro
index 827608186b..49466eecbb 100644
--- a/tests/auto/qwswindowsystem/qwswindowsystem.pro
+++ b/tests/auto/qwswindowsystem/qwswindowsystem.pro
@@ -1,5 +1,3 @@
load(qttest_p4)
SOURCES += tst_qwswindowsystem.cpp
-
-
-
+QT = core
diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro
index 6c767cb81b..304fc54c92 100644
--- a/tests/auto/qxml/qxml.pro
+++ b/tests/auto/qxml/qxml.pro
@@ -3,7 +3,7 @@ load(qttest_p4)
SOURCES += tst_qxml.cpp
QT = core xml
-wince*: {
+wince*|symbian*: {
addFiles.sources = 0x010D.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro
index e3d16f6589..4c00d73871 100644
--- a/tests/auto/qxmlformatter/qxmlformatter.pro
+++ b/tests/auto/qxmlformatter/qxmlformatter.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qxmlformatter.cpp
include (../xmlpatterns.pri)
-wince*:{
+wince*|symbian*:{
addFiles.sources = baselines input
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index e8ab641ab2..386df05e28 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -12,7 +12,7 @@ QT += network
include (../xmlpatterns.pri)
-wince*: {
+wince*|symbian*: {
addFiles.sources = pushBaselines input.xml
addFiles.path = .
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index d4575814f5..986bde9fab 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -88,6 +88,7 @@ public:
, m_pushTestsCount(0)
, m_testNetwork(true)
{
+ Q_SET_DEFAULT_IAP
}
private Q_SLOTS:
diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
index e7e80072d4..bfdec58bc5 100644
--- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
@@ -12,8 +12,8 @@ QT += network xml
QT -= gui
-wince*: {
+wince*|symbian*: {
addFiles.sources = encodings parser xmldocs
addFiles.path = .
DEPLOYMENT += addFiles
-} \ No newline at end of file
+}
diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
index d919a4206b..ea09361fdb 100644
--- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -117,7 +117,7 @@ void XmlServer::run()
i += cnt;
sock->flush();
QTest::qSleep(1);
-
+
if (quit_soon) {
sock->abort();
break;
@@ -575,12 +575,16 @@ void tst_QXmlSimpleReader::inputFromSocket_data()
void tst_QXmlSimpleReader::inputFromSocket()
{
QFETCH(QString, file_name);
+
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll);
+#endif
#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET))
QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll);
#endif
QTcpSocket sock;
- sock.connectToHost("localhost", TEST_PORT);
+ sock.connectToHost(QHostAddress::LocalHost, TEST_PORT);
const bool connectionSuccess = sock.waitForConnected();
if(!connectionSuccess) {
diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro
index 46eed566ce..ac03d421d1 100644
--- a/tests/auto/qxmlstream/qxmlstream.pro
+++ b/tests/auto/qxmlstream/qxmlstream.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxmlstream.cpp
QT = core xml network
-wince*: {
+wince*|symbian*: {
addFiles.sources = data XML-Test-Suite
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qzip/qzip.pro b/tests/auto/qzip/qzip.pro
index 17b95436dd..632c743f1a 100644
--- a/tests/auto/qzip/qzip.pro
+++ b/tests/auto/qzip/qzip.pro
@@ -1,11 +1,11 @@
load(qttest_p4)
SOURCES += tst_qzip.cpp
-wince*: {
+wince*|symbian: {
addFiles.sources = testdata
addFiles.path = .
DEPLOYMENT += addFiles
- DEFINES += SRCDIR=\\\".\\\"
+ !symbian:DEFINES += SRCDIR=\\\".\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qzip/tst_qzip.cpp b/tests/auto/qzip/tst_qzip.cpp
index c2ae6634fb..56b2b838a7 100644
--- a/tests/auto/qzip/tst_qzip.cpp
+++ b/tests/auto/qzip/tst_qzip.cpp
@@ -44,6 +44,10 @@
#include <private/qzipwriter_p.h>
#include <private/qzipreader_p.h>
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR "."
+#endif
+
class tst_QZip : public QObject
{
Q_OBJECT
diff --git a/tests/auto/symbian/qmainexceptions/qmainexceptions.pro b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro
new file mode 100644
index 0000000000..7533dd4e49
--- /dev/null
+++ b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+HEADERS +=
+SOURCES += tst_qmainexceptions.cpp
+
+
diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
new file mode 100644
index 0000000000..103dd62731
--- /dev/null
+++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#ifdef Q_OS_SYMBIAN
+
+class tst_qmainexceptions : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qmainexceptions(){};
+ ~tst_qmainexceptions(){};
+public slots:
+ void initTestCase();
+private slots:
+ void trap();
+ void cleanupstack();
+ void leave();
+};
+
+class CDummy : public CBase
+{
+public:
+ CDummy(){}
+ ~CDummy(){}
+};
+
+void tst_qmainexceptions::initTestCase()
+{
+}
+
+void tst_qmainexceptions::trap()
+{
+ TTrapHandler *th= User::TrapHandler();
+ QVERIFY((int)th);
+}
+
+void tst_qmainexceptions::cleanupstack()
+{
+ __UHEAP_MARK;
+ //fails if OOM
+ CDummy* dummy1 = new (ELeave) CDummy;
+ __UHEAP_CHECK(1);
+ CleanupStack::PushL(dummy1);
+ CleanupStack::PopAndDestroy(dummy1);
+ __UHEAP_MARKEND;
+}
+void tst_qmainexceptions::leave()
+{
+ __UHEAP_MARK;
+ CDummy* dummy1 = 0;
+ TRAPD(err,{
+ CDummy* csDummy = new (ELeave) CDummy;
+ CleanupStack::PushL(csDummy);
+ __UHEAP_FAILNEXT(1);
+ dummy1 = new (ELeave) CDummy;
+ //CleanupStack::PopAndDestroy(csDummy); not executed as previous line throws
+ });
+ QCOMPARE(err,KErrNoMemory);
+ QVERIFY(!((int)dummy1));
+ __UHEAP_MARKEND;
+}
+
+
+QTEST_MAIN(tst_qmainexceptions)
+#include "tst_qmainexceptions.moc"
+#else
+QTEST_NOOP_MAIN
+#endif
diff --git a/tests/auto/symbian/qsymbiantests.pro b/tests/auto/symbian/qsymbiantests.pro
new file mode 100644
index 0000000000..151d7ec0d6
--- /dev/null
+++ b/tests/auto/symbian/qsymbiantests.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = qmainexceptions \ No newline at end of file
diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
index 1a74ccc53e..000a7c87ef 100644
--- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
+++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
@@ -102,6 +102,8 @@ tst_XmlPatterns::tst_XmlPatterns() : m_generatedTests(0)
, m_command(QLatin1String("xmlpatterns"))
, m_dontRun(false)
{
+ Q_SET_DEFAULT_IAP
+
Q_ASSERT(m_normalizeTestName.isValid());
Q_ASSERT(m_filenameInStderr.isValid());
}
diff --git a/tests/benchmarks/qfile/main.cpp b/tests/benchmarks/qfile/main.cpp
index e9f8d2def2..57920104af 100644
--- a/tests/benchmarks/qfile/main.cpp
+++ b/tests/benchmarks/qfile/main.cpp
@@ -1,5 +1,10 @@
/****************************************************************************
**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+****************************************************************************/
+
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp
index 669d2cf079..316c71df7a 100644
--- a/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp
+++ b/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
#if 0
ItemMover mover(scrollItem);
#endif
-
+
CountView view;
view.setScene(&scene);
view.setSceneRect(-25, -25, 150, 150);
diff --git a/tests/benchmarks/qiodevice/main.cpp b/tests/benchmarks/qiodevice/main.cpp
index fa41f1cc51..5c459a8382 100755
--- a/tests/benchmarks/qiodevice/main.cpp
+++ b/tests/benchmarks/qiodevice/main.cpp
@@ -66,8 +66,10 @@ void tst_qiodevice::read_data()
QTest::newRow("100k") << qint64(100 * 1024);
QTest::newRow("1000k") << qint64(1000 * 1024);
QTest::newRow("10000k") << qint64(10000 * 1024);
+#ifndef Q_OS_SYMBIAN // Symbian devices don't (yet) have enough available RAM to run these
QTest::newRow("100000k") << qint64(100000 * 1024);
QTest::newRow("1000000k") << qint64(1000000 * 1024);
+#endif
}
void tst_qiodevice::read_old()
diff --git a/tests/benchmarks/qiodevice/qiodevice.pro b/tests/benchmarks/qiodevice/qiodevice.pro
index 59b63022dc..749a4d68d3 100755
--- a/tests/benchmarks/qiodevice/qiodevice.pro
+++ b/tests/benchmarks/qiodevice/qiodevice.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
TEMPLATE = app
TARGET = tst_qiodevice
+TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro
index 1ce9a1bea1..b82104e8d1 100644
--- a/tools/configure/configure.pro
+++ b/tools/configure/configure.pro
@@ -6,7 +6,10 @@ CONFIG -= moc qt
DEFINES = QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE
-win32 : LIBS += -lole32 -ladvapi32
+win32 : !win32-mwc : LIBS += -lole32 -ladvapi32
+win32-mwc {
+ LIBS += -ladvapi32.lib -luuid.lib
+}
win32-msvc.net | win32-msvc2* : QMAKE_CXXFLAGS += /EHsc
win32-g++ : LIBS += -luuid
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 91344c8672..a879e5d2d3 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -310,6 +310,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "LIBJPEG" ] = "auto";
dictionary[ "LIBPNG" ] = "auto";
dictionary[ "LIBMNG" ] = "auto";
+ dictionary[ "FREETYPE" ] = "no";
dictionary[ "QT3SUPPORT" ] = "yes";
dictionary[ "ACCESSIBILITY" ] = "yes";
@@ -328,6 +329,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
dictionary[ "STYLE_MOTIF" ] = "yes";
dictionary[ "STYLE_CDE" ] = "yes";
+ dictionary[ "STYLE_S60" ] = "no";
dictionary[ "STYLE_GTK" ] = "no";
dictionary[ "SQL_MYSQL" ] = "no";
@@ -587,6 +589,13 @@ void Configure::parseCmdLine()
dictionary[ "MNG" ] = "qt";
dictionary[ "LIBMNG" ] = "system";
}
+
+ // Text Rendering --------------------------------------------
+ else if( configCmdLine.at(i) == "-no-freetype" )
+ dictionary[ "FREETYPE" ] = "no";
+ else if( configCmdLine.at(i) == "-qt-freetype" )
+ dictionary[ "FREETYPE" ] = "yes";
+
// CE- C runtime --------------------------------------------
else if( configCmdLine.at(i) == "-crt" ) {
++i;
@@ -666,6 +675,11 @@ void Configure::parseCmdLine()
else if( configCmdLine.at(i) == "-no-style-cde" )
dictionary[ "STYLE_CDE" ] = "no";
+ else if( configCmdLine.at(i) == "-qt-style-s60" )
+ dictionary[ "STYLE_S60" ] = "yes";
+ else if( configCmdLine.at(i) == "-no-style-s60" )
+ dictionary[ "STYLE_S60" ] = "no";
+
// Qt 3 Support ---------------------------------------------
else if( configCmdLine.at(i) == "-no-qt3support" )
dictionary[ "QT3SUPPORT" ] = "no";
@@ -776,6 +790,13 @@ void Configure::parseCmdLine()
dictionary[ "INCREDIBUILD_XGE" ] = "yes";
#if !defined(EVAL)
// Others ---------------------------------------------------
+ else if (configCmdLine.at(i) == "-fpu" )
+ {
+ ++i;
+ if(i==argCount)
+ break;
+ dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
+ }
else if (configCmdLine.at(i) == "-fast" )
dictionary[ "FAST" ] = "yes";
else if (configCmdLine.at(i) == "-no-fast" )
@@ -1102,12 +1123,29 @@ void Configure::parseCmdLine()
} else {
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
}
+ } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-mwc" ) ) {
+ dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-mwc";
+ dictionary[ "MAKE" ] = "make";
} else {
if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "make";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
}
}
+ // Tell the user how to proceed building Qt after configure finished its job
+ dictionary["QTBUILDINSTRUCTION"] = dictionary["MAKE"];
+ if (dictionary.contains("XQMAKESPEC")) {
+ if (dictionary["XQMAKESPEC"].startsWith("symbian")) {
+ dictionary["QTBUILDINSTRUCTION"] = dictionary["MAKE"] + QString(" debug-winscw|debug-armv5|release-armv5");
+ } else if (dictionary["XQMAKESPEC"].startsWith("wince")) {
+ dictionary["QTBUILDINSTRUCTION"] =
+ QString("setcepaths.bat ") + dictionary["XQMAKESPEC"] + QString(" && ") + dictionary["MAKE"];
+ }
+ }
+
+ // Tell the user how to confclean before the next configure
+ dictionary["CONFCLEANINSTRUCTION"] = dictionary["MAKE"] + QString(" confclean");
+
// Ensure that -spec (XQMAKESPEC) exists in the mkspecs folder as well
if (dictionary.contains("XQMAKESPEC") &&
!mkspecs.contains(dictionary["XQMAKESPEC"], Qt::CaseInsensitive)) {
@@ -1161,9 +1199,9 @@ void Configure::parseCmdLine()
#if !defined(EVAL)
void Configure::validateArgs()
{
- QStringList configs;
// Validate the specified config
+ // Get all possible configurations from the file system.
QDir dir;
QStringList filters;
filters << "qconfig-*.h";
@@ -1177,9 +1215,24 @@ void Configure::validateArgs()
allConfigs << it->remove("qconfig-").remove(".h");
allConfigs << "full";
+ // Try internal configurations first.
+ QStringList possible_configs = QStringList()
+ << "minimal"
+ << "small"
+ << "medium"
+ << "large"
+ << "full";
+ int index = possible_configs.indexOf(dictionary["QCONFIG"]);
+ if (index >= 0) {
+ for (int c = 0; c <= index; c++) {
+ qmakeConfig += possible_configs[c] + "-config";
+ }
+ return;
+ }
+
+ // If the internal configurations failed, try others.
QStringList::Iterator config;
for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) {
- configs += (*config) + "-config";
if( (*config) == dictionary[ "QCONFIG" ] )
break;
}
@@ -1188,7 +1241,7 @@ void Configure::validateArgs()
cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ;
}
else
- qmakeConfig += configs;
+ qmakeConfig += (*config) + "-config";
}
#endif
@@ -1309,6 +1362,8 @@ void Configure::applySpecSpecifics()
dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
dictionary[ "STYLE_MOTIF" ] = "no";
dictionary[ "STYLE_CDE" ] = "no";
+ dictionary[ "STYLE_S60" ] = "no";
+ dictionary[ "FREETYPE" ] = "no";
dictionary[ "QT3SUPPORT" ] = "no";
dictionary[ "OPENGL" ] = "no";
dictionary[ "OPENSSL" ] = "no";
@@ -1335,6 +1390,46 @@ void Configure::applySpecSpecifics()
dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ];
dictionary[ "QT_INSTALL_PREFIX" ] = "";
+ } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
+ dictionary[ "ACCESSIBILITY" ] = "no";
+ dictionary[ "STYLE_WINDOWSXP" ] = "no";
+ dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
+ dictionary[ "STYLE_PLASTIQUE" ] = "no";
+ dictionary[ "STYLE_CLEANLOOKS" ] = "no";
+ dictionary[ "STYLE_WINDOWSCE" ] = "no";
+ dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
+ dictionary[ "STYLE_MOTIF" ] = "no";
+ dictionary[ "STYLE_CDE" ] = "no";
+ dictionary[ "STYLE_S60" ] = "yes";
+ dictionary[ "FREETYPE" ] = "no";
+ dictionary[ "QT3SUPPORT" ] = "no";
+ dictionary[ "OPENGL" ] = "no";
+ dictionary[ "OPENSSL" ] = "no";
+ dictionary[ "STL" ] = "no";
+ dictionary[ "EXCEPTIONS" ] = "no";
+ dictionary[ "RTTI" ] = "no";
+ dictionary[ "ARCHITECTURE" ] = "symbian";
+ dictionary[ "3DNOW" ] = "no";
+ dictionary[ "SSE" ] = "no";
+ dictionary[ "SSE2" ] = "no";
+ dictionary[ "MMX" ] = "no";
+ dictionary[ "IWMMXT" ] = "no";
+ dictionary[ "CE_CRT" ] = "no";
+ dictionary[ "DIRECT3D" ] = "no";
+ dictionary[ "WEBKIT" ] = "no";
+ dictionary[ "ASSISTANT_WEBKIT" ] = "no";
+ dictionary[ "PHONON" ] = "yes";
+ dictionary[ "XMLPATTERNS" ] = "no";
+ dictionary[ "QT_GLIB" ] = "no";
+ // iconv makes makes apps start and run ridiculously slowly in symbian emulator (HW not tested)
+ // iconv_open seems to return -1 always, so something is probably missing from the platform.
+ dictionary[ "QT_ICONV" ] = "no";
+ dictionary[ "SCRIPTTOOLS" ] = "no";
+ dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ];
+ dictionary[ "QT_INSTALL_PREFIX" ] = "";
+ dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins";
+ dictionary[ "ARM_FPU_TYPE" ] = "softvfp";
+
} else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
//TODO
dictionary[ "STYLE_WINDOWSXP" ] = "no";
@@ -1608,6 +1703,7 @@ bool Configure::displayHelp()
"Available values for <arch>:");
desc("ARCHITECTURE","windows", "", " windows", ' ');
desc("ARCHITECTURE","windowsce", "", " windowsce", ' ');
+ desc("ARCHITECTURE","symbian", "", " symbian", ' ');
desc("ARCHITECTURE","boundschecker", "", " boundschecker", ' ');
desc("ARCHITECTURE","generic", "", " generic\n", ' ');
@@ -1622,7 +1718,8 @@ bool Configure::displayHelp()
desc("STYLE_MOTIF", "yes", "", " motif", ' ');
desc("STYLE_CDE", "yes", "", " cde", ' ');
desc("STYLE_WINDOWSCE", "yes", "", " windowsce", ' ');
- desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile\n", ' ');
+ desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile", ' ');
+ desc("STYLE_S60" , "yes", "", " s60\n", ' ');
/* We do not support -qconfig on Windows yet
@@ -1651,6 +1748,11 @@ bool Configure::displayHelp()
desc("OPENGL_ES_2", "no", "-opengl-es-2", "Enable support for OpenGL ES 2.0");
desc("DIRECTSHOW", "no", "-phonon-wince-ds9", "Enable Phonon Direct Show 9 backend for Windows CE");
+ // Qt\Symbian only options go below here -----------------------------------------------------------------------------
+ desc("Qt for S60 only:\n\n");
+ desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support.");
+ desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.\n");
+ desc( "-fpu <flags>", "VFP type on ARM, supported options: softvfp(default) | vfpv2 | softvfp+vfpv2\n");
return true;
}
return false;
@@ -1784,12 +1886,21 @@ bool Configure::checkAvailability(const QString &part)
else if (part == "SQL_DB2")
available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib");
else if (part == "SQL_SQLITE")
+ if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian"))
+ available = false; // In Symbian we only support system sqlite option
+ else
available = true; // Built in, we have a fork
else if (part == "SQL_SQLITE_LIB") {
if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
- available = findFile("sqlite3.h") && findFile("sqlite3.lib");
- if (available)
- dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
+ // Symbian has multiple .lib/.dll files we need to find
+ if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
+ available = true; // There is sqlite_symbian plugin which exports the necessary stuff
+ dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
+ } else {
+ available = findFile("sqlite3.h") && findFile("sqlite3.lib");
+ if (available)
+ dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
+ }
} else
available = true;
} else if (part == "SQL_SQLITE2")
@@ -2017,6 +2128,15 @@ bool Configure::verifyConfiguration()
if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
}
+ if (0 != dictionary["ARM_FPU_TYPE"].size())
+ {
+ QStringList l= QStringList()
+ << "softvfp"
+ << "softvfp+vfpv2"
+ << "vfpv2";
+ if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
+ cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
+ }
return true;
}
@@ -2166,6 +2286,10 @@ void Configure::generateOutputVars()
if( dictionary[ "LIBMNG" ] == "system" )
qtConfig += "system-mng";
+ // Text rendering --------------------------------------------------
+ if( dictionary[ "FREETYPE" ] == "yes" )
+ qtConfig += "freetype";
+
// Styles -------------------------------------------------------
if ( dictionary[ "STYLE_WINDOWS" ] == "yes" )
qmakeStyles += "windows";
@@ -2197,6 +2321,9 @@ void Configure::generateOutputVars()
if ( dictionary[ "STYLE_CDE" ] == "yes" )
qmakeStyles += "cde";
+ if ( dictionary[ "STYLE_S60" ] == "yes" )
+ qmakeStyles += "s60";
+
// Databases ----------------------------------------------------
if ( dictionary[ "SQL_MYSQL" ] == "yes" )
qmakeSql += "mysql";
@@ -2350,6 +2477,9 @@ void Configure::generateOutputVars()
}
}
+ if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) )
+ qmakeConfig += "cross_compile";
+
// Directories and settings for .qmake.cache --------------------
// if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX
@@ -2390,8 +2520,12 @@ void Configure::generateOutputVars()
qmakeVars += QString("INCLUDEPATH += ") + qmakeIncludes.join( " " );
if (!opensslLibs.isEmpty())
qmakeVars += opensslLibs;
- else if (dictionary[ "OPENSSL" ] == "linked")
- qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
+ else if (dictionary[ "OPENSSL" ] == "linked") {
+ if(dictionary[ "XQMAKESPEC" ].startsWith("symbian") )
+ qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto");
+ else
+ qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
+ }
if (!qmakeSql.isEmpty())
qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " );
if (!qmakeSqlPlugins.isEmpty())
@@ -2550,7 +2684,12 @@ void Configure::generateCachefile()
configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
if(!dictionary["QMAKE_RPATHDIR"].isEmpty())
- configStream<<"QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
+ configStream<<"QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"] <<endl;
+
+ if(!dictionary["ARM_FPU_TYPE"].isEmpty())
+ {
+ configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"];
+ }
configStream.flush();
configFile.close();
@@ -2591,6 +2730,18 @@ QString Configure::addDefine(QString def)
}
#if !defined(EVAL)
+// ### This should be removed once Qt for S60 is out.
+static void applyTemporarySymbianFlags(QStringList &qconfigList)
+{
+ qconfigList += "QT_NO_CONCURRENT";
+ qconfigList += "QT_NO_QFUTURE";
+ // This is removed because it uses UNIX signals which are not implemented yet
+ qconfigList += "QT_NO_CRASHHANDLER";
+ qconfigList += "QT_NO_PRINTER";
+ qconfigList += "QT_NO_CURSOR";
+ qconfigList += "QT_NO_SYSTEMTRAYICON";
+}
+
void Configure::generateConfigfiles()
{
QDir(buildPath).mkpath("src/corelib/global");
@@ -2660,6 +2811,7 @@ void Configure::generateConfigfiles()
if(dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
if(dictionary["STYLE_MOTIF"] != "yes") qconfigList += "QT_NO_STYLE_MOTIF";
if(dictionary["STYLE_CDE"] != "yes") qconfigList += "QT_NO_STYLE_CDE";
+ if(dictionary["STYLE_S60"] != "yes") qconfigList += "QT_NO_STYLE_S60";
if(dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE";
if(dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
if(dictionary["STYLE_GTK"] != "yes") qconfigList += "QT_NO_STYLE_GTK";
@@ -2674,7 +2826,6 @@ void Configure::generateConfigfiles()
qconfigList += "QT_NO_COMPRESS";
}
- if(dictionary["QT3SUPPORT"] == "no") qconfigList += "QT_NO_QT3SUPPORT";
if(dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY";
if(dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS";
if(dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL";
@@ -2708,6 +2859,10 @@ void Configure::generateConfigfiles()
if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
+ // ### This block should be removed once Qt for S60 is out.
+ if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
+ applyTemporarySymbianFlags(qconfigList);
+ }
qconfigList.sort();
for (int i = 0; i < qconfigList.count(); ++i)
@@ -2955,7 +3110,8 @@ void Configure::displayConfig()
cout << " TIFF support............" << dictionary[ "TIFF" ] << endl;
cout << " JPEG support............" << dictionary[ "JPEG" ] << endl;
cout << " PNG support............." << dictionary[ "PNG" ] << endl;
- cout << " MNG support............." << dictionary[ "MNG" ] << endl << endl;
+ cout << " MNG support............." << dictionary[ "MNG" ] << endl;
+ cout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl;
cout << "Styles:" << endl;
cout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl;
@@ -2966,7 +3122,8 @@ void Configure::displayConfig()
cout << " Motif..................." << dictionary[ "STYLE_MOTIF" ] << endl;
cout << " CDE....................." << dictionary[ "STYLE_CDE" ] << endl;
cout << " Windows CE.............." << dictionary[ "STYLE_WINDOWSCE" ] << endl;
- cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl << endl;
+ cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl;
+ cout << " S60....................." << dictionary[ "STYLE_S60" ] << endl << endl;
cout << "Sql Drivers:" << endl;
cout << " ODBC...................." << dictionary[ "SQL_ODBC" ] << endl;
@@ -3140,8 +3297,10 @@ void Configure::buildHostTools()
<< "src/tools/bootstrap"
<< "src/tools/moc"
<< "src/tools/rcc"
- << "src/tools/uic"
- << "tools/checksdk";
+ << "src/tools/uic";
+
+ if(dictionary["XQMAKESPEC"].startsWith("wince"))
+ hostToolsDirs << "tools/checksdk";
if (dictionary[ "CETEST" ] == "yes")
hostToolsDirs << "tools/qtestlib/wince/cetest";
@@ -3361,9 +3520,8 @@ void Configure::generateMakefiles()
void Configure::showSummary()
{
- QString make = dictionary[ "MAKE" ];
- cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
- cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
+ cout << endl << endl << "Qt is now configured for building. Just run '" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "'." << endl
+ << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl;
}
Configure::ProjectType Configure::projectType( const QString& proFileName )
@@ -3479,9 +3637,13 @@ bool Configure::showLicense(QString orgLicenseFile)
void Configure::readLicense()
{
- dictionary[ "PLATFORM NAME" ] = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h")
- && (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince")))
- ? "Qt for Windows CE" : "Qt for Windows";
+ if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") &&
+ (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince")))
+ dictionary["PLATFORM NAME"] = "Qt for Windows CE";
+ else if (dictionary.value("XQMAKESPEC").startsWith("symbian"))
+ dictionary["PLATFORM NAME"] = "Qt for S60";
+ else
+ dictionary["PLATFORM NAME"] = "Qt for Windows";
bool openSource = false;
if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") {
openSource = false;
diff --git a/tools/designer/src/lib/uilib/abstractformbuilder.cpp b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
index 4dae28e237..f819f05c52 100644
--- a/tools/designer/src/lib/uilib/abstractformbuilder.cpp
+++ b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -1701,6 +1701,24 @@ public:
};
template<class T>
+static void storeItemFlags(const T *item, QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const Qt::ItemFlags defaultFlags = T().flags();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ if (item->flags() != defaultFlags) {
+ DomProperty *p = new DomProperty;
+ p->setAttributeName(strings.flagsAttribute);
+ p->setElementSet(QString::fromAscii(itemFlags_enum.valueToKeys(item->flags())));
+ properties->append(p);
+ }
+}
+
+#ifndef Q_CC_RVCT
+// RVCT does not accept static inline functions if one argument is templated type
+// For this reason all necessary function variants are explicityly written for it.
+template<class T>
static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const T *item,
QList<DomProperty*> *properties)
{
@@ -1726,21 +1744,6 @@ static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const T *i
}
template<class T>
-static void storeItemFlags(const T *item, QList<DomProperty*> *properties)
-{
- static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
- static const Qt::ItemFlags defaultFlags = T().flags();
- static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
-
- if (item->flags() != defaultFlags) {
- DomProperty *p = new DomProperty;
- p->setAttributeName(strings.flagsAttribute);
- p->setElementSet(QString::fromAscii(itemFlags_enum.valueToKeys(item->flags())));
- properties->append(p);
- }
-}
-
-template<class T>
static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const T *item,
QList<DomProperty*> *properties)
{
@@ -1793,6 +1796,158 @@ static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, T *it
item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
}
+#else
+
+static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = formBuilder->saveText(it.second, item->data(it.first.second))))
+ properties->append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(it.first)).isValid() &&
+ (p = variantToDomProperty(abstractFormBuilder,
+ static_cast<const QMetaObject *>(&QAbstractFormBuilderGadget::staticMetaObject),
+ it.second, v)))
+ properties->append(p);
+
+ if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole))))
+ properties->append(p);
+}
+
+static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = formBuilder->saveText(it.second, item->data(it.first.second))))
+ properties->append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(it.first)).isValid() &&
+ (p = variantToDomProperty(abstractFormBuilder,
+ static_cast<const QMetaObject *>(&QAbstractFormBuilderGadget::staticMetaObject),
+ it.second, v)))
+ properties->append(p);
+
+ if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole))))
+ properties->append(p);
+}
+
+static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ storeItemProps(abstractFormBuilder, item, properties);
+ storeItemFlags(item, properties);
+}
+
+static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ storeItemProps(abstractFormBuilder, item, properties);
+ storeItemFlags(item, properties);
+}
+
+static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = formBuilder->textBuilder()->loadText(p);
+ QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v);
+ item->setData(it.first.first, qVariantValue<QString>(nativeValue));
+ item->setData(it.first.second, v);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ item->setData(it.first, v);
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p);
+ QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v);
+ item->setIcon(qVariantValue<QIcon>(nativeValue));
+ item->setData(Qt::DecorationPropertyRole, v);
+ }
+}
+
+static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = formBuilder->textBuilder()->loadText(p);
+ QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v);
+ item->setData(it.first.first, qVariantValue<QString>(nativeValue));
+ item->setData(it.first.second, v);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ item->setData(it.first, v);
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p);
+ QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v);
+ item->setIcon(qVariantValue<QIcon>(nativeValue));
+ item->setData(Qt::DecorationPropertyRole, v);
+ }
+}
+
+static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ loadItemProps(abstractFormBuilder, item, properties);
+
+ DomProperty *p;
+ if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set)
+ item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
+}
+
+static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ loadItemProps(abstractFormBuilder, item, properties);
+
+ DomProperty *p;
+ if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set)
+ item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
+}
+
+#endif
+
/*!
\internal
*/
@@ -2145,7 +2300,11 @@ void QAbstractFormBuilder::loadListWidgetExtraInfo(DomWidget *ui_widget, QListWi
foreach (DomItem *ui_item, ui_widget->elementItem()) {
const DomPropertyHash properties = propertyMap(ui_item->elementProperty());
QListWidgetItem *item = new QListWidgetItem(listWidget);
+#ifndef Q_CC_RVCT
loadItemPropsNFlags<QListWidgetItem>(this, item, properties);
+#else
+ loadItemPropsNFlags(this, item, properties);
+#endif
}
DomProperty *currentRow = propertyMap(ui_widget->elementProperty()).value(strings.currentRowProperty);
diff --git a/translations/qt_ja_JP.qm b/translations/qt_ja_JP.qm
deleted file mode 100644
index b695c97852..0000000000
--- a/translations/qt_ja_JP.qm
+++ /dev/null
Binary files differ
diff --git a/util/s60pixelmetrics/bld.inf b/util/s60pixelmetrics/bld.inf
new file mode 100644
index 0000000000..748e8810d6
--- /dev/null
+++ b/util/s60pixelmetrics/bld.inf
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+PRJ_MMPFILES
+pm_mapper.mmp
+
+// End of File
diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp
new file mode 100644
index 0000000000..8925ebe0e1
--- /dev/null
+++ b/util/s60pixelmetrics/pixel_metrics.cpp
@@ -0,0 +1,1223 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "pixel_metrics.h"
+
+#include <AknLayout2ScalableDef.h>
+#include <AknLayoutScalable_Avkon.cdl.h>
+#include <AknLayoutScalable_Apps.cdl.h>
+#include <AknUtils.h>
+
+// Version number for dynamic calculations. These are to be exported to static data,
+// so that we can keep dynamic and static values inline.
+// Please adjust version data if correcting dynamic PM calculations.
+const TInt KPMMajorVersion = 1;
+const TInt KPMMinorVersion = 14;
+
+TPixelMetricsVersion PixelMetrics::Version()
+ {
+ TPixelMetricsVersion version;
+ version.majorVersion = KPMMajorVersion;
+ version.minorVersion = KPMMinorVersion;
+ return version;
+ }
+
+TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric)
+ {
+ TInt value = -909;
+ // Main pane
+ TRect mainPaneRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::EMainPane,
+ mainPaneRect );
+ // Screen
+ TRect screenRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::EApplicationWindow,
+ screenRect );
+ // Navi pane
+ TRect naviPaneRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::ENaviPane,
+ naviPaneRect );
+
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+
+ TInt variety = 0;
+ TBool landscape = EFalse;
+ if ( screenRect.iBr.iX > screenRect.iBr.iY )
+ {
+ // in landscape another variety is used
+ landscape = ETrue;
+ }
+ switch (metric)
+ {
+ case QStyle::PM_DockWidgetHandleExtent:
+ // what's this??? Not in S60
+ break;
+ case QStyle::PM_CheckListControllerSize:
+ case QStyle::PM_CheckListButtonSize:
+ {
+ // hierarchical menu - checkbox / radiobutton
+ // Area (width/height) of the checkbox/radio button in a Q3CheckListItem.
+ TAknLayoutRect listScrollPane;
+ listScrollPane.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_gen_pane(0));
+ TAknLayoutRect listGenPane;
+ listGenPane.LayoutRect( listScrollPane.Rect(), AknLayoutScalable_Avkon::list_gen_pane(0));
+ TAknLayoutRect listHierarchyPane;
+ listHierarchyPane.LayoutRect( listGenPane.Rect(), AknLayoutScalable_Avkon::list_single_graphic_hl_pane(0));
+
+ TAknLayoutRect listHierarchyControllerPane;
+ listHierarchyPane.LayoutRect( listHierarchyPane.Rect(), AknLayoutScalable_Avkon::list_single_graphic_hl_pane_g3(0));
+ TAknLayoutRect listHierarchyPropertyPane;
+ listHierarchyPropertyPane.LayoutRect( listHierarchyPane.Rect(), AknLayoutScalable_Avkon::list_single_graphic_hl_pane_g2(0));
+
+ if (metric==QStyle::PM_CheckListControllerSize)value = Max( listHierarchyPane.Rect().Width(), listHierarchyPane.Rect().Width());
+ else value = Max( listHierarchyPropertyPane.Rect().Width(), listHierarchyPropertyPane.Rect().Width());
+ }
+ break;
+ case QStyle::PM_DialogButtonsSeparator: //Distance between buttons in a dialog buttons widget.
+ case QStyle::PM_DialogButtonsButtonWidth: // Minimum width of a button in a dialog buttons widget.
+ case QStyle::PM_DialogButtonsButtonHeight:// Minimum height of a button in a dialog buttons widget.
+ {
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+ variety = 0;
+ if ( landscape )
+ {
+ variety = 2;
+ }
+ TAknLayoutRect areaBottomRect;
+ areaBottomRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(variety) );
+
+ TAknLayoutRect controlPaneRect;
+ controlPaneRect.LayoutRect( areaBottomRect.Rect(), AknLayoutScalable_Avkon::control_pane() );
+ TAknLayoutText controlPaneLSKText;
+ TAknLayoutText controlPaneRSKText;
+ TAknLayoutText controlPaneMSKText;
+ variety = 0;
+ if (AknLayoutUtils::MSKEnabled())
+ {
+ variety = 3;
+ controlPaneMSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t3(variety)); //MSK text area
+ }
+ controlPaneLSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t1(variety)); //LSK text area
+ controlPaneRSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t2(variety)); //RSK text area
+
+ /*
+ *
+ ==================================================================================
+ | A | LSK_rect | B | MSK_rect | C | RSK_rect | D |
+ ==================================================================================
+ where A is left padding (between control pane and LSK rect)
+ B is mid-left padding (between LSK and MSK rects)
+ C is mid-right padding (between MSK and RSK rects)
+ D is right padding (between RSK and control pane)
+
+ ==> Since all these can be separate, lets take Max of {A..D} for PM value
+ */
+
+ TInt itemSpacingA = 0;
+ TInt itemSpacingB = 0;
+ TInt itemSpacingC = 0;
+ TInt itemSpacingMax = 0;
+ if ( !AknLayoutUtils::MSKEnabled() )
+ {
+ itemSpacingA = controlPaneRect.Rect().iBr.iX - controlPaneRSKText.TextRect().iBr.iX;
+ itemSpacingB = controlPaneLSKText.TextRect().iTl.iX - controlPaneRect.Rect().iTl.iX;
+ if (!landscape)
+ {
+ // use mid-gap only in portrait
+ itemSpacingC = controlPaneRSKText.TextRect().iTl.iX - controlPaneLSKText.TextRect().iBr.iX;
+ }
+ itemSpacingMax = Max(itemSpacingA, Max( itemSpacingB, itemSpacingC));
+ // no itemspacing4 if no MSK
+ }
+ else
+ {
+ TInt itemSpacingD = 0;
+ itemSpacingA = controlPaneRect.Rect().iBr.iX - controlPaneRSKText.TextRect().iBr.iX;
+ itemSpacingB = controlPaneLSKText.TextRect().iTl.iX - controlPaneRect.Rect().iTl.iX;
+ if ( !(AknLayoutUtils::PenEnabled() || landscape) ) // no MSK in touch, nor in landscape
+ {
+ itemSpacingC = controlPaneRSKText.TextRect().iTl.iX - controlPaneMSKText.TextRect().iBr.iX;
+ itemSpacingD = controlPaneMSKText.TextRect().iTl.iX - controlPaneLSKText.TextRect().iBr.iX;
+ }
+ itemSpacingMax = Max(itemSpacingA, Max( itemSpacingB, Max( itemSpacingC, itemSpacingD )));
+ }
+ if (metric==QStyle::PM_DialogButtonsSeparator) value = itemSpacingMax;
+ else if (metric==QStyle::PM_DialogButtonsButtonWidth)
+ {
+ value = Max( controlPaneLSKText.TextRect().Width(), controlPaneRSKText.TextRect().Width());
+ if (AknLayoutUtils::MSKEnabled())
+ {
+ value = Max(value, controlPaneMSKText.TextRect().Width());
+ }
+ }
+ else if (metric==QStyle::PM_DialogButtonsButtonHeight)
+ {
+ value = Max( controlPaneLSKText.TextRect().Height(), controlPaneRSKText.TextRect().Height());
+ if (AknLayoutUtils::MSKEnabled())
+ {
+ value = Max(value, controlPaneMSKText.TextRect().Height());
+ }
+ }
+ }
+ break;
+ case QStyle::PM_DockWidgetTitleMargin: // not in S60, lets use the same margin as in button
+ case QStyle::PM_DockWidgetTitleBarButtonMargin: // not in S60, lets use the same margin as in button
+ case QStyle::PM_ButtonMargin:
+ {
+ TRect myRect(TSize( 80, 20)); // this arbitrary size - user can set it - button border does not seem to have any scalability in it
+ TAknLayoutRect buttonRect;
+ TAknLayoutRect buttonBordersRect;
+ TAknLayoutText buttonText;
+
+ buttonRect.LayoutRect( myRect, AknLayoutScalable_Avkon::eswt_ctrl_button_pane());
+ buttonBordersRect.LayoutRect( buttonRect.Rect(), AknLayoutScalable_Avkon::common_borders_pane_copy2(0)); //with text
+ buttonText.LayoutText( buttonRect.Rect(), AknLayoutScalable_Avkon::control_button_pane_t1() );
+
+ // Its better to use left-right margins, since font deployment can create funny top / bottom margins
+ TInt leftMargin = buttonText.TextRect().iTl.iX - buttonBordersRect.Rect().iTl.iX;
+ TInt rightMargin = buttonBordersRect.Rect().iBr.iX - buttonText.TextRect().iBr.iX;
+ value = (TInt) ((leftMargin+rightMargin)/2);
+ }
+ break;
+ case QStyle::PM_ButtonDefaultIndicator:
+ {
+ // no default button indicators in S60
+ value = 0;
+ }
+ break;
+ case QStyle::PM_MdiSubWindowFrameWidth:
+ case QStyle::PM_ComboBoxFrameWidth:
+ case QStyle::PM_SpinBoxFrameWidth:
+ value = 0;
+ break;
+ case QStyle::PM_ToolBarFrameWidth:
+ case QStyle::PM_DefaultFrameWidth:
+ {
+ TAknLayoutRect highLightPaneRect;
+ TAknLayoutRect centerPaneRect;
+ TRect rectParent( mainPaneRect );
+ highLightPaneRect.LayoutRect( rectParent, AknLayoutScalable_Avkon::toolbar_button_pane(0).LayoutLine());
+ centerPaneRect.LayoutRect(rectParent, AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine());
+
+ value = highLightPaneRect.Rect().iBr.iX - centerPaneRect.Rect().iBr.iX;
+ }
+ break;
+ case QStyle::PM_RadioButtonLabelSpacing:
+ {
+ /*
+ *
+ ===================================================================================
+ | A | iconLayoutRect |B| itemText | C |
+ ===================================================================================
+ mirrored:
+ ===================================================================================
+ | C | itemText |B| iconLayoutRect | A |
+ ===================================================================================
+ where A is left padding
+ B is gap between icon and text
+ C is right padding
+ */
+
+ TRect rectParent( mainPaneRect );
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect( rectParent,AknLayoutScalable_Avkon::list_choice_list_pane(1).LayoutLine() ); // w/ scrollbar
+ TAknLayoutText itemText;
+ itemText.LayoutText( layoutRect.Rect(), AknLayoutScalable_Avkon::list_single_choice_list_pane_t1(1) );
+ TAknLayoutRect iconLayoutRect;
+ iconLayoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Avkon::list_single_choice_list_pane_g1().LayoutLine() );
+
+ if ( !AknLayoutUtils::LayoutMirrored() )
+ {
+ value = itemText.TextRect().iTl.iX - iconLayoutRect.Rect().iBr.iX;
+ }
+ else
+ {
+ value = iconLayoutRect.Rect().iTl.iX - itemText.TextRect().iBr.iX;
+ }
+ }
+
+ break;
+ case QStyle::PM_CheckBoxLabelSpacing:
+ {
+ /*
+ *
+ ===================================================================================
+ | A | iconLayoutRect |B| itemText | C |
+ ===================================================================================
+ mirrored:
+ ===================================================================================
+ | C | itemText |B| iconLayoutRect | A |
+ ===================================================================================
+ where A is left padding
+ B is gap between icon and text
+ C is right padding
+ */
+
+ TRect rectParent( mainPaneRect );
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect( rectParent, AknLayoutScalable_Avkon::listscroll_gen_pane(0).LayoutLine() );
+
+ TAknLayoutRect layoutRect2;
+ layoutRect2.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Avkon::list_gen_pane(0).LayoutLine() );
+ TAknLayoutRect layoutRect3;
+ layoutRect3.LayoutRect( layoutRect2.Rect(), AknLayoutScalable_Avkon::list_single_graphic_pane(0).LayoutLine() );
+
+ TAknLayoutText itemText;
+ itemText.LayoutText( layoutRect3.Rect(), AknLayoutScalable_Avkon::list_single_graphic_pane_t1(0) );
+ TAknLayoutRect iconLayoutRect;
+ iconLayoutRect.LayoutRect( layoutRect3.Rect(), AknLayoutScalable_Avkon::list_single_graphic_pane_g1(0).LayoutLine() );
+
+ if ( !AknLayoutUtils::LayoutMirrored() )
+ {
+ value = itemText.TextRect().iTl.iX - iconLayoutRect.Rect().iBr.iX;
+ }
+ else
+ {
+ value = iconLayoutRect.Rect().iTl.iX - itemText.TextRect().iBr.iX;
+ }
+ }
+ break;
+ case QStyle::PM_ToolTipLabelFrameWidth:
+ {
+ /*
+ *
+ |===================================================================================|
+ | info popup note B |
+ | ============================================================================== |
+ | A | hintText | D|
+ | ============================================================================== |
+ | C |
+ |===================================================================================|
+ where A is left padding
+ B is top padding
+ C is bottom padding
+ D is right padding
+ we'll provide the average of top and bottom padding as PM_ToolTipLabelFrameWidth
+ */
+
+ // Set pop-up to contain only one line of text
+ TInt index = 0;
+ if ( landscape )
+ {
+ // in landscape another variety is used
+ index += 5;
+ }
+ // Get parameter and table limits for popup preview text window
+ TAknLayoutScalableParameterLimits limits =
+ AknLayoutScalable_Avkon::popup_preview_text_window_ParamLimits();
+
+ TAknLayoutScalableTableLimits tableLimits =
+ AknLayoutScalable_Avkon::popup_preview_text_window_t_Limits();
+
+ TInt windowVariety = Min( Max( index, limits.FirstVariety() ), limits.LastVariety() );
+
+ TAknLayoutScalableParameterLimits tParamLimits =
+ AknLayoutScalable_Avkon:: popup_preview_text_window_t_ParamLimits(
+ tableLimits.FirstIndex() );
+
+ TInt lineVariety = Min( Max( index, tParamLimits.FirstVariety() ), tParamLimits.LastVariety() );
+
+ TAknWindowLineLayout lineLayout = AknLayoutScalable_Avkon::popup_preview_text_window(windowVariety).LayoutLine();
+
+ // rect for the whole info popup
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect(screenRect, lineLayout);
+ TRect rectPopupWindow = layoutRect.Rect();
+
+ TAknTextComponentLayout popupTextLayout =
+ AknLayoutScalable_Avkon::popup_preview_text_window_t(
+ tableLimits.FirstIndex(), lineVariety );
+
+ // rect for the whole the text inside the popup
+ TAknLayoutText layoutText;
+ layoutText.LayoutText( rectPopupWindow, popupTextLayout );
+
+ // Each margin has different value in S60 - let's take average of top & bottom
+ TInt topMargin = layoutText.TextRect().iTl.iY - layoutRect.Rect().iTl.iY;
+ TInt bottomMargin = layoutRect.Rect().iBr.iY - layoutText.TextRect().iBr.iY;
+ TInt averageMargin = (TInt)(topMargin+bottomMargin)/2;
+ value = averageMargin;
+ }
+ break;
+ case QStyle::PM_ListViewIconSize:
+ {
+ // todo: there are lots and lots of views with different sized icons - which one to use?
+ // todo: this is probably not a good default icon size, as this fetches A column icon size
+ // todo: preferably use settings item with graphic instead
+ TAknLayoutRect iconRect;
+ iconRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::list_double_graphic_pane_g1_cp2(0).LayoutLine());
+ //icon areas are usually squares - lets take bigger of two dimensions
+ value = Max( iconRect.Rect().Width(), iconRect.Rect().Height() );
+ }
+ break;
+
+ case QStyle::PM_LargeIconSize: // lets use AS icon as a base for large icon
+ case QStyle::PM_IconViewIconSize:
+ {
+ // Lets assume that we'd take these from grid (3x4) layout
+ TAknLayoutRect appPaneRect;
+ TAknLayoutRect gridAppRect;
+ TAknLayoutRect cellAppRect;
+ TInt varietyGrid = 2; //Let's use the 3x4 grid as a base.
+ TInt varietyCell = 1; //Let's use the 3x4 grid as a base.
+ if ( landscape )
+ {
+ varietyGrid = 3;
+ varietyCell = 2;
+ }
+ appPaneRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_app_pane(1).LayoutLine()); //3x4 grid
+ gridAppRect.LayoutRect( appPaneRect.Rect(), AknLayoutScalable_Avkon::grid_app_pane(varietyGrid).LayoutLine());
+ cellAppRect.LayoutRect( gridAppRect.Rect(), AknLayoutScalable_Avkon::cell_app_pane(varietyCell, 0, 0).LayoutLine());
+ TAknLayoutRect cellGraphRect;
+ TAknWindowComponentLayout appIcon = AknLayoutScalable_Avkon::cell_app_pane_g1(0); // no mark, no highlight
+ cellGraphRect.LayoutRect( gridAppRect.Rect(), appIcon);
+ //icon areas are usually squares - if not, lets take larger
+ value = Max( cellGraphRect.Rect().Width(), cellGraphRect.Rect().Height());
+ }
+ break;
+ case QStyle::PM_TabBarIconSize:
+ {
+ TAknLayoutRect naviNaviRect;
+ naviNaviRect.LayoutRect( naviPaneRect, AknLayoutScalable_Avkon::navi_navi_tabs_pane().LayoutLine()); // two tabs
+ TAknLayoutRect tabRect;
+ tabRect.LayoutRect( naviNaviRect.Rect(), AknLayoutScalable_Avkon::navi_tabs_3_pane().LayoutLine()); //active tab on left
+ TAknLayoutRect activeTabRect;
+ activeTabRect.LayoutRect( tabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane(0).LayoutLine()); //active tab
+ TAknLayoutRect activeTabGraphicRect;
+
+ activeTabGraphicRect.LayoutRect( activeTabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane_g1().LayoutLine()); //active tab graphic
+ value = Min(activeTabGraphicRect.Rect().Width(), activeTabGraphicRect.Rect().Height());
+ }
+ break;
+ case QStyle::PM_MessageBoxIconSize:
+ {
+ TAknLayoutRect noteRect;
+ noteRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_note_image_window(0).LayoutLine()); //note with image
+ TAknLayoutRect noteImageRect;
+ noteImageRect.LayoutRect( noteRect.Rect(), AknLayoutScalable_Avkon::popup_note_image_window_g2(2).LayoutLine()); //note with image
+ value = noteImageRect.Rect().Width();
+ }
+ break;
+ case QStyle::PM_TextCursorWidth:
+ {
+ TAknLayoutRect miscGraphicsRect;
+ miscGraphicsRect.LayoutRect( screenRect, AknLayoutScalable_Avkon::misc_graphics());
+ miscGraphicsRect.LayoutRect( miscGraphicsRect.Rect(), AknLayoutScalable_Avkon::misc_graphics());
+ TAknLayoutRect textsGraphicsRect;
+ textsGraphicsRect.LayoutRect( miscGraphicsRect.Rect(), AknLayoutScalable_Avkon::texts_graphics());
+ TAknLayoutRect cursorGraphicsRect;
+ cursorGraphicsRect.LayoutRect( textsGraphicsRect.Rect(), AknLayoutScalable_Avkon::cursor_graphics_pane());
+ TAknLayoutRect cursorPrimaryRect;
+ cursorPrimaryRect.LayoutRect( cursorGraphicsRect.Rect(), AknLayoutScalable_Avkon::cursor_primary_pane());
+ TAknLayoutRect cursorRect;
+ cursorRect.LayoutRect( cursorPrimaryRect.Rect(), AknLayoutScalable_Avkon::cursor_digital_pane_g1());
+ value = cursorRect.Rect().Width();
+ }
+ break;
+ case QStyle::PM_SliderLength:
+ {
+ TAknLayoutRect settingRect;
+ settingRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_set_pane() );
+ TAknLayoutRect settingContentRect;
+ settingContentRect.LayoutRect( settingRect.Rect(), AknLayoutScalable_Avkon::set_content_pane() );
+ TAknLayoutRect sliderRect;
+ sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
+ TAknLayoutRect sliderSettingRect;
+ sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
+ TAknLayoutRect sliderGraph2Rect;
+ sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
+ value = sliderGraph2Rect.Rect().Width();
+ }
+ break;
+ case QStyle::PM_SliderThickness:
+ {
+ TAknLayoutRect settingRect;
+ settingRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_set_pane() );
+ TAknLayoutRect settingContentRect;
+ settingContentRect.LayoutRect( settingRect.Rect(), AknLayoutScalable_Avkon::set_content_pane() );
+ TAknLayoutRect sliderRect;
+ sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
+ TAknLayoutRect sliderSettingRect;
+ sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
+ TAknLayoutRect sliderGraph2Rect;
+ sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
+ value = (TInt)(sliderGraph2Rect.Rect().Height()*1.5); // add assumed tickmark height
+ }
+ break;
+ case QStyle::PM_SliderTickmarkOffset:
+ {
+ TAknLayoutRect settingRect;
+ settingRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_set_pane() );
+ TAknLayoutRect settingContentRect;
+ settingContentRect.LayoutRect( settingRect.Rect(), AknLayoutScalable_Avkon::set_content_pane() );
+ TAknLayoutRect sliderRect;
+ sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
+ TAknLayoutRect sliderSettingRect;
+ sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
+ TAknLayoutRect sliderGraph2Rect;
+ sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
+ value = (TInt)(sliderGraph2Rect.Rect().Height()*0.5); // no tickmarks in S60, lets assume they are half the size of slider indicator
+ }
+ break;
+ case QStyle::PM_SliderControlThickness:
+ {
+ TAknLayoutRect settingRect;
+ settingRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_set_pane() );
+ TAknLayoutRect settingContentRect;
+ settingContentRect.LayoutRect( settingRect.Rect(), AknLayoutScalable_Avkon::set_content_pane() );
+ TAknLayoutRect sliderRect;
+ sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
+ TAknLayoutRect sliderSettingRect;
+ sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
+ TAknLayoutRect sliderGraph2Rect;
+ sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
+ value = sliderGraph2Rect.Rect().Height();
+ }
+ break;
+ case QStyle::PM_SliderSpaceAvailable:
+ {
+ TAknLayoutRect settingRect;
+ settingRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_set_pane() );
+ TAknLayoutRect settingContentRect;
+ settingContentRect.LayoutRect( settingRect.Rect(), AknLayoutScalable_Avkon::set_content_pane() );
+ TAknLayoutRect sliderRect;
+ sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
+ TAknLayoutRect sliderSettingRect;
+ sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
+ value = sliderSettingRect.Rect().Width();
+ }
+ break;
+ case QStyle::PM_MenuBarItemSpacing:
+ {
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+
+ variety = 0;
+ if ( landscape )
+ {
+ variety = 2;
+ }
+ TAknLayoutRect areaBottomRect;
+ areaBottomRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(variety) );
+
+ TAknLayoutRect controlPaneRect;
+ controlPaneRect.LayoutRect( areaBottomRect.Rect(), AknLayoutScalable_Avkon::control_pane() );
+ TAknLayoutText controlPaneLSKText;
+ TAknLayoutText controlPaneRSKText;
+ TAknLayoutText controlPaneMSKText;
+ variety = 0;
+ if (AknLayoutUtils::MSKEnabled())
+ {
+ variety = 3;
+ controlPaneMSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t3(variety)); //MSK text area
+ }
+ controlPaneLSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t1(variety)); //LSK text area
+ controlPaneRSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t2(variety)); //RSK text area
+
+ /*
+ *
+ ==================================================================================
+ | A | LSK_rect | B | MSK_rect | C | RSK_rect | D |
+ ==================================================================================
+ where A is left padding (between control pane and LSK rect)
+ B is mid-left padding (between LSK and MSK rects)
+ C is mid-right padding (between MSK and RSK rects)
+ D is right padding (between RSK and control pane)
+
+ ==> Since all these can be separate, lets take Max of {A..D} for PM value
+ */
+
+ TInt itemSpacing1 = 0;
+ TInt itemSpacing2 = 0;
+ TInt itemSpacing3 = 0;
+ TInt itemSpacing4 = 0;
+ TInt itemSpacingMax = 0;
+ if ( !AknLayoutUtils::MSKEnabled() )
+ {
+ itemSpacing1 = controlPaneRect.Rect().iBr.iX - controlPaneRSKText.TextRect().iBr.iX;
+ itemSpacing2 = controlPaneLSKText.TextRect().iTl.iX - controlPaneRect.Rect().iTl.iX;
+ if ( !landscape )
+ {
+ // use mid gap only in portrait
+ itemSpacing3 = controlPaneRSKText.TextRect().iTl.iX - controlPaneLSKText.TextRect().iBr.iX;
+ }
+ itemSpacingMax = Max(itemSpacing1, Max( itemSpacing2, itemSpacing3));
+ // no itemspacing4 if no MSK
+ }
+ else
+ {
+ itemSpacing1 = controlPaneRect.Rect().iBr.iX - controlPaneRSKText.TextRect().iBr.iX;
+ itemSpacing2 = controlPaneLSKText.TextRect().iTl.iX - controlPaneRect.Rect().iTl.iX;
+ if ( !(AknLayoutUtils::PenEnabled() || landscape) ) // no MSK in touch, nor in landscape
+ {
+ itemSpacing3 = controlPaneRSKText.TextRect().iTl.iX - controlPaneMSKText.TextRect().iBr.iX;
+ itemSpacing4 = controlPaneMSKText.TextRect().iTl.iX - controlPaneLSKText.TextRect().iBr.iX;
+ }
+ itemSpacingMax = Max(itemSpacing1, Max( itemSpacing2, Max( itemSpacing3, itemSpacing4 )));
+ }
+ value = itemSpacingMax;
+ }
+ break;
+ case QStyle::PM_MenuBarHMargin:
+ {
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+
+ variety = 0;
+ if ( landscape )
+ {
+ variety = 6;
+ }
+ TAknLayoutRect areaBottomRect;
+ areaBottomRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(variety) );
+
+ // variety 7 if thin status pane, 1 if no status pane, 3 if small status pane and with main pane, 4 otherwise (idle has bunch of own varieties)
+ TAknLayoutRect controlPaneRect;
+ controlPaneRect.LayoutRect( areaBottomRect.Rect(), AknLayoutScalable_Avkon::control_pane() );
+ value = areaBottomRect.Rect().Height() - controlPaneRect.Rect().Height();
+ }
+ break;
+ case QStyle::PM_MenuBarVMargin:
+ {
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+
+ variety = 0;
+ if ( landscape )
+ {
+ variety = 6;
+ }
+ TAknLayoutText controlPaneLSKText;
+ TAknLayoutRect areaBottomRect;
+ areaBottomRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(variety) );
+ // variety 7 if thin status pane, 1 if no status pane, 3 if small status pane and with main pane, 4 otherwise (idle has bunch of own varieties)
+ TAknLayoutRect controlPaneRect;
+ controlPaneRect.LayoutRect( areaBottomRect.Rect(), AknLayoutScalable_Avkon::control_pane() );
+
+ variety = 0;
+ if (AknLayoutUtils::MSKEnabled())
+ {
+ variety = 3;
+ }
+ controlPaneLSKText.LayoutText( controlPaneRect.Rect(), AknLayoutScalable_Avkon::control_pane_t1(variety)); //LSK text area
+
+ value = controlPaneRect.Rect().Height() - controlPaneLSKText.TextRect().Height();
+ }
+ break;
+ case QStyle::PM_ToolBarItemSpacing:
+ {
+ TAknLayoutRect popupToolBarWindow;
+ variety = 4;
+ popupToolBarWindow.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_toolbar_window(variety) );
+ TAknLayoutRect gridToolBarRect;
+ gridToolBarRect.LayoutRect( popupToolBarWindow.Rect(), AknLayoutScalable_Avkon::grid_toobar_pane() );
+ TAknLayoutRect cellToolBarRect1;
+ TAknLayoutRect cellToolBarRect2;
+ cellToolBarRect1.LayoutRect( gridToolBarRect.Rect(), AknLayoutScalable_Avkon::cell_toolbar_pane(0).LayoutLine() ); //first item
+ cellToolBarRect2.LayoutRect( gridToolBarRect.Rect(), AknLayoutScalable_Avkon::cell_toolbar_pane(1).LayoutLine() ); //second item
+ value = cellToolBarRect1.Rect().iBr.iX - cellToolBarRect2.Rect().iTl.iX;
+ }
+ break;
+ case QStyle::PM_ToolBarItemMargin:
+ {
+ variety = 4;
+ TAknLayoutRect popupToolBarWindow;
+ popupToolBarWindow.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_toolbar_window(variety) );
+ TAknLayoutRect gridToolBarRect;
+ gridToolBarRect.LayoutRect( popupToolBarWindow.Rect(), AknLayoutScalable_Avkon::grid_toobar_pane() );
+ TAknLayoutRect cellToolBarRect1;
+ cellToolBarRect1.LayoutRect( gridToolBarRect.Rect(), AknLayoutScalable_Avkon::cell_toolbar_pane(0).LayoutLine() ); //first item
+ value = gridToolBarRect.Rect().iTl.iX - cellToolBarRect1.Rect().iTl.iX;
+ }
+ break;
+ case QStyle::PM_LayoutLeftMargin: // there really isn't a default layoutting on s60, but lets use AppShell icon deployment as base
+ case QStyle::PM_LayoutRightMargin:
+ case QStyle::PM_LayoutTopMargin:
+ case QStyle::PM_LayoutBottomMargin:
+ case QStyle::PM_LayoutHorizontalSpacing:
+ case QStyle::PM_LayoutVerticalSpacing:
+ {
+ //since spacing and margins should be globally same, lets use same easy component as base - such as find popup
+ TAknLayoutRect popup_find_windowRect;
+ TAknLayoutRect bg_popup_window_pane_cp12Rect;
+ TAknLayoutRect find_popup_paneRect;
+ popup_find_windowRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_find_window(0).LayoutLine());
+ bg_popup_window_pane_cp12Rect.LayoutRect( popup_find_windowRect.Rect(), AknLayoutScalable_Avkon::bg_popup_window_pane_cp12().LayoutLine());
+ find_popup_paneRect.LayoutRect( bg_popup_window_pane_cp12Rect.Rect(), AknLayoutScalable_Avkon::find_popup_pane().LayoutLine());
+
+ const TBool mirrored = AknLayoutUtils::LayoutMirrored();
+ if ((metric==QStyle::PM_LayoutVerticalSpacing && !mirrored) || metric==QStyle::PM_LayoutLeftMargin)
+ {
+ if (mirrored)
+ {
+ value = find_popup_paneRect.Rect().iTl.iX - bg_popup_window_pane_cp12Rect.Rect().iTl.iX;
+ }
+ else
+ {
+ value = find_popup_paneRect.Rect().iTl.iX - bg_popup_window_pane_cp12Rect.Rect().iTl.iX;
+ }
+ }
+ else if (metric==QStyle::PM_LayoutRightMargin || (metric==QStyle::PM_LayoutVerticalSpacing && mirrored))
+ {
+ if (mirrored)
+ {
+ value = bg_popup_window_pane_cp12Rect.Rect().iBr.iX - find_popup_paneRect.Rect().iBr.iX;
+ }
+ else
+ {
+ value = bg_popup_window_pane_cp12Rect.Rect().iBr.iX - find_popup_paneRect.Rect().iBr.iX;
+ }
+ }
+ else if (metric==QStyle::PM_LayoutTopMargin || metric==QStyle::PM_LayoutHorizontalSpacing)
+ {
+ value = find_popup_paneRect.Rect().iTl.iY - bg_popup_window_pane_cp12Rect.Rect().iTl.iY;
+ }
+ else if (metric==QStyle::PM_LayoutBottomMargin)
+ {
+ value = bg_popup_window_pane_cp12Rect.Rect().iBr.iY - find_popup_paneRect.Rect().iBr.iY;
+ }
+ }
+ break;
+ case QStyle::PM_MaximumDragDistance:
+ {
+ value = -1; //disable - not in S60
+ }
+ break;
+ case QStyle::PM_ScrollBarExtent:
+ {
+ TAknLayoutRect miscGraphicsRect;
+ miscGraphicsRect.LayoutRect( screenRect, AknLayoutScalable_Avkon::misc_graphics());
+ miscGraphicsRect.LayoutRect( miscGraphicsRect.Rect(), AknLayoutScalable_Avkon::misc_graphics());
+ TAknLayoutRect textsGraphicsRect;
+ textsGraphicsRect.LayoutRect( miscGraphicsRect.Rect(), AknLayoutScalable_Avkon::texts_graphics());
+ TAknLayoutRect editorScrollRect;
+ editorScrollRect.LayoutRect( textsGraphicsRect.Rect(), AknLayoutScalable_Avkon::editor_scroll_pane());
+ TAknLayoutRect scrollPaneRect;
+ scrollPaneRect.LayoutRect( editorScrollRect.Rect(), AknLayoutScalable_Avkon::scroll_pane_cp13());
+ value = scrollPaneRect.Rect().Width(); // width of editor's scroll bar
+ }
+ break;
+ case QStyle::PM_ScrollBarSliderMin:
+ {
+ TAknLayoutRect listScrollPane;
+ listScrollPane.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_gen_pane(0));
+ TAknLayoutRect scrollPane;
+ scrollPane.LayoutRect( listScrollPane.Rect(), AknLayoutScalable_Avkon::scroll_pane());
+ TAknLayoutRect scrollHandlePane;
+ scrollHandlePane.LayoutRect( scrollPane.Rect(), AknLayoutScalable_Avkon::scroll_handle_pane());
+ TAknLayoutRect aidMinSizePane;
+ aidMinSizePane.LayoutRect( scrollHandlePane.Rect(), AknLayoutScalable_Avkon::aid_size_min_handle()); // this gives min width size for horizontal scroll bar - same can be used for vertical height minimum
+ value = aidMinSizePane.Rect().Height();
+ }
+ break;
+ case QStyle::PM_MenuBarPanelWidth:
+ {
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(0) );
+
+ variety = 0;
+ if ( landscape )
+ {
+ variety = 2;
+ }
+ TAknLayoutRect areaBottomRect;
+ areaBottomRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(variety) );
+
+ // todo: prt: variety 7 if thin status pane, 1 if no status pane, 3 if small status pane and with main pane, 4 otherwise (idle has bunch of own varieties)
+ // todo: lsc: variety 6 if thin status pane
+ // todo: should stacon be considered?
+ TAknLayoutRect controlPaneRect;
+ controlPaneRect.LayoutRect( areaBottomRect.Rect(), AknLayoutScalable_Avkon::control_pane() );
+ value = areaBottomRect.Rect().Height() - controlPaneRect.Rect().Height(); //usually zero
+ }
+ break;
+ case QStyle::PM_ProgressBarChunkWidth:
+ {
+ // This is either deduced or skinned (for Java) in S60
+ // Layout data does not know it. It would require parameters from the
+ // actual progress dialog to be able to calc this (max. value and increment)
+ // So we need to set up some values - lets take one tenth of progress dialog area:
+ TAknLayoutRect appWindow;
+ appWindow.LayoutRect( screenRect, AknLayoutScalable_Avkon::application_window(variety) );
+ if (landscape)
+ {
+ variety = 6;
+ }
+ TAknLayoutRect popupWaitWindowRect;
+ popupWaitWindowRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_note_wait_window(variety) );
+ TAknLayoutRect waitbarPaneRect;
+ waitbarPaneRect.LayoutRect( popupWaitWindowRect.Rect(), AknLayoutScalable_Avkon::wait_bar_pane(0) );
+ TAknLayoutRect waitAnimRect;
+ waitAnimRect.LayoutRect( waitbarPaneRect.Rect(), AknLayoutScalable_Avkon::wait_anim_pane() );
+ value = (TInt) (waitAnimRect.Rect().Width() / 10);
+ }
+ break;
+ case QStyle::PM_TabBarTabOverlap:
+ case QStyle::PM_TabBarTabHSpace:
+ case QStyle::PM_TabBarTabVSpace:
+ case QStyle::PM_TabBarBaseHeight:
+ case QStyle::PM_TabBarBaseOverlap:
+ case QStyle::PM_TabBarScrollButtonWidth:
+ case QStyle::PM_TabBarTabShiftHorizontal:
+ case QStyle::PM_TabBarTabShiftVertical:
+ value = PixelMetricTabValue(metric, appWindow.Rect(), landscape);
+ break;
+ case QStyle::PM_MenuPanelWidth:
+ case QStyle::PM_MenuHMargin:
+ case QStyle::PM_MenuVMargin:
+ value = PixelMetricMenuValue(metric, mainPaneRect);
+ break;
+ case QStyle::PM_ButtonIconSize:
+ //lets use voice recorder icons as a base
+ //Unfortunately S60 graphics don't separate button bevel graphics from the actual icon.
+ //Se we have no means to query the margin from bevel border to "central icon" border.
+ //So, we need to make a estimate...
+
+ const TInt varietyForButtons = !landscape ? 0 : 1;
+
+ TAknLayoutRect vRMainRect;
+ vRMainRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_vorec_pane() );
+
+ TAknLayoutRect vRButtonGridRect;
+ vRButtonGridRect.LayoutRect( vRMainRect.Rect(), AknLayoutScalable_Apps::grid_vorec_pane() );
+
+ TAknLayoutRect vRButtonCellRect;
+ vRButtonCellRect.LayoutRect( vRButtonGridRect.Rect(), AknLayoutScalable_Apps::cell_vorec_pane(0) );
+
+ TAknLayoutRect vRButtonCellGraphicsRect;
+ vRButtonCellGraphicsRect.LayoutRect( vRButtonCellRect.Rect(), AknLayoutScalable_Apps::cell_vorec_pane_g1() );
+
+ // 0.32 is the estimate how much the icon occupies of the button bevel area
+ value = vRButtonCellGraphicsRect.Rect().Width() * 0.32;
+
+ break;
+ case QStyle::PM_SmallIconSize:
+ {
+ // lets use AI2 icon as a base
+ TAknLayoutRect idlePaneRect;
+ idlePaneRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::main_idle_act2_pane() );
+ TAknLayoutRect idleDataRect;
+ idleDataRect.LayoutRect( idlePaneRect.Rect(), AknLayoutScalable_Avkon::popup_ai2_data_window(1) );
+ TAknLayoutRect ai2GridRect;
+ ai2GridRect.LayoutRect( idleDataRect.Rect(), AknLayoutScalable_Avkon::grid_ai2_button_pane() );
+ TAknLayoutRect ai2MpRect;
+ ai2MpRect.LayoutRect( ai2GridRect.Rect(), AknLayoutScalable_Avkon::ai2_mp_button_pane() );
+ TAknLayoutRect ai2CellPaneRect;
+ ai2CellPaneRect.LayoutRect( ai2MpRect.Rect(), AknLayoutScalable_Avkon::cell_ai2_button_pane(1).LayoutLine() );
+ TAknLayoutRect ai2CellButtonRect;
+ ai2CellButtonRect.LayoutRect( ai2CellPaneRect.Rect(), AknLayoutScalable_Avkon::cell_ai2_button_pane_g1());
+ value = Min( ai2CellButtonRect.Rect().Width(), ai2CellButtonRect.Rect().Height());
+ }
+ break;
+ case QStyle::PM_FocusFrameHMargin:
+ case QStyle::PM_FocusFrameVMargin:
+ {
+ TAknLayoutRect gridRect;
+ gridRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::grid_highlight_pane(0));
+ TAknLayoutRect gridRectCenter;
+ gridRectCenter.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::cell_highlight_pane_g1());
+
+ // The difference of center piece from border tell the frame width.
+ if ( value == QStyle::PM_FocusFrameHMargin)
+ {
+ value = gridRect.Rect().iBr.iX - gridRectCenter.Rect().iBr.iX;
+ }
+ else
+ {
+ value = gridRect.Rect().iBr.iY - gridRectCenter.Rect().iBr.iY;
+ }
+ }
+ break;
+ case QStyle::PM_ToolBarIconSize:
+ {
+ TAknLayoutRect popupToolBarWindow;
+ variety = 4;
+ popupToolBarWindow.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_toolbar_window(variety) );
+ TAknLayoutRect gridToolBarRect;
+ gridToolBarRect.LayoutRect( popupToolBarWindow.Rect(), AknLayoutScalable_Avkon::grid_toobar_pane() );
+ TAknLayoutRect cellToolBarRect1;
+ TAknLayoutRect cellToolBarRect2;
+ cellToolBarRect1.LayoutRect( gridToolBarRect.Rect(), AknLayoutScalable_Avkon::cell_toolbar_pane(0).LayoutLine() ); //first item
+ value = Min( cellToolBarRect1.Rect().Height(), cellToolBarRect1.Rect().Width() );
+ }
+ break;
+
+ case QStyle::PM_TitleBarHeight: // use titlepane height
+ {
+ TAknLayoutRect statusPaneRect;
+ TAknLayoutRect titlePane;
+ TAknLayoutRect areaTopRect;
+ if (landscape)
+ {
+ if ( AknLayoutUtils::PenEnabled() )
+ {
+ // Top area - 0 is for classic landscape (used in touch landscape as well)
+ areaTopRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_top_pane(2) );
+ // Status pane - 0 softkeys on right
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::stacon_top_pane() );
+ }
+ else
+ {
+ // Top area - 2 is for classic landscape.
+ areaTopRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_bottom_pane(2) );
+ // Stacon top pane (default ok)
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::stacon_bottom_pane() );
+ }
+ titlePane.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::title_pane_stacon(0) ); //softkeys on right
+ }
+ else
+ {
+ // Top area - 0 is for classic portrait
+ areaTopRect.LayoutRect( appWindow.Rect(), AknLayoutScalable_Avkon::area_top_pane(0) );
+ // Status pane - 0 is for classic portrait
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::status_pane(0) );
+ titlePane.LayoutRect( statusPaneRect.Rect(), AknLayoutScalable_Avkon::title_pane(0) );
+ }
+ value = titlePane.Rect().Height();
+ }
+ break;
+ case QStyle::PM_IndicatorWidth:
+ case QStyle::PM_IndicatorHeight:
+ {
+ TRect rectParent( mainPaneRect );
+
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect( rectParent,AknLayoutScalable_Avkon::set_content_pane().LayoutLine() );
+ TAknLayoutRect layoutRect2;
+ layoutRect2.LayoutRect( layoutRect.Rect(),AknLayoutScalable_Avkon::list_set_graphic_pane(0).LayoutLine() );
+
+ TAknLayoutRect iconLayoutRect;
+ iconLayoutRect.LayoutRect( layoutRect2.Rect(), AknLayoutScalable_Avkon::list_set_graphic_pane_g1(0).LayoutLine() );
+ if (metric==QStyle::PM_IndicatorWidth)
+ {
+ value = iconLayoutRect.Rect().Width();
+ }
+ else
+ {
+ value = iconLayoutRect.Rect().Height();
+ }
+ }
+ break;
+ case QStyle::PM_ExclusiveIndicatorHeight:
+ case QStyle::PM_ExclusiveIndicatorWidth:
+ {
+ TRect rectParent( mainPaneRect );
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect( rectParent,AknLayoutScalable_Avkon::list_choice_list_pane(1).LayoutLine() ); // w/ scrollbar
+ TAknLayoutText itemText;
+ itemText.LayoutText( layoutRect.Rect(), AknLayoutScalable_Avkon::list_single_choice_list_pane_t1(1) );
+ TAknLayoutRect iconLayoutRect;
+ iconLayoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Avkon::list_single_choice_list_pane_g1().LayoutLine() );
+
+ if (metric==QStyle::PM_ExclusiveIndicatorHeight)
+ {
+ value = iconLayoutRect.Rect().Height();
+ }
+ else
+ {
+ value = iconLayoutRect.Rect().Width();
+ }
+ }
+ break;
+
+ // These are obsolete.
+ case QStyle::PM_DefaultTopLevelMargin:
+ case QStyle::PM_DefaultChildMargin:
+ case QStyle::PM_DefaultLayoutSpacing:
+ break;
+
+ case QStyle::PM_Custom_FrameCornerWidth:
+ {
+ TAknLayoutRect inputFocusRect;
+ inputFocusRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::input_focus_pane(0));
+ TAknLayoutRect inputFocusInnerRect;
+ inputFocusInnerRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::input_focus_pane_g1());
+
+ value = inputFocusRect.Rect().iBr.iX - inputFocusInnerRect.Rect().iBr.iX;
+ value+= 2; //visually better value for generic cases
+ }
+ break;
+ case QStyle::PM_Custom_FrameCornerHeight:
+ {
+ TAknLayoutRect inputFocusRect;
+ inputFocusRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::input_focus_pane(0));
+ TAknLayoutRect inputFocusInnerRect;
+ inputFocusInnerRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::input_focus_pane_g1());
+ value = inputFocusRect.Rect().iBr.iY - inputFocusInnerRect.Rect().iBr.iY;
+ value+= 2; //visually better value for generic cases
+ }
+ break;
+ case QStyle::PM_Custom_BoldLineWidth:
+ value = 3;
+ break;
+ case QStyle::PM_Custom_ThinLineWidth:
+ value = 1;
+ break;
+ case QStyle::PM_ButtonShiftHorizontal:
+ case QStyle::PM_ButtonShiftVertical:
+ value = 0;
+ break;
+
+ case QStyle::PM_ToolBarExtensionExtent:
+ value = PixelMetricTabValue(QStyle::PM_TabBarScrollButtonWidth, appWindow.Rect(), landscape);
+ break;
+
+// todo: re-check if these really are not available in s60
+ case QStyle::PM_MenuDesktopFrameWidth: // not needed in S60 - dislocates Menu both horizontally and vertically
+ case QStyle::PM_HeaderMarkSize: // The size of the sort indicator in a header. Not in S60
+ case QStyle::PM_SpinBoxSliderHeight: // The height of the optional spin box slider. Not in S60
+ case QStyle::PM_HeaderMargin: // not in S60
+ case QStyle::PM_MenuScrollerHeight: // not in S60
+ case QStyle::PM_MenuTearoffHeight: // not in S60
+ case QStyle::PM_DockWidgetFrameWidth: // not in S60
+ case QStyle::PM_DockWidgetSeparatorExtent: // not in S60
+ case QStyle::PM_MdiSubWindowMinimizedWidth: //no such thing in S60
+ case QStyle::PM_HeaderGripMargin: // not in S60
+ case QStyle::PM_SplitterWidth: // not in S60
+ case QStyle::PM_ToolBarSeparatorExtent: // not in S60
+ case QStyle::PM_ToolBarHandleExtent: // not in s60
+ case QStyle::PM_MenuButtonIndicator: // none???
+ case QStyle::PM_TabBar_ScrollButtonOverlap: // not used in S60 - tab arrows are on left and right side of tab group - not together
+ case QStyle::PM_SizeGripSize: // use default
+ case QStyle::PM_TabCloseIndicatorWidth:
+ case QStyle::PM_TabCloseIndicatorHeight:
+ case QStyle::PM_ScrollView_ScrollBarSpacing:
+ case QStyle::PM_SubMenuOverlap:
+ default:
+ break;
+ }
+ return value;
+ }
+
+TInt PixelMetrics::PixelMetricTabValue(QStyle::PixelMetric tabMetric, TRect appWindow, TBool landscape)
+ {
+ TInt tabValue = 0;
+ // common ones
+ TAknLayoutRect mainAreaRect;
+ TAknLayoutRect rightIndicationRect;
+ TAknLayoutRect leftIndicationRect;
+ TAknLayoutRect activeTabRect;
+ TAknLayoutText activeTabTextRect;
+ TAknLayoutRect passiveTabRect;
+ TAknLayoutText passiveTabTextRect;
+ TAknLayoutRect tabsPaneRect;
+ if ( landscape )
+ {
+ TAknLayoutRect statusPaneRect;
+ TAknLayoutRect areaTopRect;
+ if ( AknLayoutUtils::PenEnabled() )
+ {
+ // Top area - 0 is for classic landscape (used in touch landscape as well)
+ areaTopRect.LayoutRect( appWindow, AknLayoutScalable_Avkon::area_top_pane(2) );
+ // Status pane - 0 softkeys on right
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::stacon_top_pane() );
+ }
+ else
+ {
+ // Top area - 2 is for classic landscape.
+ areaTopRect.LayoutRect( appWindow, AknLayoutScalable_Avkon::area_bottom_pane(2) );
+ // Stacon top pane (default ok)
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::stacon_bottom_pane() );
+ }
+ // main pane for landscape
+ mainAreaRect.LayoutRect( appWindow, AknLayoutScalable_Avkon::main_pane(4) );
+
+ // navi pane
+ TAknLayoutRect naviPaneRect;
+ naviPaneRect.LayoutRect( statusPaneRect.Rect(), AknLayoutScalable_Avkon::navi_pane_stacon(0) ); // softkeys on right
+ // navi-navi pane
+ tabsPaneRect.LayoutRect( naviPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane_stacon(0) ); // softkeys on right
+ // Passive tab item - lets use layout where active is on left side of passive
+ passiveTabRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::tabs_3_passive_pane(0) );
+ // Active tab item
+ activeTabRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane(0) );
+ // Left indication
+ leftIndicationRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane_g1(0) );
+ // Right indication
+ rightIndicationRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane_g2(0) );
+ // active tab text rect
+ activeTabTextRect.LayoutText( activeTabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane_t1(1) );
+ // passive tab text rect
+ passiveTabTextRect.LayoutText( passiveTabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_passive_pane_t1(1) );
+ }
+ else
+ {
+ // main pane for portait
+ mainAreaRect.LayoutRect( appWindow, AknLayoutScalable_Avkon::main_pane(3) );
+ // Top area - 0 is for classic portrait
+ TAknLayoutRect areaTopRect;
+ areaTopRect.LayoutRect( appWindow, AknLayoutScalable_Avkon::area_top_pane(0) );
+ // Status pane - 0 is for classic portrait
+ TAknLayoutRect statusPaneRect;
+ statusPaneRect.LayoutRect( areaTopRect.Rect(), AknLayoutScalable_Avkon::status_pane(0) );
+
+ // Navi pane
+ TAknLayoutRect naviPaneRect;
+ naviPaneRect.LayoutRect( statusPaneRect.Rect(), AknLayoutScalable_Avkon::navi_pane(0) );
+ // Navi-navi pane for tabs (0)
+ TAknLayoutRect navi2PaneRect;
+ navi2PaneRect.LayoutRect( naviPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane() );
+ // Short tab pane
+ tabsPaneRect.LayoutRect( navi2PaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_tabs_pane() );
+ // Tab pane for 2 items
+ TAknLayoutRect tab2PaneRect;
+ tab2PaneRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::navi_tabs_3_pane() );
+ // Passive tab item - lets use layout where active is on left side of passive
+ passiveTabRect.LayoutRect( tab2PaneRect.Rect(), AknLayoutScalable_Avkon::tabs_3_passive_pane(0) );
+ // Active tab item
+ activeTabRect.LayoutRect( tab2PaneRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane(0) );
+ // Left indication
+ leftIndicationRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane_g1(0) );
+ // Right indication
+ rightIndicationRect.LayoutRect( tabsPaneRect.Rect(), AknLayoutScalable_Avkon::navi_navi_pane_g2(0) );
+ // active tab text rect
+ activeTabTextRect.LayoutText( activeTabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_active_pane_t1(0) );
+ // passive tab text rect
+ passiveTabTextRect.LayoutText( passiveTabRect.Rect(), AknLayoutScalable_Avkon::tabs_3_passive_pane_t1(0) );
+ }
+
+ // active tab on left, passive on rightside
+ TInt tabOverlap = activeTabRect.Rect().iBr.iX - passiveTabRect.Rect().iTl.iX;
+ TInt tabHSpace = (TInt) ((activeTabTextRect.TextRect().iTl.iX - activeTabRect.Rect().iTl.iX + activeTabRect.Rect().iBr.iX - activeTabTextRect.TextRect().iBr.iX)/2);
+ TInt tabVSpace = (TInt) ((activeTabTextRect.TextRect().iTl.iY - activeTabRect.Rect().iTl.iY + activeTabRect.Rect().iBr.iY - activeTabTextRect.TextRect().iBr.iY)/2);
+ TInt tabBaseHeight = 0;
+ if ( landscape && !AknLayoutUtils::PenEnabled())
+ {
+ // In landscape tab is below mainpane
+ tabBaseHeight = mainAreaRect.Rect().iBr.iY - tabsPaneRect.Rect().iTl.iY;
+ }
+ else
+ {
+ // In portrait (and in landscape touch) tab is above mainpane
+ tabBaseHeight = tabsPaneRect.Rect().iBr.iY - mainAreaRect.Rect().iTl.iY;
+ }
+ TInt tabBaseOverlap = 0;
+ if ( landscape && !AknLayoutUtils::PenEnabled())
+ {
+ // In landscape tab is below mainpane
+ tabBaseOverlap = Max( 0, mainAreaRect.Rect().iBr.iY - tabsPaneRect.Rect().iTl.iY);
+ }
+ else
+ {
+ // In portrait tab is above mainpane
+ tabBaseOverlap = Max( 0, mainAreaRect.Rect().iTl.iY - tabsPaneRect.Rect().iBr.iY);
+ }
+ TInt tabButtonWidth = Max(leftIndicationRect.Rect().Width(), rightIndicationRect.Rect().Width());
+ TInt tabVShift = Max( Abs(activeTabTextRect.TextRect().iBr.iY - passiveTabTextRect.TextRect().iBr.iY), Abs(activeTabTextRect.TextRect().iTl.iY - passiveTabTextRect.TextRect().iTl.iY) );
+ TInt tabHShift = Max( Abs(activeTabTextRect.TextRect().iBr.iX - passiveTabTextRect.TextRect().iBr.iX), Abs(activeTabTextRect.TextRect().iTl.iX - passiveTabTextRect.TextRect().iTl.iX) );
+ tabHShift -= (passiveTabRect.Rect().Width() - tabOverlap); // remove tab change and add overlapping area
+
+ switch( tabMetric )
+ {
+ case QStyle::PM_TabBarTabOverlap:
+ tabValue = tabOverlap;
+ break;
+ case QStyle::PM_TabBarTabHSpace:
+ tabValue = tabHSpace;
+ break;
+ case QStyle::PM_TabBarTabVSpace:
+ tabValue = tabVSpace;
+ break;
+ case QStyle::PM_TabBarBaseHeight:
+ tabValue = tabBaseHeight;
+ break;
+ case QStyle::PM_TabBarBaseOverlap:
+ tabValue = tabBaseOverlap;
+ break;
+ case QStyle::PM_TabBarScrollButtonWidth:
+ // Since in Qt the scroll indicator is shown within a button, we need to add button margins to this value
+ {
+ tabValue = tabButtonWidth + 2*PixelMetricValue(QStyle::PM_ButtonMargin);
+ }
+ break;
+ case QStyle::PM_TabBarTabShiftHorizontal:
+ tabValue = tabHShift;
+ break;
+ case QStyle::PM_TabBarTabShiftVertical:
+ tabValue = tabVShift;
+ break;
+ default:
+ break;
+ }
+ return tabValue;
+ }
+
+TInt PixelMetrics::PixelMetricMenuValue(QStyle::PixelMetric tabMetric, TRect mainPaneRect )
+ {
+ TInt menuValue = 0;
+ TAknLayoutRect popupMenuRect;
+ popupMenuRect.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_menu_window(0) );
+ TAknLayoutRect listScrollPaneRect;
+ listScrollPaneRect.LayoutRect( popupMenuRect.Rect(), AknLayoutScalable_Avkon::listscroll_menu_pane(0) );
+ TAknLayoutRect listMenuPaneRect;
+ listMenuPaneRect.LayoutRect( listScrollPaneRect.Rect(), AknLayoutScalable_Avkon::list_menu_pane(0) );
+ TAknLayoutRect listMenuRow1Rect;
+ listMenuRow1Rect.LayoutRect( listScrollPaneRect.Rect(), AknLayoutScalable_Avkon::list_single_pane_cp2(0));
+
+ switch (tabMetric)
+ {
+ case QStyle::PM_MenuPanelWidth:
+ menuValue = listMenuPaneRect.Rect().iTl.iX - listScrollPaneRect.Rect().iTl.iX;
+ if ( AknLayoutUtils::LayoutMirrored() )
+ {
+ menuValue = listScrollPaneRect.Rect().iBr.iX - listMenuPaneRect.Rect().iBr.iX;
+ }
+ break;
+ case QStyle::PM_MenuHMargin:
+ menuValue = listMenuRow1Rect.Rect().iTl.iX - popupMenuRect.Rect().iTl.iX;
+ if ( AknLayoutUtils::LayoutMirrored() )
+ {
+ menuValue = popupMenuRect.Rect().iBr.iX - listMenuRow1Rect.Rect().iBr.iX;
+ }
+ break;
+ case QStyle::PM_MenuVMargin:
+ menuValue = listMenuRow1Rect.Rect().iTl.iY - popupMenuRect.Rect().iTl.iY;
+ break;
+ default:
+ break;
+ }
+ return menuValue;
+ }
diff --git a/util/s60pixelmetrics/pixel_metrics.h b/util/s60pixelmetrics/pixel_metrics.h
new file mode 100644
index 0000000000..692564ca6e
--- /dev/null
+++ b/util/s60pixelmetrics/pixel_metrics.h
@@ -0,0 +1,216 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PIXELMETRICS_H
+#define PIXELMETRICS_H
+
+#include <e32base.h>
+#define S60_Rnd_Env
+
+#ifdef S60_Rnd_Env
+#pragma message ("Building in supported environment")
+
+const TInt KUnknownBase = -5000;
+
+NONSHARABLE_CLASS( QStyle )
+ {
+ public:
+ enum PixelMetric {
+ PM_ButtonMargin,
+ PM_ButtonDefaultIndicator,
+ PM_MenuButtonIndicator,
+ PM_ButtonShiftHorizontal,
+ PM_ButtonShiftVertical,
+
+ PM_DefaultFrameWidth,
+ PM_SpinBoxFrameWidth,
+ PM_ComboBoxFrameWidth,
+
+ PM_MaximumDragDistance,
+
+ PM_ScrollBarExtent,
+ PM_ScrollBarSliderMin,
+
+ PM_SliderThickness, // total slider thickness
+ PM_SliderControlThickness, // thickness of the business part
+ PM_SliderLength, // total length of slider
+ PM_SliderTickmarkOffset, //
+ PM_SliderSpaceAvailable, // available space for slider to move
+
+ PM_DockWidgetSeparatorExtent,
+ PM_DockWidgetHandleExtent,
+ PM_DockWidgetFrameWidth,
+
+ PM_TabBarTabOverlap,
+ PM_TabBarTabHSpace,
+ PM_TabBarTabVSpace,
+ PM_TabBarBaseHeight,
+ PM_TabBarBaseOverlap,
+
+ PM_ProgressBarChunkWidth,
+
+ PM_SplitterWidth,
+ PM_TitleBarHeight,
+
+ PM_MenuScrollerHeight,
+ PM_MenuHMargin,
+ PM_MenuVMargin,
+ PM_MenuPanelWidth,
+ PM_MenuTearoffHeight,
+ PM_MenuDesktopFrameWidth,
+
+ PM_MenuBarPanelWidth,
+ PM_MenuBarItemSpacing,
+ PM_MenuBarVMargin,
+ PM_MenuBarHMargin,
+
+ PM_IndicatorWidth,
+ PM_IndicatorHeight,
+ PM_ExclusiveIndicatorWidth,
+ PM_ExclusiveIndicatorHeight,
+ PM_CheckListButtonSize,
+ PM_CheckListControllerSize,
+
+ PM_DialogButtonsSeparator,
+ PM_DialogButtonsButtonWidth,
+ PM_DialogButtonsButtonHeight,
+
+ PM_MdiSubWindowFrameWidth,
+ PM_MDIFrameWidth = PM_MdiSubWindowFrameWidth, //obsolete
+ PM_MdiSubWindowMinimizedWidth,
+ PM_MDIMinimizedWidth = PM_MdiSubWindowMinimizedWidth, //obsolete
+
+ PM_HeaderMargin,
+ PM_HeaderMarkSize,
+ PM_HeaderGripMargin,
+ PM_TabBarTabShiftHorizontal,
+ PM_TabBarTabShiftVertical,
+ PM_TabBarScrollButtonWidth,
+
+ PM_ToolBarFrameWidth,
+ PM_ToolBarHandleExtent,
+ PM_ToolBarItemSpacing,
+ PM_ToolBarItemMargin,
+ PM_ToolBarSeparatorExtent,
+ PM_ToolBarExtensionExtent,
+
+ PM_SpinBoxSliderHeight,
+
+ PM_DefaultTopLevelMargin,
+ PM_DefaultChildMargin,
+ PM_DefaultLayoutSpacing,
+
+ PM_ToolBarIconSize,
+ PM_ListViewIconSize,
+ PM_IconViewIconSize,
+ PM_SmallIconSize,
+ PM_LargeIconSize,
+
+ PM_FocusFrameVMargin,
+ PM_FocusFrameHMargin,
+
+ PM_ToolTipLabelFrameWidth,
+ PM_CheckBoxLabelSpacing,
+ PM_TabBarIconSize,
+ PM_SizeGripSize,
+ PM_DockWidgetTitleMargin,
+ PM_MessageBoxIconSize,
+ PM_ButtonIconSize,
+
+ PM_DockWidgetTitleBarButtonMargin,
+
+ PM_RadioButtonLabelSpacing,
+ PM_LayoutLeftMargin,
+ PM_LayoutTopMargin,
+ PM_LayoutRightMargin,
+ PM_LayoutBottomMargin,
+ PM_LayoutHorizontalSpacing,
+ PM_LayoutVerticalSpacing,
+ PM_TabBar_ScrollButtonOverlap,
+
+ PM_TextCursorWidth,
+
+ PM_TabCloseIndicatorWidth,
+ PM_TabCloseIndicatorHeight,
+
+ PM_ScrollView_ScrollBarSpacing,
+ PM_SubMenuOverlap,
+
+ // do not add any values below/greater than this
+ PM_CustomBase = 0xf0000000,
+
+ // The following are custom values needed to draw the S60Style according scalable UIs.
+ // Width of 9-part frame-corner
+ PM_Custom_FrameCornerWidth,
+ // Height of 9-part frame corner
+ PM_Custom_FrameCornerHeight,
+ // Bold line width
+ PM_Custom_BoldLineWidth,
+ // Thin line width
+ PM_Custom_ThinLineWidth
+ };
+
+ };
+#else
+#pragma message ("Building in non-supported environment, this probably fails")
+#endif
+
+
+// Pixel metrics version information.
+class TPixelMetricsVersion
+ {
+ public:
+ TInt majorVersion;
+ TInt minorVersion;
+ };
+
+NONSHARABLE_CLASS(PixelMetrics)
+{
+ public:
+ static TPixelMetricsVersion Version();
+ static TInt PixelMetricValue(QStyle::PixelMetric);
+
+ private:
+ static TInt PixelMetricMenuValue( QStyle::PixelMetric menuValue, TRect mainPaneRect );
+ static TInt PixelMetricTabValue( QStyle::PixelMetric tabValue, TRect appWindow, TBool landscape );
+};
+
+#endif // PIXELMETRICS_H
diff --git a/util/s60pixelmetrics/pm_mapper.hrh b/util/s60pixelmetrics/pm_mapper.hrh
new file mode 100644
index 0000000000..afd47db974
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapper.hrh
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PMMAPPER_HRH
+#define PMMAPPER_HRH
+
+// DATA TYPES
+
+// View IDs.
+enum
+ {
+ EPMMapperViewId = 1 // Base view.
+ };
+
+// Menu items (commands)
+enum
+ {
+ ECmdStartCalculations = 8500,
+ ECmdSwitchOrientation,
+ ECmdSwitchMirroring,
+ ECmdStatus,
+ ECmdSwitchOutput,
+ ECmdCreateHeaderFile,
+ ECmdSetAutoMode
+ };
+
+enum
+ {
+ EWaitNote = 9000
+ };
+
+#endif // PMMAPPER_HRH
+
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapper.mmp b/util/s60pixelmetrics/pm_mapper.mmp
new file mode 100644
index 0000000000..a277404e00
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapper.mmp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <data_caging_paths.hrh>
+#include <domain\osextensions\platform_paths.hrh>
+
+TARGET pm_mapper.exe
+TARGETTYPE exe
+UID 0x100039CE 0x2002121F
+
+CAPABILITY CAP_APPLICATION
+VENDORID VID_DEFAULT
+
+SOURCEPATH .
+SOURCE pm_mapperview.cpp
+SOURCE pm_mapperapp.cpp
+SOURCE pixel_metrics.cpp
+
+START RESOURCE pm_mapper.rss
+HEADER
+TARGETPATH APP_RESOURCE_DIR
+END
+
+START RESOURCE pm_mapper_reg.rss
+TARGETPATH \private\10003a3f\apps
+END
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE .
+
+LIBRARY eikcoctl.lib
+LIBRARY avkon.lib
+LIBRARY euser.lib
+LIBRARY apparc.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY bafl.lib
+LIBRARY eikctl.lib
+LIBRARY apgrfx.lib
+LIBRARY aknnotify.lib
+LIBRARY ws32.lib
+LIBRARY commonengine.lib
+LIBRARY fbscli.lib
+LIBRARY eikdlg.lib
+LIBRARY aknskins.lib
+LIBRARY gdi.lib
+LIBRARY CentralRepository.lib
+LIBRARY efsrv.lib
+LIBRARY cdlengine.lib
+LIBRARY AknLayout2.lib
+LIBRARY AknLayout2Scalable.lib
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapper.pkg b/util/s60pixelmetrics/pm_mapper.pkg
new file mode 100644
index 0000000000..1f2e38fab0
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapper.pkg
@@ -0,0 +1,32 @@
+; ==============================================================================
+; Name : PMMapper.pkg
+; Part of : Pixel Metrics Mapper
+; Description : Package file for pixel metrics mapper
+; SIS creation.
+; Version :
+;
+; Copyright (c) 2009 Nokia Corporation.
+; This material, including documentation and any related
+; computer programs, is protected by copyright controlled by
+; Nokia Corporation. All rights are reserved. Copying,
+; including reproducing, storing, adapting or translating, any
+; or all of this material requires the prior written consent of
+; Nokia Corporation. This material also contains confidential
+; information which may not be disclosed to others without the
+; prior written consent of Nokia Corporation.
+; ==============================================================================
+
+
+;Header
+#{"PMMapper"},(0x2002121F),1,0,0
+
+;Localised Vendor name
+%{"Nokia Test EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+;Files to install
+"\Epoc32\release\armv5\urel\pm_mapper.exe" -"!:\sys\bin\pm_mapper.exe"
+"\epoc32\data\z\private\10003a3f\apps\pm_mapper_reg.rsc" -"!:\private\10003a3f\import\apps\pm_mapper_reg.rsc"
+"\epoc32\data\Z\Resource\Apps\pm_mapper.RSC" -"!:\resource\apps\pm_mapper.rsc"
diff --git a/util/s60pixelmetrics/pm_mapper.rss b/util/s60pixelmetrics/pm_mapper.rss
new file mode 100644
index 0000000000..85432718ae
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapper.rss
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// RESOURCE IDENTIFIER
+NAME TATR
+
+
+// INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <avkon.hrh>
+#include <uikon.hrh>
+#include <avkonIcons.hrh>
+#include <data_caging_paths_strings.hrh>
+#include <appinfo.rh>
+
+#include "pm_mapper.hrh"
+
+
+// RESOURCE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+//
+// RSS_SIGNATURE
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+
+// -----------------------------------------------------------------------------
+//
+// TBUF
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF { buf = "pm_mapper"; }
+
+
+// -----------------------------------------------------------------------------
+//
+// EIK_APP_INFO
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+ {
+ }
+
+// -----------------------------------------------------------------------------
+//
+// r_pmmapper_localisable_app_info
+// Captions for this application.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_pmmapper_localisable_app_info
+ {
+ short_caption = "pm_mapper";
+ caption_and_icon =
+ CAPTION_AND_ICON_INFO
+ {
+ caption = "PixelMetricsMapper";
+ };
+ }
+
+// -----------------------------------------------------------------------------
+//
+// r_pmmapper_view
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_pmmapper_view
+ {
+ menubar = r_pmmapper_view_menu;
+ cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_pmmapper_view_menu
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_pmmapper_view_menu
+ {
+ titles=
+ {
+ MENU_TITLE { txt = "A"; menu_pane = r_pmmapper_system_menu; }
+ };
+ }
+
+// -----------------------------------------------------------------------------
+//
+// r_pmmapper_system_menu
+//
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_pmmapper_system_menu
+ {
+ items =
+ {
+ MENU_ITEM { command = ECmdStartCalculations; txt = "Start calculations"; },
+ MENU_ITEM { command = ECmdSwitchOrientation; txt = "Switch orientation"; },
+ MENU_ITEM { command = ECmdSwitchMirroring; txt = "Switch mirroring";},
+ MENU_ITEM { command = ECmdStatus; txt = "Status"; },
+ MENU_ITEM { command = ECmdSwitchOutput; txt = "Switch output (file/screen)"; },
+ MENU_ITEM { command = ECmdCreateHeaderFile; txt = "Create header file"; },
+ MENU_ITEM { command = ECmdSetAutoMode; txt = "Switch autoMode";}
+ };
+ }
+
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapper_reg.rss b/util/s60pixelmetrics/pm_mapper_reg.rss
new file mode 100644
index 0000000000..d21a2c8314
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapper_reg.rss
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <appinfo.rh>
+#include <pm_mapper.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2002121F // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+ {
+ app_file = "pm_mapper";
+ localisable_resource_file =
+ APP_RESOURCE_DIR"\\pm_mapper";
+ localisable_resource_id = R_PMMAPPER_LOCALISABLE_APP_INFO;
+ }
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapperapp.cpp b/util/s60pixelmetrics/pm_mapperapp.cpp
new file mode 100644
index 0000000000..e699019e35
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapperapp.cpp
@@ -0,0 +1,1044 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+
+#include <avkon.rsg>
+#include <avkon.hrh>
+#include "pm_mapper.hrh"
+#include "pm_mapperapp.h"
+#include "pm_mapperview.h"
+#include <pm_mapper.rsg>
+
+#include <BldVariant.hrh>
+
+#include <w32std.h>
+#include <apgwgnam.h>
+#include <eikstart.h>
+#include <eikenv.h>
+#include <f32file.h>
+
+#include <avkon.hrh>
+#include <aknenv.h>
+
+#include <aknnotedialog.h>
+#include <stringloader.h>
+#include <coneresloader.h>
+#include <aknglobalnote.h>
+
+#include <CentralRepository.h>
+#include <AvkonInternalCRKeys.h> // KAknLayoutId
+
+#include <Aknsutils.h>
+#include <AknUtils.h>
+#include "pixel_metrics.h"
+
+#include <avkon.mbg>
+
+#include <AknLayoutConfig.h>
+#include <aknsgcc.h>
+
+typedef TBuf<2048> TMySmallBuffer;
+typedef TBuf<8192> TMyBigBuffer;
+
+_LIT(KLayoutSourceFileAndPath, "\\private\\2002121f\\pm_layout.cpp");
+_LIT(KPixelMetricsDataFiles, "\\private\\2002121f\\*.txt");
+_LIT(KOpenBrace, "{");
+_LIT(KComma, ",");
+_LIT(KColon, ":");
+_LIT(KTab, "\t");
+_LIT(KEndBraceWithCommaAndCRLF, "},\n");
+_LIT(KCRLF, "\n");
+
+// Number of header lines in layout data.
+const TInt KHeaderValues = 5;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPixelMetricsMapperAppUi::CPixelMetricsMapperAppUi() : iFileOutputOn(EFalse)
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CPixelMetricsMapperAppUi::~CPixelMetricsMapperAppUi()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperAppUi::ConstructL()
+ {
+ BaseConstructL();
+
+ CEikonEnv& eikEnv = *CEikonEnv::Static();
+
+ eikEnv.WsSession().ComputeMode(
+ RWsSession::EPriorityControlDisabled );
+ RThread().SetProcessPriority( EPriorityHigh );
+
+ CPixelMetricsMapperView* view = new( ELeave ) CPixelMetricsMapperView;
+ CleanupStack::PushL( view );
+ view->ConstructL();
+ CleanupStack::Pop(); // view
+ AddViewL(view); // transfer ownership to CAknViewAppUi
+ iView = view;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CPixelMetricsMapperAppUi::HandleKeyEventL(
+ const TKeyEvent& /*aKeyEvent*/,
+ TEventCode aType )
+ {
+ return EKeyWasNotConsumed;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand )
+ {
+ switch ( aCommand )
+ {
+ case EAknSoftkeyExit:
+ case EEikCmdExit:
+ Exit();
+ break;
+ case ECmdSwitchOutput:
+ iFileOutputOn = !iFileOutputOn;
+ break;
+ case ECmdStatus:
+ {
+ ClearL();
+
+ // layout
+ CRepository* repository = NULL;
+ TInt value = KErrNotFound;
+ TRAPD(ret, repository = CRepository::NewL(KCRUidAvkon));
+ if (ret == KErrNone)
+ {
+ ret = repository->Get(KAknLayoutId, value);
+ }
+ delete repository;
+ ret= 0;
+ HBufC* buffer = HBufC::NewLC( 100 );
+ TPtr bufferPtr = buffer->Des();
+ bufferPtr.Append(_L("Layout: "));
+ if (ret==KErrNone)
+ {
+ bufferPtr.AppendNum(value);
+ }
+ else
+ {
+ bufferPtr.Append(_L("(error) "));
+ bufferPtr.AppendNum(ret);
+ }
+ TBool last = ETrue;
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+
+ // Orientation
+ bufferPtr.Append(_L("Orientation: "));
+ bufferPtr.AppendNum((TInt)iAvkonAppUi->Orientation());
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+
+ // Output
+ bufferPtr.Append(_L("Output: "));
+ if (iFileOutputOn) bufferPtr.Append(_L("File"));
+ else bufferPtr.Append(_L("Screen"));
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+
+ // Automode
+ bufferPtr.Append(_L("AutoMode: "));
+ bufferPtr.AppendNum((TInt)iAutoMode);
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+
+ CAknLayoutConfig::TScreenMode localAppScreenMode = CAknSgcClient::ScreenMode();
+ TInt hashValue = localAppScreenMode.ScreenStyleHash();
+ TPixelsTwipsAndRotation pixels = CAknSgcClient::PixelsAndRotation();
+ TSize pixelSize = pixels.iPixelSize;
+
+ bufferPtr.Append(_L("LayoutName: "));
+
+ if ( (pixelSize.iWidth == 320 || pixelSize.iWidth == 240 )&&
+ (pixelSize.iHeight == 320 || pixelSize.iHeight == 240 ))
+ {
+ if (hashValue==0x996F7AA7)
+ bufferPtr.Append(_L("QVGA2"));
+ else
+ bufferPtr.Append(_L("QVGA1"));
+ }
+ else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 360 )&&
+ (pixelSize.iHeight == 360 || pixelSize.iHeight == 640 ))
+ {
+ bufferPtr.Append(_L("nHD"));
+ }
+ else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 480 )&&
+ (pixelSize.iHeight == 480 || pixelSize.iHeight == 640 ))
+ {
+ bufferPtr.Append(_L("VGA"));
+ }
+ else if ((pixelSize.iWidth == 352 || pixelSize.iWidth == 800 )&&
+ (pixelSize.iHeight == 800 || pixelSize.iHeight == 352 ))
+ {
+ bufferPtr.Append(_L("E90"));
+ }
+ else if ((pixelSize.iWidth == 320 || pixelSize.iWidth == 480 ||
+ pixelSize.iWidth == 240 || pixelSize.iWidth == 640 )&&
+ (pixelSize.iHeight == 320 || pixelSize.iHeight == 480 ||
+ pixelSize.iHeight == 240 || pixelSize.iHeight == 640))
+ {
+ bufferPtr.Append(_L("HVGA"));
+ }
+ else if ((pixelSize.iWidth == 480 || pixelSize.iWidth == 854 ||
+ pixelSize.iWidth == 848 || pixelSize.iWidth == 800 )&&
+ (pixelSize.iHeight == 800 || pixelSize.iHeight == 480 ||
+ pixelSize.iHeight == 848 || pixelSize.iHeight == 854))
+ {
+ bufferPtr.Append(_L("WVGA"));
+ }
+ else
+ {
+ bufferPtr.Append(_L("Unknown"));
+ }
+
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+ CleanupStack::PopAndDestroy( buffer );
+ }
+ break;
+ case ECmdSwitchMirroring:
+ {
+ // set the shared data value
+ CRepository* repository = NULL;
+ TRAPD(ret, repository = CRepository::NewL(KCRUidAvkon));
+ if (ret == KErrNone)
+ {
+ TInt value = KErrNotFound;
+ repository->Get(KAknLayoutId, value);
+ if ( value == EAknLayoutIdELAF)
+ {
+ value = EAknLayoutIdABRW;
+ }
+ else if (value ==EAknLayoutIdABRW)
+ {
+ value = EAknLayoutIdELAF;
+ }
+ ret = repository->Set(KAknLayoutId, value);
+ }
+ delete repository;
+ // now inform all open apps of the switch
+ TWsEvent event;
+ event.SetType(KEikDynamicLayoutVariantSwitch);
+ iEikonEnv->WsSession().SendEventToAllWindowGroups(event);
+ }
+ break;
+ case ECmdSwitchOrientation:
+ {
+ ClearL();
+ #ifndef __SERIES60_31__
+ if (!iAvkonAppUi->OrientationCanBeChanged())
+ {
+ HBufC* buffer = HBufC::NewLC( 100 );
+ TPtr bufferPtr = buffer->Des();
+ bufferPtr.Append(_L("Orientation cannot be changed."));
+ TBool last = EFalse;
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+ delete buffer;
+ }
+ #endif //__SERIES60_31__
+ if ( iAvkonAppUi->Orientation() == CAknAppUiBase::EAppUiOrientationPortrait)
+ {
+ iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
+ }
+ else if (iAvkonAppUi->Orientation() == CAknAppUiBase::EAppUiOrientationLandscape)
+ {
+ iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait);
+ }
+ else
+ {
+ // unspecified
+ iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
+ /*User::After(100000);
+ HBufC* buffer = HBufC::NewLC( 100 );
+ TPtr bufferPtr = buffer->Des();
+ bufferPtr.Append(_L("Orientation unspecified."));
+ TBool last = EFalse;
+ ShowL( *buffer, last );
+ bufferPtr.Zero();
+ delete buffer;*/
+ }
+ break;
+ }
+ case ECmdStartCalculations:
+ {
+ ClearL();
+ // Get known values
+ TInt index = 0;
+ TBool last = EFalse;
+ if (iFileOutputOn)
+ {
+ TRect screenRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::EApplicationWindow,
+ screenRect );
+
+ // Add screen dimensions
+ TInt height = screenRect.Height();
+ TInt width = screenRect.Width();
+ TBuf16<32> tgt;
+ // HEIGTH
+ tgt.Append(_L("height: \t"));
+ tgt.AppendNum(height, EDecimal); // put max height into text file
+ ShowL( tgt, last );
+ tgt.Zero();
+ // WIDTH
+ tgt.Append(_L("width: \t"));
+ tgt.AppendNum(width, EDecimal); // put max width into text file
+ ShowL( tgt, last );
+ tgt.Zero();
+ // VERSION
+ TPixelMetricsVersion version = PixelMetrics::Version();
+ tgt.Append(_L("major_version: \t"));
+ tgt.AppendNum(version.majorVersion, EDecimal); // put major version into text file
+ ShowL( tgt, last );
+ tgt.Zero();
+ tgt.Append(_L("minor_version: \t"));
+ tgt.AppendNum(version.minorVersion, EDecimal); // put minor version into text file
+ ShowL( tgt, last );
+ tgt.Zero();
+ // MIRRORED
+ TBool mirrored = AknLayoutUtils::LayoutMirrored();
+ tgt.Append(_L("mirrored: \t"));
+ tgt.AppendNum(mirrored, EDecimal); // put mirrored state into text file
+ ShowL( tgt, last );
+ tgt.Zero();
+ }
+
+ TInt myValue = KErrNotFound;
+ for (;;)
+ {
+ if (index==QStyle::PM_Custom_ThinLineWidth)
+ {
+ last = ETrue;
+ }
+ myValue = PixelMetrics::PixelMetricValue(static_cast<QStyle::PixelMetric>(index));
+ ShowSingleValueL( index, myValue, last );
+
+ if (last) break;
+ // if last before custom values, "jump" to custom base
+ if (index==QStyle::PM_SubMenuOverlap) index = QStyle::PM_CustomBase;
+ index++;
+ }
+ if (iAutoMode && !iMode)
+ {
+ HandleCommandL(ECmdSwitchMirroring);
+ iMode = ETrue;
+ }
+ }
+ break;
+ case ECmdCreateHeaderFile:
+ CreateHeaderFileL();
+ break;
+ case ECmdSetAutoMode:
+ iAutoMode = !iAutoMode;
+ default:
+ break;
+ }
+ }
+void CPixelMetricsMapperAppUi::DoAutoOperationL()
+ {
+ HandleCommandL(ECmdStartCalculations);
+ iMode = EFalse;
+ HandleCommandL(ECmdSwitchMirroring);
+ }
+
+TBool CPixelMetricsMapperAppUi::ReadyForAutoOp() const
+ {
+ return (iAutoMode && iMode);
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperAppUi::ShowL( const TDesC& aText, TBool& aLast, const TBool& aFileOutput )
+ {
+ _LIT( KTestPrefix, "\t" );
+
+ HBufC* buffer = HBufC::NewLC( aText.Length() + KTestPrefix().Length() );
+ TPtr ptr = buffer->Des();
+ ptr.Append( KTestPrefix );
+ ptr.Append( aText );
+ iView->ShowL( *buffer, aLast, aFileOutput );
+ CleanupStack::PopAndDestroy( buffer );
+ }
+
+void CPixelMetricsMapperAppUi::ShowSingleValueL(TInt& aPixelMetric, TInt& aValue, TBool& aLast )
+ {
+ HBufC* buffer = HBufC::NewLC( 100 );
+ TPtr bufferPtr = buffer->Des();
+
+ switch (aPixelMetric)
+ {
+ case QStyle::PM_DockWidgetTitleMargin:
+ bufferPtr.Append(_L("DockTitleMargin: "));
+ break;
+ case QStyle::PM_DockWidgetTitleBarButtonMargin:
+ bufferPtr.Append(_L("DockTitleBtnMargin: "));
+ break;
+ case QStyle::PM_ButtonMargin:
+ bufferPtr.Append(_L("ButtonMargin: "));
+ break;
+ case QStyle::PM_ButtonDefaultIndicator:
+ bufferPtr.Append(_L("ButtonDefaultIndicator: "));
+ break;
+ case QStyle::PM_MdiSubWindowFrameWidth:
+ bufferPtr.Append(_L("MdiSubWndFrameW: "));
+ break;
+ case QStyle::PM_ComboBoxFrameWidth:
+ bufferPtr.Append(_L("ComboBoxFrameWidth: "));
+ break;
+ case QStyle::PM_SpinBoxFrameWidth:
+ bufferPtr.Append(_L("SpinBoxFrameWidth: "));
+ break;
+ case QStyle::PM_DefaultFrameWidth:
+ bufferPtr.Append(_L("DefaultFrameWidth: "));
+ break;
+ case QStyle::PM_RadioButtonLabelSpacing:
+ bufferPtr.Append(_L("RadioButtonLabelSpc: "));
+ break;
+ case QStyle::PM_CheckBoxLabelSpacing:
+ bufferPtr.Append(_L("CheckBoxLabelSpacing: "));
+ break;
+ case QStyle::PM_ToolTipLabelFrameWidth:
+ bufferPtr.Append(_L("ToolTipLabelFrameW: "));
+ break;
+ case QStyle::PM_ListViewIconSize:
+ bufferPtr.Append(_L("ListViewIconSize: "));
+ break;
+ case QStyle::PM_LargeIconSize:
+ bufferPtr.Append(_L("LargeIconSize: "));
+ break;
+ case QStyle::PM_IconViewIconSize:
+ bufferPtr.Append(_L("IconViewIconSize: "));
+ break;
+ case QStyle::PM_TabBarIconSize:
+ bufferPtr.Append(_L("TabBarIconSize: "));
+ break;
+ case QStyle::PM_MessageBoxIconSize:
+ bufferPtr.Append(_L("MessageBoxIconSize: "));
+ break;
+ case QStyle::PM_ButtonIconSize:
+ bufferPtr.Append(_L("ButtonIconSize: "));
+ break;
+ case QStyle::PM_TextCursorWidth:
+ bufferPtr.Append(_L("TextCursorWidth: "));
+ break;
+ case QStyle::PM_SliderLength:
+ bufferPtr.Append(_L("SliderLength: "));
+ break;
+ case QStyle::PM_SliderThickness:
+ bufferPtr.Append(_L("SliderThickness: "));
+ break;
+ case QStyle::PM_SliderTickmarkOffset:
+ bufferPtr.Append(_L("SliderTickmarkOffset: "));
+ break;
+ case QStyle::PM_SliderControlThickness:
+ bufferPtr.Append(_L("SliderCntrlThickness: "));
+ break;
+ case QStyle::PM_SliderSpaceAvailable:
+ bufferPtr.Append(_L("SliderSpaceAvailable: "));
+ break;
+ case QStyle::PM_MenuBarItemSpacing:
+ bufferPtr.Append(_L("MenuBarItemSpacing: "));
+ break;
+ case QStyle::PM_MenuBarHMargin:
+ bufferPtr.Append(_L("MenuBarHMargin: "));
+ break;
+ case QStyle::PM_MenuBarVMargin:
+ bufferPtr.Append(_L("MenuBarVMargin: "));
+ break;
+ case QStyle::PM_ToolBarItemSpacing:
+ bufferPtr.Append(_L("ToolBarItemSpacing: "));
+ break;
+ case QStyle::PM_ToolBarFrameWidth:
+ bufferPtr.Append(_L("ToolBarFrameWidth: "));
+ break;
+ case QStyle::PM_ToolBarItemMargin:
+ bufferPtr.Append(_L("ToolBarItemMargin: "));
+ break;
+ case QStyle::PM_LayoutLeftMargin:
+ bufferPtr.Append(_L("LayoutLeftMargin: "));
+ break;
+ case QStyle::PM_LayoutRightMargin:
+ bufferPtr.Append(_L("LayoutRightMargin: "));
+ break;
+ case QStyle::PM_LayoutTopMargin:
+ bufferPtr.Append(_L("LayoutTopMargin: "));
+ break;
+ case QStyle::PM_LayoutBottomMargin:
+ bufferPtr.Append(_L("LayoutBottomMargin: "));
+ break;
+ case QStyle::PM_LayoutHorizontalSpacing:
+ bufferPtr.Append(_L("LayoutHSpacing: "));
+ break;
+ case QStyle::PM_LayoutVerticalSpacing:
+ bufferPtr.Append(_L("LayoutVSpacing: "));
+ break;
+ case QStyle::PM_MaximumDragDistance:
+ bufferPtr.Append(_L("MaxDragDistance: "));
+ break;
+ case QStyle::PM_ScrollBarExtent:
+ bufferPtr.Append(_L("ScrollBarExtent: "));
+ break;
+ case QStyle::PM_ScrollBarSliderMin:
+ bufferPtr.Append(_L("ScrollBarSliderMin: "));
+ break;
+ case QStyle::PM_MenuBarPanelWidth:
+ bufferPtr.Append(_L("MenuBarPanelWidth: "));
+ break;
+ case QStyle::PM_ProgressBarChunkWidth:
+ bufferPtr.Append(_L("ProgBarChunkWidth: "));
+ break;
+ case QStyle::PM_TabBarTabOverlap:
+ bufferPtr.Append(_L("TabBarTabOverlap: "));
+ break;
+ case QStyle::PM_TabBarTabHSpace:
+ bufferPtr.Append(_L("TabBarTabHSpace: "));
+ break;
+ case QStyle::PM_TabBarTabVSpace:
+ bufferPtr.Append(_L("TabBarTabVSpace: "));
+ break;
+ case QStyle::PM_TabBarBaseHeight:
+ bufferPtr.Append(_L("TabBarBaseHeight: "));
+ break;
+ case QStyle::PM_TabBarBaseOverlap:
+ bufferPtr.Append(_L("TabBarBaseOverlap: "));
+ break;
+ case QStyle::PM_TabBarScrollButtonWidth:
+ bufferPtr.Append(_L("TabBarScrollBtnWidth: "));
+ break;
+ case QStyle::PM_TabBarTabShiftHorizontal:
+ bufferPtr.Append(_L("TabBarTabShiftH: "));
+ break;
+ case QStyle::PM_TabBarTabShiftVertical:
+ bufferPtr.Append(_L("TabBarTabShiftV: "));
+ break;
+ case QStyle::PM_MenuPanelWidth:
+ bufferPtr.Append(_L("MenuPanelWidth: "));
+ break;
+ case QStyle::PM_MenuHMargin:
+ bufferPtr.Append(_L("MenuHMargin: "));
+ break;
+ case QStyle::PM_MenuVMargin:
+ bufferPtr.Append(_L("MenuVMargin: "));
+ break;
+ case QStyle::PM_MenuDesktopFrameWidth:
+ bufferPtr.Append(_L("MenuFrameWidth: "));
+ break;
+ case QStyle::PM_SmallIconSize:
+ bufferPtr.Append(_L("SmallIconSize: "));
+ break;
+ case QStyle::PM_FocusFrameHMargin:
+ bufferPtr.Append(_L("FocusFrameHMargin: "));
+ break;
+ case QStyle::PM_FocusFrameVMargin:
+ bufferPtr.Append(_L("FocusFrameVMargin: "));
+ break;
+ case QStyle::PM_ToolBarIconSize:
+ bufferPtr.Append(_L("ToolBarIconSize: "));
+ break;
+ case QStyle::PM_TitleBarHeight: // use titlepane height
+ bufferPtr.Append(_L("TitleBarHeight: "));
+ break;
+ case QStyle::PM_IndicatorWidth:
+ bufferPtr.Append(_L("IndicatorWidth: "));
+ break;
+ case QStyle::PM_IndicatorHeight:
+ bufferPtr.Append(_L("IndicatorHeight: "));
+ break;
+ case QStyle::PM_ExclusiveIndicatorHeight:
+ bufferPtr.Append(_L("ExclusiveIndHeight: "));
+ break;
+ case QStyle::PM_ExclusiveIndicatorWidth:
+ bufferPtr.Append(_L("ExclusiveIndWidth: "));
+ break;
+ case QStyle::PM_HeaderMargin: // not in S60
+ bufferPtr.Append(_L("HeaderMargin: "));
+ break;
+ case QStyle::PM_MenuScrollerHeight: // not in S60
+ bufferPtr.Append(_L("MenuScrollerHeight: "));
+ break;
+ case QStyle::PM_MenuTearoffHeight: // not in S60
+ bufferPtr.Append(_L("MenuTearoffHeight: "));
+ break;
+ case QStyle::PM_DockWidgetFrameWidth: // not in S60
+ bufferPtr.Append(_L("DockFrameWidth: "));
+ break;
+ case QStyle::PM_DockWidgetSeparatorExtent: // not in S60
+ bufferPtr.Append(_L("DockSepExtent: "));
+ break;
+ case QStyle::PM_MdiSubWindowMinimizedWidth: //no such thing in S60
+ bufferPtr.Append(_L("MdiSubWndMinWidth: "));
+ break;
+ case QStyle::PM_HeaderGripMargin: // not in S60
+ bufferPtr.Append(_L("HeaderGripMargin: "));
+ break;
+ case QStyle::PM_SplitterWidth: // not in S60
+ bufferPtr.Append(_L("SplitterWidth: "));
+ break;
+ case QStyle::PM_ToolBarExtensionExtent: // not in S60
+ bufferPtr.Append(_L("ToolBarExtExtent: "));
+ break;
+ case QStyle::PM_ToolBarSeparatorExtent: // not in S60
+ bufferPtr.Append(_L("ToolBarSepExtent: "));
+ break;
+ case QStyle::PM_ToolBarHandleExtent: // not in s60
+ bufferPtr.Append(_L("ToolBarHandleExtent: "));
+ break;
+ case QStyle::PM_MenuButtonIndicator: // none???
+ bufferPtr.Append(_L("MenuButtonIndicator: "));
+ break;
+ case QStyle::PM_ButtonShiftHorizontal: //none in 3.x
+ bufferPtr.Append(_L("ButtonShiftHorizontal: "));
+ break;
+ case QStyle::PM_ButtonShiftVertical: // none in 3.x
+ bufferPtr.Append(_L("ButtonShiftVertical: "));
+ break;
+ case QStyle::PM_TabBar_ScrollButtonOverlap: // not used in S60 - tab arrows are on left and right side of tab group - not together
+ bufferPtr.Append(_L("TabScrollBtnOverlap: "));
+ break;
+ case QStyle::PM_SizeGripSize: // use default
+ bufferPtr.Append(_L("SizeGripSize: "));
+ break;
+ case QStyle::PM_DockWidgetHandleExtent:
+ bufferPtr.Append(_L("DockWdgtHandleExt: "));
+ break;
+ case QStyle::PM_CheckListButtonSize:
+ bufferPtr.Append(_L("CheckListButtonSize: "));
+ break;
+ case QStyle::PM_CheckListControllerSize:
+ bufferPtr.Append(_L("CheckListCntlerSize: "));
+ break;
+ case QStyle::PM_DialogButtonsSeparator:
+ bufferPtr.Append(_L("DialogBtnSeparator: "));
+ break;
+ case QStyle::PM_DialogButtonsButtonWidth:
+ bufferPtr.Append(_L("DialogBtnWidth: "));
+ break;
+ case QStyle::PM_DialogButtonsButtonHeight:
+ bufferPtr.Append(_L("DialogBtnHeight: "));
+ break;
+ case QStyle::PM_HeaderMarkSize:
+ bufferPtr.Append(_L("HeaderMarkSize: "));
+ break;
+ case QStyle::PM_SpinBoxSliderHeight:
+ bufferPtr.Append(_L("SpinBoxSliderHeight: "));
+ break;
+ case QStyle::PM_DefaultTopLevelMargin:
+ bufferPtr.Append(_L("DefaultTopLvlMrg: "));
+ break;
+ case QStyle::PM_DefaultChildMargin:
+ bufferPtr.Append(_L("DefaultChildMrg: "));
+ break;
+ case QStyle::PM_DefaultLayoutSpacing:
+ bufferPtr.Append(_L("DefaultlayoutSpc: "));
+ break;
+ case QStyle::PM_TabCloseIndicatorWidth:
+ bufferPtr.Append(_L("TabCloseIndWidth: "));
+ break;
+ case QStyle::PM_TabCloseIndicatorHeight:
+ bufferPtr.Append(_L("TabCloseIndHeight: "));
+ break;
+ case QStyle::PM_ScrollView_ScrollBarSpacing:
+ bufferPtr.Append(_L("ScrollViewBarSpc: "));
+ break;
+ case QStyle::PM_SubMenuOverlap:
+ bufferPtr.Append(_L("SubMenuOverlap: "));
+ break;
+ case QStyle::PM_Custom_FrameCornerHeight:
+ bufferPtr.Append(_L("C_FrCornerHeight: "));
+ break;
+ case QStyle::PM_Custom_FrameCornerWidth:
+ bufferPtr.Append(_L("C_FrCornerWidth: "));
+ break;
+ case QStyle::PM_Custom_ThinLineWidth:
+ bufferPtr.Append(_L("C_ThinLineWidth: "));
+ break;
+ case QStyle::PM_Custom_BoldLineWidth:
+ bufferPtr.Append(_L("C_BoldLineWidth: "));
+ break;
+ default:
+ bufferPtr.Append(_L("Default: "));
+ break;
+ }
+
+ if (iFileOutputOn)
+ {
+ bufferPtr.Append('\t');
+ }
+ bufferPtr.AppendNum(aValue);
+ bufferPtr.Append(_L(" "));
+ ShowL( *buffer, aLast, iFileOutputOn );
+ CleanupStack::PopAndDestroy( buffer );
+ }
+
+void CPixelMetricsMapperAppUi::ClearL()
+ {
+ iView->ClearL();
+ }
+
+void CPixelMetricsMapperAppUi::CreateHeaderFileL() const
+ {
+ // Open/create resulting file.
+ RFile file;
+ HBufC* layoutFile = HBufC::NewLC( KMaxFileName );
+ *layoutFile = KLayoutSourceFileAndPath;
+ TFileName fileName = *layoutFile;
+ CleanupStack::PopAndDestroy(layoutFile);
+ RFs& fs = CEikonEnv::Static()->FsSession();
+ TInt error = file.Open(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText );
+ if (error==KErrNotFound)
+ {
+ file.Create(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText);
+ }
+ CleanupClosePushL( file );
+ file.SetSize( 0 );
+
+ // Make all writes as from textfile.
+ TFileText textFile;
+ textFile.Set( file );
+ textFile.Seek( ESeekStart );
+
+ // Take all layout files from private folder.
+ CDir* dirList;
+ User::LeaveIfError(fs.GetDir(
+ KPixelMetricsDataFiles,
+ KEntryAttMaskSupported,
+ ESortByName,
+ dirList));
+
+ TMySmallBuffer bufferLayoutHdr;
+ TMyBigBuffer bufferPMData;
+ TInt fileCount = dirList->Count();
+ for (TInt i=0;i<fileCount;i++)
+ {
+ // open sourcefile
+ RFile sourceFile;
+ TFileName layoutFile = (*dirList)[i].iName;
+ User::LeaveIfError( sourceFile.Open(
+ fs,layoutFile, EFileRead|EFileShareAny|EFileStreamText ));
+ CleanupClosePushL( sourceFile );
+
+ // Make all reads as from textfile.
+ TFileText textSourceFile;
+ textSourceFile.Set( sourceFile );
+ TFileName layoutName = CreateLayoutNameL( textSourceFile );
+
+ // rewind - just in case.
+ textSourceFile.Seek( ESeekStart );
+ TFileName oneline;
+ bufferLayoutHdr.Append(KOpenBrace);
+ bufferPMData.Append(KOpenBrace);
+ TInt loop = 0;
+ FOREVER
+ {
+ if( textSourceFile.Read(oneline) != KErrNone )
+ {
+ break;
+ }
+ // Add commas for all but first line
+ if (loop != 0)
+ {
+ if ( loop <= KHeaderValues-1)
+ {
+ bufferLayoutHdr.Append(KComma);
+ }
+ else
+ {
+ if (loop != KHeaderValues)
+ {
+ bufferPMData.Append(KComma);
+ }
+ }
+ if (loop==KHeaderValues)
+ {
+ bufferLayoutHdr.Append(_L(",QLatin1String(\""));
+ bufferLayoutHdr.Append(layoutName);
+ bufferLayoutHdr.Append(_L("\")"));
+ }
+ }
+ // Remove pixel metrics name and ":"
+ oneline = oneline.Mid(oneline.Find(KColon)+1);
+ // Remove tab
+ oneline = oneline.Mid(oneline.Find(KTab)+1);
+ // remove crap from the end of line
+ TLex lex(oneline);
+ TInt nextValue = -666;
+ User::LeaveIfError( lex.Val(nextValue) );
+ if ( loop <= KHeaderValues-1)
+ {
+ if (loop == KHeaderValues -1 ) // true / false values
+ {
+ if (nextValue == 1)
+ {
+ bufferLayoutHdr.Append(_L("true"));
+ }
+ else
+ {
+ bufferLayoutHdr.Append(_L("false"));
+ }
+ }
+ else
+ {
+ bufferLayoutHdr.AppendNum(nextValue);
+ }
+ }
+ else
+ {
+ if (nextValue == -909)
+ bufferPMData.Append(_L("ECommonStyleValue"));
+ else
+ bufferPMData.AppendNum(nextValue);
+ }
+ oneline.Zero();
+ loop++;
+ }
+ file.Flush();
+ bufferLayoutHdr.Append(KEndBraceWithCommaAndCRLF);
+ bufferPMData.Append(KEndBraceWithCommaAndCRLF);
+ CleanupStack::PopAndDestroy(); //sourceFile
+ }
+
+ bufferLayoutHdr = bufferLayoutHdr.Left(bufferLayoutHdr.Length()-2);
+ bufferPMData = bufferPMData.Left(bufferPMData.Length()-2);
+ textFile.Write(bufferLayoutHdr);
+ textFile.Write(KCRLF);
+ textFile.Write(bufferPMData);
+ delete dirList;
+
+ CleanupStack::PopAndDestroy(); //file
+ }
+
+TFileName CPixelMetricsMapperAppUi::CreateLayoutNameL(TFileText& aFileHandle) const
+{
+ aFileHandle.Seek(ESeekStart);
+ // Layout data is deployed like this:
+ // first line - height
+ // second line - width
+ // fifth line mirror info
+ TFileName lines;
+ TFileName layoutName;
+
+ TInt height = -666;
+ TInt width = -666;
+ TInt mirroring = -666;
+ // Collect name information.
+ for (TInt i=0; i<6; i++)
+ {
+ User::LeaveIfError(aFileHandle.Read(lines));
+ // Remove pixel metrics name and ":"
+ lines = lines.Mid(lines.Find(KColon)+1);
+ // Remove tab
+ lines = lines.Mid(lines.Find(KTab)+1);
+ TLex myLexer(lines);
+ TInt error = KErrNone;
+ if (i==0) //height is first
+ {
+ error = myLexer.Val(height);
+ }
+ if (i==1) //width is second
+ {
+ error = myLexer.Val(width);
+ }
+ if (i==4) //mirror info is fourth
+ {
+ error = myLexer.Val(mirroring);
+ }
+ User::LeaveIfError(error);
+ }
+
+ // Interpret results and write name to buffer.
+ if ( (width == 240 && height == 320) ||
+ (width == 320 && height == 240))
+ {
+ layoutName.Append(_L("QVGA "));
+ }
+ else if ( (width == 360 && height == 640) ||
+ (width == 640 && height == 360))
+ {
+ layoutName.Append(_L("NHD "));
+ }
+ else if ( (width == 480 && height == 640) ||
+ (width == 640 && height == 480))
+ {
+ layoutName.Append(_L("VGA "));
+ }
+ else if ( (width == 800 && height == 352) ||
+ (width == 352 && height == 800))
+ {
+ layoutName.Append(_L("E90 "));
+ }
+ else if ( (width == 800 && height == 480) ||
+ (width == 480 && height == 800) ||
+ (width == 848 && height == 480) ||
+ (width == 480 && height == 848) ||
+ (width == 854 && height == 480) ||
+ (width == 480 && height == 854))
+ {
+ layoutName.Append(_L("WVGA "));
+ }
+ else if ( (width == 480 && height == 320) ||
+ (width == 320 && height == 480) ||
+ (width == 640 && height == 240) ||
+ (width == 240 && height == 640))
+ {
+ layoutName.Append(_L("HVGA "));
+ }
+ else
+ {
+ layoutName.Append(_L("Unknown "));
+ layoutName.AppendNum(height);
+ layoutName.Append(_L("x"));
+ layoutName.AppendNum(width);
+ }
+ if (width > height)
+ {
+ layoutName.Append(_L("Landscape"));
+ }
+ else
+ {
+ layoutName.Append(_L("Portrait"));
+ }
+ if (mirroring)
+ {
+ layoutName.Append(_L(" Mirrored"));
+ }
+ return layoutName;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CPixelMetricsMapperDocument::CreateAppUiL()
+ {
+ return( new ( ELeave ) CPixelMetricsMapperAppUi );
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperDocument::ConstructL()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUid CPixelMetricsMapperApplication::AppDllUid() const
+ {
+ return KUidPMMapperApplication;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CPixelMetricsMapperApplication::CreateDocumentL()
+ {
+ CPixelMetricsMapperDocument* document =
+ new( ELeave ) CPixelMetricsMapperDocument( *this );
+ CleanupStack::PushL( document );
+ document->ConstructL();
+ CleanupStack::Pop();
+ return( document );
+ }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// ---------------------------------------------------------
+// NewApplication implements
+//
+// Creates an instance of application.
+//
+// Returns: an instance of CVtUiApp
+// ---------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+ {
+ return new CPixelMetricsMapperApplication;
+ }
+
+// ---------------------------------------------------------
+// E32Main implements
+//
+// It is called when executable is started.
+//
+// Returns: error code.
+// ---------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+ {
+ return EikStart::RunApplication( NewApplication );
+ }
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapperapp.h b/util/s60pixelmetrics/pm_mapperapp.h
new file mode 100644
index 0000000000..02d297eca2
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapperapp.h
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PMMAPPERAPP_H
+#define PMMAPPERAPP_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <aknViewAppUi.h>
+
+// CONSTANTS
+const TUid KUidPMMapperApplication = { 0x2002121F };
+
+
+// FORWARD DECLARATIONS
+class CPixelMetricsMapperView;
+class MAknsSkinInstance;
+
+// CLASS DECLARATION
+/**
+* CPixelMetricsMapperDocument
+*/
+class CPixelMetricsMapperDocument : public CEikDocument
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Constructor.
+ */
+ CPixelMetricsMapperDocument( CEikApplication& aApp )
+ : CEikDocument( aApp ) {}
+
+ /**
+ * Destructor.
+ */
+ ~CPixelMetricsMapperDocument(){}
+
+ public: // Functions from base classes
+
+ /**
+ * From CEikDocument.
+ */
+ CFileStore* OpenFileL(
+ TBool /*aDoOpen*/,
+ const TDesC& /*aFilename*/,
+ RFs& /*aFs*/ )
+ {
+ return NULL;
+ }
+
+ private: // Functions from base classes
+
+ /**
+ * From CEikDocument.
+ */
+ CEikAppUi* CreateAppUiL();
+ };
+
+/**
+* CPixelMetricsMapperAppUi
+*/
+class CPixelMetricsMapperAppUi : public CAknViewAppUi
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor.
+ */
+ CPixelMetricsMapperAppUi();
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Destructor.
+ */
+ ~CPixelMetricsMapperAppUi();
+
+ public:
+ void DoAutoOperationL();
+
+ TBool ReadyForAutoOp() const;
+
+
+ private: // Functions from base classes
+
+ /**
+ * From CEikAppUi.
+ */
+ void HandleCommandL(TInt aCommand);
+
+ /**
+ * From CEikAppUi.
+ */
+ virtual TKeyResponse HandleKeyEventL(
+ const TKeyEvent& aKeyEvent,
+ TEventCode aType );
+
+ private:
+
+ /**
+ * Shows text given.
+ */
+ void ShowL( const TDesC& aText, TBool& aLast, const TBool& aFileOutput = EFalse );
+ void ShowSingleValueL(TInt& aPixelMetric, TInt& aValue, TBool& aLast);
+ void ClearL();
+ void CreateHeaderFileL() const;
+
+ TFileName CreateLayoutNameL(TFileText& aFileHandle) const;
+
+ private: // Data
+
+ // Test view.
+ CPixelMetricsMapperView* iView;
+
+ CEikDialog* iDialog;
+
+ TBool iFileOutputOn;
+
+ CFbsBitmap* icon;
+ CFbsBitmap* iconMask;
+
+ TBool iAutoMode;
+ TBool iMode;
+
+ };
+
+
+/**
+* CPixelMetricsMapperApplication
+*/
+class CPixelMetricsMapperApplication : public CEikApplication
+ {
+ private: // Functions from base classes
+
+ /**
+ * From CApaApplication.
+ */
+ CApaDocument* CreateDocumentL();
+
+ /**
+ * From CApaApplication.
+ */
+ TUid AppDllUid() const;
+ };
+
+
+#endif // PMMAPPERAPP_H
+
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapperview.cpp b/util/s60pixelmetrics/pm_mapperview.cpp
new file mode 100644
index 0000000000..f7ab2acca2
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapperview.cpp
@@ -0,0 +1,375 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// INCLUDE FILES
+
+#include <eiklabel.h>
+#include <avkon.rsg>
+#include <aknviewappui.h>
+#include <aknconsts.h>
+
+#include "pm_mapper.hrh"
+#include <pm_mapper.rsg>
+#include "pm_mapperView.h"
+#include "pm_mapperApp.h"
+
+#include <aknlists.h>
+#include <avkon.hrh>
+#include <AknUtils.h>
+
+// -----------------------------------------------------------------------------
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPixelMetricsMapperViewContainer::CPixelMetricsMapperViewContainer(): iCount( 1 )
+ {
+ }
+
+
+// -----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperViewContainer::ConstructL( const TRect& aRect )
+ {
+ CreateWindowL();
+ SetCanDrawOutsideRect();
+
+ iTexts = new( ELeave ) CDesCArrayFlat( 10 );
+ iTexts->AppendL( _L( "\tStarted." ) );
+
+ iListbox = new( ELeave ) CAknSingleStyleListBox;
+ iListbox->SetContainerWindowL( *this );
+ iListbox->ConstructL( this, EAknListBoxViewerFlags );
+
+ iListbox->Model()->SetItemTextArray( iTexts );
+ iListbox->SetRect( TRect( aRect.Size() ) );
+
+ iListbox->CreateScrollBarFrameL( ETrue );
+ iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
+ CEikScrollBarFrame::EOn,
+ CEikScrollBarFrame::EOn );
+
+ SetRect( aRect );
+ iListbox->ActivateL();
+ ActivateL();
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperViewContainer::ShowL( const TDesC& aString, TBool& aLast, const TBool& aFileOutput )
+ {
+ MDesCArray* itemList = iListbox->Model()->ItemTextArray();
+ CDesCArray* itemArray = ( CDesCArray* ) itemList;
+
+ itemArray->AppendL( aString );
+
+ iListbox->HandleItemAdditionL();
+ iListbox->SetCurrentItemIndex( iCount );
+ iCount++;
+ if ( aLast )
+ {
+ if (aFileOutput)
+ {
+ RFile file;
+ RFs& fs = CEikonEnv::Static()->FsSession();
+ TFileName fileName =_L("Layout_");
+
+ TRect screenRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::EApplicationWindow,
+ screenRect );
+
+ // Add screen dimensions
+ TInt height = screenRect.Height();
+ TInt width = screenRect.Width();
+ fileName.AppendNum(height);
+ fileName.Append('_');
+ fileName.AppendNum(width);
+
+ if (AknLayoutUtils::LayoutMirrored())
+ fileName.Append(_L("_mirrored"));
+ fileName.Append(_L(".txt"));
+
+ TInt err=file.Open(fs,fileName,EFileStreamText|EFileWrite|EFileShareAny);
+ if (err==KErrNotFound) // file does not exist - create it
+ err=file.Create(fs,fileName,EFileStreamText|EFileWrite|EFileShareAny);
+ else
+ file.SetSize(0); //sweep the file
+ TFileText textFile;
+ textFile.Set(file);
+ err = textFile.Seek(ESeekStart);
+ if (err) User::InfoPrint(_L("File corrupted"));
+
+ // Finally loop through all the entries:
+ TInt idx = 0;
+ for(;idx!=itemList->MdcaCount();idx++)
+ {
+ err = textFile.Write(itemList->MdcaPoint(idx));
+ if (err) User::InfoPrint(_L("File corrupted"));
+ }
+ file.Close();
+ }
+ DrawNow();
+ }
+ }
+
+void CPixelMetricsMapperViewContainer::ClearL()
+ {
+ MDesCArray* itemList = iListbox->Model()->ItemTextArray();
+ CDesCArray* itemArray = ( CDesCArray* ) itemList;
+
+ itemArray->Reset();
+
+ iListbox->HandleItemAdditionL();
+ iCount = 0;
+ DrawNow();
+ }
+
+
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CPixelMetricsMapperViewContainer::~CPixelMetricsMapperViewContainer()
+ {
+ delete iListbox;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperViewContainer::SizeChanged()
+ {
+ CCoeControl::SizeChanged();
+ if ( iListbox )
+ {
+ iListbox->SetRect( Rect() );
+ }
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CPixelMetricsMapperViewContainer::CountComponentControls() const
+ {
+ return 1;
+ }
+
+
+// -----------------------------------------------------------------------------
+// CTestAppViewContainer::ComponentControl
+//
+//
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPixelMetricsMapperViewContainer::ComponentControl(
+ TInt /*aIndex*/ ) const
+ {
+ return iListbox;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperViewContainer::Draw( const TRect& /*aRect*/ ) const
+ {
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperViewContainer::HandleControlEventL(
+ CCoeControl* /*aControl*/,
+ TCoeEvent /*aEventType*/ )
+ {
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CPixelMetricsMapperViewContainer::OfferKeyEventL(
+ const TKeyEvent& aKeyEvent,
+ TEventCode aType )
+ {
+ if (aKeyEvent.iCode == EKeyUpArrow ||
+ aKeyEvent.iCode == EKeyDownArrow )
+ {
+ return iListbox->OfferKeyEventL( aKeyEvent, aType );
+ }
+ return EKeyWasNotConsumed;
+ }
+
+void CPixelMetricsMapperViewContainer::HandleResourceChange(TInt aType)
+ {
+ CCoeControl::HandleResourceChange( aType );
+ if ( aType == KEikDynamicLayoutVariantSwitch )
+ {
+ TRect mainPaneRect;
+ AknLayoutUtils::LayoutMetricsRect(
+ AknLayoutUtils::EMainPane,
+ mainPaneRect );
+ SetRect( mainPaneRect );
+
+ CPixelMetricsMapperAppUi* myApp = static_cast<CPixelMetricsMapperAppUi*> (ControlEnv()->AppUi());
+ if (myApp->ReadyForAutoOp())
+ myApp->DoAutoOperationL();
+ }
+ if (iListbox) iListbox->HandleResourceChange(aType);
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::ShowL( const TDesC& aString, TBool& aLast, const TBool& aFileOutput )
+ {
+ iView->ShowL( aString, aLast, aFileOutput );
+ }
+
+void CPixelMetricsMapperView::ClearL()
+ {
+ iView->ClearL();
+ }
+
+
+// -----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::ConstructL()
+ {
+ BaseConstructL( R_PMMAPPER_VIEW );
+ }
+
+
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CPixelMetricsMapperView::~CPixelMetricsMapperView()
+ {
+ if ( iView )
+ {
+ AppUi()->RemoveFromViewStack( *this, iView );
+ }
+ delete iView;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUid CPixelMetricsMapperView::Id() const
+ {
+ return TUid::Uid( EPMMapperViewId );
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::HandleCommandL( TInt aCommand )
+ {
+ AppUi()->HandleCommandL( aCommand );
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::HandleStatusPaneSizeChange()
+ {
+ if ( iView )
+ {
+ TRect cr = ClientRect();
+ iView->SetRect( cr );
+ }
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::DoActivateL(
+ const TVwsViewId& /*aPrevViewId*/,
+ TUid /*aCustomMessageId*/,
+ const TDesC8& /*aCustomMessage*/ )
+ {
+ iView = new( ELeave ) CPixelMetricsMapperViewContainer;
+
+ TRect cr = ClientRect();
+ iView->ConstructL( cr );
+ AppUi()->AddToViewStackL( *this, iView );
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPixelMetricsMapperView::DoDeactivate()
+ {
+ if (iView)
+ {
+ AppUi()->RemoveFromViewStack( *this, iView );
+ }
+ delete iView;
+ iView = NULL;
+ }
+
+// End of File
diff --git a/util/s60pixelmetrics/pm_mapperview.h b/util/s60pixelmetrics/pm_mapperview.h
new file mode 100644
index 0000000000..e9eb42eb9d
--- /dev/null
+++ b/util/s60pixelmetrics/pm_mapperview.h
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utility 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PMMAPPERVIEW_H
+#define PMMAPPERVIEW_H
+
+
+// INCLUDES
+#include <aknview.h>
+#include <EIKLBO.H>
+
+// CONSTANTS
+// FORWARD DECLARATIONS
+class CAknSingleStyleListBox;
+class CAknSettingStyleListBox;
+
+// CLASS DECLARATION
+
+/**
+* CPixelMetricsMapperViewContainer
+*
+*/
+class CPixelMetricsMapperViewContainer
+: public CCoeControl,
+ public MCoeControlObserver
+ {
+ public: // Constructors and destructor
+
+ /**
+ * C++ constructor.
+ */
+ CPixelMetricsMapperViewContainer();
+
+ /**
+ * Symbian 2nd phase constructor.
+ *
+ * @param aRect Rectangle.
+ */
+ void ConstructL( const TRect& aRect );
+
+ /**
+ * Destructor.
+ */
+ ~CPixelMetricsMapperViewContainer();
+
+
+ public: // New functions
+
+ /**
+ * Show the given string.
+ *
+ * @param aString The string to be shown.
+ */
+ void ShowL( const TDesC& aString, TBool& aLast, const TBool& aFileOutput = EFalse );
+
+ void ClearL();
+
+
+ public: // Functions from base classes
+
+ /**
+ * From CCoeControl.
+ */
+ TKeyResponse OfferKeyEventL(
+ const TKeyEvent& aKeyEvent,
+ TEventCode aType );
+
+
+ void HandleResourceChange(TInt aType);
+
+
+ private: // Functions from base classes
+
+ /**
+ * From CCoeControl.
+ */
+ void SizeChanged();
+
+ /**
+ * From CCoeControl.
+ */
+ TInt CountComponentControls() const;
+
+ /**
+ * From CCoeControl.
+ */
+ CCoeControl* ComponentControl( TInt aIndex ) const;
+
+ /**
+ * From CCoeControl.
+ */
+ void Draw( const TRect& aRect ) const;
+
+
+ private: // Functions from base classes
+
+ /**
+ * From MCoeControlObserver.
+ */
+ void HandleControlEventL(
+ CCoeControl* aControl,
+ TCoeEvent aEventType );
+
+
+ private: // Data
+
+ // Texts.
+ CDesCArray* iTexts;
+
+ // Count.
+ TInt iCount;
+
+ // Listbox.
+ CAknSingleStyleListBox* iListbox;
+
+ };
+
+
+
+/**
+* CPixelMetricsMapperView
+*
+*
+* @since 1.0
+*/
+class CPixelMetricsMapperView : public CAknView
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Destructor.
+ */
+ ~CPixelMetricsMapperView();
+
+
+ public: // Functions from base classes
+
+ /**
+ * From CAknView.
+ */
+ TUid Id() const;
+
+ /**
+ * From CAknView.
+ */
+ void HandleCommandL( TInt aCommand );
+
+ /**
+ * From CAknView.
+ */
+ void HandleStatusPaneSizeChange();
+
+ /**
+ * From CAknView.
+ */
+ void ShowL( const TDesC& aString, TBool& aLast, const TBool& aFileOutput =EFalse );
+ void ClearL();
+
+
+ private: // from CAknView
+
+ /**
+ * From CAknView.
+ */
+ void DoActivateL(
+ const TVwsViewId& aPrevViewId,
+ TUid aCustomMessageId,
+ const TDesC8& aCustomMessage );
+
+ /**
+ * From CAknView.
+ */
+ void DoDeactivate();
+
+
+ private: // Data
+
+ // The view container.
+ CPixelMetricsMapperViewContainer* iView;
+
+ };
+
+#endif // PMMAPPERVIEW_H
+
+// End of File