From 0748751c9f097d9d866605306bbdd4b96e2a5c4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 27 Apr 2011 19:16:41 +0200 Subject: Squashed commit of the changes from the mobile-examples repository (4.7-generated-declarative branch). --- doc/src/examples/broadcastreceiver.qdoc | 2 +- doc/src/examples/combowidgetmapper.qdoc | 2 +- doc/src/examples/dragdroprobot.qdoc | 2 +- doc/src/examples/elasticnodes.qdoc | 2 +- doc/src/examples/rsslisting.qdoc | 2 +- doc/src/tutorials/modelview.qdoc | 1 - examples/animation/animatedtiles/animatedtiles.pro | 1 + examples/animation/animatedtiles/main.cpp | 4 + examples/animation/appchooser/appchooser.pro | 1 + examples/animation/appchooser/main.cpp | 30 ++- examples/animation/easing/easing.pro | 4 +- examples/animation/easing/form.ui | 95 +++++++-- examples/animation/easing/main.cpp | 8 + examples/animation/easing/window.cpp | 7 +- examples/animation/easing/window.h | 3 - examples/animation/moveblocks/main.cpp | 41 ++-- examples/animation/moveblocks/moveblocks.pro | 1 + examples/animation/states/main.cpp | 38 +++- examples/animation/states/states.pro | 1 + examples/animation/stickman/graphicsview.cpp | 5 +- examples/animation/stickman/graphicsview.h | 1 + examples/animation/stickman/lifecycle.cpp | 6 +- examples/animation/stickman/lifecycle.h | 3 +- examples/animation/stickman/main.cpp | 34 +++- examples/animation/stickman/stickman.pro | 7 +- examples/dbus/complexpingpong/complexping.pro | 4 +- examples/dbus/complexpingpong/complexpong.pro | 4 +- examples/dbus/dbus-chat/dbus-chat.pro | 4 +- examples/dbus/dbus.pro | 1 + examples/dbus/listnames/listnames.pro | 5 +- examples/dbus/pingpong/ping.pro | 3 + examples/dbus/pingpong/pong.pro | 3 + examples/dbus/remotecontrolledcar/car/car.pro | 4 +- .../remotecontrolledcar/controller/controller.pro | 4 +- .../remotecontrolledcar/remotecontrolledcar.pro | 1 + examples/desktop/desktop.pro | 1 + examples/desktop/screenshot/screenshot.pro | 4 + examples/dialogs/classwizard/classwizard.pro | 4 + examples/dialogs/configdialog/configdialog.pro | 4 + examples/dialogs/dialogs.pro | 1 + examples/dialogs/extension/extension.pro | 2 + examples/dialogs/extension/finddialog.cpp | 45 ++++- examples/dialogs/extension/main.cpp | 9 +- examples/dialogs/findfiles/findfiles.pro | 1 + examples/dialogs/findfiles/main.cpp | 4 + examples/dialogs/findfiles/window.cpp | 23 ++- examples/dialogs/findfiles/window.h | 4 +- examples/dialogs/licensewizard/licensewizard.pro | 4 + examples/dialogs/sipdialog/sipdialog.pro | 5 +- examples/dialogs/standarddialogs/dialog.cpp | 15 +- examples/dialogs/standarddialogs/dialog.h | 4 +- examples/dialogs/standarddialogs/main.cpp | 8 +- .../dialogs/standarddialogs/standarddialogs.pro | 1 + examples/dialogs/tabdialog/main.cpp | 8 +- examples/dialogs/tabdialog/tabdialog.cpp | 1 + examples/dialogs/tabdialog/tabdialog.pro | 3 + examples/dialogs/trivialwizard/trivialwizard.cpp | 4 + examples/dialogs/trivialwizard/trivialwizard.pro | 3 + .../draganddrop/draggableicons/draggableicons.pro | 1 + examples/draganddrop/draggableicons/dragwidget.cpp | 9 +- examples/draganddrop/draggableicons/main.cpp | 4 + .../draganddrop/draggabletext/draggabletext.pro | 2 + examples/draganddrop/draggabletext/dragwidget.cpp | 4 +- examples/draganddrop/draggabletext/main.cpp | 4 + examples/draganddrop/dropsite/dropsite.pro | 4 + examples/draganddrop/fridgemagnets/dragwidget.cpp | 4 + .../draganddrop/fridgemagnets/fridgemagnets.pro | 2 +- examples/draganddrop/fridgemagnets/main.cpp | 5 + examples/draganddrop/puzzle/main.cpp | 4 + examples/draganddrop/puzzle/mainwindow.cpp | 16 +- examples/draganddrop/puzzle/pieceslist.cpp | 6 +- examples/draganddrop/puzzle/pieceslist.h | 4 +- examples/draganddrop/puzzle/puzzle.pro | 1 + examples/draganddrop/puzzle/puzzlewidget.cpp | 26 ++- examples/draganddrop/puzzle/puzzlewidget.h | 6 +- examples/effects/blurpicker/blurpicker.cpp | 32 ++- examples/effects/blurpicker/blurpicker.h | 2 + examples/effects/blurpicker/blurpicker.pro | 3 + examples/effects/blurpicker/main.cpp | 5 + examples/effects/fademessage/fademessage.cpp | 11 +- examples/effects/fademessage/fademessage.pro | 4 +- examples/effects/fademessage/main.cpp | 4 + examples/effects/lighting/lighting.cpp | 6 + examples/effects/lighting/lighting.h | 3 + examples/effects/lighting/lighting.pro | 4 + examples/effects/lighting/main.cpp | 5 + examples/examples.pro | 1 + examples/gestures/imagegestures/imagegestures.pro | 4 + .../graphicsview/anchorlayout/anchorlayout.pro | 5 + examples/graphicsview/anchorlayout/main.cpp | 5 + .../basicgraphicslayouts/basicgraphicslayouts.pro | 2 + .../graphicsview/basicgraphicslayouts/main.cpp | 4 + .../graphicsview/collidingmice/collidingmice.pro | 2 + examples/graphicsview/collidingmice/main.cpp | 4 + .../graphicsview/diagramscene/diagramscene.pro | 4 + .../graphicsview/dragdroprobot/dragdroprobot.pro | 3 + examples/graphicsview/dragdroprobot/main.cpp | 24 ++- examples/graphicsview/elasticnodes/edge.cpp | 2 +- .../graphicsview/elasticnodes/elasticnodes.pro | 3 + examples/graphicsview/elasticnodes/graphwidget.cpp | 29 ++- examples/graphicsview/elasticnodes/graphwidget.h | 5 + examples/graphicsview/elasticnodes/main.cpp | 15 +- examples/graphicsview/elasticnodes/node.cpp | 15 +- examples/graphicsview/flowlayout/flowlayout.pro | 5 +- examples/graphicsview/flowlayout/main.cpp | 6 + examples/graphicsview/graphicsview.pro | 1 + examples/graphicsview/padnavigator/main.cpp | 5 +- .../graphicsview/padnavigator/padnavigator.pro | 3 + examples/graphicsview/simpleanchorlayout/main.cpp | 7 + .../simpleanchorlayout/simpleanchorlayout.pro | 4 + examples/graphicsview/weatheranchorlayout/main.cpp | 23 +++ .../weatheranchorlayout/weatheranchorlayout.pro | 3 + examples/ipc/ipc.pro | 1 + examples/ipc/localfortuneclient/client.cpp | 5 + examples/ipc/localfortuneclient/client.h | 9 + .../ipc/localfortuneclient/localfortuneclient.pro | 5 +- examples/ipc/localfortuneclient/main.cpp | 6 +- .../ipc/localfortuneserver/localfortuneserver.pro | 3 +- examples/ipc/localfortuneserver/main.cpp | 6 +- examples/ipc/localfortuneserver/server.cpp | 5 + examples/ipc/localfortuneserver/server.h | 8 + examples/ipc/sharedmemory/sharedmemory.pro | 5 + examples/itemviews/addressbook/addressbook.pro | 2 + examples/itemviews/addressbook/main.cpp | 4 + .../basicsortfiltermodel/basicsortfiltermodel.pro | 1 + examples/itemviews/basicsortfiltermodel/main.cpp | 4 + examples/itemviews/basicsortfiltermodel/window.cpp | 41 +++- examples/itemviews/basicsortfiltermodel/window.h | 6 + examples/itemviews/chart/chart.pro | 2 + examples/itemviews/chart/main.cpp | 4 + .../coloreditorfactory/coloreditorfactory.pro | 4 + examples/itemviews/coloreditorfactory/main.cpp | 4 + .../combowidgetmapper/combowidgetmapper.pro | 3 + examples/itemviews/combowidgetmapper/main.cpp | 4 + .../customsortfiltermodel.pro | 1 + examples/itemviews/customsortfiltermodel/main.cpp | 4 + .../itemviews/customsortfiltermodel/window.cpp | 62 ++++-- examples/itemviews/customsortfiltermodel/window.h | 6 + examples/itemviews/dirview/dirview.pro | 1 + examples/itemviews/dirview/main.cpp | 4 + .../editabletreemodel/editabletreemodel.pro | 1 + examples/itemviews/editabletreemodel/main.cpp | 4 + .../itemviews/editabletreemodel/mainwindow.cpp | 5 + examples/itemviews/fetchmore/fetchmore.pro | 2 + examples/itemviews/fetchmore/main.cpp | 4 + examples/itemviews/frozencolumn/frozencolumn.pro | 3 + examples/itemviews/frozencolumn/main.cpp | 6 + examples/itemviews/itemviews.pro | 9 +- examples/itemviews/pixelator/main.cpp | 4 + examples/itemviews/pixelator/pixelator.pro | 1 + examples/itemviews/pixelator/pixeldelegate.cpp | 2 +- examples/itemviews/puzzle/main.cpp | 4 + examples/itemviews/puzzle/mainwindow.cpp | 20 +- examples/itemviews/puzzle/piecesmodel.cpp | 8 +- examples/itemviews/puzzle/piecesmodel.h | 4 +- examples/itemviews/puzzle/puzzle.pro | 2 + examples/itemviews/puzzle/puzzlewidget.cpp | 26 ++- examples/itemviews/puzzle/puzzlewidget.h | 6 +- examples/itemviews/simpledommodel/main.cpp | 6 + .../itemviews/simpledommodel/simpledommodel.pro | 1 + examples/itemviews/simpletreemodel/main.cpp | 4 + .../itemviews/simpletreemodel/simpletreemodel.pro | 1 + examples/itemviews/simplewidgetmapper/main.cpp | 4 + .../simplewidgetmapper/simplewidgetmapper.pro | 1 + examples/itemviews/spinboxdelegate/main.cpp | 4 + .../itemviews/spinboxdelegate/spinboxdelegate.pro | 5 + examples/itemviews/stardelegate/main.cpp | 4 + examples/itemviews/stardelegate/stardelegate.pro | 4 + examples/ja_JP/linguist/hellotr/hellotr.pro | 1 + examples/layouts/basiclayouts/basiclayouts.pro | 5 + examples/layouts/basiclayouts/main.cpp | 8 +- examples/layouts/borderlayout/borderlayout.pro | 1 + examples/layouts/borderlayout/main.cpp | 4 + examples/layouts/dynamiclayouts/dialog.cpp | 4 + examples/layouts/dynamiclayouts/dialog.h | 5 + examples/layouts/dynamiclayouts/dynamiclayouts.pro | 5 + examples/layouts/dynamiclayouts/main.cpp | 7 +- examples/layouts/flowlayout/flowlayout.pro | 1 + examples/layouts/flowlayout/main.cpp | 4 + examples/layouts/flowlayout/window.cpp | 2 +- examples/layouts/layouts.pro | 1 + examples/linguist/arrowpad/arrowpad.pro | 5 + examples/linguist/hellotr/hellotr.pro | 5 + examples/linguist/linguist.pro | 1 + examples/linguist/trollprint/trollprint.pro | 5 + examples/mainwindows/application/application.pro | 4 + examples/mainwindows/application/main.cpp | 4 + examples/mainwindows/dockwidgets/dockwidgets.pro | 5 + examples/mainwindows/mainwindows.pro | 6 +- examples/mainwindows/mdi/main.cpp | 4 + examples/mainwindows/mdi/mdi.pro | 4 + examples/mainwindows/menus/main.cpp | 4 + examples/mainwindows/menus/mainwindow.cpp | 6 + examples/mainwindows/menus/menus.pro | 3 + examples/mainwindows/recentfiles/main.cpp | 4 + examples/mainwindows/recentfiles/recentfiles.pro | 3 + examples/mainwindows/sdi/main.cpp | 4 + examples/mainwindows/sdi/sdi.pro | 4 + examples/network/bearermonitor/bearermonitor.cpp | 8 +- examples/network/bearermonitor/bearermonitor.h | 4 +- examples/network/bearermonitor/bearermonitor.pro | 9 +- .../blockingfortuneclient/blockingclient.cpp | 54 ++++- .../network/blockingfortuneclient/blockingclient.h | 10 +- .../blockingfortuneclient.pro | 9 +- examples/network/blockingfortuneclient/main.cpp | 6 +- .../broadcastreceiver/broadcastreceiver.pro | 6 +- examples/network/broadcastreceiver/main.cpp | 6 +- examples/network/broadcastreceiver/receiver.cpp | 18 +- examples/network/broadcastreceiver/receiver.h | 9 +- .../network/broadcastsender/broadcastsender.pro | 6 +- examples/network/broadcastsender/main.cpp | 6 +- examples/network/broadcastsender/sender.cpp | 3 +- examples/network/broadcastsender/sender.h | 4 +- examples/network/download/download.pro | 5 +- .../network/downloadmanager/downloadmanager.pro | 12 +- examples/network/fortuneclient/fortuneclient.pro | 5 + examples/network/fortuneserver/fortuneserver.pro | 5 + examples/network/googlesuggest/googlesuggest.pro | 7 + examples/network/http/http.pro | 6 +- examples/network/http/httpwindow.cpp | 25 ++- examples/network/http/httpwindow.h | 10 + examples/network/http/main.cpp | 17 +- examples/network/loopback/dialog.cpp | 31 +++ examples/network/loopback/dialog.h | 7 + examples/network/loopback/loopback.pro | 6 +- examples/network/loopback/main.cpp | 6 +- examples/network/network-chat/network-chat.pro | 4 + examples/network/network.pro | 1 + examples/network/qftp/ftpwindow.cpp | 8 +- examples/network/qftp/qftp.pro | 4 + .../network/securesocketclient/certificateinfo.cpp | 4 +- .../network/securesocketclient/certificateinfo.ui | 68 ++++--- examples/network/securesocketclient/main.cpp | 4 + .../securesocketclient/securesocketclient.pro | 3 + examples/network/securesocketclient/sslclient.cpp | 7 +- examples/network/securesocketclient/sslclient.ui | 223 +++++++++++---------- examples/network/securesocketclient/sslerrors.ui | 57 +++--- examples/network/threadedfortuneserver/dialog.cpp | 18 +- examples/network/threadedfortuneserver/dialog.h | 4 +- examples/network/threadedfortuneserver/main.cpp | 6 +- .../threadedfortuneserver.pro | 9 +- examples/network/torrent/torrent.pro | 5 + examples/opengl/2dpainting/2dpainting.pro | 4 + .../framebufferobject2/framebufferobject2.pro | 5 + examples/opengl/grabber/grabber.pro | 5 + examples/opengl/hellogl/hellogl.pro | 5 + examples/opengl/hellogl_es/hellogl_es.pro | 8 +- examples/opengl/hellogl_es2/hellogl_es2.pro | 13 +- examples/opengl/opengl.pro | 2 + examples/opengl/overpainting/overpainting.pro | 6 + examples/opengl/pbuffers/pbuffers.pro | 6 + examples/opengl/pbuffers2/pbuffers2.pro | 6 +- examples/opengl/samplebuffers/samplebuffers.pro | 5 + examples/opengl/textures/textures.pro | 4 + examples/openvg/openvg.pro | 1 + examples/painting/basicdrawing/basicdrawing.pro | 3 + examples/painting/basicdrawing/main.cpp | 4 + examples/painting/basicdrawing/window.cpp | 43 ++-- .../concentriccircles/concentriccircles.pro | 2 + examples/painting/concentriccircles/main.cpp | 4 + examples/painting/fontsampler/fontsampler.pro | 1 + examples/painting/fontsampler/main.cpp | 4 + examples/painting/fontsampler/mainwindow.cpp | 56 +++--- examples/painting/fontsampler/mainwindow.h | 4 + examples/painting/fontsampler/mainwindowbase.ui | 126 ++++++------ .../painting/imagecomposition/imagecomposer.cpp | 10 + .../painting/imagecomposition/imagecomposition.pro | 2 + examples/painting/imagecomposition/main.cpp | 4 + examples/painting/painterpaths/main.cpp | 4 + examples/painting/painterpaths/painterpaths.pro | 2 + examples/painting/painterpaths/window.cpp | 53 +++-- examples/painting/painterpaths/window.h | 4 +- examples/painting/painting.pro | 6 +- examples/painting/transformations/main.cpp | 4 + .../painting/transformations/transformations.pro | 5 + .../qtconcurrent/imagescaling/imagescaling.pro | 3 + examples/qtconcurrent/imagescaling/main.cpp | 21 +- examples/qtconcurrent/map/main.cpp | 19 +- examples/qtconcurrent/map/map.pro | 3 + examples/qtconcurrent/progressdialog/main.cpp | 17 +- .../qtconcurrent/progressdialog/progressdialog.pro | 4 +- examples/qtconcurrent/qtconcurrent.pro | 1 + examples/qtconcurrent/runfunction/main.cpp | 19 +- examples/qtconcurrent/runfunction/runfunction.pro | 4 +- examples/qtconcurrent/wordcount/main.cpp | 23 ++- examples/qtconcurrent/wordcount/wordcount.pro | 4 +- examples/qtestlib/qtestlib.pro | 1 + examples/qtestlib/tutorial1/tutorial1.pro | 5 + examples/qtestlib/tutorial2/tutorial2.pro | 5 + examples/qtestlib/tutorial3/tutorial3.pro | 5 + examples/qtestlib/tutorial4/tutorial4.pro | 5 + examples/qtestlib/tutorial5/tutorial5.pro | 5 + examples/qws/dbscreen/dbscreen.pro | 4 + examples/qws/framebuffer/framebuffer.pro | 6 + examples/qws/mousecalibration/mousecalibration.pro | 7 + examples/qws/simpledecoration/simpledecoration.pro | 7 + examples/qws/svgalib/svgalib.pro | 6 + examples/richtext/calendar/calendar.pro | 4 + examples/richtext/calendar/main.cpp | 6 + examples/richtext/calendar/mainwindow.cpp | 7 +- examples/richtext/orderform/detailsdialog.cpp | 30 +++ examples/richtext/orderform/main.cpp | 6 + examples/richtext/orderform/orderform.pro | 1 + examples/richtext/richtext.pro | 1 + examples/richtext/syntaxhighlighter/main.cpp | 6 + .../syntaxhighlighter/syntaxhighlighter.pro | 2 + examples/sql/cachedtable/cachedtable.pro | 1 + examples/sql/cachedtable/main.cpp | 6 +- examples/sql/cachedtable/tableeditor.cpp | 3 +- examples/sql/cachedtable/tableeditor.h | 2 +- examples/sql/drilldown/drilldown.pro | 3 + examples/sql/drilldown/informationwindow.cpp | 6 +- examples/sql/drilldown/main.cpp | 2 +- examples/sql/drilldown/view.cpp | 2 +- examples/sql/masterdetail/main.cpp | 4 + examples/sql/masterdetail/mainwindow.cpp | 4 + examples/sql/masterdetail/masterdetail.pro | 5 + examples/sql/querymodel/main.cpp | 27 ++- examples/sql/querymodel/querymodel.pro | 1 + .../relationaltablemodel/relationaltablemodel.cpp | 4 + .../relationaltablemodel/relationaltablemodel.pro | 1 + examples/sql/sql.pro | 1 + examples/sql/sqlwidgetmapper/main.cpp | 4 + examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro | 3 + examples/sql/tablemodel/tablemodel.cpp | 18 +- examples/sql/tablemodel/tablemodel.pro | 1 + .../eventtransitions/eventtransitions.pro | 5 + examples/statemachine/eventtransitions/main.cpp | 11 +- examples/statemachine/factorial/factorial.pro | 5 + examples/statemachine/pingpong/pingpong.pro | 5 + examples/statemachine/rogue/main.cpp | 4 + examples/statemachine/rogue/movementtransition.h | 7 +- examples/statemachine/rogue/rogue.pro | 3 + examples/statemachine/rogue/window.cpp | 12 +- examples/statemachine/rogue/window.h | 5 + examples/statemachine/trafficlight/main.cpp | 9 + .../statemachine/trafficlight/trafficlight.pro | 4 + examples/statemachine/twowaybutton/main.cpp | 6 + .../statemachine/twowaybutton/twowaybutton.pro | 4 + examples/threads/mandelbrot/main.cpp | 4 + examples/threads/mandelbrot/mandelbrot.pro | 1 + examples/threads/mandelbrot/mandelbrotwidget.cpp | 18 ++ examples/threads/mandelbrot/mandelbrotwidget.h | 30 ++- examples/threads/queuedcustomtype/main.cpp | 4 + .../threads/queuedcustomtype/queuedcustomtype.pro | 10 + examples/threads/semaphores/semaphores.cpp | 81 +++++--- examples/threads/semaphores/semaphores.pro | 6 +- examples/threads/threads.pro | 1 + examples/threads/waitconditions/waitconditions.cpp | 132 ++++++++---- examples/threads/waitconditions/waitconditions.pro | 5 +- examples/tools/codecs/codecs.pro | 5 + examples/tools/completer/completer.pro | 5 + examples/tools/contiguouscache/contiguouscache.pro | 7 + examples/tools/customcompleter/customcompleter.pro | 5 + examples/tools/customtype/customtype.pro | 13 ++ .../tools/customtypesending/customtypesending.pro | 13 ++ examples/tools/echoplugin/echoplugin.pro | 1 + .../tools/echoplugin/echowindow/echowindow.pro | 5 + examples/tools/echoplugin/plugin/plugin.pro | 10 +- examples/tools/i18n/i18n.pro | 5 + examples/tools/inputpanel/inputpanel.pro | 5 + examples/tools/plugandpaint/plugandpaint.pro | 5 + .../plugandpaintplugins/basictools/basictools.pro | 1 + .../extrafilters/extrafilters.pro | 1 + .../plugandpaintplugins/plugandpaintplugins.pro | 1 + examples/tools/regexp/regexp.pro | 5 + examples/tools/settingseditor/settingseditor.pro | 5 + examples/tools/styleplugin/plugin/plugin.pro | 1 + examples/tools/styleplugin/styleplugin.pro | 1 + .../tools/styleplugin/stylewindow/stylewindow.pro | 1 + examples/tools/tools.pro | 1 + .../treemodelcompleter/treemodelcompleter.pro | 5 + examples/tools/undoframework/undoframework.pro | 5 + examples/touch/dials/dials.pro | 7 + examples/touch/fingerpaint/fingerpaint.pro | 7 + examples/touch/knobs/knobs.pro | 7 + examples/touch/pinchzoom/pinchzoom.pro | 7 + .../tutorials/addressbook-fr/addressbook-fr.pro | 1 + examples/tutorials/addressbook-fr/part1/part1.pro | 7 + examples/tutorials/addressbook-fr/part2/part2.pro | 7 + examples/tutorials/addressbook-fr/part3/part3.pro | 7 + examples/tutorials/addressbook-fr/part4/part4.pro | 7 + examples/tutorials/addressbook-fr/part5/part5.pro | 7 + examples/tutorials/addressbook-fr/part6/part6.pro | 7 + examples/tutorials/addressbook-fr/part7/part7.pro | 7 + examples/tutorials/addressbook/addressbook.pro | 1 + examples/tutorials/addressbook/part1/part1.pro | 5 + examples/tutorials/addressbook/part2/part2.pro | 5 + examples/tutorials/addressbook/part3/part3.pro | 5 + examples/tutorials/addressbook/part4/part4.pro | 5 + examples/tutorials/addressbook/part5/part5.pro | 5 + examples/tutorials/addressbook/part6/part6.pro | 5 + examples/tutorials/addressbook/part7/part7.pro | 5 + .../tutorials/modelview/1_readonly/1_readonly.pro | 5 + .../modelview/2_formatting/2_formatting.pro | 5 + .../modelview/3_changingmodel/3_changingmodel.pro | 5 + .../tutorials/modelview/4_headers/4_headers.pro | 5 + examples/tutorials/modelview/5_edit/5_edit.pro | 5 + .../tutorials/modelview/6_treeview/6_treeview.pro | 5 + .../modelview/7_selections/7_selections.pro | 5 + examples/tutorials/modelview/modelview.pro | 1 + .../tutorials/widgets/childwidget/childwidget.pro | 7 + .../widgets/nestedlayouts/nestedlayouts.pro | 7 + examples/tutorials/widgets/toplevel/toplevel.pro | 7 + .../widgets/windowlayout/windowlayout.pro | 7 + examples/uitools/multipleinheritance/main.cpp | 4 + .../multipleinheritance/multipleinheritance.pro | 2 + examples/uitools/textfinder/textfinder.pro | 4 + examples/uitools/uitools.pro | 1 + examples/widgets/analogclock/analogclock.pro | 2 + examples/widgets/analogclock/main.cpp | 4 + examples/widgets/calculator/calculator.cpp | 7 +- examples/widgets/calculator/calculator.h | 4 +- examples/widgets/calculator/calculator.pro | 2 + examples/widgets/calculator/main.cpp | 4 + examples/widgets/calendarwidget/calendarwidget.pro | 5 + examples/widgets/charactermap/charactermap.pro | 5 + examples/widgets/codeeditor/codeeditor.pro | 5 + examples/widgets/codeeditor/main.cpp | 4 + examples/widgets/digitalclock/digitalclock.pro | 1 + examples/widgets/digitalclock/main.cpp | 4 + examples/widgets/groupbox/groupbox.pro | 5 + examples/widgets/groupbox/main.cpp | 4 + examples/widgets/icons/icons.pro | 5 + examples/widgets/icons/main.cpp | 4 + examples/widgets/imageviewer/imageviewer.pro | 8 + examples/widgets/imageviewer/main.cpp | 4 + examples/widgets/lineedits/lineedits.pro | 5 + examples/widgets/lineedits/main.cpp | 4 + examples/widgets/movie/main.cpp | 5 + examples/widgets/movie/movie.pro | 5 + examples/widgets/scribble/main.cpp | 4 + examples/widgets/scribble/scribble.pro | 1 + examples/widgets/shapedclock/main.cpp | 4 + examples/widgets/shapedclock/shapedclock.pro | 4 + examples/widgets/sliders/main.cpp | 4 + examples/widgets/sliders/sliders.pro | 5 + examples/widgets/softkeys/softkeys.pro | 2 + examples/widgets/spinboxes/main.cpp | 4 + examples/widgets/spinboxes/spinboxes.pro | 5 + examples/widgets/styles/styles.pro | 5 + examples/widgets/stylesheet/main.cpp | 4 + examples/widgets/stylesheet/stylesheet.pro | 5 + examples/widgets/tablet/main.cpp | 7 +- examples/widgets/tablet/tablet.pro | 5 + examples/widgets/tetrix/main.cpp | 4 + examples/widgets/tetrix/tetrix.pro | 2 + examples/widgets/tooltips/main.cpp | 4 + examples/widgets/tooltips/tooltips.pro | 1 + examples/widgets/validators/main.cpp | 4 + examples/widgets/validators/validators.pro | 5 + examples/widgets/widgets.pro | 9 +- examples/widgets/wiggly/main.cpp | 4 + examples/widgets/wiggly/wiggly.pro | 2 + examples/widgets/windowflags/main.cpp | 4 + examples/widgets/windowflags/windowflags.pro | 5 + examples/xml/dombookmarks/dombookmarks.pro | 15 +- examples/xml/dombookmarks/main.cpp | 5 + examples/xml/dombookmarks/mainwindow.cpp | 18 ++ examples/xml/htmlinfo/htmlinfo.pro | 7 + examples/xml/htmlinfo/main.cpp | 5 +- examples/xml/rsslisting/main.cpp | 4 + examples/xml/rsslisting/rsslisting.cpp | 20 ++ examples/xml/rsslisting/rsslisting.h | 15 ++ examples/xml/rsslisting/rsslisting.pro | 12 +- examples/xml/saxbookmarks/saxbookmarks.pro | 2 + examples/xml/streambookmarks/main.cpp | 3 + examples/xml/streambookmarks/mainwindow.cpp | 18 ++ examples/xml/streambookmarks/streambookmarks.pro | 8 +- examples/xml/xml.pro | 1 + examples/xml/xmlstreamlint/xmlstreamlint.pro | 4 + qmake/generators/symbian/symbiancommon.h | 1 + src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 13 ++ src/gui/kernel/qwidget.cpp | 2 +- 474 files changed, 3172 insertions(+), 649 deletions(-) diff --git a/doc/src/examples/broadcastreceiver.qdoc b/doc/src/examples/broadcastreceiver.qdoc index ea3c331032..3d127dc6fd 100644 --- a/doc/src/examples/broadcastreceiver.qdoc +++ b/doc/src/examples/broadcastreceiver.qdoc @@ -29,7 +29,7 @@ \example network/broadcastreceiver \title Broadcast Receiver Example - The Broadcast Receiever example shows how to receive information that is broadcasted + The Broadcast Receiver example shows how to receive information that is broadcasted over a local network. \image broadcastreceiver-example.png diff --git a/doc/src/examples/combowidgetmapper.qdoc b/doc/src/examples/combowidgetmapper.qdoc index 897d135580..e3050525cd 100644 --- a/doc/src/examples/combowidgetmapper.qdoc +++ b/doc/src/examples/combowidgetmapper.qdoc @@ -29,7 +29,7 @@ \example itemviews/combowidgetmapper \title Combo Widget Mapper Example - The Delegate Widget Mapper example shows how to use a custom delegate to + The Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form. \image combowidgetmapper-example.png diff --git a/doc/src/examples/dragdroprobot.qdoc b/doc/src/examples/dragdroprobot.qdoc index bcf0fe7a82..0a0931496b 100644 --- a/doc/src/examples/dragdroprobot.qdoc +++ b/doc/src/examples/dragdroprobot.qdoc @@ -29,7 +29,7 @@ \example graphicsview/dragdroprobot \title Drag and Drop Robot Example - This GraphicsView example shows how to implement Drag and Drop in a + The Drag and Drop Robot example shows how to implement Drag and Drop in a QGraphicsItem subclass, as well as how to animate items using Qt's \l{Animation Framework}. diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc index bba6d90a9d..8526d556ee 100644 --- a/doc/src/examples/elasticnodes.qdoc +++ b/doc/src/examples/elasticnodes.qdoc @@ -29,7 +29,7 @@ \example graphicsview/elasticnodes \title Elastic Nodes Example - This GraphicsView example shows how to implement edges between nodes in a + The Elastic Nodes example shows how to implement edges between nodes in a graph, with basic interaction. You can click to drag a node around, and zoom in and out using the mouse wheel or the keyboard. Hitting the space bar will randomize the nodes. The example is also resolution independent; diff --git a/doc/src/examples/rsslisting.qdoc b/doc/src/examples/rsslisting.qdoc index ca29c04bed..6bef665839 100644 --- a/doc/src/examples/rsslisting.qdoc +++ b/doc/src/examples/rsslisting.qdoc @@ -29,7 +29,7 @@ \example xml/rsslisting \title RSS-Listing Example - This example shows how to create a widget that displays news items + The RSS-Listing example shows how to create a widget that displays news items from RDF news sources. \image rsslistingexample.png diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc index efd0ff2efb..ed08252565 100644 --- a/doc/src/tutorials/modelview.qdoc +++ b/doc/src/tutorials/modelview.qdoc @@ -104,7 +104,6 @@ array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. - This method is very intuitive and useful in many applications, but displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro index 763357f8ec..3182c20a4f 100644 --- a/examples/animation/animatedtiles/animatedtiles.pro +++ b/examples/animation/animatedtiles/animatedtiles.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000D7D1 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp index 1badb4f3ef..46b5d1ddc5 100644 --- a/examples/animation/animatedtiles/main.cpp +++ b/examples/animation/animatedtiles/main.cpp @@ -210,7 +210,11 @@ int main(int argc, char **argv) view->setBackgroundBrush(bgPix); view->setCacheMode(QGraphicsView::CacheBackground); view->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); +#ifdef Q_OS_SYMBIAN + view->showMaximized(); +#else view->show(); +#endif QStateMachine states; states.addState(rootState); diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro index 65e2345165..7b735d9d52 100644 --- a/examples/animation/appchooser/appchooser.pro +++ b/examples/animation/appchooser/appchooser.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F5 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp index 86ec073f6e..3788533aa8 100644 --- a/examples/animation/appchooser/main.cpp +++ b/examples/animation/appchooser/main.cpp @@ -80,6 +80,21 @@ private: QPixmap p; }; +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = 0) : QGraphicsView(scene, parent) + { + } + + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + + void createStates(const QObjectList &objects, const QRect &selectedRect, QState *parent) { @@ -112,10 +127,10 @@ int main(int argc, char **argv) p3->setObjectName("p3"); p4->setObjectName("p4"); - p1->setGeometry(QRectF(0.0, 0.0, 64.0, 64.0)); - p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0)); + p1->setGeometry(QRectF( 0.0, 0.0, 64.0, 64.0)); + p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0)); p3->setGeometry(QRectF(236.0, 236.0, 64.0, 64.0)); - p4->setGeometry(QRectF(0.0, 236.0, 64.0, 64.0)); + p4->setGeometry(QRectF( 0.0, 236.0, 64.0, 64.0)); QGraphicsScene scene(0, 0, 300, 300); scene.setBackgroundBrush(Qt::white); @@ -124,7 +139,7 @@ int main(int argc, char **argv) scene.addItem(p3); scene.addItem(p4); - QGraphicsView window(&scene); + GraphicsView window(&scene); window.setFrameStyle(0); window.setAlignment(Qt::AlignLeft | Qt::AlignTop); window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -135,12 +150,13 @@ int main(int argc, char **argv) QState *group = new QState(&machine); group->setObjectName("group"); + QRect selectedRect(86, 86, 128, 128); QState *idleState = new QState(group); group->setInitialState(idleState); - QObjectList objects; + QObjectList objects; objects << p1 << p2 << p3 << p4; createStates(objects, selectedRect, group); createAnimations(objects, &machine); @@ -148,8 +164,12 @@ int main(int argc, char **argv) machine.setInitialState(group); machine.start(); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + window.showMaximized(); +#else window.resize(300, 300); window.show(); +#endif return app.exec(); } diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro index 3a10004022..0d5eaf4386 100644 --- a/examples/animation/easing/easing.pro +++ b/examples/animation/easing/easing.pro @@ -5,7 +5,7 @@ SOURCES = main.cpp \ FORMS = form.ui -RESOURCES = easing.qrc +RESOURCES = easing.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/easing @@ -17,3 +17,5 @@ symbian { TARGET.UID3 = 0xA000E3F6 CONFIG += qt_example } + +maemo5: CONFIG += qt_example diff --git a/examples/animation/easing/form.ui b/examples/animation/easing/form.ui index b60ade86a4..364aebeda6 100644 --- a/examples/animation/easing/form.ui +++ b/examples/animation/easing/form.ui @@ -49,12 +49,27 @@ + + + 16777215 + 16777215 + + Path type - - + + + + + 16777215 + 40 + + + + Qt::LeftToRight + Line @@ -66,8 +81,14 @@ - + + + + 16777215 + 40 + + Circle @@ -96,6 +117,18 @@ + + + 0 + 0 + + + + + 0 + 30 + + Period @@ -106,6 +139,18 @@ false + + + 0 + 0 + + + + + 0 + 30 + + -1.000000000000000 @@ -117,18 +162,17 @@ - - - - Amplitude - - - - + false + + + 0 + 30 + + -1.000000000000000 @@ -140,18 +184,30 @@ - + + + + 0 + 30 + + Overshoot - + false + + + 0 + 30 + + -1.000000000000000 @@ -163,6 +219,19 @@ + + + + + 0 + 30 + + + + Amplitude + + + diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp index def1db27de..66a6958cf2 100644 --- a/examples/animation/easing/main.cpp +++ b/examples/animation/easing/main.cpp @@ -46,7 +46,15 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(easing); QApplication app(argc, argv); Window w; + +#if defined(Q_OS_SYMBIAN) + w.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + w.show(); +#else w.resize(400, 400); w.show(); +#endif + return app.exec(); } diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index b466cec3d0..869bca4798 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -41,7 +41,12 @@ #include "window.h" Window::Window(QWidget *parent) - : QWidget(parent), m_iconSize(64, 64) + : QWidget(parent), +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + m_iconSize(32, 32) +#else + m_iconSize(64, 64) +#endif { m_ui.setupUi(this); QButtonGroup *buttonGroup = findChild(); // ### workaround for uic in 4.4 diff --git a/examples/animation/easing/window.h b/examples/animation/easing/window.h index bbdf14e0dc..17899a422e 100644 --- a/examples/animation/easing/window.h +++ b/examples/animation/easing/window.h @@ -39,7 +39,6 @@ ****************************************************************************/ #include - #include "ui_form.h" #include "animation.h" @@ -73,6 +72,4 @@ private: PixmapItem *m_item; Animation *m_anim; QSize m_iconSize; - - }; diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp index 3194c1b623..ca1876f95a 100644 --- a/examples/animation/moveblocks/main.cpp +++ b/examples/animation/moveblocks/main.cpp @@ -154,25 +154,28 @@ QState *createGeometryState(QObject *w1, const QRect &rect1, } //![13] + +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = NULL) : QGraphicsView(scene, parent) + { + } + +protected: + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(scene()->sceneRect()); + QGraphicsView::resizeEvent(event); + } +}; + + int main(int argc, char **argv) { QApplication app(argc, argv); -#if 0 - QWidget window; - QPalette palette; - palette.setBrush(QPalette::Window, Qt::black); - window.setPalette(palette); - QPushButton *button1 = new QPushButton("A", &window); - QPushButton *button2 = new QPushButton("B", &window); - QPushButton *button3 = new QPushButton("C", &window); - QPushButton *button4 = new QPushButton("D", &window); - - button1->setObjectName("button1"); - button2->setObjectName("button2"); - button3->setObjectName("button3"); - button4->setObjectName("button4"); -#else //![1] QGraphicsRectWidget *button1 = new QGraphicsRectWidget; QGraphicsRectWidget *button2 = new QGraphicsRectWidget; @@ -188,12 +191,11 @@ int main(int argc, char **argv) scene.addItem(button3); scene.addItem(button4); //![1] - QGraphicsView window(&scene); + GraphicsView window(&scene); window.setFrameStyle(0); window.setAlignment(Qt::AlignLeft | Qt::AlignTop); window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -#endif //![2] QStateMachine machine; @@ -308,8 +310,13 @@ int main(int argc, char **argv) machine.start(); //![9] +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + window.showMaximized(); + window.fitInView(scene.sceneRect() ); +#else window.resize(300, 300); window.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro index b9c8542f4f..b49495ddd3 100644 --- a/examples/animation/moveblocks/moveblocks.pro +++ b/examples/animation/moveblocks/moveblocks.pro @@ -10,3 +10,4 @@ symbian { TARGET.UID3 = 0xA000E3F7 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index 1565489069..d49aa415a7 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -62,6 +62,19 @@ private: QPixmap p; }; +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) + { + } + + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(states); @@ -130,12 +143,12 @@ int main(int argc, char *argv[]) state1->assignProperty(button, "text", "Switch to state 2"); state1->assignProperty(widget, "geometry", QRectF(0, 0, 400, 150)); state1->assignProperty(box, "geometry", QRect(-200, 150, 200, 150)); - state1->assignProperty(p1, "pos", QPointF(68, 185)); - state1->assignProperty(p2, "pos", QPointF(168, 185)); - state1->assignProperty(p3, "pos", QPointF(268, 185)); - state1->assignProperty(p4, "pos", QPointF(68-150, 48-150)); - state1->assignProperty(p5, "pos", QPointF(168, 48-150)); - state1->assignProperty(p6, "pos", QPointF(268+150, 48-150)); + state1->assignProperty(p1, "pos", QPointF(68, 200)); // 185)); + state1->assignProperty(p2, "pos", QPointF(168, 200)); // 185)); + state1->assignProperty(p3, "pos", QPointF(268, 200)); // 185)); + state1->assignProperty(p4, "pos", QPointF(68 - 150, 48 - 150)); + state1->assignProperty(p5, "pos", QPointF(168, 48 - 150)); + state1->assignProperty(p6, "pos", QPointF(268 + 150, 48 - 150)); state1->assignProperty(p1, "rotation", qreal(0)); state1->assignProperty(p2, "rotation", qreal(0)); state1->assignProperty(p3, "rotation", qreal(0)); @@ -154,9 +167,9 @@ int main(int argc, char *argv[]) state2->assignProperty(button, "text", "Switch to state 3"); state2->assignProperty(widget, "geometry", QRectF(200, 150, 200, 150)); state2->assignProperty(box, "geometry", QRect(9, 150, 190, 150)); - state2->assignProperty(p1, "pos", QPointF(68-150, 185+150)); - state2->assignProperty(p2, "pos", QPointF(168, 185+150)); - state2->assignProperty(p3, "pos", QPointF(268+150, 185+150)); + state2->assignProperty(p1, "pos", QPointF(68 - 150, 185 + 150)); + state2->assignProperty(p2, "pos", QPointF(168, 185 + 150)); + state2->assignProperty(p3, "pos", QPointF(268 + 150, 185 + 150)); state2->assignProperty(p4, "pos", QPointF(64, 48)); state2->assignProperty(p5, "pos", QPointF(168, 48)); state2->assignProperty(p6, "pos", QPointF(268, 48)); @@ -262,8 +275,13 @@ int main(int argc, char *argv[]) machine.start(); - QGraphicsView view(&scene); + GraphicsView view(&scene); + +#if defined(Q_OS_SYMBIAN) + view.showMaximized(); +#else view.show(); +#endif return app.exec(); } diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro index 00963fe8c0..56b3c51299 100644 --- a/examples/animation/states/states.pro +++ b/examples/animation/states/states.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F8 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/stickman/graphicsview.cpp b/examples/animation/stickman/graphicsview.cpp index 23036efe92..0f7ce5f1c6 100644 --- a/examples/animation/stickman/graphicsview.cpp +++ b/examples/animation/stickman/graphicsview.cpp @@ -54,4 +54,7 @@ void GraphicsView::keyPressEvent(QKeyEvent *e) emit keyPressed(Qt::Key(e->key())); } - +void GraphicsView::resizeEvent(QResizeEvent *event) +{ + fitInView(scene()->sceneRect()); +} diff --git a/examples/animation/stickman/graphicsview.h b/examples/animation/stickman/graphicsview.h index 9cf87b63e6..400e4a63d4 100644 --- a/examples/animation/stickman/graphicsview.h +++ b/examples/animation/stickman/graphicsview.h @@ -51,6 +51,7 @@ public: GraphicsView(QWidget *parent = 0); protected: + virtual void resizeEvent(QResizeEvent *event); void keyPressEvent(QKeyEvent *); signals: diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index 4abcdc22e5..8e9dbe1e8b 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -159,10 +159,14 @@ void LifeCycle::start() m_machine->start(); } -void LifeCycle::addActivity(const QString &fileName, Qt::Key key) +void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sender, const char *signal) { QState *state = makeState(m_alive, fileName); m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state)); + + if((sender != NULL) || (signal != NULL)) { + m_alive->addTransition(sender, signal, state); + } } QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName) diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h index 1bf3661f6c..ca1a052c39 100644 --- a/examples/animation/stickman/lifecycle.h +++ b/examples/animation/stickman/lifecycle.h @@ -50,6 +50,7 @@ class QAnimationGroup; class QState; class QAbstractState; class QAbstractTransition; +class QObject; QT_END_NAMESPACE class GraphicsView; class LifeCycle @@ -59,7 +60,7 @@ public: ~LifeCycle(); void setDeathAnimation(const QString &fileName); - void addActivity(const QString &fileName, Qt::Key key); + void addActivity(const QString &fileName, Qt::Key key, QObject *sender = NULL, const char *signal = NULL); void start(); diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp index 08df766509..902e572a0e 100644 --- a/examples/animation/stickman/main.cpp +++ b/examples/animation/stickman/main.cpp @@ -43,6 +43,7 @@ #include "lifecycle.h" #include "stickman.h" #include "graphicsview.h" +#include "rectbutton.h" #include #include @@ -55,6 +56,11 @@ int main(int argc, char **argv) StickMan *stickMan = new StickMan; stickMan->setDrawSticks(false); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + RectButton *buttonJump = new RectButton("Jump"); buttonJump->setPos(100, 125); + RectButton *buttonDance = new RectButton("Dance"); buttonDance->setPos(100, 200); + RectButton *buttonChill = new RectButton("Chill"); buttonChill->setPos(100, 275); +#else QGraphicsTextItem *textItem = new QGraphicsTextItem(); textItem->setHtml("Stickman" "

" @@ -71,31 +77,55 @@ int main(int argc, char **argv) qreal w = textItem->boundingRect().width(); QRectF stickManBoundingRect = stickMan->mapToScene(stickMan->boundingRect()).boundingRect(); textItem->setPos(-w / 2.0, stickManBoundingRect.bottom() + 25.0); +#endif QGraphicsScene scene; scene.addItem(stickMan); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + scene.addItem(buttonJump); + scene.addItem(buttonDance); + scene.addItem(buttonChill); +#else scene.addItem(textItem); +#endif scene.setBackgroundBrush(Qt::black); GraphicsView view; view.setRenderHints(QPainter::Antialiasing); view.setTransformationAnchor(QGraphicsView::NoAnchor); view.setScene(&scene); - view.show(); - view.setFocus(); QRectF sceneRect = scene.sceneRect(); // making enough room in the scene for stickman to jump and die view.resize(sceneRect.width() + 100, sceneRect.height() + 100); view.setSceneRect(sceneRect); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.showMaximized(); + view.fitInView(scene.sceneRect(), Qt::KeepAspectRatio); +#else + view.show(); + view.setFocus(); +#endif + LifeCycle cycle(stickMan, &view); cycle.setDeathAnimation(":/animations/dead"); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + cycle.addActivity(":/animations/jumping", Qt::Key_J, buttonJump, SIGNAL(clicked())); + cycle.addActivity(":/animations/dancing", Qt::Key_D, buttonDance, SIGNAL(clicked())); + cycle.addActivity(":/animations/chilling", Qt::Key_C, buttonChill, SIGNAL(clicked())); +#else cycle.addActivity(":/animations/jumping", Qt::Key_J); cycle.addActivity(":/animations/dancing", Qt::Key_D); cycle.addActivity(":/animations/chilling", Qt::Key_C); +#endif + cycle.start(); + return app.exec(); } diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro index 2fefe72c4f..206321dbc8 100644 --- a/examples/animation/stickman/stickman.pro +++ b/examples/animation/stickman/stickman.pro @@ -2,13 +2,15 @@ HEADERS += stickman.h \ animation.h \ node.h \ lifecycle.h \ - graphicsview.h + graphicsview.h \ + rectbutton.h SOURCES += main.cpp \ stickman.cpp \ animation.cpp \ node.cpp \ lifecycle.cpp \ - graphicsview.cpp + graphicsview.cpp \ + rectbutton.cpp RESOURCES += stickman.qrc @@ -22,3 +24,4 @@ symbian { TARGET.UID3 = 0xA000E3F9 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro index de4ed61f79..c84ef081e4 100644 --- a/examples/dbus/complexpingpong/complexping.pro +++ b/examples/dbus/complexpingpong/complexping.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro index b3a2e75e37..a9ca7cab94 100644 --- a/examples/dbus/complexpingpong/complexpong.pro +++ b/examples/dbus/complexpingpong/complexpong.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/dbus-chat/dbus-chat.pro b/examples/dbus/dbus-chat/dbus-chat.pro index 8de055afdb..ae2b7fee5d 100644 --- a/examples/dbus/dbus-chat/dbus-chat.pro +++ b/examples/dbus/dbus-chat/dbus-chat.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -19,3 +18,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/chat INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro index 7a83e8864e..0ac20ad165 100644 --- a/examples/dbus/dbus.pro +++ b/examples/dbus/dbus.pro @@ -15,3 +15,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/dbus/listnames/listnames.pro b/examples/dbus/listnames/listnames.pro index f633f10c11..dc9c26e8c7 100644 --- a/examples/dbus/listnames/listnames.pro +++ b/examples/dbus/listnames/listnames.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,4 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/listnames INSTALLS += target sources symbian: CONFIG += qt_example - +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/pingpong/ping.pro b/examples/dbus/pingpong/ping.pro index 66fc196462..9d3f2da84b 100644 --- a/examples/dbus/pingpong/ping.pro +++ b/examples/dbus/pingpong/ping.pro @@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/pingpong/pong.pro b/examples/dbus/pingpong/pong.pro index afd5f51776..f82be77191 100644 --- a/examples/dbus/pingpong/pong.pro +++ b/examples/dbus/pingpong/pong.pro @@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro index 8bca29c6a3..b7f232f7a2 100644 --- a/examples/dbus/remotecontrolledcar/car/car.pro +++ b/examples/dbus/remotecontrolledcar/car/car.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -20,3 +19,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/car INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro index 00a5a2a317..5edf1a006f 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.pro +++ b/examples/dbus/remotecontrolledcar/controller/controller.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -21,3 +20,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/controlle INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro index 41a7476b11..eec736d74f 100644 --- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro +++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro @@ -8,3 +8,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/desktop/desktop.pro b/examples/desktop/desktop.pro index 58c7b977fb..3333578451 100644 --- a/examples/desktop/desktop.pro +++ b/examples/desktop/desktop.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/desktop INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/desktop/screenshot/screenshot.pro b/examples/desktop/screenshot/screenshot.pro index c2c6ead8cc..d86f038152 100644 --- a/examples/desktop/screenshot/screenshot.pro +++ b/examples/desktop/screenshot/screenshot.pro @@ -9,3 +9,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/desktop/screenshot INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/classwizard/classwizard.pro b/examples/dialogs/classwizard/classwizard.pro index 0952e8f724..09cdce2b4c 100644 --- a/examples/dialogs/classwizard/classwizard.pro +++ b/examples/dialogs/classwizard/classwizard.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/classwizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro index c6e47485bb..24544a9826 100644 --- a/examples/dialogs/configdialog/configdialog.pro +++ b/examples/dialogs/configdialog/configdialog.pro @@ -14,3 +14,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/dialogs.pro b/examples/dialogs/dialogs.pro index f4ea5713df..5bdac5a63d 100644 --- a/examples/dialogs/dialogs.pro +++ b/examples/dialogs/dialogs.pro @@ -17,3 +17,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/extension/extension.pro b/examples/dialogs/extension/extension.pro index 108906f483..db57fc8361 100644 --- a/examples/dialogs/extension/extension.pro +++ b/examples/dialogs/extension/extension.pro @@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/extension INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/extension/finddialog.cpp b/examples/dialogs/extension/finddialog.cpp index 313e8e4201..2ce0391d3c 100644 --- a/examples/dialogs/extension/finddialog.cpp +++ b/examples/dialogs/extension/finddialog.cpp @@ -63,9 +63,6 @@ FindDialog::FindDialog(QWidget *parent) //! [0] moreButton->setAutoDefault(false); - buttonBox = new QDialogButtonBox(Qt::Vertical); - buttonBox->addButton(findButton, QDialogButtonBox::ActionRole); - buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole); //! [1] //! [2] @@ -77,7 +74,42 @@ FindDialog::FindDialog(QWidget *parent) //! [2] //! [3] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + // Create menu + QMenu *menu = new QMenu(this); + + // Create Find menu item + menu->addAction(tr("Find")); + + // Create More menu item + QAction *moreAction = menu->addAction(tr("More")); + moreAction->setCheckable(true); + + // Create Options CBA + QAction *optionAction = new QAction(tr("Options"), this); + + // Set defined menu into Options button + optionAction->setMenu(menu); + optionAction->setSoftKeyRole(QAction::PositiveSoftKey); + addAction(optionAction); + + // Connect More menu item to setVisible slot + connect(moreAction, SIGNAL(triggered(bool)), extension, SLOT(setVisible(bool))); + + // Create Exit CBA + QAction *backSoftKeyAction = new QAction(QString(tr("Exit")), this); + backSoftKeyAction->setSoftKeyRole(QAction::NegativeSoftKey); + + // Exit button closes the application + connect(backSoftKeyAction, SIGNAL(triggered()), qApp, SLOT(quit())); + addAction(backSoftKeyAction); +#else + buttonBox = new QDialogButtonBox(Qt::Vertical); + buttonBox->addButton(findButton, QDialogButtonBox::ActionRole); + buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole); + connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool))); +#endif QVBoxLayout *extensionLayout = new QVBoxLayout; extensionLayout->setMargin(0); @@ -96,13 +128,18 @@ FindDialog::FindDialog(QWidget *parent) leftLayout->addLayout(topLeftLayout); leftLayout->addWidget(caseCheckBox); leftLayout->addWidget(fromStartCheckBox); - leftLayout->addStretch(1); QGridLayout *mainLayout = new QGridLayout; +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) mainLayout->setSizeConstraint(QLayout::SetFixedSize); +#endif mainLayout->addLayout(leftLayout, 0, 0); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_SIMULATOR) mainLayout->addWidget(buttonBox, 0, 1); +#endif mainLayout->addWidget(extension, 1, 0, 1, 2); + mainLayout->setRowStretch(2, 1); + setLayout(mainLayout); setWindowTitle(tr("Extension")); diff --git a/examples/dialogs/extension/main.cpp b/examples/dialogs/extension/main.cpp index d487faab69..9937b6d0b5 100644 --- a/examples/dialogs/extension/main.cpp +++ b/examples/dialogs/extension/main.cpp @@ -46,5 +46,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); FindDialog dialog; - return dialog.exec(); + +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else + dialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/findfiles/findfiles.pro b/examples/dialogs/findfiles/findfiles.pro index ffae120bda..865fb8e0ba 100644 --- a/examples/dialogs/findfiles/findfiles.pro +++ b/examples/dialogs/findfiles/findfiles.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/findfiles INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/findfiles/main.cpp b/examples/dialogs/findfiles/main.cpp index f2079f511b..c5a324a452 100644 --- a/examples/dialogs/findfiles/main.cpp +++ b/examples/dialogs/findfiles/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#ifdef Q_OS_SYMBIAN + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/dialogs/findfiles/window.cpp b/examples/dialogs/findfiles/window.cpp index 3d6c0fd398..f700e82d5e 100644 --- a/examples/dialogs/findfiles/window.cpp +++ b/examples/dialogs/findfiles/window.cpp @@ -44,7 +44,7 @@ //! [0] Window::Window(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { browseButton = createButton(tr("&Browse..."), SLOT(browse())); findButton = createButton(tr("&Find"), SLOT(find())); @@ -62,11 +62,8 @@ Window::Window(QWidget *parent) //! [0] //! [1] - QHBoxLayout *buttonsLayout = new QHBoxLayout; - buttonsLayout->addStretch(); - buttonsLayout->addWidget(findButton); - QGridLayout *mainLayout = new QGridLayout; + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); mainLayout->addWidget(fileLabel, 0, 0); mainLayout->addWidget(fileComboBox, 0, 1, 1, 2); mainLayout->addWidget(textLabel, 1, 0); @@ -75,12 +72,14 @@ Window::Window(QWidget *parent) mainLayout->addWidget(directoryComboBox, 2, 1); mainLayout->addWidget(browseButton, 2, 2); mainLayout->addWidget(filesTable, 3, 0, 1, 3); - mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 3); - mainLayout->addLayout(buttonsLayout, 5, 0, 1, 3); + mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2); + mainLayout->addWidget(findButton, 4, 2); setLayout(mainLayout); setWindowTitle(tr("Find Files")); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) resize(700, 300); +#endif } //! [1] @@ -194,7 +193,12 @@ void Window::showFiles(const QStringList &files) filesTable->setItem(row, 1, sizeItem); } filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()) + +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + (" (Select file to open it)")); +#else (" (Double click on a file to open it)")); +#endif + filesFoundLabel->setWordWrap(true); } //! [8] @@ -214,6 +218,9 @@ QComboBox *Window::createComboBox(const QString &text) comboBox->setEditable(true); comboBox->addItem(text); comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + comboBox->setMinimumContentsLength(3); +#endif return comboBox; } //! [10] @@ -225,7 +232,7 @@ void Window::createFilesTable() filesTable->setSelectionBehavior(QAbstractItemView::SelectRows); QStringList labels; - labels << tr("File Name") << tr("Size"); + labels << tr("Filename") << tr("Size"); filesTable->setHorizontalHeaderLabels(labels); filesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); filesTable->verticalHeader()->hide(); diff --git a/examples/dialogs/findfiles/window.h b/examples/dialogs/findfiles/window.h index 73b065233b..4dbb446e18 100644 --- a/examples/dialogs/findfiles/window.h +++ b/examples/dialogs/findfiles/window.h @@ -41,7 +41,7 @@ #ifndef WINDOW_H #define WINDOW_H -#include +#include #include QT_BEGIN_NAMESPACE @@ -53,7 +53,7 @@ class QTableWidgetItem; QT_END_NAMESPACE //! [0] -class Window : public QDialog +class Window : public QWidget { Q_OBJECT diff --git a/examples/dialogs/licensewizard/licensewizard.pro b/examples/dialogs/licensewizard/licensewizard.pro index cdf6aa7fdc..4c43e7ae91 100644 --- a/examples/dialogs/licensewizard/licensewizard.pro +++ b/examples/dialogs/licensewizard/licensewizard.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/licensewizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro index ffc9693604..015aa43dac 100644 --- a/examples/dialogs/sipdialog/sipdialog.pro +++ b/examples/dialogs/sipdialog/sipdialog.pro @@ -11,4 +11,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib - +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/standarddialogs/dialog.cpp b/examples/dialogs/standarddialogs/dialog.cpp index 0b7728ece4..a59b3c5ef7 100644 --- a/examples/dialogs/standarddialogs/dialog.cpp +++ b/examples/dialogs/standarddialogs/dialog.cpp @@ -49,7 +49,7 @@ "will activate the detected escape button (if any).") Dialog::Dialog(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { errorMessageDialog = new QErrorMessage(this); @@ -149,6 +149,7 @@ Dialog::Dialog(QWidget *parent) native = new QCheckBox(this); native->setText("Use native file dialog."); native->setChecked(true); + QGridLayout *layout = new QGridLayout; layout->setColumnStretch(1, 1); layout->setColumnMinimumWidth(1, 250); @@ -183,7 +184,19 @@ Dialog::Dialog(QWidget *parent) layout->addWidget(errorButton, 14, 0); layout->addWidget(errorLabel, 14, 1); layout->addWidget(native, 15, 0); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QWidget *widget = new QWidget; + widget->setLayout(layout); + + QScrollArea *scrollArea = new QScrollArea(this); + scrollArea->setWidget(widget); + + QHBoxLayout *mainLayout = new QHBoxLayout; + mainLayout->addWidget(scrollArea); + setLayout(mainLayout); +#else setLayout(layout); +#endif setWindowTitle(tr("Standard Dialogs")); } diff --git a/examples/dialogs/standarddialogs/dialog.h b/examples/dialogs/standarddialogs/dialog.h index 9af17d130b..506fc00f90 100644 --- a/examples/dialogs/standarddialogs/dialog.h +++ b/examples/dialogs/standarddialogs/dialog.h @@ -41,7 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include +#include QT_BEGIN_NAMESPACE class QCheckBox; @@ -49,7 +49,7 @@ class QLabel; class QErrorMessage; QT_END_NAMESPACE -class Dialog : public QDialog +class Dialog : public QWidget { Q_OBJECT diff --git a/examples/dialogs/standarddialogs/main.cpp b/examples/dialogs/standarddialogs/main.cpp index 2aec376dab..5dbf2cf910 100644 --- a/examples/dialogs/standarddialogs/main.cpp +++ b/examples/dialogs/standarddialogs/main.cpp @@ -56,5 +56,11 @@ int main(int argc, char *argv[]) app.installTranslator(translator); Dialog dialog; - return dialog.exec(); +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else + dialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro index f7b3cef905..e8f63d0127 100644 --- a/examples/dialogs/standarddialogs/standarddialogs.pro +++ b/examples/dialogs/standarddialogs/standarddialogs.pro @@ -11,3 +11,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/dialogs/tabdialog/main.cpp b/examples/dialogs/tabdialog/main.cpp index 87265c3986..6c83aa0b80 100644 --- a/examples/dialogs/tabdialog/main.cpp +++ b/examples/dialogs/tabdialog/main.cpp @@ -53,5 +53,11 @@ int main(int argc, char *argv[]) fileName = "."; TabDialog tabdialog(fileName); - return tabdialog.exec(); +#ifdef Q_OS_SYMBIAN + tabdialog.showMaximized(); +#else + tabdialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/tabdialog/tabdialog.cpp b/examples/dialogs/tabdialog/tabdialog.cpp index 62c921c84b..5d4d345a0c 100644 --- a/examples/dialogs/tabdialog/tabdialog.cpp +++ b/examples/dialogs/tabdialog/tabdialog.cpp @@ -65,6 +65,7 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent) //! [4] QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); mainLayout->addWidget(tabWidget); mainLayout->addWidget(buttonBox); setLayout(mainLayout); diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro index c67fcbd157..0486db9ca9 100644 --- a/examples/dialogs/tabdialog/tabdialog.pro +++ b/examples/dialogs/tabdialog/tabdialog.pro @@ -10,3 +10,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/dialogs/trivialwizard/trivialwizard.cpp b/examples/dialogs/trivialwizard/trivialwizard.cpp index 2a5c0ae5db..3dbc039b62 100644 --- a/examples/dialogs/trivialwizard/trivialwizard.cpp +++ b/examples/dialogs/trivialwizard/trivialwizard.cpp @@ -128,7 +128,11 @@ int main(int argc, char *argv[]) wizard.addPage(createConclusionPage()); wizard.setWindowTitle("Trivial Wizard"); +#ifdef Q_OS_SYMBIAN + wizard.showMaximized(); +#else wizard.show(); +#endif return app.exec(); } diff --git a/examples/dialogs/trivialwizard/trivialwizard.pro b/examples/dialogs/trivialwizard/trivialwizard.pro index 31422de763..0321ac8fdb 100644 --- a/examples/dialogs/trivialwizard/trivialwizard.pro +++ b/examples/dialogs/trivialwizard/trivialwizard.pro @@ -7,3 +7,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/trivialwizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro index db56b7cc95..691c270e81 100644 --- a/examples/draganddrop/draggableicons/draggableicons.pro +++ b/examples/draganddrop/draggableicons/draggableicons.pro @@ -13,3 +13,4 @@ symbian { TARGET.UID3 = 0xA000C615 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/draganddrop/draggableicons/dragwidget.cpp b/examples/draganddrop/draggableicons/dragwidget.cpp index c8c3b134fc..46bfff9330 100644 --- a/examples/draganddrop/draggableicons/dragwidget.cpp +++ b/examples/draganddrop/draggableicons/dragwidget.cpp @@ -46,25 +46,28 @@ DragWidget::DragWidget(QWidget *parent) : QFrame(parent) { +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) +#else setMinimumSize(200, 200); +#endif setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); setAcceptDrops(true); QLabel *boatIcon = new QLabel(this); boatIcon->setPixmap(QPixmap(":/images/boat.png")); - boatIcon->move(20, 20); + boatIcon->move(10, 10); boatIcon->show(); boatIcon->setAttribute(Qt::WA_DeleteOnClose); QLabel *carIcon = new QLabel(this); carIcon->setPixmap(QPixmap(":/images/car.png")); - carIcon->move(120, 20); + carIcon->move(100, 10); carIcon->show(); carIcon->setAttribute(Qt::WA_DeleteOnClose); QLabel *houseIcon = new QLabel(this); houseIcon->setPixmap(QPixmap(":/images/house.png")); - houseIcon->move(20, 120); + houseIcon->move(10, 80); houseIcon->show(); houseIcon->setAttribute(Qt::WA_DeleteOnClose); } diff --git a/examples/draganddrop/draggableicons/main.cpp b/examples/draganddrop/draggableicons/main.cpp index 7a80b92a8a..a6ade67651 100644 --- a/examples/draganddrop/draggableicons/main.cpp +++ b/examples/draganddrop/draggableicons/main.cpp @@ -55,7 +55,11 @@ int main(int argc, char *argv[]) mainWidget.setLayout(horizontalLayout); mainWidget.setWindowTitle(QObject::tr("Draggable Icons")); +#ifdef Q_OS_SYMBIAN + mainWidget.showMaximized(); +#else mainWidget.show(); +#endif return app.exec(); } diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro index ffe219be14..33885f906f 100644 --- a/examples/draganddrop/draggabletext/draggabletext.pro +++ b/examples/draganddrop/draggabletext/draggabletext.pro @@ -15,3 +15,5 @@ symbian { TARGET.UID3 = 0xA000CF64 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/draganddrop/draggabletext/dragwidget.cpp b/examples/draganddrop/draggabletext/dragwidget.cpp index df61c39476..060d41de2d 100644 --- a/examples/draganddrop/draggabletext/dragwidget.cpp +++ b/examples/draganddrop/draggabletext/dragwidget.cpp @@ -62,16 +62,18 @@ DragWidget::DragWidget(QWidget *parent) wordLabel->show(); wordLabel->setAttribute(Qt::WA_DeleteOnClose); x += wordLabel->width() + 2; - if (x >= 195) { + if (x >= 245) { x = 5; y += wordLabel->height() + 2; } } } + /* QPalette newPalette = palette(); newPalette.setColor(QPalette::Window, Qt::white); setPalette(newPalette); + */ setAcceptDrops(true); setMinimumSize(400, qMax(200, y)); diff --git a/examples/draganddrop/draggabletext/main.cpp b/examples/draganddrop/draggabletext/main.cpp index 4d0a121337..0ae794b280 100644 --- a/examples/draganddrop/draggabletext/main.cpp +++ b/examples/draganddrop/draggabletext/main.cpp @@ -47,6 +47,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); DragWidget window; +#ifdef Q_OS_SYMBIAN + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro index 0ee9f600d1..b3be1b64cb 100644 --- a/examples/draganddrop/dropsite/dropsite.pro +++ b/examples/draganddrop/dropsite/dropsite.pro @@ -11,3 +11,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/draganddrop/dropsite INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp index aeab3ade12..19abfb6976 100644 --- a/examples/draganddrop/fridgemagnets/dragwidget.cpp +++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp @@ -65,7 +65,11 @@ DragWidget::DragWidget(QWidget *parent) wordLabel->show(); wordLabel->setAttribute(Qt::WA_DeleteOnClose); x += wordLabel->width() + 2; +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + if (x >= 345) { +#else if (x >= 245) { +#endif x = 5; y += wordLabel->height() + 2; } diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro index fe1377fb74..5fb7379dd1 100644 --- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro +++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro @@ -16,4 +16,4 @@ symbian { CONFIG += qt_example } - +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp index 1166abbcaa..623e6d2718 100644 --- a/examples/draganddrop/fridgemagnets/main.cpp +++ b/examples/draganddrop/fridgemagnets/main.cpp @@ -51,10 +51,15 @@ int main(int argc, char *argv[]) #endif DragWidget window; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + window.showMaximized(); +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); if (smallScreen) window.showFullScreen(); else window.show(); +#endif + return app.exec(); } diff --git a/examples/draganddrop/puzzle/main.cpp b/examples/draganddrop/puzzle/main.cpp index 60341948ab..b432ddc40e 100644 --- a/examples/draganddrop/puzzle/main.cpp +++ b/examples/draganddrop/puzzle/main.cpp @@ -49,6 +49,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; window.openImage(":/images/example.jpg"); +#ifdef Q_OS_SYMBIAN + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/draganddrop/puzzle/mainwindow.cpp b/examples/draganddrop/puzzle/mainwindow.cpp index ea7cff12ce..09fcaf7c59 100644 --- a/examples/draganddrop/puzzle/mainwindow.cpp +++ b/examples/draganddrop/puzzle/mainwindow.cpp @@ -90,14 +90,15 @@ void MainWindow::setupPuzzle() { int size = qMin(puzzleImage.width(), puzzleImage.height()); puzzleImage = puzzleImage.copy((puzzleImage.width() - size)/2, - (puzzleImage.height() - size)/2, size, size).scaled(400, - 400, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + (puzzleImage.height() - size)/2, size, size).scaled(puzzleWidget->width(), + puzzleWidget->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); piecesList->clear(); for (int y = 0; y < 5; ++y) { for (int x = 0; x < 5; ++x) { - QPixmap pieceImage = puzzleImage.copy(x*80, y*80, 80, 80); + int pieceSize = puzzleWidget->pieceSize(); + QPixmap pieceImage = puzzleImage.copy(x * pieceSize, y * pieceSize, pieceSize, pieceSize); piecesList->addPiece(pieceImage, QPoint(x, y)); } } @@ -137,9 +138,14 @@ void MainWindow::setupWidgets() { QFrame *frame = new QFrame; QHBoxLayout *frameLayout = new QHBoxLayout(frame); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + puzzleWidget = new PuzzleWidget(260); +#else + puzzleWidget = new PuzzleWidget(400); +#endif + + piecesList = new PiecesList(puzzleWidget->pieceSize(), this); - piecesList = new PiecesList; - puzzleWidget = new PuzzleWidget; connect(puzzleWidget, SIGNAL(puzzleCompleted()), this, SLOT(setCompleted()), Qt::QueuedConnection); diff --git a/examples/draganddrop/puzzle/pieceslist.cpp b/examples/draganddrop/puzzle/pieceslist.cpp index db27e7ad13..5eb4984146 100644 --- a/examples/draganddrop/puzzle/pieceslist.cpp +++ b/examples/draganddrop/puzzle/pieceslist.cpp @@ -42,12 +42,12 @@ #include "pieceslist.h" -PiecesList::PiecesList(QWidget *parent) - : QListWidget(parent) +PiecesList::PiecesList(int pieceSize, QWidget *parent) + : QListWidget(parent), m_PieceSize(pieceSize) { setDragEnabled(true); setViewMode(QListView::IconMode); - setIconSize(QSize(60, 60)); + setIconSize(QSize(m_PieceSize, m_PieceSize)); setSpacing(10); setAcceptDrops(true); setDropIndicatorShown(true); diff --git a/examples/draganddrop/puzzle/pieceslist.h b/examples/draganddrop/puzzle/pieceslist.h index 2068dceb17..967ade0c73 100644 --- a/examples/draganddrop/puzzle/pieceslist.h +++ b/examples/draganddrop/puzzle/pieceslist.h @@ -48,7 +48,7 @@ class PiecesList : public QListWidget Q_OBJECT public: - PiecesList(QWidget *parent = 0); + PiecesList(int pieceSize, QWidget *parent = 0); void addPiece(QPixmap pixmap, QPoint location); protected: @@ -56,6 +56,8 @@ protected: void dragMoveEvent(QDragMoveEvent *event); void dropEvent(QDropEvent *event); void startDrag(Qt::DropActions supportedActions); + + int m_PieceSize; }; #endif diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro index 0d3a5dab2e..2682032e87 100644 --- a/examples/draganddrop/puzzle/puzzle.pro +++ b/examples/draganddrop/puzzle/puzzle.pro @@ -27,3 +27,4 @@ wince*: { addFile.path = . DEPLOYMENT += addFile } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/draganddrop/puzzle/puzzlewidget.cpp b/examples/draganddrop/puzzle/puzzlewidget.cpp index 355c6d55cd..e83f248112 100644 --- a/examples/draganddrop/puzzle/puzzlewidget.cpp +++ b/examples/draganddrop/puzzle/puzzlewidget.cpp @@ -42,12 +42,12 @@ #include "puzzlewidget.h" -PuzzleWidget::PuzzleWidget(QWidget *parent) - : QWidget(parent) +PuzzleWidget::PuzzleWidget(int imageSize, QWidget *parent) + : QWidget(parent), m_ImageSize(imageSize) { setAcceptDrops(true); - setMinimumSize(400, 400); - setMaximumSize(400, 400); + setMinimumSize(m_ImageSize, m_ImageSize); + setMaximumSize(m_ImageSize, m_ImageSize); } void PuzzleWidget::clear() @@ -116,7 +116,7 @@ void PuzzleWidget::dropEvent(QDropEvent *event) event->setDropAction(Qt::MoveAction); event->accept(); - if (location == QPoint(square.x()/80, square.y()/80)) { + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) { inPlace++; if (inPlace == 25) emit puzzleCompleted(); @@ -151,7 +151,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event) piecePixmaps.removeAt(found); pieceRects.removeAt(found); - if (location == QPoint(square.x()/80, square.y()/80)) + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) inPlace--; update(square); @@ -175,7 +175,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event) pieceRects.insert(found, square); update(targetSquare(event->pos())); - if (location == QPoint(square.x()/80, square.y()/80)) + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) inPlace++; } } @@ -200,5 +200,15 @@ void PuzzleWidget::paintEvent(QPaintEvent *event) const QRect PuzzleWidget::targetSquare(const QPoint &position) const { - return QRect(position.x()/80 * 80, position.y()/80 * 80, 80, 80); + return QRect(position.x()/pieceSize() * pieceSize(), position.y()/pieceSize() * pieceSize(), pieceSize(), pieceSize()); +} + +int PuzzleWidget::pieceSize() const +{ + return m_ImageSize / 5; +} + +int PuzzleWidget::imageSize() const +{ + return m_ImageSize; } diff --git a/examples/draganddrop/puzzle/puzzlewidget.h b/examples/draganddrop/puzzle/puzzlewidget.h index e0356b48fd..2cc789c292 100644 --- a/examples/draganddrop/puzzle/puzzlewidget.h +++ b/examples/draganddrop/puzzle/puzzlewidget.h @@ -57,9 +57,12 @@ class PuzzleWidget : public QWidget Q_OBJECT public: - PuzzleWidget(QWidget *parent = 0); + PuzzleWidget(int imageSize, QWidget *parent = 0); void clear(); + int pieceSize() const; + int imageSize() const; + signals: void puzzleCompleted(); @@ -80,6 +83,7 @@ private: QList pieceLocations; QRect highlightedRect; int inPlace; + int m_ImageSize; }; #endif diff --git a/examples/effects/blurpicker/blurpicker.cpp b/examples/effects/blurpicker/blurpicker.cpp index 26e53aafae..362ec43931 100644 --- a/examples/effects/blurpicker/blurpicker.cpp +++ b/examples/effects/blurpicker/blurpicker.cpp @@ -131,8 +131,34 @@ void BlurPicker::keyPressEvent(QKeyEvent *event) break; } if (m_animation.state() == QAbstractAnimation::Stopped && delta) { - m_animation.setEndValue(m_index + delta); - m_animation.start(); - event->accept(); + m_animation.setEndValue(m_index + delta); + m_animation.start(); + event->accept(); + } +} + +void BlurPicker::resizeEvent(QResizeEvent */*event*/) +{ +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + fitInView(sceneRect(), Qt::KeepAspectRatio); +#endif +} + +void BlurPicker::mousePressEvent(QMouseEvent *event) +{ + int delta = 0; + if(event->x() > (width() / 2)) + { + delta = 1; + } + else + { + delta = -1; + } + + if (m_animation.state() == QAbstractAnimation::Stopped && delta) { + m_animation.setEndValue(m_index + delta); + m_animation.start(); + event->accept(); } } diff --git a/examples/effects/blurpicker/blurpicker.h b/examples/effects/blurpicker/blurpicker.h index fa5743c70a..af367b96c2 100644 --- a/examples/effects/blurpicker/blurpicker.h +++ b/examples/effects/blurpicker/blurpicker.h @@ -60,6 +60,8 @@ public: protected: void keyPressEvent(QKeyEvent *event); + void resizeEvent(QResizeEvent *event); + void mousePressEvent(QMouseEvent *event); private: void setupScene(); diff --git a/examples/effects/blurpicker/blurpicker.pro b/examples/effects/blurpicker/blurpicker.pro index ba65da8a5c..2dfa8b70d0 100644 --- a/examples/effects/blurpicker/blurpicker.pro +++ b/examples/effects/blurpicker/blurpicker.pro @@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/blurpicker sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blurpicker.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/blurpicker INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/effects/blurpicker/main.cpp b/examples/effects/blurpicker/main.cpp index e95b7e0239..5138fccfcf 100644 --- a/examples/effects/blurpicker/main.cpp +++ b/examples/effects/blurpicker/main.cpp @@ -47,8 +47,13 @@ int main(int argc, char **argv) BlurPicker blurPicker; blurPicker.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Application Picker")); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + blurPicker.showMaximized(); +#else blurPicker.setFixedSize(400, 300); blurPicker.show(); +#endif return app.exec(); } diff --git a/examples/effects/fademessage/fademessage.cpp b/examples/effects/fademessage/fademessage.cpp index 88f9f89f1b..158f0491bc 100644 --- a/examples/effects/fademessage/fademessage.cpp +++ b/examples/effects/fademessage/fademessage.cpp @@ -56,7 +56,6 @@ FadeMessage::FadeMessage(QWidget *parent): QGraphicsView(parent) m_animation->setStartValue(0); m_animation->setEndValue(1); - setRenderHint(QPainter::Antialiasing, true); setFrameStyle(QFrame::NoFrame); } @@ -75,7 +74,7 @@ void FadeMessage::togglePopup() void FadeMessage::setupScene() { - QGraphicsRectItem *parent = m_scene.addRect(0, 0, 400, 600); + QGraphicsRectItem *parent = m_scene.addRect(0, 0, 800, 600); parent->setPen(Qt::NoPen); parent->setZValue(0); @@ -85,7 +84,7 @@ void FadeMessage::setupScene() for (int i = 1; i < 5; ++i) for (int j = 2; j < 5; ++j) { - QGraphicsRectItem *item = m_scene.addRect(i * 50, j * 50, 38, 38); + QGraphicsRectItem *item = m_scene.addRect(i * 50, (j - 1) * 50, 38, 38); item->setParentItem(parent); item->setZValue(1); int hue = 12 * (i * 5 + j); @@ -124,6 +123,10 @@ void FadeMessage::setupScene() press->setText(tr("Press me")); connect(press, SIGNAL(clicked()), SLOT(togglePopup())); m_scene.addWidget(press); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + press->move(200, 210); +#else press->move(300, 500); +#endif } - diff --git a/examples/effects/fademessage/fademessage.pro b/examples/effects/fademessage/fademessage.pro index 9cff9a1dfa..b46ac0e9c9 100644 --- a/examples/effects/fademessage/fademessage.pro +++ b/examples/effects/fademessage/fademessage.pro @@ -12,5 +12,7 @@ sources.files = $$SOURCES \ fademessage.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/fademessage -DEPLOYMENT_PLUGIN += qjpeg +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/effects/fademessage/main.cpp b/examples/effects/fademessage/main.cpp index 83d6d8eab8..8c72a458b0 100644 --- a/examples/effects/fademessage/main.cpp +++ b/examples/effects/fademessage/main.cpp @@ -48,8 +48,12 @@ int main(int argc, char **argv) FadeMessage widget; widget.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Popup Message with Effect")); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + widget.showMaximized(); +#else widget.setFixedSize(400, 600); widget.show(); +#endif return app.exec(); } diff --git a/examples/effects/lighting/lighting.cpp b/examples/effects/lighting/lighting.cpp index a988ffbcb3..bd23a2d21a 100644 --- a/examples/effects/lighting/lighting.cpp +++ b/examples/effects/lighting/lighting.cpp @@ -134,3 +134,9 @@ void Lighting::animate() m_scene.update(); } +void Lighting::resizeEvent(QResizeEvent */*event*/) +{ +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + fitInView(sceneRect(), Qt::KeepAspectRatio); +#endif +} diff --git a/examples/effects/lighting/lighting.h b/examples/effects/lighting/lighting.h index 6a6bc56582..5099653b71 100644 --- a/examples/effects/lighting/lighting.h +++ b/examples/effects/lighting/lighting.h @@ -57,6 +57,9 @@ private slots: private: void setupScene(); +protected: + void resizeEvent(QResizeEvent *event); + private: qreal angle; QGraphicsScene m_scene; diff --git a/examples/effects/lighting/lighting.pro b/examples/effects/lighting/lighting.pro index fd2288640d..e79a40714c 100644 --- a/examples/effects/lighting/lighting.pro +++ b/examples/effects/lighting/lighting.pro @@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/lighting sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lighting.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/lighting INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/effects/lighting/main.cpp b/examples/effects/lighting/main.cpp index c75d84159f..fff3d73f2a 100644 --- a/examples/effects/lighting/main.cpp +++ b/examples/effects/lighting/main.cpp @@ -47,8 +47,13 @@ int main(int argc, char **argv) Lighting lighting; lighting.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Lighting and Shadows")); + +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + lighting.showMaximized(); +#else lighting.resize(640, 480); lighting.show(); +#endif return app.exec(); } diff --git a/examples/examples.pro b/examples/examples.pro index 0680ff45f6..9da2085675 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -62,3 +62,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES] INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro index 2e75f06355..4c334cfc3c 100644 --- a/examples/gestures/imagegestures/imagegestures.pro +++ b/examples/gestures/imagegestures/imagegestures.pro @@ -19,3 +19,7 @@ symbian { TARGET.UID3 = 0xA000D7D0 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/graphicsview/anchorlayout/anchorlayout.pro b/examples/graphicsview/anchorlayout/anchorlayout.pro index 52cb13b241..eb83890f34 100644 --- a/examples/graphicsview/anchorlayout/anchorlayout.pro +++ b/examples/graphicsview/anchorlayout/anchorlayout.pro @@ -7,3 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/anchorlayout INSTALLS += target sources TARGET = anchorlayout + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/anchorlayout/main.cpp b/examples/graphicsview/anchorlayout/main.cpp index c31afd214d..dbe9f19880 100644 --- a/examples/graphicsview/anchorlayout/main.cpp +++ b/examples/graphicsview/anchorlayout/main.cpp @@ -122,7 +122,12 @@ int main(int argc, char **argv) scene.addItem(w); scene.setBackgroundBrush(Qt::darkGreen); QGraphicsView view(&scene); + +#if defined(Q_WS_S60) + view.showMaximized(); +#else view.show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro index 8b667387a0..7d0ed4a8cc 100644 --- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro +++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro @@ -15,3 +15,5 @@ symbian { TARGET.UID3 = 0xA000A645 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/basicgraphicslayouts/main.cpp b/examples/graphicsview/basicgraphicslayouts/main.cpp index 57448a58d7..11da1838f3 100644 --- a/examples/graphicsview/basicgraphicslayouts/main.cpp +++ b/examples/graphicsview/basicgraphicslayouts/main.cpp @@ -51,8 +51,12 @@ int main(int argc, char **argv) Window *window = new Window; scene.addItem(window); QGraphicsView view(&scene); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + view.showMaximized(); +#else view.resize(600, 600); view.show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro index b49f44be4c..ea2b0d7cdf 100644 --- a/examples/graphicsview/collidingmice/collidingmice.pro +++ b/examples/graphicsview/collidingmice/collidingmice.pro @@ -17,3 +17,5 @@ symbian { TARGET.UID3 = 0xA000A643 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/collidingmice/main.cpp b/examples/graphicsview/collidingmice/main.cpp index 2970a0079f..43594029fa 100644 --- a/examples/graphicsview/collidingmice/main.cpp +++ b/examples/graphicsview/collidingmice/main.cpp @@ -79,8 +79,12 @@ int main(int argc, char **argv) view.setDragMode(QGraphicsView::ScrollHandDrag); //! [5] //! [6] view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Colliding Mice")); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + view.showMaximized(); +#else view.resize(400, 300); view.show(); +#endif QTimer timer; QObject::connect(&timer, SIGNAL(timeout()), &scene, SLOT(advance())); diff --git a/examples/graphicsview/diagramscene/diagramscene.pro b/examples/graphicsview/diagramscene/diagramscene.pro index 6af1160015..0703365d07 100644 --- a/examples/graphicsview/diagramscene/diagramscene.pro +++ b/examples/graphicsview/diagramscene/diagramscene.pro @@ -19,4 +19,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/diagramscene INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/graphicsview/dragdroprobot/dragdroprobot.pro index 5240b4208f..0fe241dbd2 100644 --- a/examples/graphicsview/dragdroprobot/dragdroprobot.pro +++ b/examples/graphicsview/dragdroprobot/dragdroprobot.pro @@ -18,3 +18,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/dragdroprobot INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/dragdroprobot/main.cpp b/examples/graphicsview/dragdroprobot/main.cpp index 315d2b6917..c8b84ecb97 100644 --- a/examples/graphicsview/dragdroprobot/main.cpp +++ b/examples/graphicsview/dragdroprobot/main.cpp @@ -45,6 +45,22 @@ #include +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) + { + } + +protected: + virtual void resizeEvent(QResizeEvent *event) + { +#if defined(Q_OS_SYMBIAN) + fitInView(sceneRect(), Qt::KeepAspectRatio); +#endif + } +}; + //! [0] int main(int argc, char **argv) { @@ -69,12 +85,16 @@ int main(int argc, char **argv) scene.addItem(robot); //! [1] //! [2] - QGraphicsView view(&scene); + GraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing); view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); view.setBackgroundBrush(QColor(230, 200, 167)); view.setWindowTitle("Drag and Drop Robot"); - view.show(); +#if defined(Q_OS_SYMBIAN) + view.showMaximized(); +#else + view.show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/elasticnodes/edge.cpp b/examples/graphicsview/elasticnodes/edge.cpp index 2b5cae5e1b..652ab737fc 100644 --- a/examples/graphicsview/elasticnodes/edge.cpp +++ b/examples/graphicsview/elasticnodes/edge.cpp @@ -144,6 +144,6 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) painter->setBrush(Qt::black); painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2); - painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); + painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); } //! [6] diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro index 208c849d13..7a58dd162b 100644 --- a/examples/graphicsview/elasticnodes/elasticnodes.pro +++ b/examples/graphicsview/elasticnodes/elasticnodes.pro @@ -21,3 +21,6 @@ symbian { TARGET.UID3 = 0xA000A642 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/elasticnodes/graphwidget.cpp b/examples/graphicsview/elasticnodes/graphwidget.cpp index c875b6551d..f6bf05de31 100644 --- a/examples/graphicsview/elasticnodes/graphwidget.cpp +++ b/examples/graphicsview/elasticnodes/graphwidget.cpp @@ -132,17 +132,14 @@ void GraphWidget::keyPressEvent(QKeyEvent *event) centerNode->moveBy(20, 0); break; case Qt::Key_Plus: - scaleView(qreal(1.2)); + zoomIn(); break; case Qt::Key_Minus: - scaleView(1 / qreal(1.2)); + zoomOut(); break; case Qt::Key_Space: case Qt::Key_Enter: - foreach (QGraphicsItem *item, scene()->items()) { - if (qgraphicsitem_cast(item)) - item->setPos(-150 + qrand() % 300, -150 + qrand() % 300); - } + shuffle(); break; default: QGraphicsView::keyPressEvent(event); @@ -206,6 +203,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect) painter->setBrush(Qt::NoBrush); painter->drawRect(sceneRect); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) // Text QRectF textRect(sceneRect.left() + 4, sceneRect.top() + 4, sceneRect.width() - 4, sceneRect.height() - 4); @@ -220,6 +218,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect) painter->drawText(textRect.translated(2, 2), message); painter->setPen(Qt::black); painter->drawText(textRect, message); +#endif } //! [6] @@ -233,3 +232,21 @@ void GraphWidget::scaleView(qreal scaleFactor) scale(scaleFactor, scaleFactor); } //! [7] + +void GraphWidget::shuffle() +{ + foreach (QGraphicsItem *item, scene()->items()) { + if (qgraphicsitem_cast(item)) + item->setPos(-150 + qrand() % 300, -150 + qrand() % 300); + } +} + +void GraphWidget::zoomIn() +{ + scaleView(qreal(1.2)); +} + +void GraphWidget::zoomOut() +{ + scaleView(1 / qreal(1.2)); +} diff --git a/examples/graphicsview/elasticnodes/graphwidget.h b/examples/graphicsview/elasticnodes/graphwidget.h index 764bb3f0b9..524ef67b8a 100644 --- a/examples/graphicsview/elasticnodes/graphwidget.h +++ b/examples/graphicsview/elasticnodes/graphwidget.h @@ -55,6 +55,11 @@ public: void itemMoved(); +public slots: + void shuffle(); + void zoomIn(); + void zoomOut(); + protected: void keyPressEvent(QKeyEvent *event); void timerEvent(QTimerEvent *event); diff --git a/examples/graphicsview/elasticnodes/main.cpp b/examples/graphicsview/elasticnodes/main.cpp index ab7e7cf7c7..d653da5355 100644 --- a/examples/graphicsview/elasticnodes/main.cpp +++ b/examples/graphicsview/elasticnodes/main.cpp @@ -47,7 +47,18 @@ int main(int argc, char **argv) QApplication app(argc, argv); qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - GraphWidget widget; - widget.show(); + GraphWidget *widget = new GraphWidget; + + QMainWindow mainWindow; + mainWindow.setCentralWidget(widget); + +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + mainWindow.menuBar()->addAction("Shuffle", widget, SLOT(shuffle())); + mainWindow.menuBar()->addAction("Zoom In", widget, SLOT(zoomIn())); + mainWindow.menuBar()->addAction("Zoom Out", widget, SLOT(zoomOut())); + mainWindow.showMaximized(); +#else + mainWindow.show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/elasticnodes/node.cpp b/examples/graphicsview/elasticnodes/node.cpp index 8d1daddc12..b345f83640 100644 --- a/examples/graphicsview/elasticnodes/node.cpp +++ b/examples/graphicsview/elasticnodes/node.cpp @@ -141,9 +141,16 @@ bool Node::advance() //! [8] QRectF Node::boundingRect() const { +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + // Add some extra space around the circle for easier touching with finger + qreal adjust = 30; + return QRectF( -10 - adjust, -10 - adjust, + 20 + adjust * 2, 20 + adjust * 2); +#else qreal adjust = 2; - return QRectF(-10 - adjust, -10 - adjust, + return QRectF( -10 - adjust, -10 - adjust, 23 + adjust, 23 + adjust); +#endif } //! [8] @@ -151,7 +158,12 @@ QRectF Node::boundingRect() const QPainterPath Node::shape() const { QPainterPath path; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + // Add some extra space around the circle for easier touching with finger + path.addEllipse( -40, -40, 80, 80); +#else path.addEllipse(-10, -10, 20, 20); +#endif return path; } //! [9] @@ -174,6 +186,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid gradient.setColorAt(1, Qt::darkYellow); } painter->setBrush(gradient); + painter->setPen(QPen(Qt::black, 0)); painter->drawEllipse(-10, -10, 20, 20); } diff --git a/examples/graphicsview/flowlayout/flowlayout.pro b/examples/graphicsview/flowlayout/flowlayout.pro index ce3536774b..8a97d2dc79 100644 --- a/examples/graphicsview/flowlayout/flowlayout.pro +++ b/examples/graphicsview/flowlayout/flowlayout.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . @@ -8,3 +7,7 @@ QMAKE_PROJECT_NAME = flowlayout_graphicsview # Input HEADERS += flowlayout.h window.h SOURCES += flowlayout.cpp main.cpp window.cpp + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/flowlayout/main.cpp b/examples/graphicsview/flowlayout/main.cpp index cee08d76ac..cc5eeb6175 100644 --- a/examples/graphicsview/flowlayout/main.cpp +++ b/examples/graphicsview/flowlayout/main.cpp @@ -49,7 +49,13 @@ int main(int argc, char **argv) QGraphicsView *view = new QGraphicsView(&scene); Window *w = new Window; scene.addItem(w); + +#if defined(Q_OS_SYMBIAN) + view->showMaximized(); +#else view->resize(400, 300); view->show(); +#endif + return app.exec(); } diff --git a/examples/graphicsview/graphicsview.pro b/examples/graphicsview/graphicsview.pro index a1458ded91..d1b0e86e7f 100644 --- a/examples/graphicsview/graphicsview.pro +++ b/examples/graphicsview/graphicsview.pro @@ -22,3 +22,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp index 8f4a681743..d7d2f56305 100644 --- a/examples/graphicsview/padnavigator/main.cpp +++ b/examples/graphicsview/padnavigator/main.cpp @@ -49,8 +49,11 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(padnavigator); PadNavigator navigator(QSize(3, 3)); +#if defined(Q_OS_SYMBIAN) + navigator.showMaximized(); +#else navigator.show(); - +#endif return app.exec(); } //! [0] diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro index 45ebfdcf2a..a51571f705 100644 --- a/examples/graphicsview/padnavigator/padnavigator.pro +++ b/examples/graphicsview/padnavigator/padnavigator.pro @@ -30,3 +30,6 @@ symbian { TARGET.UID3 = 0xA000A644 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/simpleanchorlayout/main.cpp b/examples/graphicsview/simpleanchorlayout/main.cpp index 4fa837f540..cba37d9fb7 100644 --- a/examples/graphicsview/simpleanchorlayout/main.cpp +++ b/examples/graphicsview/simpleanchorlayout/main.cpp @@ -126,8 +126,15 @@ int main(int argc, char *argv[]) QGraphicsView *view = new QGraphicsView(); view->setScene(scene); view->setWindowTitle(QApplication::translate("simpleanchorlayout", "Simple Anchor Layout")); + +#if defined(Q_OS_SYMBIAN) + view->showMaximized(); +#elif defined(Q_WS_MAEMO_5) + view-show(); +#else view->resize(360, 320); view->show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro index f85ad8f3a7..6ba525e26c 100644 --- a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro +++ b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro @@ -7,3 +7,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/simpleanchorlayout INSTALLS += target sources TARGET = simpleanchorlayout + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/weatheranchorlayout/main.cpp b/examples/graphicsview/weatheranchorlayout/main.cpp index 67596ac4bc..b1f2c724a1 100644 --- a/examples/graphicsview/weatheranchorlayout/main.cpp +++ b/examples/graphicsview/weatheranchorlayout/main.cpp @@ -51,6 +51,21 @@ #include +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene, QGraphicsWidget *widget) : QGraphicsView(scene), w(widget) + { + } + + virtual void resizeEvent(QResizeEvent *event) + { + w->setGeometry(0, 0, event->size().width(), event->size().height()); + } + + QGraphicsWidget *w; +}; + class PixmapWidget : public QGraphicsLayoutItem { @@ -175,7 +190,10 @@ int main(int argc, char **argv) QApplication app(argc, argv); QGraphicsScene scene; +#if defined(Q_OS_SYMBIAN) +#else scene.setSceneRect(0, 0, 800, 480); +#endif // pixmaps widgets PixmapWidget *title = new PixmapWidget(QPixmap(":/images/title.jpg")); @@ -250,8 +268,13 @@ int main(int argc, char **argv) // QGV setup scene.addItem(w); scene.setBackgroundBrush(Qt::white); +#if defined(Q_OS_SYMBIAN) + GraphicsView *view = new GraphicsView(&scene, w); + view->showMaximized(); +#else QGraphicsView *view = new QGraphicsView(&scene); view->show(); +#endif return app.exec(); } diff --git a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro index 57e154e27a..f07b7dfca8 100644 --- a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro +++ b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro @@ -12,3 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES weatheranchorlayout.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/weatheranchorlayout INSTALLS += target sources +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ipc/ipc.pro b/examples/ipc/ipc.pro index ed20b2627c..a9dd9c172e 100644 --- a/examples/ipc/ipc.pro +++ b/examples/ipc/ipc.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/ipc INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/ipc/localfortuneclient/client.cpp b/examples/ipc/localfortuneclient/client.cpp index c8c3fe4f35..86cc0cc005 100644 --- a/examples/ipc/localfortuneclient/client.cpp +++ b/examples/ipc/localfortuneclient/client.cpp @@ -44,7 +44,11 @@ #include "client.h" Client::Client(QWidget *parent) +#ifdef Q_WS_MAEMO_5 + : QWidget(parent) +#else : QDialog(parent) +#endif { hostLabel = new QLabel(tr("&Server name:")); hostLineEdit = new QLineEdit("fortune"); @@ -53,6 +57,7 @@ Client::Client(QWidget *parent) statusLabel = new QLabel(tr("This examples requires that you run the " "Fortune Server example as well.")); + statusLabel->setWordWrap(true); getFortuneButton = new QPushButton(tr("Get Fortune")); getFortuneButton->setDefault(true); diff --git a/examples/ipc/localfortuneclient/client.h b/examples/ipc/localfortuneclient/client.h index d23db9e6e2..b0f0e36189 100644 --- a/examples/ipc/localfortuneclient/client.h +++ b/examples/ipc/localfortuneclient/client.h @@ -41,7 +41,12 @@ #ifndef CLIENT_H #define CLIENT_H +#ifdef Q_WS_MAEMO_5 +#include +#else #include +#endif + #include QT_BEGIN_NAMESPACE @@ -52,7 +57,11 @@ class QPushButton; class QLocalSocket; QT_END_NAMESPACE +#ifdef Q_WS_MAEMO_5 +class Client : public QWidget +#else class Client : public QDialog +#endif { Q_OBJECT diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro index a66d4b2eca..ea1d595cda 100644 --- a/examples/ipc/localfortuneclient/localfortuneclient.pro +++ b/examples/ipc/localfortuneclient/localfortuneclient.pro @@ -10,5 +10,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/ipc/localfortuneclient INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example - +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ipc/localfortuneclient/main.cpp b/examples/ipc/localfortuneclient/main.cpp index 19464d1de3..8e6feeba72 100644 --- a/examples/ipc/localfortuneclient/main.cpp +++ b/examples/ipc/localfortuneclient/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Client client; +#if defined(Q_WS_S60) + client.showMaximized(); +#else client.show(); - return client.exec(); +#endif + return app.exec(); } diff --git a/examples/ipc/localfortuneserver/localfortuneserver.pro b/examples/ipc/localfortuneserver/localfortuneserver.pro index ae09d8007c..55857cf56e 100644 --- a/examples/ipc/localfortuneserver/localfortuneserver.pro +++ b/examples/ipc/localfortuneserver/localfortuneserver.pro @@ -10,5 +10,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/ipc/localfortuneserver INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example - +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ipc/localfortuneserver/main.cpp b/examples/ipc/localfortuneserver/main.cpp index 6c0e9ee9f3..fc0c698156 100644 --- a/examples/ipc/localfortuneserver/main.cpp +++ b/examples/ipc/localfortuneserver/main.cpp @@ -49,7 +49,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Server server; +#if defined(Q_WS_S60) + server.showMaximized(); +#else server.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - return server.exec(); + return app.exec(); } diff --git a/examples/ipc/localfortuneserver/server.cpp b/examples/ipc/localfortuneserver/server.cpp index 88784d440e..08dd31d81e 100644 --- a/examples/ipc/localfortuneserver/server.cpp +++ b/examples/ipc/localfortuneserver/server.cpp @@ -48,9 +48,14 @@ #include Server::Server(QWidget *parent) +#ifdef Q_WS_MAEMO_5 + : QWidget(parent) +#else : QDialog(parent) +#endif { statusLabel = new QLabel; + statusLabel->setWordWrap(true); quitButton = new QPushButton(tr("Quit")); quitButton->setAutoDefault(false); diff --git a/examples/ipc/localfortuneserver/server.h b/examples/ipc/localfortuneserver/server.h index 5f00ba4d2d..313862cfaa 100644 --- a/examples/ipc/localfortuneserver/server.h +++ b/examples/ipc/localfortuneserver/server.h @@ -41,7 +41,11 @@ #ifndef SERVER_H #define SERVER_H +#ifdef Q_WS_MAEMO_5 +#include +#else #include +#endif QT_BEGIN_NAMESPACE class QLabel; @@ -49,7 +53,11 @@ class QPushButton; class QLocalServer; QT_END_NAMESPACE +#ifdef Q_WS_MAEMO_5 +class Server : public QWidget +#else class Server : public QDialog +#endif { Q_OBJECT diff --git a/examples/ipc/sharedmemory/sharedmemory.pro b/examples/ipc/sharedmemory/sharedmemory.pro index 252fb29ca1..9202cb7b7a 100644 --- a/examples/ipc/sharedmemory/sharedmemory.pro +++ b/examples/ipc/sharedmemory/sharedmemory.pro @@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/ipc/sharedmemory INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example does not work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro index 21a9f329b9..855d4b18af 100644 --- a/examples/itemviews/addressbook/addressbook.pro +++ b/examples/itemviews/addressbook/addressbook.pro @@ -20,3 +20,5 @@ symbian { TARGET.UID3 = 0xA000A646 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/itemviews/addressbook/main.cpp b/examples/itemviews/addressbook/main.cpp index 455b275dfb..76efb01979 100644 --- a/examples/itemviews/addressbook/main.cpp +++ b/examples/itemviews/addressbook/main.cpp @@ -46,7 +46,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mw; +#if defined(Q_OS_SYMBIAN) + mw.showMaximized(); +#else mw.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro index da06113587..9bc0e93a02 100644 --- a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro +++ b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/basicsortfiltermodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/basicsortfiltermodel/main.cpp b/examples/itemviews/basicsortfiltermodel/main.cpp index 84cfd05478..750a19e55a 100644 --- a/examples/itemviews/basicsortfiltermodel/main.cpp +++ b/examples/itemviews/basicsortfiltermodel/main.cpp @@ -88,6 +88,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); Window window; window.setSourceModel(createMailModel(&window)); +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/basicsortfiltermodel/window.cpp b/examples/itemviews/basicsortfiltermodel/window.cpp index f35c1e18f6..f95c9cc48a 100644 --- a/examples/itemviews/basicsortfiltermodel/window.cpp +++ b/examples/itemviews/basicsortfiltermodel/window.cpp @@ -47,9 +47,6 @@ Window::Window() proxyModel = new QSortFilterProxyModel; proxyModel->setDynamicSortFilter(true); - sourceGroupBox = new QGroupBox(tr("Original Model")); - proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model")); - sourceView = new QTreeView; sourceView->setRootIsDecorated(false); sourceView->setAlternatingRowColors(true); @@ -92,6 +89,41 @@ Window::Window() connect(sortCaseSensitivityCheckBox, SIGNAL(toggled(bool)), this, SLOT(sortChanged())); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + sourceWidget = new QWidget; + filterWidget = new QWidget; + proxyWidget = new QWidget; + + QHBoxLayout *sourceLayout = new QHBoxLayout; + sourceLayout->addWidget(sourceView); + sourceWidget->setLayout(sourceLayout); + + QGridLayout *filterLayout = new QGridLayout; + filterLayout->addWidget(filterPatternLabel, 1, 0); + filterLayout->addWidget(filterPatternLineEdit, 1, 1, 1, 2); + filterLayout->addWidget(filterSyntaxLabel, 2, 0); + filterLayout->addWidget(filterSyntaxComboBox, 2, 1, 1, 2); + filterLayout->addWidget(filterColumnLabel, 3, 0); + filterLayout->addWidget(filterColumnComboBox, 3, 1, 1, 2); + filterLayout->addWidget(filterCaseSensitivityCheckBox, 4, 0, 1, 2); + filterLayout->addWidget(sortCaseSensitivityCheckBox, 4, 2); + filterWidget->setLayout(filterLayout); + + QHBoxLayout *proxyLayout = new QHBoxLayout; + proxyLayout->addWidget(proxyView); + proxyWidget->setLayout(proxyLayout); + + QVBoxLayout *mainLayout = new QVBoxLayout; + + QTabWidget *tabWidget = new QTabWidget; + tabWidget->addTab(sourceWidget, "Source"); + tabWidget->addTab(filterWidget, "Filters"); + tabWidget->addTab(proxyWidget, "Proxy"); + mainLayout->addWidget(tabWidget); +#else + sourceGroupBox = new QGroupBox(tr("Original Model")); + proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model")); + QHBoxLayout *sourceLayout = new QHBoxLayout; sourceLayout->addWidget(sourceView); sourceGroupBox->setLayout(sourceLayout); @@ -109,8 +141,11 @@ Window::Window() proxyGroupBox->setLayout(proxyLayout); QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(sourceGroupBox); mainLayout->addWidget(proxyGroupBox); +#endif + setLayout(mainLayout); setWindowTitle(tr("Basic Sort/Filter Model")); diff --git a/examples/itemviews/basicsortfiltermodel/window.h b/examples/itemviews/basicsortfiltermodel/window.h index 92b5008384..fbdffc3abb 100644 --- a/examples/itemviews/basicsortfiltermodel/window.h +++ b/examples/itemviews/basicsortfiltermodel/window.h @@ -71,8 +71,14 @@ private slots: private: QSortFilterProxyModel *proxyModel; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QWidget *sourceWidget; + QWidget *filterWidget; + QWidget *proxyWidget; +#else QGroupBox *sourceGroupBox; QGroupBox *proxyGroupBox; +#endif QTreeView *sourceView; QTreeView *proxyView; QCheckBox *filterCaseSensitivityCheckBox; diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro index 3da23d4038..6716f909d1 100644 --- a/examples/itemviews/chart/chart.pro +++ b/examples/itemviews/chart/chart.pro @@ -18,3 +18,5 @@ symbian { TARGET.UID3 = 0xA000A647 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/itemviews/chart/main.cpp b/examples/itemviews/chart/main.cpp index 936654097f..52d8f281c3 100644 --- a/examples/itemviews/chart/main.cpp +++ b/examples/itemviews/chart/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro index 3147375a45..2b150b43b3 100644 --- a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro +++ b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro @@ -11,3 +11,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/coloreditorfactory INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/itemviews/coloreditorfactory/main.cpp b/examples/itemviews/coloreditorfactory/main.cpp index aa46cc5c53..8b7eff429e 100644 --- a/examples/itemviews/coloreditorfactory/main.cpp +++ b/examples/itemviews/coloreditorfactory/main.cpp @@ -47,7 +47,11 @@ int main(int argv, char **args) QApplication app(argv, args); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro index 5a0d562003..d02773af9d 100644 --- a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro +++ b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro @@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/combowidgetmapper sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/combowidgetmapper INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/itemviews/combowidgetmapper/main.cpp b/examples/itemviews/combowidgetmapper/main.cpp index 41e756d8ad..9e45edefac 100644 --- a/examples/itemviews/combowidgetmapper/main.cpp +++ b/examples/itemviews/combowidgetmapper/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char **argv) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro index e04c5dfaae..40cc2237a7 100644 --- a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro +++ b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro @@ -12,3 +12,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/customsortfiltermodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/customsortfiltermodel/main.cpp b/examples/itemviews/customsortfiltermodel/main.cpp index b35b847663..4154dbf1f9 100644 --- a/examples/itemviews/customsortfiltermodel/main.cpp +++ b/examples/itemviews/customsortfiltermodel/main.cpp @@ -89,7 +89,11 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); Window window; window.setSourceModel(createMailModel(&window)); +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/itemviews/customsortfiltermodel/window.cpp b/examples/itemviews/customsortfiltermodel/window.cpp index 555e854044..51fdcb705e 100644 --- a/examples/itemviews/customsortfiltermodel/window.cpp +++ b/examples/itemviews/customsortfiltermodel/window.cpp @@ -48,22 +48,27 @@ Window::Window() { proxyModel = new MySortFilterProxyModel(this); proxyModel->setDynamicSortFilter(true); -//! [0] + //! [0] -//! [1] + //! [1] sourceView = new QTreeView; sourceView->setRootIsDecorated(false); sourceView->setAlternatingRowColors(true); -//! [1] + //! [1] QHBoxLayout *sourceLayout = new QHBoxLayout; -//! [2] + //! [2] sourceLayout->addWidget(sourceView); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + sourceWidget = new QWidget; + sourceWidget->setLayout(sourceLayout); +#else sourceGroupBox = new QGroupBox(tr("Original Model")); sourceGroupBox->setLayout(sourceLayout); -//! [2] +#endif + //! [2] -//! [3] + //! [3] filterCaseSensitivityCheckBox = new QCheckBox(tr("Case sensitive filter")); filterCaseSensitivityCheckBox->setChecked(true); @@ -97,11 +102,11 @@ Window::Window() connect(fromDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(dateFilterChanged())); connect(toDateEdit, SIGNAL(dateChanged(QDate)), -//! [3] //! [4] + //! [3] //! [4] this, SLOT(dateFilterChanged())); -//! [4] + //! [4] -//! [5] + //! [5] proxyView = new QTreeView; proxyView->setRootIsDecorated(false); proxyView->setAlternatingRowColors(true); @@ -109,6 +114,26 @@ Window::Window() proxyView->setSortingEnabled(true); proxyView->sortByColumn(1, Qt::AscendingOrder); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QGridLayout *filterLayout = new QGridLayout; + filterLayout->addWidget(filterPatternLabel, 0, 0); + filterLayout->addWidget(filterPatternLineEdit, 0, 1); + filterLayout->addWidget(filterSyntaxComboBox, 0, 2); + filterLayout->addWidget(filterCaseSensitivityCheckBox, 1, 0, 1, 3); + filterLayout->addWidget(fromLabel, 2, 0); + filterLayout->addWidget(fromDateEdit, 2, 1, 1, 2); + filterLayout->addWidget(toLabel, 3, 0); + filterLayout->addWidget(toDateEdit, 3, 1, 1, 2); + + filterWidget = new QWidget; + filterWidget->setLayout(filterLayout); + + QHBoxLayout *proxyLayout = new QHBoxLayout; + proxyLayout->addWidget(proxyView); + + proxyWidget = new QWidget; + proxyWidget->setLayout(proxyLayout); +#else QGridLayout *proxyLayout = new QGridLayout; proxyLayout->addWidget(proxyView, 0, 0, 1, 3); proxyLayout->addWidget(filterPatternLabel, 1, 0); @@ -122,9 +147,21 @@ Window::Window() proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model")); proxyGroupBox->setLayout(proxyLayout); -//! [5] +#endif + //! [5] -//! [6] + //! [6] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QTabWidget *tabWidget = new QTabWidget; + tabWidget->addTab(sourceWidget, "Original"); + tabWidget->addTab(filterWidget, "Filters"); + tabWidget->addTab(proxyWidget, "Sorted"); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(tabWidget); + setLayout(mainLayout); + setWindowTitle(tr("Custom Model")); +#else QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(sourceGroupBox); mainLayout->addWidget(proxyGroupBox); @@ -132,6 +169,7 @@ Window::Window() setWindowTitle(tr("Custom Sort/Filter Model")); resize(500, 450); +#endif } //! [6] @@ -151,7 +189,7 @@ void Window::textFilterChanged() filterSyntaxComboBox->currentIndex()).toInt()); Qt::CaseSensitivity caseSensitivity = filterCaseSensitivityCheckBox->isChecked() ? Qt::CaseSensitive - : Qt::CaseInsensitive; + : Qt::CaseInsensitive; QRegExp regExp(filterPatternLineEdit->text(), caseSensitivity, syntax); proxyModel->setFilterRegExp(regExp); diff --git a/examples/itemviews/customsortfiltermodel/window.h b/examples/itemviews/customsortfiltermodel/window.h index 15baffc2c6..50ec1f413c 100644 --- a/examples/itemviews/customsortfiltermodel/window.h +++ b/examples/itemviews/customsortfiltermodel/window.h @@ -72,8 +72,14 @@ private slots: private: MySortFilterProxyModel *proxyModel; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5 ) || defined(Q_WS_SIMULATOR) + QWidget *sourceWidget; + QWidget *filterWidget; + QWidget *proxyWidget; +#else QGroupBox *sourceGroupBox; QGroupBox *proxyGroupBox; +#endif QTreeView *sourceView; QTreeView *proxyView; QCheckBox *filterCaseSensitivityCheckBox; diff --git a/examples/itemviews/dirview/dirview.pro b/examples/itemviews/dirview/dirview.pro index 28be5d782d..21a84b3ec4 100644 --- a/examples/itemviews/dirview/dirview.pro +++ b/examples/itemviews/dirview/dirview.pro @@ -7,3 +7,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/dirview INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/dirview/main.cpp b/examples/itemviews/dirview/main.cpp index ffa287b321..3500d7bef8 100644 --- a/examples/itemviews/dirview/main.cpp +++ b/examples/itemviews/dirview/main.cpp @@ -55,8 +55,12 @@ int main(int argc, char *argv[]) tree.setSortingEnabled(true); tree.setWindowTitle(QObject::tr("Dir View")); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + tree.showMaximized(); +#else tree.resize(640, 480); tree.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/editabletreemodel/editabletreemodel.pro b/examples/itemviews/editabletreemodel/editabletreemodel.pro index 6ed901c4a4..7f4223feca 100644 --- a/examples/itemviews/editabletreemodel/editabletreemodel.pro +++ b/examples/itemviews/editabletreemodel/editabletreemodel.pro @@ -16,3 +16,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/editabletreemodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/editabletreemodel/main.cpp b/examples/itemviews/editabletreemodel/main.cpp index b6e6b0277d..d8b3b9bcf8 100644 --- a/examples/itemviews/editabletreemodel/main.cpp +++ b/examples/itemviews/editabletreemodel/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/editabletreemodel/mainwindow.cpp b/examples/itemviews/editabletreemodel/mainwindow.cpp index 6f08ced0e9..486a9ad1c6 100644 --- a/examples/itemviews/editabletreemodel/mainwindow.cpp +++ b/examples/itemviews/editabletreemodel/mainwindow.cpp @@ -48,6 +48,11 @@ MainWindow::MainWindow(QWidget *parent) { setupUi(this); +#ifdef Q_WS_MAEMO_5 + // Alternating row colors look bad on Maemo + view->setAlternatingRowColors(false); +#endif + QStringList headers; headers << tr("Title") << tr("Description"); diff --git a/examples/itemviews/fetchmore/fetchmore.pro b/examples/itemviews/fetchmore/fetchmore.pro index 2951d93faf..b7267e48b2 100644 --- a/examples/itemviews/fetchmore/fetchmore.pro +++ b/examples/itemviews/fetchmore/fetchmore.pro @@ -10,3 +10,5 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/fetchmore INSTALLS += target sources +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/itemviews/fetchmore/main.cpp b/examples/itemviews/fetchmore/main.cpp index aedfd9f8d3..c2deca3ff1 100644 --- a/examples/itemviews/fetchmore/main.cpp +++ b/examples/itemviews/fetchmore/main.cpp @@ -45,6 +45,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/frozencolumn/frozencolumn.pro b/examples/itemviews/frozencolumn/frozencolumn.pro index a055fd93c0..faef47efe1 100644 --- a/examples/itemviews/frozencolumn/frozencolumn.pro +++ b/examples/itemviews/frozencolumn/frozencolumn.pro @@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/frozencolumn sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/frozencolumn INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/itemviews/frozencolumn/main.cpp b/examples/itemviews/frozencolumn/main.cpp index f6aa489d05..79f8ad4abe 100644 --- a/examples/itemviews/frozencolumn/main.cpp +++ b/examples/itemviews/frozencolumn/main.cpp @@ -81,8 +81,14 @@ int main( int argc, char** argv ) FreezeTableWidget *tableView = new FreezeTableWidget(model); tableView->setWindowTitle(QObject::tr("Frozen Column Example")); +#if defined(Q_OS_SYMBIAN) + tableView->showMaximized(); +#elif defined(Q_WS_MAEMO_5) + tableView->show(); +#else tableView->resize(560,680); tableView->show(); +#endif return app.exec(); } diff --git a/examples/itemviews/itemviews.pro b/examples/itemviews/itemviews.pro index 68fbc91c8c..4655b30b6b 100644 --- a/examples/itemviews/itemviews.pro +++ b/examples/itemviews/itemviews.pro @@ -2,7 +2,6 @@ TEMPLATE = subdirs SUBDIRS = addressbook \ basicsortfiltermodel \ chart \ - coloreditorfactory \ combowidgetmapper \ customsortfiltermodel \ dirview \ @@ -14,12 +13,7 @@ SUBDIRS = addressbook \ simpledommodel \ simpletreemodel \ simplewidgetmapper \ - spinboxdelegate \ - stardelegate - -symbian: SUBDIRS = \ - addressbook \ - chart + spinboxdelegate # install sources.files = README *.pro @@ -27,3 +21,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/pixelator/main.cpp b/examples/itemviews/pixelator/main.cpp index e7f45e3f42..0324b3a3b2 100644 --- a/examples/itemviews/pixelator/main.cpp +++ b/examples/itemviews/pixelator/main.cpp @@ -48,7 +48,11 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif window.openImage(":/images/qt.png"); return app.exec(); } diff --git a/examples/itemviews/pixelator/pixelator.pro b/examples/itemviews/pixelator/pixelator.pro index 2f71d34158..2464a3e506 100644 --- a/examples/itemviews/pixelator/pixelator.pro +++ b/examples/itemviews/pixelator/pixelator.pro @@ -14,3 +14,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/pixelator INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/pixelator/pixeldelegate.cpp b/examples/itemviews/pixelator/pixeldelegate.cpp index 9ec88e614c..2c026e1a98 100644 --- a/examples/itemviews/pixelator/pixeldelegate.cpp +++ b/examples/itemviews/pixelator/pixeldelegate.cpp @@ -80,7 +80,7 @@ void PixelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->setBrush(option.palette.highlightedText()); else //! [2] - painter->setBrush(QBrush(Qt::black)); + painter->setBrush(option.palette.text()); //! [9] //! [10] diff --git a/examples/itemviews/puzzle/main.cpp b/examples/itemviews/puzzle/main.cpp index 60341948ab..bdba2874f3 100644 --- a/examples/itemviews/puzzle/main.cpp +++ b/examples/itemviews/puzzle/main.cpp @@ -49,6 +49,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; window.openImage(":/images/example.jpg"); +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/puzzle/mainwindow.cpp b/examples/itemviews/puzzle/mainwindow.cpp index 4d6da116bf..6fd5d63987 100644 --- a/examples/itemviews/puzzle/mainwindow.cpp +++ b/examples/itemviews/puzzle/mainwindow.cpp @@ -50,7 +50,7 @@ MainWindow::MainWindow(QWidget *parent) { setupMenus(); setupWidgets(); - model = new PiecesModel(this); + model = new PiecesModel(puzzleWidget->pieceSize(), this); piecesList->setModel(model); setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); @@ -92,8 +92,8 @@ void MainWindow::setupPuzzle() { int size = qMin(puzzleImage.width(), puzzleImage.height()); puzzleImage = puzzleImage.copy((puzzleImage.width() - size)/2, - (puzzleImage.height() - size)/2, size, size).scaled(400, - 400, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + (puzzleImage.height() - size)/2, size, size).scaled(puzzleWidget->imageSize(), + puzzleWidget->imageSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); qsrand(QCursor::pos().x() ^ QCursor::pos().y()); @@ -125,21 +125,25 @@ void MainWindow::setupWidgets() QFrame *frame = new QFrame; QHBoxLayout *frameLayout = new QHBoxLayout(frame); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + puzzleWidget = new PuzzleWidget(260); +#else + puzzleWidget = new PuzzleWidget(400); +#endif + piecesList = new QListView; piecesList->setDragEnabled(true); piecesList->setViewMode(QListView::IconMode); - piecesList->setIconSize(QSize(60, 60)); - piecesList->setGridSize(QSize(80, 80)); + piecesList->setIconSize(QSize(puzzleWidget->pieceSize() - 20, puzzleWidget->pieceSize() - 20)); + piecesList->setGridSize(QSize(puzzleWidget->pieceSize(), puzzleWidget->pieceSize())); piecesList->setSpacing(10); piecesList->setMovement(QListView::Snap); piecesList->setAcceptDrops(true); piecesList->setDropIndicatorShown(true); - PiecesModel *model = new PiecesModel(this); + PiecesModel *model = new PiecesModel(puzzleWidget->pieceSize(), this); piecesList->setModel(model); - puzzleWidget = new PuzzleWidget; - connect(puzzleWidget, SIGNAL(puzzleCompleted()), this, SLOT(setCompleted()), Qt::QueuedConnection); diff --git a/examples/itemviews/puzzle/piecesmodel.cpp b/examples/itemviews/puzzle/piecesmodel.cpp index 4235050d9d..520b571f0a 100644 --- a/examples/itemviews/puzzle/piecesmodel.cpp +++ b/examples/itemviews/puzzle/piecesmodel.cpp @@ -42,8 +42,8 @@ #include "piecesmodel.h" -PiecesModel::PiecesModel(QObject *parent) - : QAbstractListModel(parent) +PiecesModel::PiecesModel(int pieceSize, QObject *parent) + : QAbstractListModel(parent), m_PieceSize(pieceSize) { } @@ -53,7 +53,7 @@ QVariant PiecesModel::data(const QModelIndex &index, int role) const return QVariant(); if (role == Qt::DecorationRole) - return QIcon(pixmaps.value(index.row()).scaled(60, 60, + return QIcon(pixmaps.value(index.row()).scaled(m_PieceSize, m_PieceSize, Qt::KeepAspectRatio, Qt::SmoothTransformation)); else if (role == Qt::UserRole) return pixmaps.value(index.row()); @@ -196,7 +196,7 @@ void PiecesModel::addPieces(const QPixmap& pixmap) endRemoveRows(); for (int y = 0; y < 5; ++y) { for (int x = 0; x < 5; ++x) { - QPixmap pieceImage = pixmap.copy(x*80, y*80, 80, 80); + QPixmap pieceImage = pixmap.copy(x*m_PieceSize, y*m_PieceSize, m_PieceSize, m_PieceSize); addPiece(pieceImage, QPoint(x, y)); } } diff --git a/examples/itemviews/puzzle/piecesmodel.h b/examples/itemviews/puzzle/piecesmodel.h index 30bbdf83b2..40079fe1c1 100644 --- a/examples/itemviews/puzzle/piecesmodel.h +++ b/examples/itemviews/puzzle/piecesmodel.h @@ -56,7 +56,7 @@ class PiecesModel : public QAbstractListModel Q_OBJECT public: - PiecesModel(QObject *parent = 0); + PiecesModel(int pieceSize, QObject *parent = 0); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; Qt::ItemFlags flags(const QModelIndex &index) const; @@ -75,6 +75,8 @@ public: private: QList locations; QList pixmaps; + + int m_PieceSize; }; #endif diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro index 16cbc5e72c..08e7efb65f 100644 --- a/examples/itemviews/puzzle/puzzle.pro +++ b/examples/itemviews/puzzle/puzzle.pro @@ -19,3 +19,5 @@ wince* { DEPLOYMENT_PLUGIN += qjpeg qgif qtiff } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/itemviews/puzzle/puzzlewidget.cpp b/examples/itemviews/puzzle/puzzlewidget.cpp index a0d769d20a..261e0080a2 100644 --- a/examples/itemviews/puzzle/puzzlewidget.cpp +++ b/examples/itemviews/puzzle/puzzlewidget.cpp @@ -42,12 +42,12 @@ #include "puzzlewidget.h" -PuzzleWidget::PuzzleWidget(QWidget *parent) - : QWidget(parent) +PuzzleWidget::PuzzleWidget(int imageSize, QWidget *parent) + : QWidget(parent), m_ImageSize(imageSize) { setAcceptDrops(true); - setMinimumSize(400, 400); - setMaximumSize(400, 400); + setMinimumSize(m_ImageSize, m_ImageSize); + setMaximumSize(m_ImageSize, m_ImageSize); } void PuzzleWidget::clear() @@ -116,7 +116,7 @@ void PuzzleWidget::dropEvent(QDropEvent *event) event->setDropAction(Qt::MoveAction); event->accept(); - if (location == QPoint(square.x()/80, square.y()/80)) { + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) { inPlace++; if (inPlace == 25) emit puzzleCompleted(); @@ -151,7 +151,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event) piecePixmaps.removeAt(found); pieceRects.removeAt(found); - if (location == QPoint(square.x()/80, square.y()/80)) + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) inPlace--; update(square); @@ -175,7 +175,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event) pieceRects.insert(found, square); update(targetSquare(event->pos())); - if (location == QPoint(square.x()/80, square.y()/80)) + if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) inPlace++; } } @@ -200,5 +200,15 @@ void PuzzleWidget::paintEvent(QPaintEvent *event) const QRect PuzzleWidget::targetSquare(const QPoint &position) const { - return QRect(position.x()/80 * 80, position.y()/80 * 80, 80, 80); + return QRect(position.x()/pieceSize() * pieceSize(), position.y()/pieceSize() * pieceSize(), pieceSize(), pieceSize()); +} + +int PuzzleWidget::pieceSize() const +{ + return m_ImageSize / 5; +} + +int PuzzleWidget::imageSize() const +{ + return m_ImageSize; } diff --git a/examples/itemviews/puzzle/puzzlewidget.h b/examples/itemviews/puzzle/puzzlewidget.h index e0356b48fd..2cc789c292 100644 --- a/examples/itemviews/puzzle/puzzlewidget.h +++ b/examples/itemviews/puzzle/puzzlewidget.h @@ -57,9 +57,12 @@ class PuzzleWidget : public QWidget Q_OBJECT public: - PuzzleWidget(QWidget *parent = 0); + PuzzleWidget(int imageSize, QWidget *parent = 0); void clear(); + int pieceSize() const; + int imageSize() const; + signals: void puzzleCompleted(); @@ -80,6 +83,7 @@ private: QList pieceLocations; QRect highlightedRect; int inPlace; + int m_ImageSize; }; #endif diff --git a/examples/itemviews/simpledommodel/main.cpp b/examples/itemviews/simpledommodel/main.cpp index 74a14b0f8c..94496f88bb 100644 --- a/examples/itemviews/simpledommodel/main.cpp +++ b/examples/itemviews/simpledommodel/main.cpp @@ -46,7 +46,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#elif defined(Q_WS_MAEMO_5) + window.show(); +#else window.resize(640, 480); window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/simpledommodel/simpledommodel.pro b/examples/itemviews/simpledommodel/simpledommodel.pro index a0b8f06794..85ef37b1ca 100644 --- a/examples/itemviews/simpledommodel/simpledommodel.pro +++ b/examples/itemviews/simpledommodel/simpledommodel.pro @@ -15,3 +15,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/simpledommodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/simpletreemodel/main.cpp b/examples/itemviews/simpletreemodel/main.cpp index b14b52498b..6401695d00 100644 --- a/examples/itemviews/simpletreemodel/main.cpp +++ b/examples/itemviews/simpletreemodel/main.cpp @@ -56,6 +56,10 @@ int main(int argc, char *argv[]) QTreeView view; view.setModel(&model); view.setWindowTitle(QObject::tr("Simple Tree Model")); +#if defined(Q_OS_SYMBIAN) + view.showMaximized(); +#else view.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/simpletreemodel/simpletreemodel.pro b/examples/itemviews/simpletreemodel/simpletreemodel.pro index 3ff238ba03..6533b46749 100644 --- a/examples/itemviews/simpletreemodel/simpletreemodel.pro +++ b/examples/itemviews/simpletreemodel/simpletreemodel.pro @@ -13,3 +13,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/simpletreemodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/simplewidgetmapper/main.cpp b/examples/itemviews/simplewidgetmapper/main.cpp index 41e756d8ad..9e45edefac 100644 --- a/examples/itemviews/simplewidgetmapper/main.cpp +++ b/examples/itemviews/simplewidgetmapper/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char **argv) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro index 0be57ba7e3..5208115530 100644 --- a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro +++ b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/simplewidgetmapper INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/spinboxdelegate/main.cpp b/examples/itemviews/spinboxdelegate/main.cpp index e078d7f2df..50d2ef1323 100644 --- a/examples/itemviews/spinboxdelegate/main.cpp +++ b/examples/itemviews/spinboxdelegate/main.cpp @@ -80,7 +80,11 @@ int main(int argc, char *argv[]) //! [3] tableView.setWindowTitle(QObject::tr("Spin Box Delegate")); +#if defined(Q_OS_SYMBIAN) + tableView.showMaximized(); +#else tableView.show(); +#endif return app.exec(); } //! [3] diff --git a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro index 561ee29538..bbee66aa50 100644 --- a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro +++ b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/spinboxdelegate INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/itemviews/stardelegate/main.cpp b/examples/itemviews/stardelegate/main.cpp index 1af54d0d84..4f5c86164e 100644 --- a/examples/itemviews/stardelegate/main.cpp +++ b/examples/itemviews/stardelegate/main.cpp @@ -100,7 +100,11 @@ int main(int argc, char *argv[]) tableWidget.resizeColumnsToContents(); tableWidget.resize(500, 300); +#if defined(Q_OS_SYMBIAN) + tableWidget.showMaximized(); +#else tableWidget.show(); +#endif return app.exec(); } diff --git a/examples/itemviews/stardelegate/stardelegate.pro b/examples/itemviews/stardelegate/stardelegate.pro index 9e710f0bad..63d9bcba4b 100644 --- a/examples/itemviews/stardelegate/stardelegate.pro +++ b/examples/itemviews/stardelegate/stardelegate.pro @@ -13,4 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/stardelegate INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ja_JP/linguist/hellotr/hellotr.pro b/examples/ja_JP/linguist/hellotr/hellotr.pro index 40d37e2472..b42e8752d4 100644 --- a/examples/ja_JP/linguist/hellotr/hellotr.pro +++ b/examples/ja_JP/linguist/hellotr/hellotr.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/linguist/hellotr INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/layouts/basiclayouts/basiclayouts.pro b/examples/layouts/basiclayouts/basiclayouts.pro index cd0552f9ff..2b15787446 100644 --- a/examples/layouts/basiclayouts/basiclayouts.pro +++ b/examples/layouts/basiclayouts/basiclayouts.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/layouts/basiclayouts INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/layouts/basiclayouts/main.cpp b/examples/layouts/basiclayouts/main.cpp index 8aa11f488d..6b6077546f 100644 --- a/examples/layouts/basiclayouts/main.cpp +++ b/examples/layouts/basiclayouts/main.cpp @@ -46,5 +46,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; - return dialog.exec(); +#if defined(Q_OS_SYMBIAN) + dialog.showMaximized(); +#else + dialog.show(); +#endif + + return app.exec(); } diff --git a/examples/layouts/borderlayout/borderlayout.pro b/examples/layouts/borderlayout/borderlayout.pro index 6ddbb94f92..19075ab412 100644 --- a/examples/layouts/borderlayout/borderlayout.pro +++ b/examples/layouts/borderlayout/borderlayout.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/layouts/borderlayout INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/layouts/borderlayout/main.cpp b/examples/layouts/borderlayout/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/layouts/borderlayout/main.cpp +++ b/examples/layouts/borderlayout/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/layouts/dynamiclayouts/dialog.cpp b/examples/layouts/dynamiclayouts/dialog.cpp index 58711bee7f..690e52b8fa 100644 --- a/examples/layouts/dynamiclayouts/dialog.cpp +++ b/examples/layouts/dynamiclayouts/dialog.cpp @@ -43,7 +43,11 @@ #include "dialog.h" Dialog::Dialog(QWidget *parent) +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + : QWidget(parent) +#else : QDialog(parent) +#endif { createRotableGroupBox(); createOptionsGroupBox(); diff --git a/examples/layouts/dynamiclayouts/dialog.h b/examples/layouts/dynamiclayouts/dialog.h index 9409be1b57..3ada992858 100644 --- a/examples/layouts/dynamiclayouts/dialog.h +++ b/examples/layouts/dynamiclayouts/dialog.h @@ -41,6 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H +#include #include #include @@ -53,7 +54,11 @@ class QLabel; class QPushButton; QT_END_NAMESPACE +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) +class Dialog : public QWidget +#else class Dialog : public QDialog +#endif { Q_OBJECT diff --git a/examples/layouts/dynamiclayouts/dynamiclayouts.pro b/examples/layouts/dynamiclayouts/dynamiclayouts.pro index e0fbecceca..44f2b5fdcd 100644 --- a/examples/layouts/dynamiclayouts/dynamiclayouts.pro +++ b/examples/layouts/dynamiclayouts/dynamiclayouts.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/layouts/dynamiclayouts INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/layouts/dynamiclayouts/main.cpp b/examples/layouts/dynamiclayouts/main.cpp index 8aa11f488d..c30db12bb5 100644 --- a/examples/layouts/dynamiclayouts/main.cpp +++ b/examples/layouts/dynamiclayouts/main.cpp @@ -46,5 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; - return dialog.exec(); +#if defined(Q_OS_SYMBIAN) + dialog.showMaximized(); +#else + dialog.show(); +#endif + return app.exec(); } diff --git a/examples/layouts/flowlayout/flowlayout.pro b/examples/layouts/flowlayout/flowlayout.pro index 6d1a160cf6..6064b5a57c 100644 --- a/examples/layouts/flowlayout/flowlayout.pro +++ b/examples/layouts/flowlayout/flowlayout.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/layouts/flowlayout INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/layouts/flowlayout/main.cpp b/examples/layouts/flowlayout/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/layouts/flowlayout/main.cpp +++ b/examples/layouts/flowlayout/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/layouts/flowlayout/window.cpp b/examples/layouts/flowlayout/window.cpp index 51f09a8b83..0c7eb73101 100644 --- a/examples/layouts/flowlayout/window.cpp +++ b/examples/layouts/flowlayout/window.cpp @@ -56,4 +56,4 @@ Window::Window() setWindowTitle(tr("Flow Layout")); } -//! [1] \ No newline at end of file +//! [1] diff --git a/examples/layouts/layouts.pro b/examples/layouts/layouts.pro index 65bf7f235a..678691ad86 100644 --- a/examples/layouts/layouts.pro +++ b/examples/layouts/layouts.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/layouts INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro index e1ff6f648d..f9b7488feb 100644 --- a/examples/linguist/arrowpad/arrowpad.pro +++ b/examples/linguist/arrowpad/arrowpad.pro @@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/linguist/arrowpad INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro index 9c03bdc3e0..69c28ece8c 100644 --- a/examples/linguist/hellotr/hellotr.pro +++ b/examples/linguist/hellotr/hellotr.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/linguist/hellotr INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro index 7de32ef2ec..64b214c70c 100644 --- a/examples/linguist/linguist.pro +++ b/examples/linguist/linguist.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/linguist INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro index fe3dc20e59..e874f5a1fd 100644 --- a/examples/linguist/trollprint/trollprint.pro +++ b/examples/linguist/trollprint/trollprint.pro @@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/linguist/trollprint INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/application/application.pro b/examples/mainwindows/application/application.pro index 10b2b84219..6b8f80afbb 100644 --- a/examples/mainwindows/application/application.pro +++ b/examples/mainwindows/application/application.pro @@ -12,3 +12,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows/application INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/application/main.cpp b/examples/mainwindows/application/main.cpp index 9a9dc9ca76..14c7af2bb3 100644 --- a/examples/mainwindows/application/main.cpp +++ b/examples/mainwindows/application/main.cpp @@ -51,7 +51,11 @@ int main(int argc, char *argv[]) app.setOrganizationName("Trolltech"); app.setApplicationName("Application Example"); MainWindow mainWin; +#if defined(Q_OS_SYMBIAN) + mainWin.showMaximized(); +#else mainWin.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/mainwindows/dockwidgets/dockwidgets.pro b/examples/mainwindows/dockwidgets/dockwidgets.pro index daba00c99c..a45b1e1dcd 100644 --- a/examples/mainwindows/dockwidgets/dockwidgets.pro +++ b/examples/mainwindows/dockwidgets/dockwidgets.pro @@ -10,3 +10,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows/dockwidgets INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/mainwindows.pro b/examples/mainwindows/mainwindows.pro index 6471c1406a..7301c96a79 100644 --- a/examples/mainwindows/mainwindows.pro +++ b/examples/mainwindows/mainwindows.pro @@ -1,15 +1,10 @@ TEMPLATE = subdirs SUBDIRS = application \ - dockwidgets \ mdi \ menus \ recentfiles \ sdi -symbian: SUBDIRS = \ - menus - - # install target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README @@ -17,3 +12,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/mainwindows/mdi/main.cpp b/examples/mainwindows/mdi/main.cpp index 1a10a19619..4e21e75159 100644 --- a/examples/mainwindows/mdi/main.cpp +++ b/examples/mainwindows/mdi/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow mainWin; +#if defined(Q_OS_SYMBIAN) + mainWin.showMaximized(); +#else mainWin.show(); +#endif return app.exec(); } diff --git a/examples/mainwindows/mdi/mdi.pro b/examples/mainwindows/mdi/mdi.pro index 74c418b52f..d545e880bc 100644 --- a/examples/mainwindows/mdi/mdi.pro +++ b/examples/mainwindows/mdi/mdi.pro @@ -12,3 +12,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows/mdi INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/menus/main.cpp b/examples/mainwindows/menus/main.cpp index 01c8adae53..dffe80348a 100644 --- a/examples/mainwindows/menus/main.cpp +++ b/examples/mainwindows/menus/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/mainwindows/menus/mainwindow.cpp b/examples/mainwindows/menus/mainwindow.cpp index cae81f6b71..99f1ddcfbf 100644 --- a/examples/mainwindows/menus/mainwindow.cpp +++ b/examples/mainwindows/menus/mainwindow.cpp @@ -53,8 +53,12 @@ MainWindow::MainWindow() QWidget *topFiller = new QWidget; topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +#ifdef Q_OS_SYMBIAN + infoLabel = new QLabel(tr("Choose a menu option")); +#else infoLabel = new QLabel(tr("Choose a menu option, or right-click to " "invoke a context menu")); +#endif infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); infoLabel->setAlignment(Qt::AlignCenter); @@ -73,8 +77,10 @@ MainWindow::MainWindow() createActions(); createMenus(); +#ifndef Q_OS_SYMBIAN QString message = tr("A context menu is available by right-clicking"); statusBar()->showMessage(message); +#endif setWindowTitle(tr("Menus")); setMinimumSize(160, 160); diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro index c437f160bb..4131d92f92 100644 --- a/examples/mainwindows/menus/menus.pro +++ b/examples/mainwindows/menus/menus.pro @@ -12,3 +12,6 @@ symbian { TARGET.UID3 = 0xA000CF66 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/recentfiles/main.cpp b/examples/mainwindows/recentfiles/main.cpp index 3bbf0137c1..37891b3983 100644 --- a/examples/mainwindows/recentfiles/main.cpp +++ b/examples/mainwindows/recentfiles/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) app.setOrganizationName("Trolltech"); app.setApplicationName("Recent Files Example"); MainWindow *mainWin = new MainWindow; +#if defined(Q_OS_SYMBIAN) + mainWin->showMaximized(); +#else mainWin->show(); +#endif return app.exec(); } diff --git a/examples/mainwindows/recentfiles/recentfiles.pro b/examples/mainwindows/recentfiles/recentfiles.pro index a8e83ffa20..c3057fd9c0 100644 --- a/examples/mainwindows/recentfiles/recentfiles.pro +++ b/examples/mainwindows/recentfiles/recentfiles.pro @@ -9,3 +9,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows/recentfiles INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/mainwindows/sdi/main.cpp b/examples/mainwindows/sdi/main.cpp index 0fb8a0388d..ae3586cffc 100644 --- a/examples/mainwindows/sdi/main.cpp +++ b/examples/mainwindows/sdi/main.cpp @@ -49,6 +49,10 @@ int main(int argc, char *argv[]) app.setApplicationName("SDI Example"); app.setOrganizationName("Trolltech"); MainWindow *mainWin = new MainWindow; +#if defined(Q_OS_SYMBIAN) + mainWin->showMaximized(); +#else mainWin->show(); +#endif return app.exec(); } diff --git a/examples/mainwindows/sdi/sdi.pro b/examples/mainwindows/sdi/sdi.pro index 70bbf6543c..5a75e2a6cd 100644 --- a/examples/mainwindows/sdi/sdi.pro +++ b/examples/mainwindows/sdi/sdi.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/mainwindows/sdi INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 942b19ce01..43ae8e9027 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -63,7 +63,7 @@ BearerMonitor::BearerMonitor(QWidget *parent) delete tabWidget->currentWidget(); sessionGroup->hide(); #endif -#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) +#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) || defined(Q_WS_SIMULATOR) setWindowState(Qt::WindowMaximized); #endif updateConfigurations(); @@ -87,7 +87,7 @@ BearerMonitor::BearerMonitor(QWidget *parent) this, SLOT(configurationChanged(const QNetworkConfiguration))); connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations())); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork())); connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork())); #else @@ -226,7 +226,7 @@ void BearerMonitor::updateConfigurations() if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork) updateSnapConfiguration(defaultItem, defaultConfiguration); - } else if (defaultConfiguration.isValid()) { + } else { configurationAdded(defaultConfiguration); } @@ -260,7 +260,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline) onlineState->setText(tr("Offline")); } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) void BearerMonitor::registerNetwork() { QTreeWidgetItem *item = treeWidget->currentItem(); diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h index a06522fafa..f4dbf81dee 100644 --- a/examples/network/bearermonitor/bearermonitor.h +++ b/examples/network/bearermonitor/bearermonitor.h @@ -43,7 +43,7 @@ #include #include -#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) +#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_SIMULATOR) #include "ui_bearermonitor_240_320.h" #elif defined(MAEMO_UI) #include "ui_bearermonitor_maemo.h" @@ -72,7 +72,7 @@ private slots: void onlineStateChanged(bool isOnline); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_WS_SIMULATOR) void registerNetwork(); void unregisterNetwork(); #endif diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro index bd9bd68e5c..a91f064f3e 100644 --- a/examples/network/bearermonitor/bearermonitor.pro +++ b/examples/network/bearermonitor/bearermonitor.pro @@ -23,4 +23,11 @@ wince*:LIBS += -lws2 CONFIG += console -symbian:TARGET.CAPABILITY = NetworkServices ReadUserData +symbian: { + TARGET.CAPABILITY = NetworkServices ReadUserData + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/blockingfortuneclient/blockingclient.cpp b/examples/network/blockingfortuneclient/blockingclient.cpp index f5def3d927..bd2fb829a9 100644 --- a/examples/network/blockingfortuneclient/blockingclient.cpp +++ b/examples/network/blockingfortuneclient/blockingclient.cpp @@ -44,7 +44,7 @@ #include "blockingclient.h" BlockingClient::BlockingClient(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { hostLabel = new QLabel(tr("&Server name:")); portLabel = new QLabel(tr("S&erver port:")); @@ -68,12 +68,35 @@ BlockingClient::BlockingClient(QWidget *parent) portLineEdit = new QLineEdit; portLineEdit->setValidator(new QIntValidator(1, 65535, this)); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + Qt::InputMethodHint hints = Qt::ImhDigitsOnly; + portLineEdit->setInputMethodHints(hints); +#endif + hostLabel->setBuddy(hostLineEdit); portLabel->setBuddy(portLineEdit); statusLabel = new QLabel(tr("This examples requires that you run the " "Fortune Server example as well.")); + statusLabel->setWordWrap(true); + +#ifdef Q_OS_SYMBIAN + QMenu *menu = new QMenu(this); + fortuneAction = menu->addAction(tr("Get Fortune")); + fortuneAction->setVisible(false); + + QAction *optionsAction = new QAction(tr("Options"), this); + optionsAction->setMenu(menu); + optionsAction->setSoftKeyRole(QAction::PositiveSoftKey); + addAction(optionsAction); + + exitAction = new QAction(tr("Exit"), this); + exitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(exitAction); + connect(fortuneAction, SIGNAL(triggered()), this, SLOT(requestNewFortune())); + connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); +#else getFortuneButton = new QPushButton(tr("Get Fortune")); getFortuneButton->setDefault(true); getFortuneButton->setEnabled(false); @@ -84,13 +107,14 @@ BlockingClient::BlockingClient(QWidget *parent) buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole); buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole); + connect(getFortuneButton, SIGNAL(clicked()), this, SLOT(requestNewFortune())); + connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); +#endif + connect(hostLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableGetFortuneButton())); connect(portLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableGetFortuneButton())); - connect(getFortuneButton, SIGNAL(clicked()), - this, SLOT(requestNewFortune())); - connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); //! [0] connect(&thread, SIGNAL(newFortune(QString)), this, SLOT(showFortune(QString))); @@ -105,7 +129,9 @@ BlockingClient::BlockingClient(QWidget *parent) mainLayout->addWidget(portLabel, 1, 0); mainLayout->addWidget(portLineEdit, 1, 1); mainLayout->addWidget(statusLabel, 2, 0, 1, 2); +#ifndef Q_OS_SYMBIAN mainLayout->addWidget(buttonBox, 3, 0, 1, 2); +#endif setLayout(mainLayout); setWindowTitle(tr("Blocking Fortune Client")); @@ -115,7 +141,11 @@ BlockingClient::BlockingClient(QWidget *parent) //! [2] void BlockingClient::requestNewFortune() { +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(false); +#else getFortuneButton->setEnabled(false); +#endif thread.requestNewFortune(hostLineEdit->text(), portLineEdit->text().toInt()); } @@ -133,7 +163,11 @@ void BlockingClient::showFortune(const QString &nextFortune) //! [4] currentFortune = nextFortune; statusLabel->setText(currentFortune); +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(true); +#else getFortuneButton->setEnabled(true); +#endif } //! [4] @@ -158,11 +192,19 @@ void BlockingClient::displayError(int socketError, const QString &message) .arg(message)); } +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(true); +#else getFortuneButton->setEnabled(true); +#endif } void BlockingClient::enableGetFortuneButton() { - getFortuneButton->setEnabled(!hostLineEdit->text().isEmpty() - && !portLineEdit->text().isEmpty()); + bool enable(!hostLineEdit->text().isEmpty() && !portLineEdit->text().isEmpty()); +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(enable); +#else + getFortuneButton->setEnabled(enable); +#endif } diff --git a/examples/network/blockingfortuneclient/blockingclient.h b/examples/network/blockingfortuneclient/blockingclient.h index 8b76fa6596..83ff93b228 100644 --- a/examples/network/blockingfortuneclient/blockingclient.h +++ b/examples/network/blockingfortuneclient/blockingclient.h @@ -41,7 +41,7 @@ #ifndef BLOCKINGCLIENT_H #define BLOCKINGCLIENT_H -#include +#include #include "fortunethread.h" @@ -50,10 +50,11 @@ class QDialogButtonBox; class QLabel; class QLineEdit; class QPushButton; +class QAction; QT_END_NAMESPACE //! [0] -class BlockingClient : public QDialog +class BlockingClient : public QWidget { Q_OBJECT @@ -72,9 +73,14 @@ private: QLineEdit *hostLineEdit; QLineEdit *portLineEdit; QLabel *statusLabel; +#ifdef Q_OS_SYMBIAN + QAction *fortuneAction; + QAction *exitAction; +#else QPushButton *getFortuneButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; +#endif FortuneThread thread; QString currentFortune; diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro index 2faedaa810..ea64f00b92 100644 --- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro +++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro @@ -11,4 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pr sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/blockingfortuneclient INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/blockingfortuneclient/main.cpp b/examples/network/blockingfortuneclient/main.cpp index d1ff1659af..97ce59fdb3 100644 --- a/examples/network/blockingfortuneclient/main.cpp +++ b/examples/network/blockingfortuneclient/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); BlockingClient client; +#ifdef Q_OS_SYMBIAN + client.showMaximized(); +#else client.show(); - return client.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro index 458585def3..adef726ed0 100644 --- a/examples/network/broadcastreceiver/broadcastreceiver.pro +++ b/examples/network/broadcastreceiver/broadcastreceiver.pro @@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/broadcastreceiver INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example diff --git a/examples/network/broadcastreceiver/main.cpp b/examples/network/broadcastreceiver/main.cpp index 041163178d..80d0bba869 100644 --- a/examples/network/broadcastreceiver/main.cpp +++ b/examples/network/broadcastreceiver/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Receiver receiver; +#ifdef Q_OS_SYMBIAN + receiver.showMaximized(); +#else receiver.show(); - return receiver.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastreceiver/receiver.cpp b/examples/network/broadcastreceiver/receiver.cpp index bd45a3cb35..04feffbc80 100644 --- a/examples/network/broadcastreceiver/receiver.cpp +++ b/examples/network/broadcastreceiver/receiver.cpp @@ -44,10 +44,18 @@ #include "receiver.h" Receiver::Receiver(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel(tr("Listening for broadcasted messages")); + statusLabel->setWordWrap(true); + +#ifdef Q_OS_SYMBIAN + quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); +#else quitButton = new QPushButton(tr("&Quit")); +#endif //! [0] udpSocket = new QUdpSocket(this); @@ -58,6 +66,13 @@ Receiver::Receiver(QWidget *parent) connect(udpSocket, SIGNAL(readyRead()), this, SLOT(processPendingDatagrams())); //! [1] +#ifdef Q_OS_SYMBIAN + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(statusLabel); + setLayout(mainLayout); +#else connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *buttonLayout = new QHBoxLayout; @@ -69,6 +84,7 @@ Receiver::Receiver(QWidget *parent) mainLayout->addWidget(statusLabel); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); +#endif setWindowTitle(tr("Broadcast Receiver")); } diff --git a/examples/network/broadcastreceiver/receiver.h b/examples/network/broadcastreceiver/receiver.h index 80b35a5571..3084da1e26 100644 --- a/examples/network/broadcastreceiver/receiver.h +++ b/examples/network/broadcastreceiver/receiver.h @@ -41,15 +41,16 @@ #ifndef RECEIVER_H #define RECEIVER_H -#include +#include QT_BEGIN_NAMESPACE class QLabel; class QPushButton; class QUdpSocket; +class QAction; QT_END_NAMESPACE -class Receiver : public QDialog +class Receiver : public QWidget { Q_OBJECT @@ -61,7 +62,11 @@ private slots: private: QLabel *statusLabel; +#ifdef Q_OS_SYMBIAN + QAction *quitAction; +#else QPushButton *quitButton; +#endif QUdpSocket *udpSocket; }; diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro index eb76c38071..d2bf78d414 100644 --- a/examples/network/broadcastsender/broadcastsender.pro +++ b/examples/network/broadcastsender/broadcastsender.pro @@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/broadcastsender INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example diff --git a/examples/network/broadcastsender/main.cpp b/examples/network/broadcastsender/main.cpp index 56e35c9540..88be21d2d8 100644 --- a/examples/network/broadcastsender/main.cpp +++ b/examples/network/broadcastsender/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Sender sender; +#ifdef Q_OS_SYMBIAN + sender.showMaximized(); +#else sender.show(); - return sender.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastsender/sender.cpp b/examples/network/broadcastsender/sender.cpp index d753094637..7ce877d586 100644 --- a/examples/network/broadcastsender/sender.cpp +++ b/examples/network/broadcastsender/sender.cpp @@ -44,9 +44,10 @@ #include "sender.h" Sender::Sender(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel(tr("Ready to broadcast datagrams on port 45454")); + statusLabel->setWordWrap(true); startButton = new QPushButton(tr("&Start")); quitButton = new QPushButton(tr("&Quit")); diff --git a/examples/network/broadcastsender/sender.h b/examples/network/broadcastsender/sender.h index d592051efd..666269f38e 100644 --- a/examples/network/broadcastsender/sender.h +++ b/examples/network/broadcastsender/sender.h @@ -41,7 +41,7 @@ #ifndef SENDER_H #define SENDER_H -#include +#include QT_BEGIN_NAMESPACE class QDialogButtonBox; @@ -51,7 +51,7 @@ class QTimer; class QUdpSocket; QT_END_NAMESPACE -class Sender : public QDialog +class Sender : public QWidget { Q_OBJECT diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro index 4bea359f16..a3b270d252 100644 --- a/examples/network/download/download.pro +++ b/examples/network/download/download.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT = core network @@ -19,3 +18,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/download INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro index 8855aae94c..2f83f41afc 100644 --- a/examples/network/downloadmanager/downloadmanager.pro +++ b/examples/network/downloadmanager/downloadmanager.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT = core network @@ -20,3 +19,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/downloadmanager INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +OTHER_FILES += \ + debian/changelog \ + debian/compat \ + debian/control \ + debian/copyright \ + debian/README \ + debian/rules +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index 2e3ec01abb..2737f9862a 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -14,3 +14,8 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index c34c565a0f..1d84c49593 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -15,3 +15,8 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro index e118dc9c26..9b8fa9423d 100644 --- a/examples/network/googlesuggest/googlesuggest.pro +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro index 74a8e49d90..7da0979935 100644 --- a/examples/network/http/http.pro +++ b/examples/network/http/http.pro @@ -10,4 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/http INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp index 874994ab92..6497a33508 100644 --- a/examples/network/http/httpwindow.cpp +++ b/examples/network/http/httpwindow.cpp @@ -45,7 +45,11 @@ #include "ui_authenticationdialog.h" HttpWindow::HttpWindow(QWidget *parent) +#ifdef Q_WS_MAEMO_5 + : QWidget(parent) +#else : QDialog(parent) +#endif { #ifndef QT_NO_OPENSSL urlLineEdit = new QLineEdit("https://qt.nokia.com/"); @@ -57,6 +61,7 @@ HttpWindow::HttpWindow(QWidget *parent) urlLabel->setBuddy(urlLineEdit); statusLabel = new QLabel(tr("Please enter the URL of a file you want to " "download.")); + statusLabel->setWordWrap(true); downloadButton = new QPushButton(tr("Download")); downloadButton->setDefault(true); @@ -67,7 +72,9 @@ HttpWindow::HttpWindow(QWidget *parent) buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole); buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole); +#ifndef Q_WS_MAEMO_5 progressDialog = new QProgressDialog(this); +#endif connect(urlLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableDownloadButton())); @@ -78,7 +85,9 @@ HttpWindow::HttpWindow(QWidget *parent) connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList)), this, SLOT(sslErrors(QNetworkReply*,QList))); #endif +#ifndef Q_WS_MAEMO_5 connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload())); +#endif connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); @@ -117,7 +126,7 @@ void HttpWindow::downloadFile() fileName = "index.html"; if (QFile::exists(fileName)) { - if (QMessageBox::question(this, tr("HTTP"), + if (QMessageBox::question(this, tr("HTTP"), tr("There already exists a file called %1 in " "the current directory. Overwrite?").arg(fileName), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) @@ -136,9 +145,10 @@ void HttpWindow::downloadFile() return; } - +#ifndef Q_WS_MAEMO_5 progressDialog->setWindowTitle(tr("HTTP")); progressDialog->setLabelText(tr("Downloading %1.").arg(fileName)); +#endif downloadButton->setEnabled(false); // schedule the request @@ -164,11 +174,15 @@ void HttpWindow::httpFinished() file = 0; } reply->deleteLater(); +#ifndef Q_WS_MAEMO_5 progressDialog->hide(); +#endif return; } +#ifndef Q_WS_MAEMO_5 progressDialog->hide(); +#endif file->flush(); file->close(); @@ -194,7 +208,7 @@ void HttpWindow::httpFinished() } } else { QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName(); - statusLabel->setText(tr("Downloaded %1 to current directory.").arg(fileName)); + statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath())); downloadButton->setEnabled(true); } @@ -219,8 +233,13 @@ void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes) if (httpRequestAborted) return; +#ifndef Q_WS_MAEMO_5 progressDialog->setMaximum(totalBytes); progressDialog->setValue(bytesRead); +#else + Q_UNUSED(bytesRead); + Q_UNUSED(totalBytes); +#endif } void HttpWindow::enableDownloadButton() diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h index 0ec87af48a..8bbe1a261a 100644 --- a/examples/network/http/httpwindow.h +++ b/examples/network/http/httpwindow.h @@ -41,7 +41,11 @@ #ifndef HTTPWINDOW_H #define HTTPWINDOW_H +#ifdef Q_WS_MAEMO_5 +#include +#else #include +#endif #include #include @@ -59,7 +63,11 @@ class QNetworkReply; QT_END_NAMESPACE +#ifdef Q_WS_MAEMO_5 +class HttpWindow : public QWidget +#else class HttpWindow : public QDialog +#endif { Q_OBJECT @@ -84,7 +92,9 @@ private: QLabel *statusLabel; QLabel *urlLabel; QLineEdit *urlLineEdit; +#ifndef Q_WS_MAEMO_5 QProgressDialog *progressDialog; +#endif QPushButton *downloadButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp index 4c4f61c775..e4f157476c 100644 --- a/examples/network/http/main.cpp +++ b/examples/network/http/main.cpp @@ -39,13 +39,28 @@ ****************************************************************************/ #include +#include #include "httpwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); + +#if defined(Q_OS_SYMBIAN) + // Change current directory from default private to c:\data + // in order that user can access the downloaded content + QDir::setCurrent("c:\\data"); +#elif defined(Q_WS_MAEMO_5) + QDir::setCurrent("/home/user"); +#endif + HttpWindow httpWin; + +#if defined(Q_OS_SYMBIAN) + httpWin.showMaximized(); +#else httpWin.show(); - return httpWin.exec(); +#endif + return app.exec(); } diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp index 50a191e9ee..14154b47cc 100644 --- a/examples/network/loopback/dialog.cpp +++ b/examples/network/loopback/dialog.cpp @@ -58,6 +58,22 @@ Dialog::Dialog(QWidget *parent) serverProgressBar = new QProgressBar; serverStatusLabel = new QLabel(tr("Server ready")); +#ifdef Q_OS_SYMBIAN + QMenu *menu = new QMenu(this); + + QAction *optionsAction = new QAction(tr("Options"), this); + optionsAction->setSoftKeyRole(QAction::PositiveSoftKey); + optionsAction->setMenu(menu); + addAction(optionsAction); + + startAction = menu->addAction(tr("Start"), this, SLOT(start())); + + quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); + + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); +#else startButton = new QPushButton(tr("&Start")); quitButton = new QPushButton(tr("&Quit")); @@ -67,6 +83,7 @@ Dialog::Dialog(QWidget *parent) connect(startButton, SIGNAL(clicked()), this, SLOT(start())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); +#endif connect(&tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection())); connect(&tcpClient, SIGNAL(connected()), this, SLOT(startTransfer())); @@ -82,7 +99,9 @@ Dialog::Dialog(QWidget *parent) mainLayout->addWidget(serverStatusLabel); mainLayout->addStretch(1); mainLayout->addSpacing(10); +#ifndef Q_OS_SYMBIAN mainLayout->addWidget(buttonBox); +#endif setLayout(mainLayout); setWindowTitle(tr("Loopback")); @@ -90,7 +109,11 @@ Dialog::Dialog(QWidget *parent) void Dialog::start() { +#ifdef Q_OS_SYMBIAN + startAction->setVisible(false); +#else startButton->setEnabled(false); +#endif #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); @@ -146,7 +169,11 @@ void Dialog::updateServerProgress() if (bytesReceived == TotalBytes) { tcpServerConnection->close(); +#ifdef Q_OS_SYMBIAN + startAction->setVisible(true); +#else startButton->setEnabled(true); +#endif #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif @@ -183,7 +210,11 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError) serverProgressBar->reset(); clientStatusLabel->setText(tr("Client ready")); serverStatusLabel->setText(tr("Server ready")); +#ifdef Q_OS_SYMBIAN + startAction->setVisible(true); +#else startButton->setEnabled(true); +#endif #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif diff --git a/examples/network/loopback/dialog.h b/examples/network/loopback/dialog.h index 09b4366e19..b48c090d3f 100644 --- a/examples/network/loopback/dialog.h +++ b/examples/network/loopback/dialog.h @@ -52,6 +52,7 @@ class QProgressBar; class QPushButton; class QTcpServer; class QTcpSocket; +class QAction; QT_END_NAMESPACE class Dialog : public QDialog @@ -74,9 +75,15 @@ private: QProgressBar *serverProgressBar; QLabel *clientStatusLabel; QLabel *serverStatusLabel; + +#ifdef Q_OS_SYMBIAN + QAction *startAction; + QAction *quitAction; +#else QPushButton *startButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; +#endif QTcpServer tcpServer; QTcpSocket tcpClient; diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro index ea175b3e3c..3565058e12 100644 --- a/examples/network/loopback/loopback.pro +++ b/examples/network/loopback/loopback.pro @@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/loopback INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example diff --git a/examples/network/loopback/main.cpp b/examples/network/loopback/main.cpp index 6810b795fc..7f26fd4357 100644 --- a/examples/network/loopback/main.cpp +++ b/examples/network/loopback/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else dialog.show(); - return dialog.exec(); +#endif + return app.exec(); } diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index 7c1514f727..ca4e8beaa6 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -24,3 +24,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/network.pro b/examples/network/network.pro index 09765a622a..b8416bb31f 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -35,3 +35,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp index c3e629f4f2..c0a2b73428 100644 --- a/examples/network/qftp/ftpwindow.cpp +++ b/examples/network/qftp/ftpwindow.cpp @@ -51,7 +51,7 @@ FtpWindow::FtpWindow(QWidget *parent) ftpServerLabel->setBuddy(ftpServerLineEdit); statusLabel = new QLabel(tr("Please enter the name of an FTP server.")); -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) // Use word wrapping to fit the text on screen statusLabel->setWordWrap( true ); #endif @@ -243,6 +243,12 @@ void FtpWindow::downloadFile() void FtpWindow::cancelDownload() { ftp->abort(); + + if (file->exists()) { + file->close(); + file->remove(); + } + delete file; } //![5] diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro index 0e62d153d9..5775f0172a 100644 --- a/examples/network/qftp/qftp.pro +++ b/examples/network/qftp/qftp.pro @@ -16,3 +16,7 @@ symbian { INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData" } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp index ff3a4d2f3c..b1a9acb0b2 100644 --- a/examples/network/securesocketclient/certificateinfo.cpp +++ b/examples/network/securesocketclient/certificateinfo.cpp @@ -47,7 +47,7 @@ CertificateInfo::CertificateInfo(QWidget *parent) form = new Ui_CertificateInfo; form->setupUi(this); - connect(form->certificationPathView, SIGNAL(currentRowChanged(int)), + connect(form->certificationPathView, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCertificateInfo(int))); } @@ -69,7 +69,7 @@ void CertificateInfo::setCertificateChain(const QList &chain) .arg(cert.subjectInfo(QSslCertificate::CommonName))); } - form->certificationPathView->setCurrentRow(0); + form->certificationPathView->setCurrentIndex(0); } void CertificateInfo::updateCertificateInfo(int index) diff --git a/examples/network/securesocketclient/certificateinfo.ui b/examples/network/securesocketclient/certificateinfo.ui index 3761fe8f50..c5238eb3e1 100644 --- a/examples/network/securesocketclient/certificateinfo.ui +++ b/examples/network/securesocketclient/certificateinfo.ui @@ -1,7 +1,8 @@ - + + CertificateInfo - - + + 0 0 @@ -9,42 +10,57 @@ 397 - + Display Certificate Information - + + + QLayout::SetDefaultConstraint + - - + + Certification Path - - - - - - - + + + 3 + + + + + + Certificate Information - - - - - - + + + + 8 + + + + true + + + + + + + QLayout::SetDefaultConstraint + - + Qt::Horizontal - + 40 20 @@ -53,8 +69,8 @@ - - + + QDialogButtonBox::Close @@ -71,11 +87,11 @@ CertificateInfo accept() - + 343 374 - + 352 422 diff --git a/examples/network/securesocketclient/main.cpp b/examples/network/securesocketclient/main.cpp index c15534b523..ca50f31dcf 100644 --- a/examples/network/securesocketclient/main.cpp +++ b/examples/network/securesocketclient/main.cpp @@ -56,7 +56,11 @@ int main(int argc, char **argv) } SslClient client; +#ifdef Q_OS_SYMBIAN + client.showMaximized(); +#else client.show(); +#endif return app.exec(); } diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro index f6276dd0bf..ae4b15ffbe 100644 --- a/examples/network/securesocketclient/securesocketclient.pro +++ b/examples/network/securesocketclient/securesocketclient.pro @@ -18,4 +18,7 @@ INSTALLS += target sources symbian { TARGET.UID3 = 0xA000CF67 CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices } +maemo5: CONFIG += qt_example + diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp index 43b81cd984..11e6ffd537 100644 --- a/examples/network/securesocketclient/sslclient.cpp +++ b/examples/network/securesocketclient/sslclient.cpp @@ -82,7 +82,6 @@ void SslClient::updateEnabledState() form->connectButton->setEnabled(unconnected && !form->hostNameEdit->text().isEmpty()); bool connected = socket && socket->state() == QAbstractSocket::ConnectedState; - form->sessionBox->setEnabled(connected); form->sessionOutput->setEnabled(connected); form->sessionInput->setEnabled(connected); form->sessionInputLabel->setEnabled(connected); @@ -193,6 +192,9 @@ void SslClient::sslErrors(const QList &errors) ui.sslErrorList->addItem(error.errorString()); executingDialog = true; +#ifdef Q_OS_SYMBIAN + errorDialog.showMaximized(); +#endif if (errorDialog.exec() == QDialog::Accepted) socket->ignoreSslErrors(); executingDialog = false; @@ -206,6 +208,9 @@ void SslClient::displayCertificateInfo() { CertificateInfo *info = new CertificateInfo(this); info->setCertificateChain(socket->peerCertificateChain()); +#ifdef Q_OS_SYMBIAN + info->showMaximized(); +#endif info->exec(); info->deleteLater(); } diff --git a/examples/network/securesocketclient/sslclient.ui b/examples/network/securesocketclient/sslclient.ui index 5a24751168..4b81fe46eb 100644 --- a/examples/network/securesocketclient/sslclient.ui +++ b/examples/network/securesocketclient/sslclient.ui @@ -1,7 +1,8 @@ - + + Form - - + + 0 0 @@ -9,147 +10,149 @@ 320 - + Secure Socket Client - - - - - - + + + + + + Host name: - - - + + + imap.example.com - - - + + + Port: - - - + + + 1 - + 65535 - + 993 - - - + + + + Active session + + + + + + true - + Connect to host - + true - - - + + + + + + Cryptographic Cipher: + + + true + + + + + + + <none> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + + false - - Active session + + Qt::StrongFocus - - - - - - - Cryptographic Cipher: - - - - - - - <none> - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - false - - - Qt::NoFocus - - - true - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> - - - - - - - - - Input: - - - - - - - false - - - - - - - false - - - Qt::TabFocus - - - &Send - - - true - - - - - - +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p></body></html> + + + + + + + Input: + + + + + + + false + + + + + + + false + + + Qt::TabFocus + + + &Send + + + true + + + + + @@ -160,11 +163,11 @@ p, li { white-space: pre-wrap; } connectButton animateClick() - + 126 20 - + 142 78 @@ -176,11 +179,11 @@ p, li { white-space: pre-wrap; } sendButton animateClick() - + 142 241 - + 297 234 diff --git a/examples/network/securesocketclient/sslerrors.ui b/examples/network/securesocketclient/sslerrors.ui index 4aac18cddb..1aadbfeca5 100644 --- a/examples/network/securesocketclient/sslerrors.ui +++ b/examples/network/securesocketclient/sslerrors.ui @@ -1,7 +1,8 @@ - + + SslErrors - - + + 0 0 @@ -9,44 +10,48 @@ 216 - + Unable To Validate The Connection - + - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">Warning</span><span style=" color:#ff0000;">:</span><span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click </span><span style=" color:#000000;">Ignore</span><span style=" color:#000000;"> to continue, or </span><span style=" color:#000000;">Cancel</span><span style=" color:#000000;"> to abort the connection.</span></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">Warning</span><span style=" color:#ff0000;">:</span><span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click </span><span style=" color:#000000;">Ignore</span><span style=" color:#000000;"> to continue, or </span><span style=" color:#000000;">Cancel</span><span style=" color:#000000;"> to abort the connection.</span></p></body></html> - + true - + + + true + + - + - - + + View Certificate Chain - + false - + Qt::Horizontal - + 40 20 @@ -55,15 +60,15 @@ p, li { white-space: pre-wrap; } - - + + Ignore - - + + Cancel @@ -80,11 +85,11 @@ p, li { white-space: pre-wrap; } SslErrors accept() - + 235 185 - + 228 287 @@ -96,11 +101,11 @@ p, li { white-space: pre-wrap; } SslErrors reject() - + 325 192 - + 333 231 diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp index b69f42cc85..27bf253b1a 100644 --- a/examples/network/threadedfortuneserver/dialog.cpp +++ b/examples/network/threadedfortuneserver/dialog.cpp @@ -47,11 +47,18 @@ #include "fortuneserver.h" Dialog::Dialog(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel; + statusLabel->setWordWrap(true); +#ifdef Q_OS_SYMBIAN + QAction *quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); +#else quitButton = new QPushButton(tr("Quit")); quitButton->setAutoDefault(false); +#endif if (!server.listen()) { QMessageBox::critical(this, tr("Threaded Fortune Server"), @@ -78,6 +85,13 @@ Dialog::Dialog(QWidget *parent) "Run the Fortune Client example now.") .arg(ipAddress).arg(server.serverPort())); +#ifdef Q_OS_SYMBIAN + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(statusLabel); + setLayout(mainLayout); +#else connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *buttonLayout = new QHBoxLayout; @@ -89,6 +103,6 @@ Dialog::Dialog(QWidget *parent) mainLayout->addWidget(statusLabel); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); - +#endif setWindowTitle(tr("Threaded Fortune Server")); } diff --git a/examples/network/threadedfortuneserver/dialog.h b/examples/network/threadedfortuneserver/dialog.h index 10ae3ebaa2..19a6fc2f47 100644 --- a/examples/network/threadedfortuneserver/dialog.h +++ b/examples/network/threadedfortuneserver/dialog.h @@ -41,7 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include +#include #include "fortuneserver.h" QT_BEGIN_NAMESPACE @@ -49,7 +49,7 @@ class QLabel; class QPushButton; QT_END_NAMESPACE -class Dialog : public QDialog +class Dialog : public QWidget { Q_OBJECT diff --git a/examples/network/threadedfortuneserver/main.cpp b/examples/network/threadedfortuneserver/main.cpp index 396f9244b6..1e245e9e01 100644 --- a/examples/network/threadedfortuneserver/main.cpp +++ b/examples/network/threadedfortuneserver/main.cpp @@ -49,7 +49,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else dialog.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - return dialog.exec(); + return app.exec(); } diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro index a76974a57e..335666bd76 100644 --- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro +++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro @@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pr sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/threadedfortuneserver INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro index 0dc3aa7950..3565978d8c 100644 --- a/examples/network/torrent/torrent.pro +++ b/examples/network/torrent/torrent.pro @@ -37,3 +37,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/torrent INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro index 3998cf55a5..ac88b9940a 100644 --- a/examples/opengl/2dpainting/2dpainting.pro +++ b/examples/opengl/2dpainting/2dpainting.pro @@ -17,3 +17,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/2dpainting INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro index 8a26573c84..d2787853e0 100644 --- a/examples/opengl/framebufferobject2/framebufferobject2.pro +++ b/examples/opengl/framebufferobject2/framebufferobject2.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/framebufferobject2 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro index 7f5c3d63c9..e9f371b6ad 100644 --- a/examples/opengl/grabber/grabber.pro +++ b/examples/opengl/grabber/grabber.pro @@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/grabber INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro index 1c67fe01bd..0c81aae5c1 100644 --- a/examples/opengl/hellogl/hellogl.pro +++ b/examples/opengl/hellogl/hellogl.pro @@ -17,3 +17,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro index 774bfef265..d0e953110b 100644 --- a/examples/opengl/hellogl_es/hellogl_es.pro +++ b/examples/opengl/hellogl_es/hellogl_es.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . @@ -25,3 +24,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro index 8016aa37b0..3714ae0797 100644 --- a/examples/opengl/hellogl_es2/hellogl_es2.pro +++ b/examples/opengl/hellogl_es2/hellogl_es2.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . @@ -25,3 +24,15 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + +maemo5 { + # Debian package name may not contain numbers or special characters + # such as '_', lets change this in Maemo. + TARGET = helloglestwo + include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +} + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index f9ca0bdaf4..2a96807102 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -12,6 +12,7 @@ contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2){ } } else { SUBDIRS = 2dpainting \ + cube \ grabber \ hellogl \ overpainting \ @@ -28,3 +29,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro index 31adf0fb34..6dfcf28ad1 100644 --- a/examples/opengl/overpainting/overpainting.pro +++ b/examples/opengl/overpainting/overpainting.pro @@ -20,4 +20,10 @@ sources.files = $$SOURCES \ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/overpainting INSTALLS += target \ sources + symbian:CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro index 79d5a6d96c..755ed8c6a8 100644 --- a/examples/opengl/pbuffers/pbuffers.pro +++ b/examples/opengl/pbuffers/pbuffers.pro @@ -16,4 +16,10 @@ sources.files = $$SOURCES \ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/pbuffers INSTALLS += target \ sources + symbian:CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro index 0fb75c1f00..d70981879d 100644 --- a/examples/opengl/pbuffers2/pbuffers2.pro +++ b/examples/opengl/pbuffers2/pbuffers2.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . @@ -21,3 +20,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/pbuffers2 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro index 34720736df..a8938b9dc1 100644 --- a/examples/opengl/samplebuffers/samplebuffers.pro +++ b/examples/opengl/samplebuffers/samplebuffers.pro @@ -10,3 +10,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/samplebuffers INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example does not work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro index 78555d58cb..5bb0d5782e 100644 --- a/examples/opengl/textures/textures.pro +++ b/examples/opengl/textures/textures.pro @@ -13,3 +13,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/textures INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/openvg/openvg.pro b/examples/openvg/openvg.pro index ffbe81c312..f8c982dbfc 100644 --- a/examples/openvg/openvg.pro +++ b/examples/openvg/openvg.pro @@ -6,3 +6,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/openvg sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS openvg.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/openvg INSTALLS += target sources + diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro index e607721ffb..41642e8f35 100644 --- a/examples/painting/basicdrawing/basicdrawing.pro +++ b/examples/painting/basicdrawing/basicdrawing.pro @@ -15,3 +15,6 @@ symbian { TARGET.UID3 = 0xA000A649 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/painting/basicdrawing/main.cpp b/examples/painting/basicdrawing/main.cpp index 6662742166..aa839f68cc 100644 --- a/examples/painting/basicdrawing/main.cpp +++ b/examples/painting/basicdrawing/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/painting/basicdrawing/window.cpp b/examples/painting/basicdrawing/window.cpp index 54422a0104..072c3e08aa 100644 --- a/examples/painting/basicdrawing/window.cpp +++ b/examples/painting/basicdrawing/window.cpp @@ -74,7 +74,11 @@ Window::Window() //! [2] penWidthSpinBox = new QSpinBox; penWidthSpinBox->setRange(0, 20); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + penWidthSpinBox->setSpecialValueText(tr("0")); +#else penWidthSpinBox->setSpecialValueText(tr("0 (cosmetic pen)")); +#endif penWidthLabel = new QLabel(tr("Pen &Width:")); penWidthLabel->setBuddy(penWidthSpinBox); @@ -134,12 +138,12 @@ Window::Window() brushStyleComboBox->addItem(tr("Dense 7"), Qt::Dense7Pattern); brushStyleComboBox->addItem(tr("None"), Qt::NoBrush); - brushStyleLabel = new QLabel(tr("&Brush Style:")); + brushStyleLabel = new QLabel(tr("&Brush:")); brushStyleLabel->setBuddy(brushStyleComboBox); //! [4] //! [5] - otherOptionsLabel = new QLabel(tr("Other Options:")); + otherOptionsLabel = new QLabel(tr("Options:")); //! [5] //! [6] antialiasingCheckBox = new QCheckBox(tr("&Antialiasing")); //! [6] //! [7] @@ -168,26 +172,27 @@ Window::Window() //! [9] QGridLayout *mainLayout = new QGridLayout; //! [9] //! [10] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); +#endif mainLayout->setColumnStretch(0, 1); mainLayout->setColumnStretch(3, 1); mainLayout->addWidget(renderArea, 0, 0, 1, 4); - mainLayout->setRowMinimumHeight(1, 6); - mainLayout->addWidget(shapeLabel, 2, 1, Qt::AlignRight); - mainLayout->addWidget(shapeComboBox, 2, 2); - mainLayout->addWidget(penWidthLabel, 3, 1, Qt::AlignRight); - mainLayout->addWidget(penWidthSpinBox, 3, 2); - mainLayout->addWidget(penStyleLabel, 4, 1, Qt::AlignRight); - mainLayout->addWidget(penStyleComboBox, 4, 2); - mainLayout->addWidget(penCapLabel, 5, 1, Qt::AlignRight); - mainLayout->addWidget(penCapComboBox, 5, 2); - mainLayout->addWidget(penJoinLabel, 6, 1, Qt::AlignRight); - mainLayout->addWidget(penJoinComboBox, 6, 2); - mainLayout->addWidget(brushStyleLabel, 7, 1, Qt::AlignRight); - mainLayout->addWidget(brushStyleComboBox, 7, 2); - mainLayout->setRowMinimumHeight(8, 6); - mainLayout->addWidget(otherOptionsLabel, 9, 1, Qt::AlignRight); - mainLayout->addWidget(antialiasingCheckBox, 9, 2); - mainLayout->addWidget(transformationsCheckBox, 10, 2); + mainLayout->addWidget(shapeLabel, 2, 0, Qt::AlignRight); + mainLayout->addWidget(shapeComboBox, 2, 1); + mainLayout->addWidget(penWidthLabel, 3, 0, Qt::AlignRight); + mainLayout->addWidget(penWidthSpinBox, 3, 1); + mainLayout->addWidget(penStyleLabel, 4, 0, Qt::AlignRight); + mainLayout->addWidget(penStyleComboBox, 4, 1); + mainLayout->addWidget(penCapLabel, 3, 2, Qt::AlignRight); + mainLayout->addWidget(penCapComboBox, 3, 3); + mainLayout->addWidget(penJoinLabel, 2, 2, Qt::AlignRight); + mainLayout->addWidget(penJoinComboBox, 2, 3); + mainLayout->addWidget(brushStyleLabel, 4, 2, Qt::AlignRight); + mainLayout->addWidget(brushStyleComboBox, 4, 3); + mainLayout->addWidget(otherOptionsLabel, 5, 0, Qt::AlignRight); + mainLayout->addWidget(antialiasingCheckBox, 5, 1, 1, 1, Qt::AlignRight); + mainLayout->addWidget(transformationsCheckBox, 5, 2, 1, 2, Qt::AlignRight); setLayout(mainLayout); shapeChanged(); diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro index f7e050ba21..731edc61ae 100644 --- a/examples/painting/concentriccircles/concentriccircles.pro +++ b/examples/painting/concentriccircles/concentriccircles.pro @@ -14,3 +14,5 @@ symbian { TARGET.UID3 = 0xA000A64A CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/painting/concentriccircles/main.cpp b/examples/painting/concentriccircles/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/painting/concentriccircles/main.cpp +++ b/examples/painting/concentriccircles/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/painting/fontsampler/fontsampler.pro b/examples/painting/fontsampler/fontsampler.pro index b9328a6439..6d93d913e8 100644 --- a/examples/painting/fontsampler/fontsampler.pro +++ b/examples/painting/fontsampler/fontsampler.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/fontsampler INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/painting/fontsampler/main.cpp b/examples/painting/fontsampler/main.cpp index 01c8adae53..dffe80348a 100644 --- a/examples/painting/fontsampler/main.cpp +++ b/examples/painting/fontsampler/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/painting/fontsampler/mainwindow.cpp b/examples/painting/fontsampler/mainwindow.cpp index 0976d1f971..96698437b1 100644 --- a/examples/painting/fontsampler/mainwindow.cpp +++ b/examples/painting/fontsampler/mainwindow.cpp @@ -47,6 +47,10 @@ MainWindow::MainWindow(QWidget *parent) { setupUi(this); +#if defined(Q_OS_SYMBIAN) + addDockWidget(Qt::BottomDockWidgetArea, dockWidget); +#endif + sampleSizes << 32 << 24 << 16 << 14 << 12 << 8 << 4 << 2 << 1; markedCount = 0; setupFontTree(); @@ -140,7 +144,11 @@ void MainWindow::showFont(QTreeWidgetItem *item) QString oldText = textEdit->toPlainText().trimmed(); bool modified = textEdit->document()->isModified(); textEdit->clear(); +#if defined(Q_OS_SYMBIAN) + textEdit->document()->setDefaultFont(QFont(family, 10, weight, italic)); +#else textEdit->document()->setDefaultFont(QFont(family, 32, weight, italic)); +#endif QTextCursor cursor = textEdit->textCursor(); QTextBlockFormat blockFormat; @@ -217,6 +225,30 @@ void MainWindow::updateStyles(QTreeWidgetItem *item, int column) printPreviewAction->setEnabled(markedCount > 0); } +QMap MainWindow::currentPageMap() +{ + QMap pageMap; + + for (int row = 0; row < fontTree->topLevelItemCount(); ++row) { + QTreeWidgetItem *familyItem = fontTree->topLevelItem(row); + QString family; + + if (familyItem->checkState(0) == Qt::Checked) { + family = familyItem->text(0); + pageMap[family] = StyleItems(); + } + + for (int childRow = 0; childRow < familyItem->childCount(); ++childRow) { + QTreeWidgetItem *styleItem = familyItem->child(childRow); + if (styleItem->checkState(0) == Qt::Checked) + pageMap[family].append(styleItem); + } + } + + return pageMap; +} + +#ifndef QT_NO_PRINTER void MainWindow::on_printAction_triggered() { pageMap = currentPageMap(); @@ -283,29 +315,6 @@ void MainWindow::on_printPreviewAction_triggered() preview.exec(); } -QMap MainWindow::currentPageMap() -{ - QMap pageMap; - - for (int row = 0; row < fontTree->topLevelItemCount(); ++row) { - QTreeWidgetItem *familyItem = fontTree->topLevelItem(row); - QString family; - - if (familyItem->checkState(0) == Qt::Checked) { - family = familyItem->text(0); - pageMap[family] = StyleItems(); - } - - for (int childRow = 0; childRow < familyItem->childCount(); ++childRow) { - QTreeWidgetItem *styleItem = familyItem->child(childRow); - if (styleItem->checkState(0) == Qt::Checked) - pageMap[family].append(styleItem); - } - } - - return pageMap; -} - void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) { QString family = pageMap.keys()[index]; @@ -370,3 +379,4 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) painter->restore(); } +#endif diff --git a/examples/painting/fontsampler/mainwindow.h b/examples/painting/fontsampler/mainwindow.h index 7ea4cd5ed0..4021ee7c6c 100644 --- a/examples/painting/fontsampler/mainwindow.h +++ b/examples/painting/fontsampler/mainwindow.h @@ -61,11 +61,15 @@ public: public slots: void on_clearAction_triggered(); void on_markAction_triggered(); +#ifndef QT_NO_PRINTER void on_printAction_triggered(); void on_printPreviewAction_triggered(); +#endif void on_unmarkAction_triggered(); +#ifndef QT_NO_PRINTER void printDocument(QPrinter *printer); void printPage(int index, QPainter *painter, QPrinter *printer); +#endif void showFont(QTreeWidgetItem *item); void updateStyles(QTreeWidgetItem *item, int column); diff --git a/examples/painting/fontsampler/mainwindowbase.ui b/examples/painting/fontsampler/mainwindowbase.ui index 6545b34083..1a95ebd6d1 100644 --- a/examples/painting/fontsampler/mainwindowbase.ui +++ b/examples/painting/fontsampler/mainwindowbase.ui @@ -1,10 +1,8 @@ - - - - + + MainWindowBase - - + + 0 0 @@ -12,129 +10,133 @@ 345 - + Font Sampler - - - - 9 - - + + + 6 + + 9 + - + - - + + 0 0 800 - 24 + 18 - - + + &Selection - - - + + + - - + + &File - - - + + + - - + + - - - - QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable|QDockWidget::NoDockWidgetFeatures + + + + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable - + Available Fonts - + 1 - - - - 9 - - + + + 6 + + 9 + - - + + QAbstractItemView::ExtendedSelection + + + 1 + + - - + + false - + &Print... - + Ctrl+P - - + + E&xit - + Ctrl+Q - - + + &Mark - + Ctrl+M - - + + &Unmark - + Ctrl+U - - + + &Clear - - + + false - + Print Preview... - diff --git a/examples/painting/imagecomposition/imagecomposer.cpp b/examples/painting/imagecomposition/imagecomposer.cpp index a41f405fd0..9488204e30 100644 --- a/examples/painting/imagecomposition/imagecomposer.cpp +++ b/examples/painting/imagecomposition/imagecomposer.cpp @@ -43,7 +43,11 @@ #include "imagecomposer.h" //! [0] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) +static const QSize resultSize(50, 50); +#else static const QSize resultSize(200, 200); +#endif //! [0] //! [1] @@ -104,7 +108,10 @@ ImageComposer::ImageComposer() mainLayout->addWidget(destinationButton, 0, 2, 3, 1); mainLayout->addWidget(equalLabel, 1, 3); mainLayout->addWidget(resultLabel, 0, 4, 3, 1); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) +#else mainLayout->setSizeConstraint(QLayout::SetFixedSize); +#endif setLayout(mainLayout); //! [4] @@ -176,6 +183,9 @@ void ImageComposer::loadImage(const QString &fileName, QImage *image, { image->load(fileName); + // Scale the image to given size + *image = image->scaled(resultSize, Qt::KeepAspectRatio); + QImage fixedImage(resultSize, QImage::Format_ARGB32_Premultiplied); QPainter painter(&fixedImage); painter.setCompositionMode(QPainter::CompositionMode_Source); diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro index e8be8fa2b5..a763108306 100644 --- a/examples/painting/imagecomposition/imagecomposition.pro +++ b/examples/painting/imagecomposition/imagecomposition.pro @@ -13,3 +13,5 @@ symbian { TARGET.UID3 = 0xA000A64B CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/painting/imagecomposition/main.cpp b/examples/painting/imagecomposition/main.cpp index e70fa5fae9..f97a3ff7ef 100644 --- a/examples/painting/imagecomposition/main.cpp +++ b/examples/painting/imagecomposition/main.cpp @@ -49,7 +49,11 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); ImageComposer composer; +#if defined(Q_OS_SYMBIAN) + composer.showMaximized(); +#else composer.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/painting/painterpaths/main.cpp b/examples/painting/painterpaths/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/painting/painterpaths/main.cpp +++ b/examples/painting/painterpaths/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro index 84bbecaa83..2a7d224716 100644 --- a/examples/painting/painterpaths/painterpaths.pro +++ b/examples/painting/painterpaths/painterpaths.pro @@ -15,3 +15,5 @@ symbian { TARGET.UID3 = 0xA000A64C CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/painting/painterpaths/window.cpp b/examples/painting/painterpaths/window.cpp index 429f470b26..0a4c1b0ca3 100644 --- a/examples/painting/painterpaths/window.cpp +++ b/examples/painting/painterpaths/window.cpp @@ -130,16 +130,17 @@ Window::Window() //! [9] //! [10] - renderAreas[0] = new RenderArea(rectPath); - renderAreas[1] = new RenderArea(roundRectPath); - renderAreas[2] = new RenderArea(ellipsePath); - renderAreas[3] = new RenderArea(piePath); - renderAreas[4] = new RenderArea(polygonPath); - renderAreas[5] = new RenderArea(groupPath); - renderAreas[6] = new RenderArea(textPath); - renderAreas[7] = new RenderArea(bezierPath); - renderAreas[8] = new RenderArea(starPath); - Q_ASSERT(NumRenderAreas == 9); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) + renderAreas.push_back(new RenderArea(rectPath)); + renderAreas.push_back(new RenderArea(roundRectPath)); + renderAreas.push_back(new RenderArea(ellipsePath)); + renderAreas.push_back(new RenderArea(piePath)); + renderAreas.push_back(new RenderArea(polygonPath)); + renderAreas.push_back(new RenderArea(groupPath)); +#endif + renderAreas.push_back(new RenderArea(textPath)); + renderAreas.push_back(new RenderArea(bezierPath)); + renderAreas.push_back(new RenderArea(starPath)); //! [10] //! [11] @@ -201,19 +202,27 @@ Window::Window() connect(penColorComboBox, SIGNAL(activated(int)), this, SLOT(penColorChanged())); - for (int i = 0; i < NumRenderAreas; ++i) { + for(QList::iterator it = renderAreas.begin(); it != renderAreas.end(); it++) { connect(penWidthSpinBox, SIGNAL(valueChanged(int)), - renderAreas[i], SLOT(setPenWidth(int))); + *it, SLOT(setPenWidth(int))); connect(rotationAngleSpinBox, SIGNAL(valueChanged(int)), - renderAreas[i], SLOT(setRotationAngle(int))); + *it, SLOT(setRotationAngle(int))); } //! [16] //! [17] QGridLayout *topLayout = new QGridLayout; - for (int i = 0; i < NumRenderAreas; ++i) - topLayout->addWidget(renderAreas[i], i / 3, i % 3); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + topLayout->setSizeConstraint(QLayout::SetNoConstraint); +#endif + + int i=0; + for(QList::iterator it = renderAreas.begin(); it != renderAreas.end(); it++, i++) + topLayout->addWidget(*it, i / 3, i % 3); QGridLayout *mainLayout = new QGridLayout; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); +#endif mainLayout->addLayout(topLayout, 0, 0, 1, 4); mainLayout->addWidget(fillRuleLabel, 1, 0); mainLayout->addWidget(fillRuleComboBox, 1, 1, 1, 3); @@ -225,8 +234,10 @@ Window::Window() mainLayout->addWidget(penWidthSpinBox, 3, 1, 1, 3); mainLayout->addWidget(penColorLabel, 4, 0); mainLayout->addWidget(penColorComboBox, 4, 1, 1, 3); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) mainLayout->addWidget(rotationAngleLabel, 5, 0); mainLayout->addWidget(rotationAngleSpinBox, 5, 1, 1, 3); +#endif setLayout(mainLayout); //! [17] @@ -245,8 +256,8 @@ void Window::fillRuleChanged() { Qt::FillRule rule = (Qt::FillRule)currentItemData(fillRuleComboBox).toInt(); - for (int i = 0; i < NumRenderAreas; ++i) - renderAreas[i]->setFillRule(rule); + for(QList::iterator it = renderAreas.begin(); it != renderAreas.end(); it++) + (*it)->setFillRule(rule); } //! [19] @@ -256,8 +267,8 @@ void Window::fillGradientChanged() QColor color1 = qvariant_cast(currentItemData(fillColor1ComboBox)); QColor color2 = qvariant_cast(currentItemData(fillColor2ComboBox)); - for (int i = 0; i < NumRenderAreas; ++i) - renderAreas[i]->setFillGradient(color1, color2); + for(QList::iterator it = renderAreas.begin(); it != renderAreas.end(); it++) + (*it)->setFillGradient(color1, color2); } //! [20] @@ -266,8 +277,8 @@ void Window::penColorChanged() { QColor color = qvariant_cast(currentItemData(penColorComboBox)); - for (int i = 0; i < NumRenderAreas; ++i) - renderAreas[i]->setPenColor(color); + for(QList::iterator it = renderAreas.begin(); it != renderAreas.end(); it++) + (*it)->setPenColor(color); } //! [21] diff --git a/examples/painting/painterpaths/window.h b/examples/painting/painterpaths/window.h index 4891fdd153..b95cd93851 100644 --- a/examples/painting/painterpaths/window.h +++ b/examples/painting/painterpaths/window.h @@ -71,9 +71,7 @@ private: //! [1] //! [2] - enum { NumRenderAreas = 9 }; - - RenderArea *renderAreas[NumRenderAreas]; + QList renderAreas; QLabel *fillRuleLabel; QLabel *fillGradientLabel; QLabel *fillToLabel; diff --git a/examples/painting/painting.pro b/examples/painting/painting.pro index 4108a64edd..41f91822c4 100644 --- a/examples/painting/painting.pro +++ b/examples/painting/painting.pro @@ -3,9 +3,8 @@ SUBDIRS = basicdrawing \ concentriccircles \ imagecomposition \ painterpaths \ - transformations - -!wince*:!symbian: SUBDIRS += fontsampler + transformations \ + fontsampler # install target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting @@ -14,3 +13,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/painting/transformations/main.cpp b/examples/painting/transformations/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/painting/transformations/main.cpp +++ b/examples/painting/transformations/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro index 8fe8be932e..0107046374 100644 --- a/examples/painting/transformations/transformations.pro +++ b/examples/painting/transformations/transformations.pro @@ -14,3 +14,8 @@ symbian { TARGET.UID3 = 0xA000A64D CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro index f6c029b678..cb87d718f5 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.pro +++ b/examples/qtconcurrent/imagescaling/imagescaling.pro @@ -15,3 +15,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/imagescaling/main.cpp b/examples/qtconcurrent/imagescaling/main.cpp index de64116f1c..d6ca7e57f0 100644 --- a/examples/qtconcurrent/imagescaling/main.cpp +++ b/examples/qtconcurrent/imagescaling/main.cpp @@ -48,16 +48,33 @@ int main(int argc, char *argv[]) QApplication app(argc,argv); Images imageView; +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + imageView.showMaximized(); +#else imageView.show(); +#endif return app.exec(); } #else -int main() +int main(int argc, char *argv[]) { - qDebug() << "Qt Concurrent is not supported on this platform"; + QApplication app(argc, argv); + QString text("Qt Concurrent is not supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + label->showMaximized(); +#else + label->show(); +#endif + qDebug() << text; + + app.exec(); } #endif diff --git a/examples/qtconcurrent/map/main.cpp b/examples/qtconcurrent/map/main.cpp index bb6c5c657a..76b14476f3 100644 --- a/examples/qtconcurrent/map/main.cpp +++ b/examples/qtconcurrent/map/main.cpp @@ -73,9 +73,24 @@ int main(int argc, char *argv[]) #else -int main() +#include + +int main(int argc, char *argv[]) { - qDebug() << "Qt Concurrent is not yet supported on this platform"; + QApplication app(argc, argv); + QString text("Qt Concurrent is not yet supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + label->showMaximized(); +#else + label->show(); +#endif + qDebug() << text; + + app.exec(); } #endif diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro index da8b5cb664..715df396f3 100644 --- a/examples/qtconcurrent/map/map.pro +++ b/examples/qtconcurrent/map/map.pro @@ -14,3 +14,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp index 307baed45b..d302366380 100644 --- a/examples/qtconcurrent/progressdialog/main.cpp +++ b/examples/qtconcurrent/progressdialog/main.cpp @@ -90,9 +90,22 @@ int main(int argc, char **argv) #else -int main() +int main(int argc, char *argv[]) { - qDebug() << "Qt Concurrent is not yet supported on this platform"; + QApplication app(argc, argv); + QString text("Qt Concurrent is not yet supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + label->showMaximized(); +#else + label->show(); +#endif + qDebug() << text; + + app.exec(); } #endif diff --git a/examples/qtconcurrent/progressdialog/progressdialog.pro b/examples/qtconcurrent/progressdialog/progressdialog.pro index be3e62ceeb..afeadd4b27 100644 --- a/examples/qtconcurrent/progressdialog/progressdialog.pro +++ b/examples/qtconcurrent/progressdialog/progressdialog.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET += DEPENDPATH += . INCLUDEPATH += . @@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro index a224b4a633..0d5d0c5983 100644 --- a/examples/qtconcurrent/qtconcurrent.pro +++ b/examples/qtconcurrent/qtconcurrent.pro @@ -15,3 +15,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/qtconcurrent/runfunction/main.cpp b/examples/qtconcurrent/runfunction/main.cpp index 1e448bb71d..86fdf80aa4 100644 --- a/examples/qtconcurrent/runfunction/main.cpp +++ b/examples/qtconcurrent/runfunction/main.cpp @@ -64,9 +64,24 @@ int main(int argc, char **argv) #else -int main() +#include + +int main(int argc, char *argv[]) { - qDebug() << "Qt Concurrent is not yet supported on this platform"; + QApplication app(argc, argv); + QString text("Qt Concurrent is not yet supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + label->showMaximized(); +#else + label->show(); +#endif + qDebug() << text; + + app.exec(); } #endif diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro index f5b359c5ef..ae87ffe839 100644 --- a/examples/qtconcurrent/runfunction/runfunction.pro +++ b/examples/qtconcurrent/runfunction/runfunction.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET += DEPENDPATH += . INCLUDEPATH += . @@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp index 035207c410..56be795c60 100644 --- a/examples/qtconcurrent/wordcount/main.cpp +++ b/examples/qtconcurrent/wordcount/main.cpp @@ -124,7 +124,11 @@ int main(int argc, char** argv) { QApplication app(argc, argv); qDebug() << "finding files..."; +#ifdef Q_WS_MAEMO_5 + QStringList files = findFiles("/usr/", QStringList() << "*.sh"); +#else QStringList files = findFiles("../../", QStringList() << "*.cpp" << "*.h"); +#endif qDebug() << files.count() << "files"; qDebug() << "warmup"; @@ -158,9 +162,24 @@ int main(int argc, char** argv) #else -int main() +#include + +int main(int argc, char *argv[]) { - qDebug() << "Qt Concurrent is not yet supported on this platform"; + QApplication app(argc, argv); + QString text("Qt Concurrent is not yet supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + label->showMaximized(); +#else + label->show(); +#endif + qDebug() << text; + + app.exec(); } #endif diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro index c6e4d852f5..1596e9c1eb 100644 --- a/examples/qtconcurrent/wordcount/wordcount.pro +++ b/examples/qtconcurrent/wordcount/wordcount.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET += DEPENDPATH += . INCLUDEPATH += . @@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtestlib/qtestlib.pro b/examples/qtestlib/qtestlib.pro index 7fce5967c7..a1331bbca0 100644 --- a/examples/qtestlib/qtestlib.pro +++ b/examples/qtestlib/qtestlib.pro @@ -8,3 +8,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtestlib INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro index 439e8403ef..fdbf2fc365 100644 --- a/examples/qtestlib/tutorial1/tutorial1.pro +++ b/examples/qtestlib/tutorial1/tutorial1.pro @@ -11,3 +11,8 @@ symbian { TARGET.UID3 = 0xA000C60B CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro index 2c44466d47..647ddd75ae 100644 --- a/examples/qtestlib/tutorial2/tutorial2.pro +++ b/examples/qtestlib/tutorial2/tutorial2.pro @@ -11,3 +11,8 @@ symbian { TARGET.UID3 = 0xA000C60C CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro index ec24447347..887fc9a592 100644 --- a/examples/qtestlib/tutorial3/tutorial3.pro +++ b/examples/qtestlib/tutorial3/tutorial3.pro @@ -11,3 +11,8 @@ symbian { TARGET.UID3 = 0xA000C60D CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro index ca3985ea21..082a3a3caa 100644 --- a/examples/qtestlib/tutorial4/tutorial4.pro +++ b/examples/qtestlib/tutorial4/tutorial4.pro @@ -11,3 +11,8 @@ symbian { TARGET.UID3 = 0xA000C60E CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro index c263a74278..4f70284309 100644 --- a/examples/qtestlib/tutorial5/tutorial5.pro +++ b/examples/qtestlib/tutorial5/tutorial5.pro @@ -11,3 +11,8 @@ symbian { TARGET.UID3 = 0xA000C60F CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro index 172a02a5e7..faa05260ad 100644 --- a/examples/qws/dbscreen/dbscreen.pro +++ b/examples/qws/dbscreen/dbscreen.pro @@ -9,3 +9,7 @@ HEADERS = dbscreen.h SOURCES = dbscreendriverplugin.cpp \ dbscreen.cpp +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro index 098a97ed14..65dc715338 100644 --- a/examples/qws/framebuffer/framebuffer.pro +++ b/examples/qws/framebuffer/framebuffer.pro @@ -9,3 +9,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/framebuffer sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/framebuffer INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro index 878aff23bc..d58f9fdd28 100644 --- a/examples/qws/mousecalibration/mousecalibration.pro +++ b/examples/qws/mousecalibration/mousecalibration.pro @@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/mousecalibration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/mousecalibration INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/simpledecoration/simpledecoration.pro b/examples/qws/simpledecoration/simpledecoration.pro index 2a4e0be51c..c452e1e21a 100644 --- a/examples/qws/simpledecoration/simpledecoration.pro +++ b/examples/qws/simpledecoration/simpledecoration.pro @@ -10,3 +10,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/simpledecoration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/simpledecoration INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro index 8a47c1d1d0..8bc53950d5 100644 --- a/examples/qws/svgalib/svgalib.pro +++ b/examples/qws/svgalib/svgalib.pro @@ -17,3 +17,9 @@ SOURCES = svgalibscreen.cpp \ svgalibpaintdevice.cpp \ svgalibplugin.cpp +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/richtext/calendar/calendar.pro b/examples/richtext/calendar/calendar.pro index 7ecc8ab6b9..834b2c1a7e 100644 --- a/examples/richtext/calendar/calendar.pro +++ b/examples/richtext/calendar/calendar.pro @@ -2,6 +2,9 @@ HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp +# App cannot be with name "calendar" in Symbian due to same named system component. +symbian: TARGET = calendarapp + # install target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/richtext/calendar sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendar.pro @@ -9,3 +12,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/richtext/calendar INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/richtext/calendar/main.cpp b/examples/richtext/calendar/main.cpp index b23e883e24..9c1141f0d1 100644 --- a/examples/richtext/calendar/main.cpp +++ b/examples/richtext/calendar/main.cpp @@ -46,7 +46,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + window.show(); +#else window.resize(640, 256); window.show(); +#endif return app.exec(); } diff --git a/examples/richtext/calendar/mainwindow.cpp b/examples/richtext/calendar/mainwindow.cpp index 5117c03ae4..60d7c51595 100644 --- a/examples/richtext/calendar/mainwindow.cpp +++ b/examples/richtext/calendar/mainwindow.cpp @@ -70,7 +70,6 @@ MainWindow::MainWindow() QLabel *fontSizeLabel = new QLabel(tr("Font size:")); QSpinBox *fontSizeSpinBox = new QSpinBox; fontSizeSpinBox->setRange(1, 64); - fontSizeSpinBox->setValue(10); editor = new QTextBrowser; insertCalendar(); @@ -83,6 +82,12 @@ MainWindow::MainWindow() this, SLOT(setFontSize(int))); //! [3] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + fontSizeSpinBox->setValue(4); +#else + fontSizeSpinBox->setValue(10); +#endif + //! [4] QHBoxLayout *controlsLayout = new QHBoxLayout; controlsLayout->addWidget(dateLabel); diff --git a/examples/richtext/orderform/detailsdialog.cpp b/examples/richtext/orderform/detailsdialog.cpp index 9aa8535c5b..b12de14d30 100644 --- a/examples/richtext/orderform/detailsdialog.cpp +++ b/examples/richtext/orderform/detailsdialog.cpp @@ -53,8 +53,13 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent) nameEdit = new QLineEdit; addressEdit = new QTextEdit; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + offersCheckBox = new QCheckBox(tr("Send information about\n" + "products and special offers")); +#else offersCheckBox = new QCheckBox(tr("Send information about products and " "special offers")); +#endif setupItemsTable(); @@ -66,6 +71,30 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent) //! [0] //! [1] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QWidget *widgetSubscriber = new QWidget; + QGridLayout *subscriberLayout = new QGridLayout; + subscriberLayout->addWidget(nameLabel, 0, 0); + subscriberLayout->addWidget(nameEdit, 0, 1); + subscriberLayout->addWidget(addressLabel, 1, 0); + subscriberLayout->addWidget(addressEdit, 1, 1); + subscriberLayout->addWidget(offersCheckBox, 2, 0, 1, 2); + widgetSubscriber->setLayout(subscriberLayout); + + QWidget *widgetOrder = new QWidget; + QVBoxLayout *orderLayout = new QVBoxLayout; + orderLayout->addWidget(itemsTable); + widgetOrder->setLayout(orderLayout); + + QTabWidget *tabWidget = new QTabWidget; + tabWidget->addTab(widgetSubscriber, "Subscriber"); + tabWidget->addTab(widgetOrder, "Order"); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(tabWidget); + mainLayout->addWidget(buttonBox); + setLayout(mainLayout); +#else QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(nameLabel, 0, 0); mainLayout->addWidget(nameEdit, 0, 1); @@ -75,6 +104,7 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent) mainLayout->addWidget(offersCheckBox, 2, 1, 1, 2); mainLayout->addWidget(buttonBox, 3, 0, 1, 3); setLayout(mainLayout); +#endif setWindowTitle(title); } diff --git a/examples/richtext/orderform/main.cpp b/examples/richtext/orderform/main.cpp index 3ad32b8e4e..a89aa76015 100644 --- a/examples/richtext/orderform/main.cpp +++ b/examples/richtext/orderform/main.cpp @@ -47,8 +47,14 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + windows.show(); +#else window.resize(640, 480); window.show(); +#endif window.createSample(); return app.exec(); } diff --git a/examples/richtext/orderform/orderform.pro b/examples/richtext/orderform/orderform.pro index 6760dad7aa..a455500bc5 100644 --- a/examples/richtext/orderform/orderform.pro +++ b/examples/richtext/orderform/orderform.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/richtext/orderform INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/richtext/richtext.pro b/examples/richtext/richtext.pro index 102181ec26..c9ed843a61 100644 --- a/examples/richtext/richtext.pro +++ b/examples/richtext/richtext.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/richtext INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/richtext/syntaxhighlighter/main.cpp b/examples/richtext/syntaxhighlighter/main.cpp index eecfb12bdc..e0e5e4f407 100644 --- a/examples/richtext/syntaxhighlighter/main.cpp +++ b/examples/richtext/syntaxhighlighter/main.cpp @@ -46,7 +46,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + window.show(); +#else window.resize(640, 512); window.show(); +#endif return app.exec(); } diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro index e981a912ad..93305ee426 100644 --- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro +++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro @@ -17,3 +17,5 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/sql/cachedtable/cachedtable.pro b/examples/sql/cachedtable/cachedtable.pro index 0b015fd0fc..a51dc951a1 100644 --- a/examples/sql/cachedtable/cachedtable.pro +++ b/examples/sql/cachedtable/cachedtable.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/sql/cachedtable INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/sql/cachedtable/main.cpp b/examples/sql/cachedtable/main.cpp index 26ddc42c54..ecbf565bab 100644 --- a/examples/sql/cachedtable/main.cpp +++ b/examples/sql/cachedtable/main.cpp @@ -51,7 +51,11 @@ int main(int argc, char *argv[]) return 1; TableEditor editor("person"); +#if defined(Q_OS_SYMBIAN) + editor.showMaximized(); +#else editor.show(); - return editor.exec(); +#endif + return app.exec(); } //! [0] diff --git a/examples/sql/cachedtable/tableeditor.cpp b/examples/sql/cachedtable/tableeditor.cpp index 216f729d6f..083e5abb82 100644 --- a/examples/sql/cachedtable/tableeditor.cpp +++ b/examples/sql/cachedtable/tableeditor.cpp @@ -45,7 +45,7 @@ //! [0] TableEditor::TableEditor(const QString &tableName, QWidget *parent) - : QDialog(parent) + : QWidget(parent) { model = new QSqlTableModel(this); model->setTable(tableName); @@ -59,6 +59,7 @@ TableEditor::TableEditor(const QString &tableName, QWidget *parent) //! [0] //! [1] QTableView *view = new QTableView; view->setModel(model); + view->resizeColumnsToContents(); //! [1] //! [2] diff --git a/examples/sql/cachedtable/tableeditor.h b/examples/sql/cachedtable/tableeditor.h index 14d9986c63..f13bd3d5bf 100644 --- a/examples/sql/cachedtable/tableeditor.h +++ b/examples/sql/cachedtable/tableeditor.h @@ -50,7 +50,7 @@ class QSqlTableModel; QT_END_NAMESPACE //! [0] -class TableEditor : public QDialog +class TableEditor : public QWidget { Q_OBJECT diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro index 6448e43d82..460d4e7243 100644 --- a/examples/sql/drilldown/drilldown.pro +++ b/examples/sql/drilldown/drilldown.pro @@ -19,3 +19,6 @@ symbian { TARGET.UID3 = 0xA000C612 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp index 3f43a5901f..351b98dd0f 100644 --- a/examples/sql/drilldown/informationwindow.cpp +++ b/examples/sql/drilldown/informationwindow.cpp @@ -96,7 +96,11 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices, locationId = id; displayedImage = imageFileEditor->currentText(); - setWindowFlags(Qt::Window); + // Commented the following line. Now the window will look like dialog and the Qt will place the QDialogBox buttons to menu area in Symbian. + // Too bad that the revert button is missing, Should the Qt place the buttons under Option menu in the menu area?! + // If the Qt::Window flag was used, the background of window is white in symbian and the QLabels can't be regognized from the background. + + //setWindowFlags(Qt::Window); enableButtons(false); setWindowTitle(tr("Office: %1").arg(locationText->text())); } diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp index e3c8fa7cce..9bfa57cbc9 100644 --- a/examples/sql/drilldown/main.cpp +++ b/examples/sql/drilldown/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) #ifndef Q_OS_SYMBIAN view.show(); #else - view.showFullScreen(); + view.showMaximized(); #endif #ifdef QT_KEYPAD_NAVIGATION QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp index 68fe06a8e2..883b28b094 100644 --- a/examples/sql/drilldown/view.cpp +++ b/examples/sql/drilldown/view.cpp @@ -62,7 +62,7 @@ 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 +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) setMinimumSize(470, 620); setMaximumSize(470, 620); #else diff --git a/examples/sql/masterdetail/main.cpp b/examples/sql/masterdetail/main.cpp index fe3dd9db50..55151ebba8 100644 --- a/examples/sql/masterdetail/main.cpp +++ b/examples/sql/masterdetail/main.cpp @@ -54,6 +54,10 @@ int main(int argc, char *argv[]) QFile *albumDetails = new QFile("albumdetails.xml"); MainWindow window("artists", "albums", albumDetails); +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/sql/masterdetail/mainwindow.cpp b/examples/sql/masterdetail/mainwindow.cpp index 24771bad09..522ee6ce02 100644 --- a/examples/sql/masterdetail/mainwindow.cpp +++ b/examples/sql/masterdetail/mainwindow.cpp @@ -77,8 +77,10 @@ MainWindow::MainWindow(const QString &artistTable, const QString &albumTable, layout->addWidget(artists, 0, 0); layout->addWidget(albums, 1, 0); layout->addWidget(details, 0, 1, 2, 1); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) layout->setColumnStretch(1, 1); layout->setColumnMinimumWidth(0, 500); +#endif QWidget *widget = new QWidget; widget->setLayout(layout); @@ -86,7 +88,9 @@ MainWindow::MainWindow(const QString &artistTable, const QString &albumTable, createMenuBar(); showImageLabel(); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) resize(850, 400); +#endif setWindowTitle(tr("Music Archive")); } diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro index 98bfac4352..68485f7a59 100644 --- a/examples/sql/masterdetail/masterdetail.pro +++ b/examples/sql/masterdetail/masterdetail.pro @@ -19,3 +19,8 @@ symbian { TARGET.UID3 = 0xA000D7CF CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/sql/querymodel/main.cpp b/examples/sql/querymodel/main.cpp index b6507e92c4..ac1a33f781 100644 --- a/examples/sql/querymodel/main.cpp +++ b/examples/sql/querymodel/main.cpp @@ -52,16 +52,23 @@ void initializeModel(QSqlQueryModel *model) model->setHeaderData(2, Qt::Horizontal, QObject::tr("Last name")); } -void createView(const QString &title, QSqlQueryModel *model) +QTableView* createView(QSqlQueryModel *model, const QString &title = "") { - static int offset = 0; - QTableView *view = new QTableView; view->setModel(model); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + Q_UNUSED(title); + view->resizeColumnsToContents(); +#else + static int offset = 0; + view->setWindowTitle(title); view->move(100 + offset, 100 + offset); offset += 20; view->show(); +#endif + + return view; } int main(int argc, char *argv[]) @@ -78,9 +85,17 @@ int main(int argc, char *argv[]) initializeModel(&editableModel); initializeModel(&customModel); - createView(QObject::tr("Plain Query Model"), &plainModel); - createView(QObject::tr("Editable Query Model"), &editableModel); - createView(QObject::tr("Custom Query Model"), &customModel); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QTabWidget *tabWidget = new QTabWidget; + tabWidget->addTab(createView(&plainModel), QObject::tr("Plain")); + tabWidget->addTab(createView(&editableModel), QObject::tr("Editable")); + tabWidget->addTab(createView(&customModel), QObject::tr("Custom")); + tabWidget->showMaximized(); +#else + createView(&plainModel, QObject::tr("Plain Query Model")); + createView(&editableModel, QObject::tr("Editable Query Model")); + createView(&customModel, QObject::tr("Custom Query Model")); +#endif return app.exec(); } diff --git a/examples/sql/querymodel/querymodel.pro b/examples/sql/querymodel/querymodel.pro index f376e126df..8b9923197f 100644 --- a/examples/sql/querymodel/querymodel.pro +++ b/examples/sql/querymodel/querymodel.pro @@ -13,3 +13,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/sql/querymodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.cpp b/examples/sql/relationaltablemodel/relationaltablemodel.cpp index ecb985e6b5..8b8ceff4d2 100644 --- a/examples/sql/relationaltablemodel/relationaltablemodel.cpp +++ b/examples/sql/relationaltablemodel/relationaltablemodel.cpp @@ -108,7 +108,11 @@ int main(int argc, char *argv[]) initializeModel(&model); QTableView *view = createView(QObject::tr("Relational Table Model"), &model); +#if defined(Q_OS_SYMBIAN) + view->showMaximized(); +#else view->show(); +#endif return app.exec(); } diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.pro b/examples/sql/relationaltablemodel/relationaltablemodel.pro index 41c1c170c4..a85bc0fbd7 100644 --- a/examples/sql/relationaltablemodel/relationaltablemodel.pro +++ b/examples/sql/relationaltablemodel/relationaltablemodel.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/sql/relationaltablemodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro index 36738fbeed..56e4f89d9b 100644 --- a/examples/sql/sql.pro +++ b/examples/sql/sql.pro @@ -18,3 +18,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/sql INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/sql/sqlwidgetmapper/main.cpp b/examples/sql/sqlwidgetmapper/main.cpp index 41e756d8ad..9e45edefac 100644 --- a/examples/sql/sqlwidgetmapper/main.cpp +++ b/examples/sql/sqlwidgetmapper/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char **argv) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro index 600531881e..65b058e5b2 100644 --- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro +++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro @@ -11,3 +11,6 @@ INSTALLS += target sources wince*: DEPLOYMENT_PLUGIN += qsqlite +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/sql/tablemodel/tablemodel.cpp b/examples/sql/tablemodel/tablemodel.cpp index 41a42bc31e..a107da07b0 100644 --- a/examples/sql/tablemodel/tablemodel.cpp +++ b/examples/sql/tablemodel/tablemodel.cpp @@ -54,11 +54,15 @@ void initializeModel(QSqlTableModel *model) model->setHeaderData(2, Qt::Horizontal, QObject::tr("Last name")); } -QTableView *createView(const QString &title, QSqlTableModel *model) +QTableView *createView(QSqlTableModel *model, const QString &title = "") { QTableView *view = new QTableView; view->setModel(model); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + Q_UNUSED(title) +#else view->setWindowTitle(title); +#endif return view; } @@ -72,12 +76,20 @@ int main(int argc, char *argv[]) initializeModel(&model); - QTableView *view1 = createView(QObject::tr("Table Model (View 1)"), &model); - QTableView *view2 = createView(QObject::tr("Table Model (View 2)"), &model); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QTabWidget *tabWidget = new QTabWidget; + tabWidget->addTab(createView(&model), "View 1"); + tabWidget->addTab(createView(&model), "View 2"); + + tabWidget->showMaximized(); +#else + QTableView *view1 = createView(&model, QObject::tr("Table Model (View 1)")); + QTableView *view2 = createView(&model, QObject::tr("Table Model (View 2)")); view1->show(); view2->move(view1->x() + view1->width() + 20, view1->y()); view2->show(); +#endif return app.exec(); } diff --git a/examples/sql/tablemodel/tablemodel.pro b/examples/sql/tablemodel/tablemodel.pro index 41280eec52..273a428f38 100644 --- a/examples/sql/tablemodel/tablemodel.pro +++ b/examples/sql/tablemodel/tablemodel.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/sql/tablemodel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro index 646c90a07d..8b77bb25a1 100644 --- a/examples/statemachine/eventtransitions/eventtransitions.pro +++ b/examples/statemachine/eventtransitions/eventtransitions.pro @@ -5,3 +5,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS eventtransitions.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/statemachine/eventtransitions/main.cpp b/examples/statemachine/eventtransitions/main.cpp index 5391057992..5c0eb8218b 100644 --- a/examples/statemachine/eventtransitions/main.cpp +++ b/examples/statemachine/eventtransitions/main.cpp @@ -48,7 +48,12 @@ public: : QWidget(parent) { QPushButton *button = new QPushButton(this); - button->setGeometry(QRect(100, 100, 100, 100)); + button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(button); + layout->setContentsMargins(80, 80, 80, 80); + setLayout(layout); //! [0] //! [1] @@ -103,7 +108,11 @@ int main(int argc, char **argv) QApplication app(argc, argv); Window window; window.resize(300, 300); +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro index 4291d43306..012e175e3b 100644 --- a/examples/statemachine/factorial/factorial.pro +++ b/examples/statemachine/factorial/factorial.pro @@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro index 9d2b17fc9e..9ee782c1de 100644 --- a/examples/statemachine/pingpong/pingpong.pro +++ b/examples/statemachine/pingpong/pingpong.pro @@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/rogue/main.cpp b/examples/statemachine/rogue/main.cpp index 71c2c69470..dc8783c67e 100644 --- a/examples/statemachine/rogue/main.cpp +++ b/examples/statemachine/rogue/main.cpp @@ -47,7 +47,11 @@ int main(int argv, char **args) QApplication app(argv, args); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h index 1153b7508d..be15e38647 100644 --- a/examples/statemachine/rogue/movementtransition.h +++ b/examples/statemachine/rogue/movementtransition.h @@ -68,7 +68,8 @@ protected: int key = keyEvent->key(); return key == Qt::Key_2 || key == Qt::Key_8 || key == Qt::Key_6 || - key == Qt::Key_4; + key == Qt::Key_4 || key == Qt::Key_Down || key == Qt::Key_Up || + key == Qt::Key_Right || key == Qt::Key_Left; } return false; } @@ -81,15 +82,19 @@ protected: int key = keyEvent->key(); switch (key) { + case Qt::Key_Left: case Qt::Key_4: window->movePlayer(Window::Left); break; + case Qt::Key_Up: case Qt::Key_8: window->movePlayer(Window::Up); break; + case Qt::Key_Right: case Qt::Key_6: window->movePlayer(Window::Right); break; + case Qt::Key_Down: case Qt::Key_2: window->movePlayer(Window::Down); break; diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro index 6ab613bea9..c4fcfe9cfe 100644 --- a/examples/statemachine/rogue/rogue.pro +++ b/examples/statemachine/rogue/rogue.pro @@ -9,3 +9,6 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/rogue INSTALLS += target sources +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/statemachine/rogue/window.cpp b/examples/statemachine/rogue/window.cpp index 39f5aa65d9..f40b7a020e 100644 --- a/examples/statemachine/rogue/window.cpp +++ b/examples/statemachine/rogue/window.cpp @@ -52,16 +52,22 @@ Window::Window() QFontDatabase database; QFont font; - if (database.families().contains("Monospace")) - font = QFont("Monospace", 12); + if (database.families().contains("Monospace")) { + font = QFont("Monospace"); + } else { foreach (QString family, database.families()) { if (database.isFixedPitch(family)) { - font = QFont(family, 12); + font = QFont(family); break; } } } +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + font.setPointSize(5); +#else + font.setPointSize(12); +#endif setFont(font); //![1] diff --git a/examples/statemachine/rogue/window.h b/examples/statemachine/rogue/window.h index 025ec79600..bdadad463d 100644 --- a/examples/statemachine/rogue/window.h +++ b/examples/statemachine/rogue/window.h @@ -49,8 +49,13 @@ class QStateMachine; class QTransition; QT_END_NAMESPACE +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) +#define WIDTH 43 +#define HEIGHT 14 +#else #define WIDTH 35 #define HEIGHT 20 +#endif //![0] class Window : public QWidget diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp index 23cd34833a..c20e05926f 100644 --- a/examples/statemachine/trafficlight/main.cpp +++ b/examples/statemachine/trafficlight/main.cpp @@ -88,6 +88,9 @@ public: : QWidget(parent) { QVBoxLayout *vbox = new QVBoxLayout(this); +#ifdef Q_WS_MAEMO_5 + vbox->setContentsMargins(320, 0, 320, 0); +#endif m_red = new LightWidget(Qt::red); vbox->addWidget(m_red); m_yellow = new LightWidget(Qt::yellow); @@ -174,8 +177,14 @@ int main(int argc, char **argv) QApplication app(argc, argv); TrafficLight widget; +#if defined(Q_OS_SYMBIAN) + widget.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + widget.show(); +#else widget.resize(110, 300); widget.show(); +#endif return app.exec(); } diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro index f6aab8d6e5..4b77bcb8e9 100644 --- a/examples/statemachine/trafficlight/trafficlight.pro +++ b/examples/statemachine/trafficlight/trafficlight.pro @@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS trafficlight.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/statemachine/twowaybutton/main.cpp b/examples/statemachine/twowaybutton/main.cpp index 6b9ce1fe55..47343ce494 100644 --- a/examples/statemachine/twowaybutton/main.cpp +++ b/examples/statemachine/twowaybutton/main.cpp @@ -74,8 +74,14 @@ int main(int argc, char **argv) //! [4] //! [5] +#if defined(Q_OS_SYMBIAN) + button.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + button.show(); +#else button.resize(100, 50); button.show(); +#endif return app.exec(); } //! [5] diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro index 212ba501d7..d9d8941750 100644 --- a/examples/statemachine/twowaybutton/twowaybutton.pro +++ b/examples/statemachine/twowaybutton/twowaybutton.pro @@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS twowaybutton.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/threads/mandelbrot/main.cpp b/examples/threads/mandelbrot/main.cpp index 610534d4a3..5211c2051c 100644 --- a/examples/threads/mandelbrot/main.cpp +++ b/examples/threads/mandelbrot/main.cpp @@ -47,7 +47,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MandelbrotWidget widget; +#if defined(Q_WS_S60) + widget.showMaximized(); +#else widget.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro index fe72cd58a7..d0fb4993af 100644 --- a/examples/threads/mandelbrot/mandelbrot.pro +++ b/examples/threads/mandelbrot/mandelbrot.pro @@ -13,3 +13,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/mandelbrot INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/threads/mandelbrot/mandelbrotwidget.cpp b/examples/threads/mandelbrot/mandelbrotwidget.cpp index 8dc1f5d811..47eb473425 100644 --- a/examples/threads/mandelbrot/mandelbrotwidget.cpp +++ b/examples/threads/mandelbrot/mandelbrotwidget.cpp @@ -44,6 +44,7 @@ #include "mandelbrotwidget.h" + //! [0] const double DefaultCenterX = -0.637011f; const double DefaultCenterY = -0.0395159f; @@ -72,6 +73,21 @@ MandelbrotWidget::MandelbrotWidget(QWidget *parent) setCursor(Qt::CrossCursor); #endif resize(550, 400); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + ZoomButton *zoomIn = new ZoomButton(tr("Zoom In"), ZoomInFactor, this); + ZoomButton *zoomOut = new ZoomButton(tr("Zoom Out"), ZoomOutFactor, this); + + QGridLayout *layout = new QGridLayout(this); + layout->addWidget(zoomIn, 0, 1); + layout->addWidget(zoomOut, 1, 1); + layout->setColumnStretch(0, 10); + layout->setRowStretch(2, 10); + setLayout(layout); + + connect(zoomIn, SIGNAL(zoom(double)), this, SLOT(zoom(double))); + connect(zoomOut, SIGNAL(zoom(double)), this, SLOT(zoom(double))); +#endif } //! [1] @@ -113,6 +129,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */) } //! [8] //! [9] +#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) QString text = tr("Use mouse wheel or the '+' and '-' keys to zoom. " "Press and hold left mouse button to scroll."); QFontMetrics metrics = painter.fontMetrics(); @@ -125,6 +142,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */) painter.setPen(Qt::white); painter.drawText((width() - textWidth) / 2, metrics.leading() + metrics.ascent(), text); +#endif } //! [9] diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h index 5af3a8dffd..53bbeb6469 100644 --- a/examples/threads/mandelbrot/mandelbrotwidget.h +++ b/examples/threads/mandelbrot/mandelbrotwidget.h @@ -43,9 +43,35 @@ #include #include - #include "renderthread.h" +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) +#include + +class ZoomButton : public QPushButton +{ + Q_OBJECT +public: + ZoomButton(const QString &text, double zoomFactor, QWidget *parent = NULL) + : QPushButton(text, parent), m_ZoomFactor(zoomFactor) + { + connect(this, SIGNAL(clicked()), this, SLOT(handleClick())); + } + +signals: + void zoom(double zoomFactor); + +private slots: + void handleClick() + { + emit zoom(m_ZoomFactor); + } + +private: + const double m_ZoomFactor; +}; +#endif + //! [0] class MandelbrotWidget : public QWidget { @@ -65,9 +91,9 @@ protected: private slots: void updatePixmap(const QImage &image, double scaleFactor); + void zoom(double zoomFactor); private: - void zoom(double zoomFactor); void scroll(int deltaX, int deltaY); RenderThread thread; diff --git a/examples/threads/queuedcustomtype/main.cpp b/examples/threads/queuedcustomtype/main.cpp index d70a88a095..356352a326 100644 --- a/examples/threads/queuedcustomtype/main.cpp +++ b/examples/threads/queuedcustomtype/main.cpp @@ -119,7 +119,11 @@ int main(int argc, char *argv[]) qsrand(QTime::currentTime().elapsed()); Window window; +#if defined(Q_WS_S60) + window.showMaximized(); +#else window.show(); +#endif window.loadImage(createImage(256, 256)); //! [main finish] diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.pro b/examples/threads/queuedcustomtype/queuedcustomtype.pro index 6f39121df7..9c9357892e 100644 --- a/examples/threads/queuedcustomtype/queuedcustomtype.pro +++ b/examples/threads/queuedcustomtype/queuedcustomtype.pro @@ -5,3 +5,13 @@ SOURCES = main.cpp \ block.cpp \ renderthread.cpp \ window.cpp + +# 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/threads/semaphores/semaphores.cpp b/examples/threads/semaphores/semaphores.cpp index 88630def09..3632895c61 100644 --- a/examples/threads/semaphores/semaphores.cpp +++ b/examples/threads/semaphores/semaphores.cpp @@ -38,13 +38,18 @@ ** ****************************************************************************/ -#include +#include #include #include //! [0] +#ifdef Q_WS_S60 +const int DataSize = 300; +#else const int DataSize = 100000; +#endif + const int BufferSize = 8192; char buffer[BufferSize]; @@ -57,43 +62,70 @@ class Producer : public QThread //! [1] //! [2] { public: - void run(); -}; - -void Producer::run() -{ - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - for (int i = 0; i < DataSize; ++i) { - freeBytes.acquire(); - buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4]; - usedBytes.release(); + void run() + { + qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); + for (int i = 0; i < DataSize; ++i) { + freeBytes.acquire(); + buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4]; + usedBytes.release(); + } } -} +}; //! [2] //! [3] class Consumer : public QThread //! [3] //! [4] { + Q_OBJECT public: - void run(); -}; - -void Consumer::run() -{ - for (int i = 0; i < DataSize; ++i) { - usedBytes.acquire(); - fprintf(stderr, "%c", buffer[i % BufferSize]); - freeBytes.release(); + void run() + { + for (int i = 0; i < DataSize; ++i) { + usedBytes.acquire(); + #ifdef Q_WS_S60 + QString text(buffer[i % BufferSize]); + freeBytes.release(); + emit stringConsumed(text); + #else + fprintf(stderr, "%c", buffer[i % BufferSize]); + freeBytes.release(); + #endif + } + fprintf(stderr, "\n"); } - fprintf(stderr, "\n"); -} + +signals: + void stringConsumed(const QString &text); + +protected: + bool finish; +}; //! [4] //! [5] int main(int argc, char *argv[]) //! [5] //! [6] { +#ifdef Q_WS_S60 + // Self made console for Symbian + QApplication app(argc, argv); + QPlainTextEdit console; + console.setReadOnly(true); + console.setTextInteractionFlags(Qt::NoTextInteraction); + console.showMaximized(); + + Producer producer; + Consumer consumer; + + QObject::connect(&consumer, SIGNAL(stringConsumed(const QString&)), &console, SLOT(insertPlainText(QString)), Qt::BlockingQueuedConnection); + + producer.start(); + consumer.start(); + + app.exec(); +#else QCoreApplication app(argc, argv); Producer producer; Consumer consumer; @@ -102,5 +134,8 @@ int main(int argc, char *argv[]) producer.wait(); consumer.wait(); return 0; +#endif } //! [6] + +#include "semaphores.moc" diff --git a/examples/threads/semaphores/semaphores.pro b/examples/threads/semaphores/semaphores.pro index 185a051986..96ab3a525f 100644 --- a/examples/threads/semaphores/semaphores.pro +++ b/examples/threads/semaphores/semaphores.pro @@ -1,5 +1,6 @@ SOURCES += semaphores.cpp -QT = core +QT = core gui + CONFIG -= app_bundle CONFIG += console @@ -10,3 +11,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/semaphores INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro index fd62ccec11..7b5eec6851 100644 --- a/examples/threads/threads.pro +++ b/examples/threads/threads.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/threads/waitconditions/waitconditions.cpp b/examples/threads/waitconditions/waitconditions.cpp index 5c8cb7149f..0063db5b91 100644 --- a/examples/threads/waitconditions/waitconditions.cpp +++ b/examples/threads/waitconditions/waitconditions.cpp @@ -38,13 +38,18 @@ ** ****************************************************************************/ -#include +#include #include #include //! [0] +#ifdef Q_WS_S60 +const int DataSize = 300; +#else const int DataSize = 100000; +#endif + const int BufferSize = 8192; char buffer[BufferSize]; @@ -59,60 +64,110 @@ class Producer : public QThread //! [1] //! [2] { public: - void run(); -}; + Producer(QObject *parent = NULL) : QThread(parent) + { + } -void Producer::run() -{ - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - - for (int i = 0; i < DataSize; ++i) { - mutex.lock(); - if (numUsedBytes == BufferSize) - bufferNotFull.wait(&mutex); - mutex.unlock(); - - buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4]; - - mutex.lock(); - ++numUsedBytes; - bufferNotEmpty.wakeAll(); - mutex.unlock(); + void run() + { + qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); + + for (int i = 0; i < DataSize; ++i) { + mutex.lock(); + if (numUsedBytes == BufferSize) + bufferNotFull.wait(&mutex); + mutex.unlock(); + + buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4]; + + mutex.lock(); + ++numUsedBytes; + bufferNotEmpty.wakeAll(); + mutex.unlock(); + } } -} +}; //! [2] //! [3] class Consumer : public QThread //! [3] //! [4] { + Q_OBJECT public: - void run(); + Consumer(QObject *parent = NULL) : QThread(parent) + { + } + + void run() + { + for (int i = 0; i < DataSize; ++i) { + mutex.lock(); + if (numUsedBytes == 0) + bufferNotEmpty.wait(&mutex); + mutex.unlock(); + + #ifdef Q_WS_S60 + emit stringConsumed(QString(buffer[i % BufferSize])); + #else + fprintf(stderr, "%c", buffer[i % BufferSize]); + #endif + + mutex.lock(); + --numUsedBytes; + bufferNotFull.wakeAll(); + mutex.unlock(); + } + fprintf(stderr, "\n"); + } + +signals: + void stringConsumed(const QString &text); }; +//! [4] -void Consumer::run() +#ifdef Q_WS_S60 +class PlainTextEdit : public QPlainTextEdit { - for (int i = 0; i < DataSize; ++i) { - mutex.lock(); - if (numUsedBytes == 0) - bufferNotEmpty.wait(&mutex); - mutex.unlock(); - - fprintf(stderr, "%c", buffer[i % BufferSize]); - - mutex.lock(); - --numUsedBytes; - bufferNotFull.wakeAll(); - mutex.unlock(); + Q_OBJECT +public: + PlainTextEdit(QWidget *parent = NULL) : QPlainTextEdit(parent), producer(NULL), consumer(NULL) + { + setTextInteractionFlags(Qt::NoTextInteraction); + + producer = new Producer(this); + consumer = new Consumer(this); + + QObject::connect(consumer, SIGNAL(stringConsumed(const QString &)), SLOT(insertPlainText(const QString &)), Qt::BlockingQueuedConnection); + + QTimer::singleShot(0, this, SLOT(startThreads())); } - fprintf(stderr, "\n"); -} -//! [4] + +protected: + Producer *producer; + Consumer *consumer; + +protected slots: + void startThreads() + { + producer->start(); + consumer->start(); + } +}; +#endif //! [5] int main(int argc, char *argv[]) //! [5] //! [6] { +#ifdef Q_WS_S60 + QApplication app(argc, argv); + + PlainTextEdit console; + console.showMaximized(); + + return app.exec(); +#else QCoreApplication app(argc, argv); Producer producer; Consumer consumer; @@ -121,5 +176,8 @@ int main(int argc, char *argv[]) producer.wait(); consumer.wait(); return 0; +#endif } //! [6] + +#include "waitconditions.moc" diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro index 53350d2dae..e326afa081 100644 --- a/examples/threads/waitconditions/waitconditions.pro +++ b/examples/threads/waitconditions/waitconditions.pro @@ -3,8 +3,8 @@ ###################################################################### TEMPLATE = app +QT = core gui CONFIG -= moc app_bundle -QT -= gui DEPENDPATH += . INCLUDEPATH += . @@ -19,3 +19,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/codecs/codecs.pro b/examples/tools/codecs/codecs.pro index 2403fc8506..2e2c9031ed 100644 --- a/examples/tools/codecs/codecs.pro +++ b/examples/tools/codecs/codecs.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/codecs INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro index 3db4484662..fd288f3b16 100644 --- a/examples/tools/completer/completer.pro +++ b/examples/tools/completer/completer.pro @@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/completer INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/contiguouscache/contiguouscache.pro b/examples/tools/contiguouscache/contiguouscache.pro index 45166d380e..0cf58ea5fe 100644 --- a/examples/tools/contiguouscache/contiguouscache.pro +++ b/examples/tools/contiguouscache/contiguouscache.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/contiguouscache sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS contiguouscache.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/contiguouscache INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/customcompleter/customcompleter.pro b/examples/tools/customcompleter/customcompleter.pro index 3b0874cbdc..b28272e2a7 100644 --- a/examples/tools/customcompleter/customcompleter.pro +++ b/examples/tools/customcompleter/customcompleter.pro @@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/customcompleter INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/customtype/customtype.pro b/examples/tools/customtype/customtype.pro index 3079964946..0871151237 100644 --- a/examples/tools/customtype/customtype.pro +++ b/examples/tools/customtype/customtype.pro @@ -1,3 +1,16 @@ HEADERS = message.h SOURCES = main.cpp \ message.cpp + +# install +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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/customtypesending/customtypesending.pro b/examples/tools/customtypesending/customtypesending.pro index b8b2aaf5fe..0ad9aaaea8 100644 --- a/examples/tools/customtypesending/customtypesending.pro +++ b/examples/tools/customtypesending/customtypesending.pro @@ -3,3 +3,16 @@ HEADERS = message.h \ SOURCES = main.cpp \ message.cpp \ window.cpp + +# install +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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/echoplugin/echoplugin.pro b/examples/tools/echoplugin/echoplugin.pro index 164dcadcf5..c59f17d782 100644 --- a/examples/tools/echoplugin/echoplugin.pro +++ b/examples/tools/echoplugin/echoplugin.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/echoplugin INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/echoplugin/echowindow/echowindow.pro b/examples/tools/echoplugin/echowindow/echowindow.pro index c1b65bfec7..c2e9a31ec7 100644 --- a/examples/tools/echoplugin/echowindow/echowindow.pro +++ b/examples/tools/echoplugin/echowindow/echowindow.pro @@ -19,3 +19,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/echoplugin/echowindow INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/echoplugin/plugin/plugin.pro b/examples/tools/echoplugin/plugin/plugin.pro index 617c1dd58f..76bfebeafa 100644 --- a/examples/tools/echoplugin/plugin/plugin.pro +++ b/examples/tools/echoplugin/plugin/plugin.pro @@ -14,6 +14,12 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/echoplugin/plugin INSTALLS += target sources -symbian: CONFIG += qt_example +symbian { + CONFIG += qt_example + TARGET.EPOCALLOWDLLDATA = 1 +} -symbian:TARGET.EPOCALLOWDLLDATA = 1 +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/i18n/i18n.pro b/examples/tools/i18n/i18n.pro index c68620a989..366bc4c327 100644 --- a/examples/tools/i18n/i18n.pro +++ b/examples/tools/i18n/i18n.pro @@ -26,3 +26,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/i18n INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/inputpanel/inputpanel.pro b/examples/tools/inputpanel/inputpanel.pro index e8582a9ea0..f51dad41ba 100644 --- a/examples/tools/inputpanel/inputpanel.pro +++ b/examples/tools/inputpanel/inputpanel.pro @@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/inputpanel INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/plugandpaint/plugandpaint.pro b/examples/tools/plugandpaint/plugandpaint.pro index 8b91053230..e2966de5a3 100644 --- a/examples/tools/plugandpaint/plugandpaint.pro +++ b/examples/tools/plugandpaint/plugandpaint.pro @@ -26,3 +26,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/plugandpaint INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.pro b/examples/tools/plugandpaintplugins/basictools/basictools.pro index 26a3f98bce..7289522cbe 100644 --- a/examples/tools/plugandpaintplugins/basictools/basictools.pro +++ b/examples/tools/plugandpaintplugins/basictools/basictools.pro @@ -15,3 +15,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/plugandpaintplugins/basictoo INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro index a9dc116bc5..cc66b57ec7 100644 --- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro +++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro @@ -17,3 +17,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro index 857b62e88e..eda965fe95 100644 --- a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro +++ b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/plugandpaintplugins INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/regexp/regexp.pro b/examples/tools/regexp/regexp.pro index 66904809f9..0e84510305 100644 --- a/examples/tools/regexp/regexp.pro +++ b/examples/tools/regexp/regexp.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/regexp INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/settingseditor/settingseditor.pro b/examples/tools/settingseditor/settingseditor.pro index 140e59f6ac..ca9e2cae19 100644 --- a/examples/tools/settingseditor/settingseditor.pro +++ b/examples/tools/settingseditor/settingseditor.pro @@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/settingseditor INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro index 319a2be15b..2484ee64ef 100644 --- a/examples/tools/styleplugin/plugin/plugin.pro +++ b/examples/tools/styleplugin/plugin/plugin.pro @@ -23,3 +23,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/tools/styleplugin/styleplugin.pro b/examples/tools/styleplugin/styleplugin.pro index 69935f666e..90a36b8c50 100644 --- a/examples/tools/styleplugin/styleplugin.pro +++ b/examples/tools/styleplugin/styleplugin.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/styleplugin INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/styleplugin/stylewindow/stylewindow.pro b/examples/tools/styleplugin/stylewindow/stylewindow.pro index 6d6d9f5049..556bc1de75 100644 --- a/examples/tools/styleplugin/stylewindow/stylewindow.pro +++ b/examples/tools/styleplugin/stylewindow/stylewindow.pro @@ -17,3 +17,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/styleplugin/stylewindow INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/tools.pro b/examples/tools/tools.pro index 4b8c896484..5335b7fe6a 100644 --- a/examples/tools/tools.pro +++ b/examples/tools/tools.pro @@ -24,3 +24,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/treemodelcompleter/treemodelcompleter.pro b/examples/tools/treemodelcompleter/treemodelcompleter.pro index 11f59085e3..fbb4d7cfd7 100644 --- a/examples/tools/treemodelcompleter/treemodelcompleter.pro +++ b/examples/tools/treemodelcompleter/treemodelcompleter.pro @@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/treemodelcompleter INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tools/undoframework/undoframework.pro b/examples/tools/undoframework/undoframework.pro index ce11d353ad..f8f127c8ce 100644 --- a/examples/tools/undoframework/undoframework.pro +++ b/examples/tools/undoframework/undoframework.pro @@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/undoframework INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro index 7f8ec9b616..31f0bf4c3f 100644 --- a/examples/touch/dials/dials.pro +++ b/examples/touch/dials/dials.pro @@ -6,3 +6,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/dials sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dials.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/dials INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro index 21e4294cf8..550fc53758 100644 --- a/examples/touch/fingerpaint/fingerpaint.pro +++ b/examples/touch/fingerpaint/fingerpaint.pro @@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/fingerpaint sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fingerpaint.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/fingerpaint INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro index c1caa98dfd..a28345d91a 100644 --- a/examples/touch/knobs/knobs.pro +++ b/examples/touch/knobs/knobs.pro @@ -6,3 +6,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/knobs sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS knobs.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/knobs INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro index e6864237e3..f7fd695d0f 100644 --- a/examples/touch/pinchzoom/pinchzoom.pro +++ b/examples/touch/pinchzoom/pinchzoom.pro @@ -14,3 +14,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/pinchzoom sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pinchzoom.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/pinchzoom INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/addressbook-fr.pro b/examples/tutorials/addressbook-fr/addressbook-fr.pro index ba945e24d6..279998b5ad 100644 --- a/examples/tutorials/addressbook-fr/addressbook-fr.pro +++ b/examples/tutorials/addressbook-fr/addressbook-fr.pro @@ -6,3 +6,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook-fr sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS addressbook-fr.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook-fr INSTALLS += target sources + diff --git a/examples/tutorials/addressbook-fr/part1/part1.pro b/examples/tutorials/addressbook-fr/part1/part1.pro index c22df740f4..d762870a2b 100644 --- a/examples/tutorials/addressbook-fr/part1/part1.pro +++ b/examples/tutorials/addressbook-fr/part1/part1.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part1 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part1 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part2/part2.pro b/examples/tutorials/addressbook-fr/part2/part2.pro index a0a53e6e6c..7ffe1db5d9 100644 --- a/examples/tutorials/addressbook-fr/part2/part2.pro +++ b/examples/tutorials/addressbook-fr/part2/part2.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part2 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part2 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part3/part3.pro b/examples/tutorials/addressbook-fr/part3/part3.pro index 0e28296c5d..713afdae59 100644 --- a/examples/tutorials/addressbook-fr/part3/part3.pro +++ b/examples/tutorials/addressbook-fr/part3/part3.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part3 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part3.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part3 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part4/part4.pro b/examples/tutorials/addressbook-fr/part4/part4.pro index 31458a79b9..1bfc4dc583 100644 --- a/examples/tutorials/addressbook-fr/part4/part4.pro +++ b/examples/tutorials/addressbook-fr/part4/part4.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part4 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part4.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part4 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part5/part5.pro b/examples/tutorials/addressbook-fr/part5/part5.pro index 0899fdd90a..08a5f7db12 100644 --- a/examples/tutorials/addressbook-fr/part5/part5.pro +++ b/examples/tutorials/addressbook-fr/part5/part5.pro @@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part5 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part5.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part5 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part6/part6.pro b/examples/tutorials/addressbook-fr/part6/part6.pro index df161f44fa..3bf1987d6f 100644 --- a/examples/tutorials/addressbook-fr/part6/part6.pro +++ b/examples/tutorials/addressbook-fr/part6/part6.pro @@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part6 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part6.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part6 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook-fr/part7/part7.pro b/examples/tutorials/addressbook-fr/part7/part7.pro index 22f4435559..337b598f75 100644 --- a/examples/tutorials/addressbook-fr/part7/part7.pro +++ b/examples/tutorials/addressbook-fr/part7/part7.pro @@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part7 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part7.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part7 INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/addressbook.pro b/examples/tutorials/addressbook/addressbook.pro index 575f5cb518..e549844be6 100644 --- a/examples/tutorials/addressbook/addressbook.pro +++ b/examples/tutorials/addressbook/addressbook.pro @@ -8,3 +8,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tutorials/addressbook/part1/part1.pro b/examples/tutorials/addressbook/part1/part1.pro index b392ee06c9..1b1bd7b0f4 100644 --- a/examples/tutorials/addressbook/part1/part1.pro +++ b/examples/tutorials/addressbook/part1/part1.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part1 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part2/part2.pro b/examples/tutorials/addressbook/part2/part2.pro index 8dbf7f21f5..204cc2db58 100644 --- a/examples/tutorials/addressbook/part2/part2.pro +++ b/examples/tutorials/addressbook/part2/part2.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part2 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part3/part3.pro b/examples/tutorials/addressbook/part3/part3.pro index 7ab6731a0a..10193b8b30 100644 --- a/examples/tutorials/addressbook/part3/part3.pro +++ b/examples/tutorials/addressbook/part3/part3.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part3 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part4/part4.pro b/examples/tutorials/addressbook/part4/part4.pro index 8dbba2e982..82765821c6 100644 --- a/examples/tutorials/addressbook/part4/part4.pro +++ b/examples/tutorials/addressbook/part4/part4.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part4 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part5/part5.pro b/examples/tutorials/addressbook/part5/part5.pro index 134a7e0461..efb36fa907 100644 --- a/examples/tutorials/addressbook/part5/part5.pro +++ b/examples/tutorials/addressbook/part5/part5.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part5 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part6/part6.pro b/examples/tutorials/addressbook/part6/part6.pro index 42401bd515..4ece4d7280 100644 --- a/examples/tutorials/addressbook/part6/part6.pro +++ b/examples/tutorials/addressbook/part6/part6.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part6 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/addressbook/part7/part7.pro b/examples/tutorials/addressbook/part7/part7.pro index ffa94448ee..9ba980755b 100644 --- a/examples/tutorials/addressbook/part7/part7.pro +++ b/examples/tutorials/addressbook/part7/part7.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part7 INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro index 102bad59e6..e99956a140 100755 --- a/examples/tutorials/modelview/1_readonly/1_readonly.pro +++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro @@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/1_readonly INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro index f7a950a4fd..c6416dc415 100755 --- a/examples/tutorials/modelview/2_formatting/2_formatting.pro +++ b/examples/tutorials/modelview/2_formatting/2_formatting.pro @@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/2_formatting INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro index d1f8971aaa..e5a61fca0f 100755 --- a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro +++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro @@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/3_changingmode INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro index 2a8b2dbbfa..16f907dc4b 100755 --- a/examples/tutorials/modelview/4_headers/4_headers.pro +++ b/examples/tutorials/modelview/4_headers/4_headers.pro @@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/4_headers INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro index f8d725d5c0..fadd0e2921 100755 --- a/examples/tutorials/modelview/5_edit/5_edit.pro +++ b/examples/tutorials/modelview/5_edit/5_edit.pro @@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/5_edit INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro index 56b00aa81b..94f301aeae 100755 --- a/examples/tutorials/modelview/6_treeview/6_treeview.pro +++ b/examples/tutorials/modelview/6_treeview/6_treeview.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/6_treeview INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro index 5dd65ad6e5..bbac7abc0a 100755 --- a/examples/tutorials/modelview/7_selections/7_selections.pro +++ b/examples/tutorials/modelview/7_selections/7_selections.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview/7_selections INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/modelview/modelview.pro b/examples/tutorials/modelview/modelview.pro index 853edfba6e..3dc4bcc01b 100755 --- a/examples/tutorials/modelview/modelview.pro +++ b/examples/tutorials/modelview/modelview.pro @@ -14,3 +14,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/modelview INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tutorials/widgets/childwidget/childwidget.pro b/examples/tutorials/widgets/childwidget/childwidget.pro index ea319ad282..2251d1b131 100644 --- a/examples/tutorials/widgets/childwidget/childwidget.pro +++ b/examples/tutorials/widgets/childwidget/childwidget.pro @@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/childwidget sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS childwidget.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/childwidget INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro index cb27f9ecc4..0dd6bf1e42 100644 --- a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro +++ b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro @@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/nestedlayouts sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS nestedlayouts.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/nestedlayouts INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/widgets/toplevel/toplevel.pro b/examples/tutorials/widgets/toplevel/toplevel.pro index b83ccfaf70..629bdefe32 100644 --- a/examples/tutorials/widgets/toplevel/toplevel.pro +++ b/examples/tutorials/widgets/toplevel/toplevel.pro @@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/toplevel sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS toplevel.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/toplevel INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/tutorials/widgets/windowlayout/windowlayout.pro b/examples/tutorials/widgets/windowlayout/windowlayout.pro index f8b55ba214..1878433b8d 100644 --- a/examples/tutorials/widgets/windowlayout/windowlayout.pro +++ b/examples/tutorials/widgets/windowlayout/windowlayout.pro @@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/windowlayout sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowlayout.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/windowlayout INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/uitools/multipleinheritance/main.cpp b/examples/uitools/multipleinheritance/main.cpp index f61c92c1c4..56ba8efe53 100644 --- a/examples/uitools/multipleinheritance/main.cpp +++ b/examples/uitools/multipleinheritance/main.cpp @@ -46,7 +46,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); CalculatorForm calculator; +#if defined(Q_OS_SYMBIAN) + calculator.showMaximized(); +#else calculator.show(); +#endif return app.exec(); } //! [0] diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro index 83b4a1331e..3debb7bd60 100644 --- a/examples/uitools/multipleinheritance/multipleinheritance.pro +++ b/examples/uitools/multipleinheritance/multipleinheritance.pro @@ -14,3 +14,5 @@ symbian { TARGET.UID3 = 0xA000D7C1 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/uitools/textfinder/textfinder.pro b/examples/uitools/textfinder/textfinder.pro index 9604ceac9e..73a9f5ea1e 100644 --- a/examples/uitools/textfinder/textfinder.pro +++ b/examples/uitools/textfinder/textfinder.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools/textfinder INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro index 7b11c98e7f..8a99f61855 100644 --- a/examples/uitools/uitools.pro +++ b/examples/uitools/uitools.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro index 77f4b7fd83..c9545c897e 100644 --- a/examples/widgets/analogclock/analogclock.pro +++ b/examples/widgets/analogclock/analogclock.pro @@ -12,3 +12,5 @@ symbian { TARGET.UID3 = 0xA000A64F CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/widgets/analogclock/main.cpp b/examples/widgets/analogclock/main.cpp index 0f31f07573..040fbb0265 100644 --- a/examples/widgets/analogclock/main.cpp +++ b/examples/widgets/analogclock/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); AnalogClock clock; +#if defined(Q_OS_SYMBIAN) + clock.showMaximized(); +#else clock.show(); +#endif return app.exec(); } diff --git a/examples/widgets/calculator/calculator.cpp b/examples/widgets/calculator/calculator.cpp index 991ffc3efc..3fbdf03b9a 100644 --- a/examples/widgets/calculator/calculator.cpp +++ b/examples/widgets/calculator/calculator.cpp @@ -47,7 +47,7 @@ //! [0] Calculator::Calculator(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { sumInMemory = 0.0; sumSoFar = 0.0; @@ -98,8 +98,11 @@ Calculator::Calculator(QWidget *parent) //! [5] QGridLayout *mainLayout = new QGridLayout; //! [5] //! [6] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); +#else mainLayout->setSizeConstraint(QLayout::SetFixedSize); - +#endif mainLayout->addWidget(display, 0, 0, 1, 6); mainLayout->addWidget(backspaceButton, 1, 0, 1, 2); mainLayout->addWidget(clearButton, 1, 2, 1, 2); diff --git a/examples/widgets/calculator/calculator.h b/examples/widgets/calculator/calculator.h index e1221f4f70..3548b85625 100644 --- a/examples/widgets/calculator/calculator.h +++ b/examples/widgets/calculator/calculator.h @@ -41,7 +41,7 @@ #ifndef CALCULATOR_H #define CALCULATOR_H -#include +#include QT_BEGIN_NAMESPACE class QLineEdit; @@ -49,7 +49,7 @@ QT_END_NAMESPACE class Button; //! [0] -class Calculator : public QDialog +class Calculator : public QWidget { Q_OBJECT diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro index d6bda73629..4c10e845f3 100644 --- a/examples/widgets/calculator/calculator.pro +++ b/examples/widgets/calculator/calculator.pro @@ -14,3 +14,5 @@ symbian { TARGET.UID3 = 0xA000C602 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/widgets/calculator/main.cpp b/examples/widgets/calculator/main.cpp index 0038aa10dd..3974f801b1 100644 --- a/examples/widgets/calculator/main.cpp +++ b/examples/widgets/calculator/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Calculator calc; +#if defined(Q_OS_SYMBIAN) + calc.showMaximized(); +#else calc.show(); +#endif return app.exec(); } diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro index cce3fb5161..e0845fe0f2 100644 --- a/examples/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/calendarwidget/calendarwidget.pro @@ -12,3 +12,8 @@ symbian { TARGET.UID3 = 0xA000C603 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro index 8356321413..20a54dd36d 100644 --- a/examples/widgets/charactermap/charactermap.pro +++ b/examples/widgets/charactermap/charactermap.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/charactermap INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/codeeditor/codeeditor.pro b/examples/widgets/codeeditor/codeeditor.pro index 2e15d86a8d..8fffb279af 100644 --- a/examples/widgets/codeeditor/codeeditor.pro +++ b/examples/widgets/codeeditor/codeeditor.pro @@ -7,3 +7,8 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/codeeditor INSTALLS += target sources +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/codeeditor/main.cpp b/examples/widgets/codeeditor/main.cpp index a2a81a1a85..cd87ac9ec0 100644 --- a/examples/widgets/codeeditor/main.cpp +++ b/examples/widgets/codeeditor/main.cpp @@ -48,7 +48,11 @@ int main(int argv, char **args) CodeEditor editor; editor.setWindowTitle(QObject::tr("Code Editor Example")); +#if defined(Q_OS_SYMBIAN) + editor.showMaximized(); +#else editor.show(); +#endif return app.exec(); } diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro index ae90686529..62346cde8b 100644 --- a/examples/widgets/digitalclock/digitalclock.pro +++ b/examples/widgets/digitalclock/digitalclock.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/digitalclock INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/widgets/digitalclock/main.cpp b/examples/widgets/digitalclock/main.cpp index c43162bade..d022918b2c 100644 --- a/examples/widgets/digitalclock/main.cpp +++ b/examples/widgets/digitalclock/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); DigitalClock clock; +#if defined(Q_OS_SYMBIAN) + clock.showMaximized(); +#else clock.show(); +#endif return app.exec(); } diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro index 48056a3f3b..92f9d461af 100644 --- a/examples/widgets/groupbox/groupbox.pro +++ b/examples/widgets/groupbox/groupbox.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/groupbox INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/groupbox/main.cpp b/examples/widgets/groupbox/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/widgets/groupbox/main.cpp +++ b/examples/widgets/groupbox/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index b355dc75d0..71c73d6fc3 100644 --- a/examples/widgets/icons/icons.pro +++ b/examples/widgets/icons/icons.pro @@ -25,3 +25,8 @@ wince*: { } DEPLOYMENT += imageFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/icons/main.cpp b/examples/widgets/icons/main.cpp index 923c1f8514..c1ba2bda40 100644 --- a/examples/widgets/icons/main.cpp +++ b/examples/widgets/icons/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mainWin; +#if defined(Q_OS_SYMBIAN) + mainWin.showMaximized(); +#else mainWin.show(); +#endif return app.exec(); } diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro index 1c0ac78115..63dd4f0f11 100644 --- a/examples/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/imageviewer/imageviewer.pro @@ -10,6 +10,14 @@ INSTALLS += target sources symbian: CONFIG += qt_example +#Symbian has built-in component named imageviewer so we use different target +symbian: TARGET = imageviewerexample + wince*: { DEPLOYMENT_PLUGIN += qjpeg qmng qgif } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/imageviewer/main.cpp b/examples/widgets/imageviewer/main.cpp index 55a362a622..8d1a068c5a 100644 --- a/examples/widgets/imageviewer/main.cpp +++ b/examples/widgets/imageviewer/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); ImageViewer imageViewer; +#if defined(Q_OS_SYMBIAN) + imageViewer.showMaximized(); +#else imageViewer.show(); +#endif return app.exec(); } diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro index b568aac164..d463c506ac 100644 --- a/examples/widgets/lineedits/lineedits.pro +++ b/examples/widgets/lineedits/lineedits.pro @@ -12,3 +12,8 @@ symbian { TARGET.UID3 = 0xA000C604 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/lineedits/main.cpp b/examples/widgets/lineedits/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/widgets/lineedits/main.cpp +++ b/examples/widgets/lineedits/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/movie/main.cpp b/examples/widgets/movie/main.cpp index 3863234936..b9a1c69914 100644 --- a/examples/widgets/movie/main.cpp +++ b/examples/widgets/movie/main.cpp @@ -47,5 +47,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MoviePlayer player; player.show(); +#if defined(Q_OS_SYMBIAN) + player.showMaximized(); +#else + player.show(); +#endif return app.exec(); } diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index f41bbbbe03..874fb773b4 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -17,3 +17,8 @@ wince*: { DEPLOYMENT_PLUGIN += qmng } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/scribble/main.cpp b/examples/widgets/scribble/main.cpp index 01c8adae53..dffe80348a 100644 --- a/examples/widgets/scribble/main.cpp +++ b/examples/widgets/scribble/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro index 09c6882f60..6532e06e28 100644 --- a/examples/widgets/scribble/scribble.pro +++ b/examples/widgets/scribble/scribble.pro @@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/scribble INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/widgets/shapedclock/main.cpp b/examples/widgets/shapedclock/main.cpp index 9b7f951a48..f5e9718d4f 100644 --- a/examples/widgets/shapedclock/main.cpp +++ b/examples/widgets/shapedclock/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); ShapedClock clock; +#if defined(Q_OS_SYMBIAN) + clock.showMaximized(); +#else clock.show(); +#endif return app.exec(); } diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro index 5563d34258..e8dc9c9c51 100644 --- a/examples/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/shapedclock/shapedclock.pro @@ -12,3 +12,7 @@ symbian { TARGET.UID3 = 0xA000C605 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/sliders/main.cpp b/examples/widgets/sliders/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/widgets/sliders/main.cpp +++ b/examples/widgets/sliders/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro index 74ca76426d..1ef719057b 100644 --- a/examples/widgets/sliders/sliders.pro +++ b/examples/widgets/sliders/sliders.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/sliders INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro index b4be01fd5f..ed4d5b5aaa 100644 --- a/examples/widgets/softkeys/softkeys.pro +++ b/examples/widgets/softkeys/softkeys.pro @@ -13,3 +13,5 @@ symbian { TARGET.UID3 = 0xA000CF6B CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/widgets/spinboxes/main.cpp b/examples/widgets/spinboxes/main.cpp index f2079f511b..4a43828d45 100644 --- a/examples/widgets/spinboxes/main.cpp +++ b/examples/widgets/spinboxes/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro index 11c471bc9e..5aa3ed5dd1 100644 --- a/examples/widgets/spinboxes/spinboxes.pro +++ b/examples/widgets/spinboxes/spinboxes.pro @@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/spinboxes INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro index 4806a1d78f..7efa0113a1 100644 --- a/examples/widgets/styles/styles.pro +++ b/examples/widgets/styles/styles.pro @@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/styles INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/stylesheet/main.cpp b/examples/widgets/stylesheet/main.cpp index fd417a0c18..3c2aaa280f 100644 --- a/examples/widgets/stylesheet/main.cpp +++ b/examples/widgets/stylesheet/main.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro index 42df886e53..eec7d1a4ce 100644 --- a/examples/widgets/stylesheet/stylesheet.pro +++ b/examples/widgets/stylesheet/stylesheet.pro @@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/stylesheet INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tablet/main.cpp b/examples/widgets/tablet/main.cpp index 27aab50901..1e045c8108 100644 --- a/examples/widgets/tablet/main.cpp +++ b/examples/widgets/tablet/main.cpp @@ -52,9 +52,14 @@ int main(int argv, char *args[]) app.setCanvas(canvas); MainWindow mainWindow(canvas); +#if defined(Q_OS_SYMBIAN) + mainWindow.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + mainWindow.show(); +#else mainWindow.resize(500, 500); mainWindow.show(); - +#endif return app.exec(); } //! [0] diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro index 8519997045..330a50aa4c 100644 --- a/examples/widgets/tablet/tablet.pro +++ b/examples/widgets/tablet/tablet.pro @@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/tablet INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tetrix/main.cpp b/examples/widgets/tetrix/main.cpp index 9a7dcf35e5..622aee9845 100644 --- a/examples/widgets/tetrix/main.cpp +++ b/examples/widgets/tetrix/main.cpp @@ -48,7 +48,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); TetrixWindow window; +#if defined(Q_OS_SYMBIAN) + window.showMaximized(); +#else window.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); return app.exec(); } diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro index 1c777f6021..5b95691ca6 100644 --- a/examples/widgets/tetrix/tetrix.pro +++ b/examples/widgets/tetrix/tetrix.pro @@ -16,3 +16,5 @@ symbian { TARGET.UID3 = 0xA000C606 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/widgets/tooltips/main.cpp b/examples/widgets/tooltips/main.cpp index c31d90a1cd..2e17f235c6 100644 --- a/examples/widgets/tooltips/main.cpp +++ b/examples/widgets/tooltips/main.cpp @@ -49,6 +49,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); SortingBox sortingBox; +#if defined(Q_OS_SYMBIAN) + sortingBox.showMaximized(); +#else sortingBox.show(); +#endif return app.exec(); } diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro index d0725371de..ab0c98e4a1 100644 --- a/examples/widgets/tooltips/tooltips.pro +++ b/examples/widgets/tooltips/tooltips.pro @@ -12,3 +12,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/tooltips INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/widgets/validators/main.cpp b/examples/widgets/validators/main.cpp index 5e5765e957..748a36125d 100644 --- a/examples/widgets/validators/main.cpp +++ b/examples/widgets/validators/main.cpp @@ -128,7 +128,11 @@ int main(int argc, char **argv) QApplication app(argc, argv); ValidatorWidget w; +#if defined(Q_OS_SYMBIAN) + w.showMaximized(); +#else w.show(); +#endif return app.exec(); } diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro index 5f36bb8fdb..2713b7d668 100644 --- a/examples/widgets/validators/validators.pro +++ b/examples/widgets/validators/validators.pro @@ -21,3 +21,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/validators INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index 8811f8b0cd..b7a92d1830 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -1,15 +1,18 @@ TEMPLATE = subdirs SUBDIRS = analogclock \ + applicationicon \ calculator \ calendarwidget \ charactermap \ codeeditor \ digitalclock \ + elidedlabel \ groupbox \ icons \ imageviewer \ lineedits \ movie \ + orientation \ scribble \ shapedclock \ sliders \ @@ -20,7 +23,7 @@ SUBDIRS = analogclock \ tooltips \ validators \ wiggly \ - windowflags + windowflags \ symbian: SUBDIRS = \ analogclock \ @@ -28,10 +31,13 @@ symbian: SUBDIRS = \ calendarwidget \ lineedits \ shapedclock \ + symbianvibration \ tetrix \ wiggly \ softkeys +MAEMO5: SUBDIRS += maemovibration + contains(styles, motif): SUBDIRS += styles # install @@ -41,3 +47,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp index 91cd1b8c4b..0b9222864f 100644 --- a/examples/widgets/wiggly/main.cpp +++ b/examples/widgets/wiggly/main.cpp @@ -47,6 +47,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); bool smallScreen = QApplication::arguments().contains("-small-screen"); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_HILDON) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + smallScreen = true; +#endif + Dialog dialog(0, smallScreen); if (!smallScreen) diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro index e3a8fbc452..411e0d32d2 100644 --- a/examples/widgets/wiggly/wiggly.pro +++ b/examples/widgets/wiggly/wiggly.pro @@ -14,3 +14,5 @@ symbian { TARGET.UID3 = 0xA000C607 CONFIG += qt_example } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/widgets/windowflags/main.cpp b/examples/widgets/windowflags/main.cpp index 8dd71ed0a5..941a3fadf7 100644 --- a/examples/widgets/windowflags/main.cpp +++ b/examples/widgets/windowflags/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); ControllerWindow controller; +#if defined(Q_OS_SYMBIAN) + controller.showMaximized(); +#else controller.show(); +#endif return app.exec(); } diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro index 23599d0ac8..892bbd7932 100644 --- a/examples/widgets/windowflags/windowflags.pro +++ b/examples/widgets/windowflags/windowflags.pro @@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/windowflags INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index aa815457f5..3d38ca3f47 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -13,8 +13,17 @@ INSTALLS += target sources symbian: CONFIG += qt_example +symbian: { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + addFiles.sources = frank.xbel jennifer.xbel + addFiles.path = files + DEPLOYMENT += addFiles +} + wince*: { - addFiles.files = frank.xbel jennifer.xbel - addFiles.path = "\\My Documents" - DEPLOYMENT += addFiles + addFiles.files = frank.xbel jennifer.xbel + addFiles.path = "\\My Documents" + DEPLOYMENT += addFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/xml/dombookmarks/main.cpp b/examples/xml/dombookmarks/main.cpp index 71ce6aec0b..6a3bb8c1a9 100644 --- a/examples/xml/dombookmarks/main.cpp +++ b/examples/xml/dombookmarks/main.cpp @@ -46,7 +46,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mainWin; +#if defined(Q_OS_SYMBIAN) + mainWin.showMaximized(); +#else mainWin.show(); +#endif + mainWin.open(); return app.exec(); } diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp index b3bfe64e17..0a3a3f9c3b 100644 --- a/examples/xml/dombookmarks/mainwindow.cpp +++ b/examples/xml/dombookmarks/mainwindow.cpp @@ -59,6 +59,15 @@ MainWindow::MainWindow() void MainWindow::open() { +#if defined(Q_OS_SYMBIAN) + // Look for bookmarks on the same drive where the application is installed to, + // if drive is not read only. QDesktopServices::DataLocation does this check, + // and returns writable drive. + QString bookmarksFolder = + QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1); + bookmarksFolder.append(":/Data/qt/saxbookmarks"); + QDir::setCurrent(bookmarksFolder); +#endif QString fileName = QFileDialog::getOpenFileName(this, tr("Open Bookmark File"), QDir::currentPath(), @@ -81,6 +90,15 @@ void MainWindow::open() void MainWindow::saveAs() { +#if defined(Q_OS_SYMBIAN) + // Look for bookmarks on the same drive where the application is installed to, + // if drive is not read only. QDesktopServices::DataLocation does this check, + // and returns writable drive. + QString bookmarksFolder = + QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1); + bookmarksFolder.append(":/Data/qt/saxbookmarks"); + QDir::setCurrent(bookmarksFolder); +#endif QString fileName = QFileDialog::getSaveFileName(this, tr("Save Bookmark File"), QDir::currentPath(), diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro index b7a262580b..7a58ed35a0 100644 --- a/examples/xml/htmlinfo/htmlinfo.pro +++ b/examples/xml/htmlinfo/htmlinfo.pro @@ -1,6 +1,10 @@ SOURCES += main.cpp QT -= gui +RESOURCES = resources.qrc + +win32: CONFIG += console + wince*|symbian:{ htmlfiles.files = *.html htmlfiles.path = . @@ -17,3 +21,6 @@ symbian { TARGET.UID3 = 0xA000C609 CONFIG += qt_example } +maemo5: CONFIG += qt_example + +symbian: warning(This example does not work on Symbian platform) diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp index cb7ac528f0..4e36b1c2cd 100644 --- a/examples/xml/htmlinfo/main.cpp +++ b/examples/xml/htmlinfo/main.cpp @@ -101,7 +101,8 @@ int main(int argc, char **argv) QStringList filter; filter << "*.htm"; filter << "*.html"; - QStringList htmlFiles = QDir::current().entryList(filter, QDir::Files); + + QStringList htmlFiles = QDir(":/").entryList(filter, QDir::Files); QTextStream out(stdout); @@ -112,7 +113,7 @@ int main(int argc, char **argv) // parse each html file and write the result to file/stream foreach(QString file, htmlFiles) - parseHtmlFile(out, file); + parseHtmlFile(out, ":/" + file); return 0; } diff --git a/examples/xml/rsslisting/main.cpp b/examples/xml/rsslisting/main.cpp index 011569f2b6..78abb92e8d 100644 --- a/examples/xml/rsslisting/main.cpp +++ b/examples/xml/rsslisting/main.cpp @@ -58,6 +58,10 @@ int main(int argc, char **argv) { QApplication app(argc, argv); RSSListing *rsslisting = new RSSListing; +#if defined(Q_OS_SYMBIAN) + rsslisting->showMaximized(); +#else rsslisting->show(); +#endif return app.exec(); } diff --git a/examples/xml/rsslisting/rsslisting.cpp b/examples/xml/rsslisting/rsslisting.cpp index 5840f08d09..ffc6d1a6c7 100644 --- a/examples/xml/rsslisting/rsslisting.cpp +++ b/examples/xml/rsslisting/rsslisting.cpp @@ -74,6 +74,24 @@ its operation, and also allows very large data sources to be read. RSSListing::RSSListing(QWidget *parent) : QWidget(parent), currentReply(0) { +#ifdef Q_OS_SYMBIAN + // Set Internet Access Point + QNetworkConfigurationManager manager; + const bool canStartIAP = manager.capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces; + + // Is there default access point, use it + QNetworkConfiguration cfg = manager.defaultConfiguration(); + if (!cfg.isValid() || !canStartIAP) { + // Available Access Points not found + QMessageBox::warning(this, "Error", "No access point"); + return; + } + + m_session = new QNetworkSession(cfg); + m_session->open(); + m_session->waitForOpened(); +#endif + lineEdit = new QLineEdit(this); lineEdit->setText("http://labs.qt.nokia.com/blogs/feed"); @@ -104,7 +122,9 @@ RSSListing::RSSListing(QWidget *parent) layout->addWidget(treeWidget); setWindowTitle(tr("RSS listing example")); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) resize(640,480); +#endif } /* diff --git a/examples/xml/rsslisting/rsslisting.h b/examples/xml/rsslisting/rsslisting.h index 98254f839b..49c694092c 100644 --- a/examples/xml/rsslisting/rsslisting.h +++ b/examples/xml/rsslisting/rsslisting.h @@ -48,6 +48,16 @@ #include #include +#ifdef Q_OS_SYMBIAN +// Bearer +#include +#include +#include + +// QtMobility namespace +QTM_USE_NAMESPACE +#endif + QT_BEGIN_NAMESPACE class QLineEdit; class QTreeWidget; @@ -84,6 +94,11 @@ private: QLineEdit *lineEdit; QTreeWidget *treeWidget; QPushButton *fetchButton; + +#ifdef Q_OS_SYMBIAN + // for bearer management + QPointer m_session; +#endif }; #endif diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro index c883b77ada..413fdf651e 100644 --- a/examples/xml/rsslisting/rsslisting.pro +++ b/examples/xml/rsslisting/rsslisting.pro @@ -8,5 +8,15 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/rsslisting INSTALLS += target sources -symbian: CONFIG += qt_example +symbian { + CONFIG += qt_example + # For QtMobility + CONFIG += mobility + MOBILITY = bearer + + # For QtMobility + TARGET.CAPABILITY = NetworkServices +} + +maemo5: CONFIG += qt_example diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro index bb1e0961e7..f03fae8ed4 100644 --- a/examples/xml/saxbookmarks/saxbookmarks.pro +++ b/examples/xml/saxbookmarks/saxbookmarks.pro @@ -26,3 +26,5 @@ symbian: { addFiles.path = /data/qt/saxbookmarks DEPLOYMENT += addFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/xml/streambookmarks/main.cpp b/examples/xml/streambookmarks/main.cpp index c44e921e82..d909c01b51 100644 --- a/examples/xml/streambookmarks/main.cpp +++ b/examples/xml/streambookmarks/main.cpp @@ -47,6 +47,9 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mainWin; +#ifdef Q_OS_SYMBIAN + mainWin.showFullScreen(); +#endif mainWin.show(); mainWin.open(); return app.exec(); diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp index e9236e93e6..ac839fe9a0 100644 --- a/examples/xml/streambookmarks/mainwindow.cpp +++ b/examples/xml/streambookmarks/mainwindow.cpp @@ -68,6 +68,15 @@ MainWindow::MainWindow() //! [1] void MainWindow::open() { +#if defined(Q_OS_SYMBIAN) + // Look for bookmarks on the same drive where the application is installed to, + // if drive is not read only. QDesktopServices::DataLocation does this check, + // and returns writable drive. + QString bookmarksFolder = + QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1); + bookmarksFolder.append(":/Data/qt/saxbookmarks"); + QDir::setCurrent(bookmarksFolder); +#endif QString fileName = QFileDialog::getOpenFileName(this, tr("Open Bookmark File"), QDir::currentPath(), @@ -103,6 +112,15 @@ void MainWindow::open() //! [2] void MainWindow::saveAs() { +#if defined(Q_OS_SYMBIAN) + // Look for bookmarks on the same drive where the application is installed to, + // if drive is not read only. QDesktopServices::DataLocation does this check, + // and returns writable drive. + QString bookmarksFolder = + QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1); + bookmarksFolder.append(":/Data/qt/saxbookmarks"); + QDir::setCurrent(bookmarksFolder); +#endif QString fileName = QFileDialog::getSaveFileName(this, tr("Save Bookmark File"), QDir::currentPath(), diff --git a/examples/xml/streambookmarks/streambookmarks.pro b/examples/xml/streambookmarks/streambookmarks.pro index 91abf97ec2..9ccbb619be 100644 --- a/examples/xml/streambookmarks/streambookmarks.pro +++ b/examples/xml/streambookmarks/streambookmarks.pro @@ -13,4 +13,10 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS streambookmarks.pro *.xb sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/streambookmarks INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + addFiles.sources = frank.xbel jennifer.xbel + addFiles.path = /data/qt/streambookmarks + DEPLOYMENT += addFiles +} +maemo5: CONFIG += qt_example diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro index 7ef5eadbaa..485e08f809 100644 --- a/examples/xml/xml.pro +++ b/examples/xml/xml.pro @@ -18,3 +18,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro index 9eb5b2a49e..dcc8197441 100644 --- a/examples/xml/xmlstreamlint/xmlstreamlint.pro +++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/xmlstreamlint INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example + +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h index 5182021439..779013736d 100644 --- a/qmake/generators/symbian/symbiancommon.h +++ b/qmake/generators/symbian/symbiancommon.h @@ -119,6 +119,7 @@ protected: const SymbianLocalizationList &symbianLocalizationList); QString generateLocFileName(); + protected: MakefileGenerator *generator; diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index ee1115bd4e..c44c8f12be 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -199,6 +199,19 @@ QT_END_NAMESPACE [super setInitialFirstResponder:view]; } +- (void)setInitialFirstResponder:(NSView *)view +{ + // This method is called the first time the window is placed on screen and + // is the earliest point in time we can connect OpenGL contexts to NSViews. + QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; + if (qwidget) { + qt_event_request_window_change(qwidget); + qt_mac_send_posted_gl_updates(qwidget); + } + + [super setInitialFirstResponder:view]; +} + - (BOOL)makeFirstResponder:(NSResponder *)responder { // For some reason Cocoa wants to flip the first responder diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d29a46a14f..5f55559606 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -613,7 +613,7 @@ void QWidget::setAutoFillBackground(bool enabled) \brief The QWidget class is the base class of all user interface objects. \ingroup basicwidgets - + The widget is the atom of the user interface: it receives mouse, keyboard and other events from the window system, and paints a representation of itself on the screen. Every widget is rectangular, and they are sorted in a -- cgit v1.2.3