summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/README39
-rw-r--r--examples/animation/README38
-rw-r--r--examples/animation/animatedtiles/animatedtiles.pro13
-rw-r--r--examples/animation/animatedtiles/animatedtiles.qrc11
-rw-r--r--examples/animation/animatedtiles/images/Time-For-Lunch-2.jpgbin0 -> 32471 bytes
-rw-r--r--examples/animation/animatedtiles/images/centered.pngbin0 -> 892 bytes
-rw-r--r--examples/animation/animatedtiles/images/ellipse.pngbin0 -> 10767 bytes
-rw-r--r--examples/animation/animatedtiles/images/figure8.pngbin0 -> 14050 bytes
-rw-r--r--examples/animation/animatedtiles/images/kinetic.pngbin0 -> 6776 bytes
-rw-r--r--examples/animation/animatedtiles/images/random.pngbin0 -> 14969 bytes
-rw-r--r--examples/animation/animatedtiles/images/tile.pngbin0 -> 16337 bytes
-rw-r--r--examples/animation/animatedtiles/main.cpp256
-rw-r--r--examples/animation/animation.pro15
-rw-r--r--examples/animation/appchooser/accessories-dictionary.pngbin0 -> 5396 bytes
-rw-r--r--examples/animation/appchooser/akregator.pngbin0 -> 4873 bytes
-rw-r--r--examples/animation/appchooser/appchooser.pro13
-rw-r--r--examples/animation/appchooser/appchooser.qrc8
-rw-r--r--examples/animation/appchooser/digikam.pngbin0 -> 3334 bytes
-rw-r--r--examples/animation/appchooser/k3b.pngbin0 -> 8220 bytes
-rw-r--r--examples/animation/appchooser/main.cpp157
-rw-r--r--examples/animation/easing/animation.h100
-rw-r--r--examples/animation/easing/easing.pro19
-rw-r--r--examples/animation/easing/easing.qrc5
-rw-r--r--examples/animation/easing/form.ui201
-rw-r--r--examples/animation/easing/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/animation/easing/main.cpp52
-rw-r--r--examples/animation/easing/window.cpp176
-rw-r--r--examples/animation/easing/window.h78
-rw-r--r--examples/animation/moveblocks/main.cpp319
-rw-r--r--examples/animation/moveblocks/moveblocks.pro12
-rw-r--r--examples/animation/states/accessories-dictionary.pngbin0 -> 5396 bytes
-rw-r--r--examples/animation/states/akregator.pngbin0 -> 4873 bytes
-rw-r--r--examples/animation/states/digikam.pngbin0 -> 3334 bytes
-rw-r--r--examples/animation/states/help-browser.pngbin0 -> 6984 bytes
-rw-r--r--examples/animation/states/k3b.pngbin0 -> 8220 bytes
-rw-r--r--examples/animation/states/kchart.pngbin0 -> 4887 bytes
-rw-r--r--examples/animation/states/main.cpp271
-rw-r--r--examples/animation/states/states.pro13
-rw-r--r--examples/animation/states/states.qrc10
-rw-r--r--examples/animation/stickman/animation.cpp192
-rw-r--r--examples/animation/stickman/animation.h82
-rw-r--r--examples/animation/stickman/animations/chillingbin0 -> 6508 bytes
-rw-r--r--examples/animation/stickman/animations/dancingbin0 -> 2348 bytes
-rw-r--r--examples/animation/stickman/animations/deadbin0 -> 268 bytes
-rw-r--r--examples/animation/stickman/animations/jumpingbin0 -> 1308 bytes
-rw-r--r--examples/animation/stickman/graphicsview.cpp57
-rw-r--r--examples/animation/stickman/graphicsview.h63
-rw-r--r--examples/animation/stickman/lifecycle.cpp213
-rw-r--r--examples/animation/stickman/lifecycle.h79
-rw-r--r--examples/animation/stickman/main.cpp101
-rw-r--r--examples/animation/stickman/node.cpp92
-rw-r--r--examples/animation/stickman/node.h70
-rw-r--r--examples/animation/stickman/stickman.cpp337
-rw-r--r--examples/animation/stickman/stickman.h103
-rw-r--r--examples/animation/stickman/stickman.pro24
-rw-r--r--examples/animation/stickman/stickman.qrc8
-rw-r--r--examples/dbus/complexpingpong/complexping.cpp117
-rw-r--r--examples/dbus/complexpingpong/complexping.h58
-rw-r--r--examples/dbus/complexpingpong/complexping.pro18
-rw-r--r--examples/dbus/complexpingpong/complexpingpong.pro4
-rw-r--r--examples/dbus/complexpingpong/complexpong.cpp104
-rw-r--r--examples/dbus/complexpingpong/complexpong.h67
-rw-r--r--examples/dbus/complexpingpong/complexpong.pro18
-rw-r--r--examples/dbus/complexpingpong/ping-common.h41
-rw-r--r--examples/dbus/dbus-chat/chat.cpp163
-rw-r--r--examples/dbus/dbus-chat/chat.h81
-rw-r--r--examples/dbus/dbus-chat/chat_adaptor.cpp74
-rw-r--r--examples/dbus/dbus-chat/chat_adaptor.h96
-rw-r--r--examples/dbus/dbus-chat/chat_interface.cpp64
-rw-r--r--examples/dbus/dbus-chat/chat_interface.h88
-rw-r--r--examples/dbus/dbus-chat/chatmainwindow.ui185
-rw-r--r--examples/dbus/dbus-chat/chatsetnickname.ui149
-rw-r--r--examples/dbus/dbus-chat/com.trolltech.chat.xml15
-rw-r--r--examples/dbus/dbus-chat/dbus-chat.pro21
-rw-r--r--examples/dbus/dbus.pro17
-rw-r--r--examples/dbus/listnames/listnames.cpp91
-rw-r--r--examples/dbus/listnames/listnames.pro19
-rw-r--r--examples/dbus/pingpong/ping-common.h41
-rw-r--r--examples/dbus/pingpong/ping.cpp74
-rw-r--r--examples/dbus/pingpong/ping.pro18
-rw-r--r--examples/dbus/pingpong/pingpong.pro4
-rw-r--r--examples/dbus/pingpong/pong.cpp79
-rw-r--r--examples/dbus/pingpong/pong.h53
-rw-r--r--examples/dbus/pingpong/pong.pro18
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.cpp137
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.h73
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.pro22
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.xml11
-rw-r--r--examples/dbus/remotecontrolledcar/car/car_adaptor.cpp98
-rw-r--r--examples/dbus/remotecontrolledcar/car/car_adaptor.h96
-rw-r--r--examples/dbus/remotecontrolledcar/car/main.cpp72
-rw-r--r--examples/dbus/remotecontrolledcar/controller/car.xml11
-rw-r--r--examples/dbus/remotecontrolledcar/controller/car_interface.cpp64
-rw-r--r--examples/dbus/remotecontrolledcar/controller/car_interface.h113
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.cpp82
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.h69
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.pro23
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.ui64
-rw-r--r--examples/dbus/remotecontrolledcar/controller/main.cpp52
-rw-r--r--examples/dbus/remotecontrolledcar/remotecontrolledcar.pro10
-rw-r--r--examples/desktop/README41
-rw-r--r--examples/desktop/desktop.pro13
-rw-r--r--examples/desktop/screenshot/main.cpp51
-rw-r--r--examples/desktop/screenshot/screenshot.cpp197
-rw-r--r--examples/desktop/screenshot/screenshot.h99
-rw-r--r--examples/desktop/screenshot/screenshot.pro11
-rw-r--r--examples/dialogs/README40
-rw-r--r--examples/dialogs/classwizard/classwizard.cpp430
-rw-r--r--examples/dialogs/classwizard/classwizard.h156
-rw-r--r--examples/dialogs/classwizard/classwizard.pro12
-rw-r--r--examples/dialogs/classwizard/classwizard.qrc11
-rw-r--r--examples/dialogs/classwizard/images/background.pngbin0 -> 22578 bytes
-rw-r--r--examples/dialogs/classwizard/images/banner.pngbin0 -> 3947 bytes
-rw-r--r--examples/dialogs/classwizard/images/logo1.pngbin0 -> 1619 bytes
-rw-r--r--examples/dialogs/classwizard/images/logo2.pngbin0 -> 1619 bytes
-rw-r--r--examples/dialogs/classwizard/images/logo3.pngbin0 -> 1619 bytes
-rw-r--r--examples/dialogs/classwizard/images/watermark1.pngbin0 -> 14516 bytes
-rw-r--r--examples/dialogs/classwizard/images/watermark2.pngbin0 -> 14912 bytes
-rw-r--r--examples/dialogs/classwizard/main.cpp63
-rw-r--r--examples/dialogs/configdialog/configdialog.cpp116
-rw-r--r--examples/dialogs/configdialog/configdialog.h69
-rw-r--r--examples/dialogs/configdialog/configdialog.pro16
-rw-r--r--examples/dialogs/configdialog/configdialog.qrc7
-rw-r--r--examples/dialogs/configdialog/images/config.pngbin0 -> 6758 bytes
-rw-r--r--examples/dialogs/configdialog/images/query.pngbin0 -> 2116 bytes
-rw-r--r--examples/dialogs/configdialog/images/update.pngbin0 -> 7890 bytes
-rw-r--r--examples/dialogs/configdialog/main.cpp52
-rw-r--r--examples/dialogs/configdialog/pages.cpp151
-rw-r--r--examples/dialogs/configdialog/pages.h64
-rw-r--r--examples/dialogs/dialogs.pro19
-rw-r--r--examples/dialogs/extension/extension.pro11
-rw-r--r--examples/dialogs/extension/finddialog.cpp112
-rw-r--r--examples/dialogs/extension/finddialog.h78
-rw-r--r--examples/dialogs/extension/main.cpp50
-rw-r--r--examples/dialogs/findfiles/findfiles.pro11
-rw-r--r--examples/dialogs/findfiles/main.cpp51
-rw-r--r--examples/dialogs/findfiles/window.cpp249
-rw-r--r--examples/dialogs/findfiles/window.h90
-rw-r--r--examples/dialogs/licensewizard/images/logo.pngbin0 -> 1810 bytes
-rw-r--r--examples/dialogs/licensewizard/images/watermark.pngbin0 -> 34998 bytes
-rw-r--r--examples/dialogs/licensewizard/licensewizard.cpp359
-rw-r--r--examples/dialogs/licensewizard/licensewizard.h163
-rw-r--r--examples/dialogs/licensewizard/licensewizard.pro12
-rw-r--r--examples/dialogs/licensewizard/licensewizard.qrc6
-rw-r--r--examples/dialogs/licensewizard/main.cpp63
-rw-r--r--examples/dialogs/sipdialog/dialog.cpp122
-rw-r--r--examples/dialogs/sipdialog/dialog.h63
-rw-r--r--examples/dialogs/sipdialog/main.cpp52
-rw-r--r--examples/dialogs/sipdialog/sipdialog.pro14
-rw-r--r--examples/dialogs/standarddialogs/dialog.cpp389
-rw-r--r--examples/dialogs/standarddialogs/dialog.h98
-rw-r--r--examples/dialogs/standarddialogs/main.cpp60
-rw-r--r--examples/dialogs/standarddialogs/standarddialogs.pro13
-rw-r--r--examples/dialogs/tabdialog/main.cpp57
-rw-r--r--examples/dialogs/tabdialog/tabdialog.cpp195
-rw-r--r--examples/dialogs/tabdialog/tabdialog.h99
-rw-r--r--examples/dialogs/tabdialog/tabdialog.pro12
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.cpp135
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.pro9
-rw-r--r--examples/draganddrop/README40
-rw-r--r--examples/draganddrop/draganddrop.pro15
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro15
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.qrc7
-rw-r--r--examples/draganddrop/draggableicons/dragwidget.cpp168
-rw-r--r--examples/draganddrop/draggableicons/dragwidget.h65
-rw-r--r--examples/draganddrop/draggableicons/images/boat.pngbin0 -> 2772 bytes
-rw-r--r--examples/draganddrop/draggableicons/images/car.pngbin0 -> 2963 bytes
-rw-r--r--examples/draganddrop/draggableicons/images/house.pngbin0 -> 3292 bytes
-rw-r--r--examples/draganddrop/draggableicons/main.cpp61
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro17
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.qrc5
-rw-r--r--examples/draganddrop/draggabletext/draglabel.cpp51
-rw-r--r--examples/draganddrop/draggabletext/draglabel.h58
-rw-r--r--examples/draganddrop/draggabletext/dragwidget.cpp163
-rw-r--r--examples/draganddrop/draggabletext/dragwidget.h62
-rw-r--r--examples/draganddrop/draggabletext/main.cpp52
-rw-r--r--examples/draganddrop/draggabletext/words.txt41
-rw-r--r--examples/draganddrop/dropsite/droparea.cpp126
-rw-r--r--examples/draganddrop/dropsite/droparea.h77
-rw-r--r--examples/draganddrop/dropsite/dropsite.pro13
-rw-r--r--examples/draganddrop/dropsite/dropsitewindow.cpp143
-rw-r--r--examples/draganddrop/dropsite/dropsitewindow.h77
-rw-r--r--examples/draganddrop/dropsite/main.cpp53
-rw-r--r--examples/draganddrop/fridgemagnets/draglabel.cpp89
-rw-r--r--examples/draganddrop/fridgemagnets/draglabel.h64
-rw-r--r--examples/draganddrop/fridgemagnets/dragwidget.cpp214
-rw-r--r--examples/draganddrop/fridgemagnets/dragwidget.h65
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.pro19
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.qrc5
-rw-r--r--examples/draganddrop/fridgemagnets/main.cpp60
-rw-r--r--examples/draganddrop/fridgemagnets/words.txt48
-rw-r--r--examples/draganddrop/puzzle/example.jpgbin0 -> 42654 bytes
-rw-r--r--examples/draganddrop/puzzle/main.cpp54
-rw-r--r--examples/draganddrop/puzzle/mainwindow.cpp150
-rw-r--r--examples/draganddrop/puzzle/mainwindow.h76
-rw-r--r--examples/draganddrop/puzzle/pieceslist.cpp121
-rw-r--r--examples/draganddrop/puzzle/pieceslist.h61
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro29
-rw-r--r--examples/draganddrop/puzzle/puzzle.qrc5
-rw-r--r--examples/draganddrop/puzzle/puzzlewidget.cpp204
-rw-r--r--examples/draganddrop/puzzle/puzzlewidget.h85
-rw-r--r--examples/effects/blurpicker/blureffect.cpp68
-rw-r--r--examples/effects/blurpicker/blureffect.h66
-rw-r--r--examples/effects/blurpicker/blurpicker.cpp138
-rw-r--r--examples/effects/blurpicker/blurpicker.h73
-rw-r--r--examples/effects/blurpicker/blurpicker.pro9
-rw-r--r--examples/effects/blurpicker/blurpicker.qrc14
-rw-r--r--examples/effects/blurpicker/images/README.txt5
-rw-r--r--examples/effects/blurpicker/images/accessories-calculator.pngbin0 -> 3760 bytes
-rw-r--r--examples/effects/blurpicker/images/accessories-text-editor.pngbin0 -> 4746 bytes
-rw-r--r--examples/effects/blurpicker/images/background.jpgbin0 -> 16259 bytes
-rw-r--r--examples/effects/blurpicker/images/help-browser.pngbin0 -> 5392 bytes
-rw-r--r--examples/effects/blurpicker/images/internet-group-chat.pngbin0 -> 2809 bytes
-rw-r--r--examples/effects/blurpicker/images/internet-mail.pngbin0 -> 3899 bytes
-rw-r--r--examples/effects/blurpicker/images/internet-web-browser.pngbin0 -> 6376 bytes
-rw-r--r--examples/effects/blurpicker/images/office-calendar.pngbin0 -> 4010 bytes
-rw-r--r--examples/effects/blurpicker/images/system-users.pngbin0 -> 5353 bytes
-rw-r--r--examples/effects/blurpicker/main.cpp54
-rw-r--r--examples/effects/effects.pro13
-rw-r--r--examples/effects/fademessage/README.txt2
-rw-r--r--examples/effects/fademessage/background.jpgbin0 -> 159108 bytes
-rw-r--r--examples/effects/fademessage/fademessage.cpp129
-rw-r--r--examples/effects/fademessage/fademessage.h70
-rw-r--r--examples/effects/fademessage/fademessage.pro16
-rw-r--r--examples/effects/fademessage/fademessage.qrc5
-rw-r--r--examples/effects/fademessage/main.cpp55
-rw-r--r--examples/effects/lighting/lighting.cpp136
-rw-r--r--examples/effects/lighting/lighting.h67
-rw-r--r--examples/effects/lighting/lighting.pro8
-rw-r--r--examples/effects/lighting/main.cpp54
-rw-r--r--examples/examples.pro77
-rw-r--r--examples/gestures/gestures.pro10
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro21
-rw-r--r--examples/gestures/imagegestures/imagewidget.cpp267
-rw-r--r--examples/gestures/imagegestures/imagewidget.h100
-rw-r--r--examples/gestures/imagegestures/main.cpp58
-rw-r--r--examples/gestures/imagegestures/mainwidget.cpp55
-rw-r--r--examples/gestures/imagegestures/mainwidget.h64
-rw-r--r--examples/graphicsview/README40
-rw-r--r--examples/graphicsview/anchorlayout/anchorlayout.pro9
-rw-r--r--examples/graphicsview/anchorlayout/main.cpp128
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro17
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.qrc5
-rw-r--r--examples/graphicsview/basicgraphicslayouts/images/block.pngbin0 -> 2146 bytes
-rw-r--r--examples/graphicsview/basicgraphicslayouts/layoutitem.cpp130
-rw-r--r--examples/graphicsview/basicgraphicslayouts/layoutitem.h65
-rw-r--r--examples/graphicsview/basicgraphicslayouts/main.cpp58
-rw-r--r--examples/graphicsview/basicgraphicslayouts/window.cpp90
-rw-r--r--examples/graphicsview/basicgraphicslayouts/window.h57
-rw-r--r--examples/graphicsview/collidingmice/collidingmice.pro19
-rw-r--r--examples/graphicsview/collidingmice/images/cheese.jpgbin0 -> 3029 bytes
-rw-r--r--examples/graphicsview/collidingmice/main.cpp91
-rw-r--r--examples/graphicsview/collidingmice/mice.qrc5
-rw-r--r--examples/graphicsview/collidingmice/mouse.cpp200
-rw-r--r--examples/graphicsview/collidingmice/mouse.h68
-rw-r--r--examples/graphicsview/diagramscene/arrow.cpp146
-rw-r--r--examples/graphicsview/diagramscene/arrow.h91
-rw-r--r--examples/graphicsview/diagramscene/diagramitem.cpp152
-rw-r--r--examples/graphicsview/diagramscene/diagramitem.h96
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.cpp240
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.h112
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.pro22
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.qrc20
-rw-r--r--examples/graphicsview/diagramscene/diagramtextitem.cpp81
-rw-r--r--examples/graphicsview/diagramscene/diagramtextitem.h78
-rw-r--r--examples/graphicsview/diagramscene/images/background1.pngbin0 -> 112 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/background2.pngbin0 -> 114 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/background3.pngbin0 -> 116 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/background4.pngbin0 -> 96 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/bold.pngbin0 -> 274 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/bringtofront.pngbin0 -> 293 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/delete.pngbin0 -> 831 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/floodfill.pngbin0 -> 282 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/italic.pngbin0 -> 247 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/linecolor.pngbin0 -> 145 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/linepointer.pngbin0 -> 141 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/pointer.pngbin0 -> 173 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/sendtoback.pngbin0 -> 318 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/textpointer.pngbin0 -> 753 bytes
-rw-r--r--examples/graphicsview/diagramscene/images/underline.pngbin0 -> 250 bytes
-rw-r--r--examples/graphicsview/diagramscene/main.cpp55
-rw-r--r--examples/graphicsview/diagramscene/mainwindow.cpp662
-rw-r--r--examples/graphicsview/diagramscene/mainwindow.h150
-rw-r--r--examples/graphicsview/dragdroprobot/coloritem.cpp142
-rw-r--r--examples/graphicsview/dragdroprobot/coloritem.h65
-rw-r--r--examples/graphicsview/dragdroprobot/dragdroprobot.pro20
-rw-r--r--examples/graphicsview/dragdroprobot/images/head.pngbin0 -> 14972 bytes
-rw-r--r--examples/graphicsview/dragdroprobot/main.cpp81
-rw-r--r--examples/graphicsview/dragdroprobot/robot.cpp307
-rw-r--r--examples/graphicsview/dragdroprobot/robot.h118
-rw-r--r--examples/graphicsview/dragdroprobot/robot.qrc5
-rw-r--r--examples/graphicsview/elasticnodes/edge.cpp149
-rw-r--r--examples/graphicsview/elasticnodes/edge.h75
-rw-r--r--examples/graphicsview/elasticnodes/elasticnodes.pro23
-rw-r--r--examples/graphicsview/elasticnodes/graphwidget.cpp235
-rw-r--r--examples/graphicsview/elasticnodes/graphwidget.h72
-rw-r--r--examples/graphicsview/elasticnodes/main.cpp53
-rw-r--r--examples/graphicsview/elasticnodes/node.cpp211
-rw-r--r--examples/graphicsview/elasticnodes/node.h85
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.cpp213
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.h76
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.pro10
-rw-r--r--examples/graphicsview/flowlayout/main.cpp55
-rw-r--r--examples/graphicsview/flowlayout/window.cpp62
-rw-r--r--examples/graphicsview/flowlayout/window.h47
-rw-r--r--examples/graphicsview/graphicsview.pro25
-rw-r--r--examples/graphicsview/padnavigator/flippablepad.cpp98
-rw-r--r--examples/graphicsview/padnavigator/flippablepad.h63
-rw-r--r--examples/graphicsview/padnavigator/form.ui208
-rw-r--r--examples/graphicsview/padnavigator/images/artsfftscope.pngbin0 -> 1291 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/blue_angle_swirl.jpgbin0 -> 11826 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/kontact_contacts.pngbin0 -> 4382 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/kontact_journal.pngbin0 -> 3261 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/kontact_mail.pngbin0 -> 3202 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/kontact_notes.pngbin0 -> 3893 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/kopeteavailable.pngbin0 -> 2380 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/metacontact_online.pngbin0 -> 2545 bytes
-rw-r--r--examples/graphicsview/padnavigator/images/minitools.pngbin0 -> 2087 bytes
-rw-r--r--examples/graphicsview/padnavigator/main.cpp56
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.cpp306
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.h70
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.pro32
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.qrc13
-rw-r--r--examples/graphicsview/padnavigator/roundrectitem.cpp113
-rw-r--r--examples/graphicsview/padnavigator/roundrectitem.h75
-rw-r--r--examples/graphicsview/padnavigator/splashitem.cpp83
-rw-r--r--examples/graphicsview/padnavigator/splashitem.h61
-rw-r--r--examples/graphicsview/simpleanchorlayout/main.cpp133
-rw-r--r--examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro9
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/5days.jpgbin0 -> 5748 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/details.jpgbin0 -> 5323 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/place.jpgbin0 -> 62438 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/tabbar.jpgbin0 -> 849 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/title.jpgbin0 -> 3472 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/images/weather-few-clouds.pngbin0 -> 18976 bytes
-rw-r--r--examples/graphicsview/weatheranchorlayout/main.cpp259
-rw-r--r--examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro14
-rw-r--r--examples/graphicsview/weatheranchorlayout/weatheranchorlayout.qrc10
-rw-r--r--examples/ipc/README35
-rw-r--r--examples/ipc/ipc.pro11
-rw-r--r--examples/ipc/localfortuneclient/client.cpp152
-rw-r--r--examples/ipc/localfortuneclient/client.h81
-rw-r--r--examples/ipc/localfortuneclient/localfortuneclient.pro14
-rw-r--r--examples/ipc/localfortuneclient/main.cpp51
-rw-r--r--examples/ipc/localfortuneserver/localfortuneserver.pro14
-rw-r--r--examples/ipc/localfortuneserver/main.cpp55
-rw-r--r--examples/ipc/localfortuneserver/server.cpp110
-rw-r--r--examples/ipc/localfortuneserver/server.h69
-rw-r--r--examples/ipc/sharedmemory/dialog.cpp188
-rw-r--r--examples/ipc/sharedmemory/dialog.h70
-rw-r--r--examples/ipc/sharedmemory/dialog.ui47
-rw-r--r--examples/ipc/sharedmemory/image.pngbin0 -> 10199 bytes
-rw-r--r--examples/ipc/sharedmemory/main.cpp53
-rw-r--r--examples/ipc/sharedmemory/qt.pngbin0 -> 2383 bytes
-rw-r--r--examples/ipc/sharedmemory/sharedmemory.pro15
-rw-r--r--examples/itemviews/README39
-rw-r--r--examples/itemviews/addressbook/adddialog.cpp82
-rw-r--r--examples/itemviews/addressbook/adddialog.h71
-rw-r--r--examples/itemviews/addressbook/addressbook.pro22
-rw-r--r--examples/itemviews/addressbook/addresswidget.cpp237
-rw-r--r--examples/itemviews/addressbook/addresswidget.h82
-rw-r--r--examples/itemviews/addressbook/main.cpp52
-rw-r--r--examples/itemviews/addressbook/mainwindow.cpp137
-rw-r--r--examples/itemviews/addressbook/mainwindow.h75
-rw-r--r--examples/itemviews/addressbook/newaddresstab.cpp77
-rw-r--r--examples/itemviews/addressbook/newaddresstab.h74
-rw-r--r--examples/itemviews/addressbook/tablemodel.cpp184
-rw-r--r--examples/itemviews/addressbook/tablemodel.h72
-rw-r--r--examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro12
-rw-r--r--examples/itemviews/basicsortfiltermodel/main.cpp93
-rw-r--r--examples/itemviews/basicsortfiltermodel/window.cpp156
-rw-r--r--examples/itemviews/basicsortfiltermodel/window.h88
-rw-r--r--examples/itemviews/chart/chart.pro20
-rw-r--r--examples/itemviews/chart/chart.qrc5
-rw-r--r--examples/itemviews/chart/main.cpp53
-rw-r--r--examples/itemviews/chart/mainwindow.cpp172
-rw-r--r--examples/itemviews/chart/mainwindow.h72
-rw-r--r--examples/itemviews/chart/mydata.cht8
-rw-r--r--examples/itemviews/chart/pieview.cpp561
-rw-r--r--examples/itemviews/chart/pieview.h114
-rw-r--r--examples/itemviews/chart/qtdata.cht14
-rw-r--r--examples/itemviews/coloreditorfactory/coloreditorfactory.pro13
-rw-r--r--examples/itemviews/coloreditorfactory/colorlisteditor.cpp76
-rw-r--r--examples/itemviews/coloreditorfactory/colorlisteditor.h69
-rw-r--r--examples/itemviews/coloreditorfactory/main.cpp53
-rw-r--r--examples/itemviews/coloreditorfactory/window.cpp94
-rw-r--r--examples/itemviews/coloreditorfactory/window.h57
-rw-r--r--examples/itemviews/combowidgetmapper/combowidgetmapper.pro9
-rw-r--r--examples/itemviews/combowidgetmapper/main.cpp51
-rw-r--r--examples/itemviews/combowidgetmapper/window.cpp136
-rw-r--r--examples/itemviews/combowidgetmapper/window.h86
-rw-r--r--examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro14
-rw-r--r--examples/itemviews/customsortfiltermodel/main.cpp95
-rw-r--r--examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp115
-rw-r--r--examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.h73
-rw-r--r--examples/itemviews/customsortfiltermodel/window.cpp167
-rw-r--r--examples/itemviews/customsortfiltermodel/window.h90
-rw-r--r--examples/itemviews/dirview/dirview.pro9
-rw-r--r--examples/itemviews/dirview/main.cpp62
-rw-r--r--examples/itemviews/editabletreemodel/default.txt40
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.pro18
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.qrc5
-rw-r--r--examples/itemviews/editabletreemodel/main.cpp53
-rw-r--r--examples/itemviews/editabletreemodel/mainwindow.cpp180
-rw-r--r--examples/itemviews/editabletreemodel/mainwindow.h71
-rw-r--r--examples/itemviews/editabletreemodel/mainwindow.ui128
-rw-r--r--examples/itemviews/editabletreemodel/treeitem.cpp179
-rw-r--r--examples/itemviews/editabletreemodel/treeitem.h74
-rw-r--r--examples/itemviews/editabletreemodel/treemodel.cpp288
-rw-r--r--examples/itemviews/editabletreemodel/treemodel.h97
-rw-r--r--examples/itemviews/fetchmore/fetchmore.pro12
-rw-r--r--examples/itemviews/fetchmore/filelistmodel.cpp115
-rw-r--r--examples/itemviews/fetchmore/filelistmodel.h75
-rw-r--r--examples/itemviews/fetchmore/main.cpp50
-rw-r--r--examples/itemviews/fetchmore/window.cpp81
-rw-r--r--examples/itemviews/fetchmore/window.h64
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.cpp165
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.h72
-rw-r--r--examples/itemviews/frozencolumn/frozencolumn.pro9
-rw-r--r--examples/itemviews/frozencolumn/grades.qrc5
-rw-r--r--examples/itemviews/frozencolumn/grades.txt36
-rw-r--r--examples/itemviews/frozencolumn/main.cpp88
-rw-r--r--examples/itemviews/itemviews.pro29
-rw-r--r--examples/itemviews/pixelator/imagemodel.cpp91
-rw-r--r--examples/itemviews/pixelator/imagemodel.h68
-rw-r--r--examples/itemviews/pixelator/images.qrc5
-rw-r--r--examples/itemviews/pixelator/images/qt.pngbin0 -> 656 bytes
-rw-r--r--examples/itemviews/pixelator/main.cpp54
-rw-r--r--examples/itemviews/pixelator/mainwindow.cpp244
-rw-r--r--examples/itemviews/pixelator/mainwindow.h74
-rw-r--r--examples/itemviews/pixelator/pixelator.pro16
-rw-r--r--examples/itemviews/pixelator/pixeldelegate.cpp107
-rw-r--r--examples/itemviews/pixelator/pixeldelegate.h79
-rw-r--r--examples/itemviews/puzzle/example.jpgbin0 -> 42654 bytes
-rw-r--r--examples/itemviews/puzzle/main.cpp54
-rw-r--r--examples/itemviews/puzzle/mainwindow.cpp149
-rw-r--r--examples/itemviews/puzzle/mainwindow.h77
-rw-r--r--examples/itemviews/puzzle/piecesmodel.cpp203
-rw-r--r--examples/itemviews/puzzle/piecesmodel.h80
-rw-r--r--examples/itemviews/puzzle/puzzle.pro21
-rw-r--r--examples/itemviews/puzzle/puzzle.qrc5
-rw-r--r--examples/itemviews/puzzle/puzzlewidget.cpp204
-rw-r--r--examples/itemviews/puzzle/puzzlewidget.h85
-rw-r--r--examples/itemviews/simpledommodel/domitem.cpp101
-rw-r--r--examples/itemviews/simpledommodel/domitem.h66
-rw-r--r--examples/itemviews/simpledommodel/dommodel.cpp189
-rw-r--r--examples/itemviews/simpledommodel/dommodel.h76
-rw-r--r--examples/itemviews/simpledommodel/main.cpp52
-rw-r--r--examples/itemviews/simpledommodel/mainwindow.cpp84
-rw-r--r--examples/itemviews/simpledommodel/mainwindow.h70
-rw-r--r--examples/itemviews/simpledommodel/simpledommodel.pro17
-rw-r--r--examples/itemviews/simpletreemodel/default.txt40
-rw-r--r--examples/itemviews/simpletreemodel/main.cpp61
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.pro15
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.qrc5
-rw-r--r--examples/itemviews/simpletreemodel/treeitem.cpp116
-rw-r--r--examples/itemviews/simpletreemodel/treeitem.h70
-rw-r--r--examples/itemviews/simpletreemodel/treemodel.cpp218
-rw-r--r--examples/itemviews/simpletreemodel/treemodel.h76
-rw-r--r--examples/itemviews/simplewidgetmapper/main.cpp51
-rw-r--r--examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro11
-rw-r--r--examples/itemviews/simplewidgetmapper/window.cpp133
-rw-r--r--examples/itemviews/simplewidgetmapper/window.h84
-rw-r--r--examples/itemviews/spinboxdelegate/delegate.cpp102
-rw-r--r--examples/itemviews/spinboxdelegate/delegate.h70
-rw-r--r--examples/itemviews/spinboxdelegate/main.cpp86
-rw-r--r--examples/itemviews/spinboxdelegate/spinboxdelegate.pro11
-rw-r--r--examples/itemviews/stardelegate/main.cpp107
-rw-r--r--examples/itemviews/stardelegate/stardelegate.cpp129
-rw-r--r--examples/itemviews/stardelegate/stardelegate.h69
-rw-r--r--examples/itemviews/stardelegate/stardelegate.pro16
-rw-r--r--examples/itemviews/stardelegate/stareditor.cpp98
-rw-r--r--examples/itemviews/stardelegate/stareditor.h77
-rw-r--r--examples/itemviews/stardelegate/starrating.cpp102
-rw-r--r--examples/itemviews/stardelegate/starrating.h76
-rw-r--r--examples/ja_JP/linguist/hellotr/hellotr.pro13
-rw-r--r--examples/ja_JP/linguist/hellotr/main.cpp70
-rw-r--r--examples/layouts/README41
-rw-r--r--examples/layouts/basiclayouts/basiclayouts.pro11
-rw-r--r--examples/layouts/basiclayouts/dialog.cpp149
-rw-r--r--examples/layouts/basiclayouts/dialog.h90
-rw-r--r--examples/layouts/basiclayouts/main.cpp50
-rw-r--r--examples/layouts/borderlayout/borderlayout.cpp213
-rw-r--r--examples/layouts/borderlayout/borderlayout.h88
-rw-r--r--examples/layouts/borderlayout/borderlayout.pro13
-rw-r--r--examples/layouts/borderlayout/main.cpp51
-rw-r--r--examples/layouts/borderlayout/window.cpp68
-rw-r--r--examples/layouts/borderlayout/window.h61
-rw-r--r--examples/layouts/dynamiclayouts/dialog.cpp169
-rw-r--r--examples/layouts/dynamiclayouts/dialog.h90
-rw-r--r--examples/layouts/dynamiclayouts/dynamiclayouts.pro11
-rw-r--r--examples/layouts/dynamiclayouts/main.cpp50
-rw-r--r--examples/layouts/flowlayout/flowlayout.cpp213
-rw-r--r--examples/layouts/flowlayout/flowlayout.h78
-rw-r--r--examples/layouts/flowlayout/flowlayout.pro13
-rw-r--r--examples/layouts/flowlayout/main.cpp51
-rw-r--r--examples/layouts/flowlayout/window.cpp59
-rw-r--r--examples/layouts/flowlayout/window.h59
-rw-r--r--examples/layouts/layouts.pro12
-rw-r--r--examples/linguist/README37
-rw-r--r--examples/linguist/arrowpad/arrowpad.cpp64
-rw-r--r--examples/linguist/arrowpad/arrowpad.h68
-rw-r--r--examples/linguist/arrowpad/arrowpad.pro18
-rw-r--r--examples/linguist/arrowpad/main.cpp63
-rw-r--r--examples/linguist/arrowpad/mainwindow.cpp61
-rw-r--r--examples/linguist/arrowpad/mainwindow.h68
-rw-r--r--examples/linguist/hellotr/hellotr.pro13
-rw-r--r--examples/linguist/hellotr/main.cpp70
-rw-r--r--examples/linguist/linguist.pro11
-rw-r--r--examples/linguist/trollprint/main.cpp60
-rw-r--r--examples/linguist/trollprint/mainwindow.cpp95
-rw-r--r--examples/linguist/trollprint/mainwindow.h74
-rw-r--r--examples/linguist/trollprint/printpanel.cpp85
-rw-r--r--examples/linguist/trollprint/printpanel.h69
-rw-r--r--examples/linguist/trollprint/trollprint.pro14
-rw-r--r--examples/linguist/trollprint/trollprint_pt.ts65
-rw-r--r--examples/mainwindows/README40
-rw-r--r--examples/mainwindows/application/application.pro14
-rw-r--r--examples/mainwindows/application/application.qrc10
-rw-r--r--examples/mainwindows/application/images/copy.pngbin0 -> 1338 bytes
-rw-r--r--examples/mainwindows/application/images/cut.pngbin0 -> 1323 bytes
-rw-r--r--examples/mainwindows/application/images/new.pngbin0 -> 852 bytes
-rw-r--r--examples/mainwindows/application/images/open.pngbin0 -> 2073 bytes
-rw-r--r--examples/mainwindows/application/images/paste.pngbin0 -> 1645 bytes
-rw-r--r--examples/mainwindows/application/images/save.pngbin0 -> 1187 bytes
-rw-r--r--examples/mainwindows/application/main.cpp57
-rw-r--r--examples/mainwindows/application/mainwindow.cpp392
-rw-r--r--examples/mainwindows/application/mainwindow.h105
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.pro12
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.qrc8
-rw-r--r--examples/mainwindows/dockwidgets/images/new.pngbin0 -> 977 bytes
-rw-r--r--examples/mainwindows/dockwidgets/images/print.pngbin0 -> 1732 bytes
-rw-r--r--examples/mainwindows/dockwidgets/images/save.pngbin0 -> 1894 bytes
-rw-r--r--examples/mainwindows/dockwidgets/images/undo.pngbin0 -> 1768 bytes
-rw-r--r--examples/mainwindows/dockwidgets/main.cpp52
-rw-r--r--examples/mainwindows/dockwidgets/mainwindow.cpp342
-rw-r--r--examples/mainwindows/dockwidgets/mainwindow.h97
-rw-r--r--examples/mainwindows/mainwindows.pro19
-rw-r--r--examples/mainwindows/mdi/images/copy.pngbin0 -> 1338 bytes
-rw-r--r--examples/mainwindows/mdi/images/cut.pngbin0 -> 1323 bytes
-rw-r--r--examples/mainwindows/mdi/images/new.pngbin0 -> 852 bytes
-rw-r--r--examples/mainwindows/mdi/images/open.pngbin0 -> 2073 bytes
-rw-r--r--examples/mainwindows/mdi/images/paste.pngbin0 -> 1645 bytes
-rw-r--r--examples/mainwindows/mdi/images/save.pngbin0 -> 1187 bytes
-rw-r--r--examples/mainwindows/mdi/main.cpp53
-rw-r--r--examples/mainwindows/mdi/mainwindow.cpp397
-rw-r--r--examples/mainwindows/mdi/mainwindow.h118
-rw-r--r--examples/mainwindows/mdi/mdi.pro14
-rw-r--r--examples/mainwindows/mdi/mdi.qrc10
-rw-r--r--examples/mainwindows/mdi/mdichild.cpp175
-rw-r--r--examples/mainwindows/mdi/mdichild.h76
-rw-r--r--examples/mainwindows/menus/main.cpp51
-rw-r--r--examples/mainwindows/menus/mainwindow.cpp370
-rw-r--r--examples/mainwindows/menus/mainwindow.h124
-rw-r--r--examples/mainwindows/menus/menus.pro14
-rw-r--r--examples/mainwindows/recentfiles/main.cpp53
-rw-r--r--examples/mainwindows/recentfiles/mainwindow.cpp251
-rw-r--r--examples/mainwindows/recentfiles/mainwindow.h96
-rw-r--r--examples/mainwindows/recentfiles/recentfiles.pro11
-rw-r--r--examples/mainwindows/sdi/images/copy.pngbin0 -> 1338 bytes
-rw-r--r--examples/mainwindows/sdi/images/cut.pngbin0 -> 1323 bytes
-rw-r--r--examples/mainwindows/sdi/images/new.pngbin0 -> 852 bytes
-rw-r--r--examples/mainwindows/sdi/images/open.pngbin0 -> 2073 bytes
-rw-r--r--examples/mainwindows/sdi/images/paste.pngbin0 -> 1645 bytes
-rw-r--r--examples/mainwindows/sdi/images/save.pngbin0 -> 1187 bytes
-rw-r--r--examples/mainwindows/sdi/main.cpp54
-rw-r--r--examples/mainwindows/sdi/mainwindow.cpp372
-rw-r--r--examples/mainwindows/sdi/mainwindow.h110
-rw-r--r--examples/mainwindows/sdi/sdi.pro12
-rw-r--r--examples/mainwindows/sdi/sdi.qrc10
-rw-r--r--examples/network/README40
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp423
-rw-r--r--examples/network/bearermonitor/bearermonitor.h94
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro26
-rw-r--r--examples/network/bearermonitor/bearermonitor_240_320.ui420
-rw-r--r--examples/network/bearermonitor/bearermonitor_640_480.ui386
-rw-r--r--examples/network/bearermonitor/bearermonitor_maemo.ui369
-rw-r--r--examples/network/bearermonitor/main.cpp59
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp204
-rw-r--r--examples/network/bearermonitor/sessionwidget.h86
-rw-r--r--examples/network/bearermonitor/sessionwidget.ui307
-rw-r--r--examples/network/bearermonitor/sessionwidget_maemo.ui310
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.cpp168
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.h84
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.pro14
-rw-r--r--examples/network/blockingfortuneclient/fortunethread.cpp137
-rw-r--r--examples/network/blockingfortuneclient/fortunethread.h73
-rw-r--r--examples/network/blockingfortuneclient/main.cpp51
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.pro12
-rw-r--r--examples/network/broadcastreceiver/main.cpp51
-rw-r--r--examples/network/broadcastreceiver/receiver.cpp87
-rw-r--r--examples/network/broadcastreceiver/receiver.h68
-rw-r--r--examples/network/broadcastsender/broadcastsender.pro12
-rw-r--r--examples/network/broadcastsender/main.cpp51
-rw-r--r--examples/network/broadcastsender/sender.cpp91
-rw-r--r--examples/network/broadcastsender/sender.h75
-rw-r--r--examples/network/download/download.pro21
-rw-r--r--examples/network/download/main.cpp192
-rw-r--r--examples/network/downloadmanager/downloadmanager.cpp172
-rw-r--r--examples/network/downloadmanager/downloadmanager.h84
-rw-r--r--examples/network/downloadmanager/downloadmanager.pro22
-rw-r--r--examples/network/downloadmanager/main.cpp67
-rw-r--r--examples/network/downloadmanager/textprogressbar.cpp98
-rw-r--r--examples/network/downloadmanager/textprogressbar.h63
-rw-r--r--examples/network/fortuneclient/client.cpp252
-rw-r--r--examples/network/fortuneclient/client.h89
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro16
-rw-r--r--examples/network/fortuneclient/main.cpp55
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro17
-rw-r--r--examples/network/fortuneserver/main.cpp59
-rw-r--r--examples/network/fortuneserver/server.cpp176
-rw-r--r--examples/network/fortuneserver/server.h74
-rw-r--r--examples/network/googlesuggest/googlesuggest.cpp234
-rw-r--r--examples/network/googlesuggest/googlesuggest.h81
-rw-r--r--examples/network/googlesuggest/googlesuggest.pro9
-rw-r--r--examples/network/googlesuggest/main.cpp51
-rw-r--r--examples/network/googlesuggest/searchbox.cpp72
-rw-r--r--examples/network/googlesuggest/searchbox.h65
-rw-r--r--examples/network/http/authenticationdialog.ui129
-rw-r--r--examples/network/http/http.pro13
-rw-r--r--examples/network/http/httpwindow.cpp266
-rw-r--r--examples/network/http/httpwindow.h100
-rw-r--r--examples/network/http/main.cpp51
-rw-r--r--examples/network/loopback/dialog.cpp190
-rw-r--r--examples/network/loopback/dialog.h89
-rw-r--r--examples/network/loopback/loopback.pro12
-rw-r--r--examples/network/loopback/main.cpp51
-rw-r--r--examples/network/multicastreceiver/main.cpp51
-rw-r--r--examples/network/multicastreceiver/multicastreceiver.pro12
-rw-r--r--examples/network/multicastreceiver/receiver.cpp84
-rw-r--r--examples/network/multicastreceiver/receiver.h70
-rw-r--r--examples/network/multicastsender/main.cpp51
-rw-r--r--examples/network/multicastsender/multicastsender.pro12
-rw-r--r--examples/network/multicastsender/sender.cpp105
-rw-r--r--examples/network/multicastsender/sender.h81
-rw-r--r--examples/network/network-chat/chatdialog.cpp141
-rw-r--r--examples/network/network-chat/chatdialog.h69
-rw-r--r--examples/network/network-chat/chatdialog.ui79
-rw-r--r--examples/network/network-chat/client.cpp139
-rw-r--r--examples/network/network-chat/client.h82
-rw-r--r--examples/network/network-chat/connection.cpp275
-rw-r--r--examples/network/network-chat/connection.h107
-rw-r--r--examples/network/network-chat/main.cpp98
-rw-r--r--examples/network/network-chat/network-chat.pro26
-rw-r--r--examples/network/network-chat/peermanager.cpp172
-rw-r--r--examples/network/network-chat/peermanager.h84
-rw-r--r--examples/network/network-chat/server.cpp57
-rw-r--r--examples/network/network-chat/server.h62
-rw-r--r--examples/network/network.pro41
-rw-r--r--examples/network/qftp/ftp.qrc7
-rw-r--r--examples/network/qftp/ftpwindow.cpp407
-rw-r--r--examples/network/qftp/ftpwindow.h107
-rw-r--r--examples/network/qftp/images/cdtoparent.pngbin0 -> 139 bytes
-rw-r--r--examples/network/qftp/images/dir.pngbin0 -> 154 bytes
-rw-r--r--examples/network/qftp/images/file.pngbin0 -> 129 bytes
-rw-r--r--examples/network/qftp/main.cpp66
-rw-r--r--examples/network/qftp/qftp.pro18
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp99
-rw-r--r--examples/network/securesocketclient/certificateinfo.h68
-rw-r--r--examples/network/securesocketclient/certificateinfo.ui85
-rw-r--r--examples/network/securesocketclient/encrypted.pngbin0 -> 750 bytes
-rw-r--r--examples/network/securesocketclient/main.cpp62
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro21
-rw-r--r--examples/network/securesocketclient/securesocketclient.qrc5
-rw-r--r--examples/network/securesocketclient/sslclient.cpp219
-rw-r--r--examples/network/securesocketclient/sslclient.h80
-rw-r--r--examples/network/securesocketclient/sslclient.ui190
-rw-r--r--examples/network/securesocketclient/sslerrors.ui110
-rw-r--r--examples/network/threadedfortuneserver/dialog.cpp94
-rw-r--r--examples/network/threadedfortuneserver/dialog.h65
-rw-r--r--examples/network/threadedfortuneserver/fortuneserver.cpp68
-rw-r--r--examples/network/threadedfortuneserver/fortuneserver.h63
-rw-r--r--examples/network/threadedfortuneserver/fortunethread.cpp76
-rw-r--r--examples/network/threadedfortuneserver/fortunethread.h66
-rw-r--r--examples/network/threadedfortuneserver/main.cpp55
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.pro16
-rw-r--r--examples/network/torrent/addtorrentdialog.cpp169
-rw-r--r--examples/network/torrent/addtorrentdialog.h73
-rw-r--r--examples/network/torrent/bencodeparser.cpp234
-rw-r--r--examples/network/torrent/bencodeparser.h80
-rw-r--r--examples/network/torrent/connectionmanager.cpp88
-rw-r--r--examples/network/torrent/connectionmanager.h65
-rw-r--r--examples/network/torrent/filemanager.cpp446
-rw-r--r--examples/network/torrent/filemanager.h143
-rw-r--r--examples/network/torrent/forms/addtorrentform.ui266
-rw-r--r--examples/network/torrent/icons.qrc12
-rw-r--r--examples/network/torrent/icons/1downarrow.pngbin0 -> 895 bytes
-rw-r--r--examples/network/torrent/icons/1uparrow.pngbin0 -> 822 bytes
-rw-r--r--examples/network/torrent/icons/bottom.pngbin0 -> 1632 bytes
-rw-r--r--examples/network/torrent/icons/edit_add.pngbin0 -> 394 bytes
-rw-r--r--examples/network/torrent/icons/edit_remove.pngbin0 -> 368 bytes
-rw-r--r--examples/network/torrent/icons/exit.pngbin0 -> 1426 bytes
-rw-r--r--examples/network/torrent/icons/peertopeer.pngbin0 -> 10072 bytes
-rw-r--r--examples/network/torrent/icons/player_pause.pngbin0 -> 690 bytes
-rw-r--r--examples/network/torrent/icons/player_play.pngbin0 -> 900 bytes
-rw-r--r--examples/network/torrent/icons/player_stop.pngbin0 -> 627 bytes
-rw-r--r--examples/network/torrent/icons/stop.pngbin0 -> 1252 bytes
-rw-r--r--examples/network/torrent/main.cpp57
-rw-r--r--examples/network/torrent/mainwindow.cpp712
-rw-r--r--examples/network/torrent/mainwindow.h131
-rw-r--r--examples/network/torrent/metainfo.cpp217
-rw-r--r--examples/network/torrent/metainfo.h121
-rw-r--r--examples/network/torrent/peerwireclient.cpp664
-rw-r--r--examples/network/torrent/peerwireclient.h209
-rw-r--r--examples/network/torrent/ratecontroller.cpp155
-rw-r--r--examples/network/torrent/ratecontroller.h79
-rw-r--r--examples/network/torrent/torrent.pro39
-rw-r--r--examples/network/torrent/torrentclient.cpp1528
-rw-r--r--examples/network/torrent/torrentclient.h204
-rw-r--r--examples/network/torrent/torrentserver.cpp103
-rw-r--r--examples/network/torrent/torrentserver.h71
-rw-r--r--examples/network/torrent/trackerclient.cpp236
-rw-r--r--examples/network/torrent/trackerclient.h103
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro19
-rw-r--r--examples/opengl/2dpainting/glwidget.cpp72
-rw-r--r--examples/opengl/2dpainting/glwidget.h72
-rw-r--r--examples/opengl/2dpainting/helper.cpp90
-rw-r--r--examples/opengl/2dpainting/helper.h71
-rw-r--r--examples/opengl/2dpainting/main.cpp50
-rw-r--r--examples/opengl/2dpainting/widget.cpp72
-rw-r--r--examples/opengl/2dpainting/widget.h71
-rw-r--r--examples/opengl/2dpainting/window.cpp71
-rw-r--r--examples/opengl/2dpainting/window.h66
-rw-r--r--examples/opengl/README41
-rw-r--r--examples/opengl/framebufferobject2/cubelogo.pngbin0 -> 5920 bytes
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.pro13
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.qrc5
-rw-r--r--examples/opengl/framebufferobject2/glwidget.cpp248
-rw-r--r--examples/opengl/framebufferobject2/glwidget.h65
-rw-r--r--examples/opengl/framebufferobject2/main.cpp61
-rw-r--r--examples/opengl/grabber/glwidget.cpp283
-rw-r--r--examples/opengl/grabber/glwidget.h97
-rw-r--r--examples/opengl/grabber/grabber.pro14
-rw-r--r--examples/opengl/grabber/main.cpp51
-rw-r--r--examples/opengl/grabber/mainwindow.cpp206
-rw-r--r--examples/opengl/grabber/mainwindow.h94
-rw-r--r--examples/opengl/hellogl/glwidget.cpp199
-rw-r--r--examples/opengl/hellogl/glwidget.h94
-rw-r--r--examples/opengl/hellogl/hellogl.pro19
-rw-r--r--examples/opengl/hellogl/main.cpp59
-rw-r--r--examples/opengl/hellogl/window.cpp97
-rw-r--r--examples/opengl/hellogl/window.h72
-rw-r--r--examples/opengl/hellogl_es/bubble.cpp139
-rw-r--r--examples/opengl/hellogl_es/bubble.h76
-rw-r--r--examples/opengl/hellogl_es/glwidget.cpp455
-rw-r--r--examples/opengl/hellogl_es/glwidget.h85
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.pro27
-rw-r--r--examples/opengl/hellogl_es/main.cpp52
-rw-r--r--examples/opengl/hellogl_es/mainwindow.cpp107
-rw-r--r--examples/opengl/hellogl_es/mainwindow.h59
-rw-r--r--examples/opengl/hellogl_es/qt.pngbin0 -> 5174 bytes
-rw-r--r--examples/opengl/hellogl_es/texture.qrc5
-rw-r--r--examples/opengl/hellogl_es2/bubble.cpp139
-rw-r--r--examples/opengl/hellogl_es2/bubble.h76
-rw-r--r--examples/opengl/hellogl_es2/glwidget.cpp463
-rw-r--r--examples/opengl/hellogl_es2/glwidget.h94
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.pro27
-rw-r--r--examples/opengl/hellogl_es2/main.cpp52
-rw-r--r--examples/opengl/hellogl_es2/mainwindow.cpp107
-rw-r--r--examples/opengl/hellogl_es2/mainwindow.h59
-rw-r--r--examples/opengl/hellogl_es2/qt.pngbin0 -> 5174 bytes
-rw-r--r--examples/opengl/hellogl_es2/texture.qrc5
-rw-r--r--examples/opengl/opengl.pro35
-rw-r--r--examples/opengl/overpainting/bubble.cpp112
-rw-r--r--examples/opengl/overpainting/bubble.h75
-rw-r--r--examples/opengl/overpainting/glwidget.cpp283
-rw-r--r--examples/opengl/overpainting/glwidget.h111
-rw-r--r--examples/opengl/overpainting/main.cpp50
-rw-r--r--examples/opengl/overpainting/overpainting.pro23
-rw-r--r--examples/opengl/pbuffers/cube.cpp348
-rw-r--r--examples/opengl/pbuffers/cube.h149
-rw-r--r--examples/opengl/pbuffers/cubelogo.pngbin0 -> 5920 bytes
-rw-r--r--examples/opengl/pbuffers/glwidget.cpp246
-rw-r--r--examples/opengl/pbuffers/glwidget.h89
-rw-r--r--examples/opengl/pbuffers/main.cpp63
-rw-r--r--examples/opengl/pbuffers/pbuffers.pro19
-rw-r--r--examples/opengl/pbuffers/pbuffers.qrc5
-rw-r--r--examples/opengl/pbuffers2/bubbles.svg215
-rw-r--r--examples/opengl/pbuffers2/designer.pngbin0 -> 2810 bytes
-rw-r--r--examples/opengl/pbuffers2/glwidget.cpp327
-rw-r--r--examples/opengl/pbuffers2/glwidget.h84
-rw-r--r--examples/opengl/pbuffers2/main.cpp61
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.pro23
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.qrc6
-rw-r--r--examples/opengl/samplebuffers/glwidget.cpp164
-rw-r--r--examples/opengl/samplebuffers/glwidget.h61
-rw-r--r--examples/opengl/samplebuffers/main.cpp71
-rw-r--r--examples/opengl/samplebuffers/samplebuffers.pro12
-rw-r--r--examples/opengl/shared/qtlogo.cpp411
-rw-r--r--examples/opengl/shared/qtlogo.h66
-rw-r--r--examples/opengl/textures/glwidget.cpp245
-rw-r--r--examples/opengl/textures/glwidget.h89
-rw-r--r--examples/opengl/textures/images/side1.pngbin0 -> 935 bytes
-rw-r--r--examples/opengl/textures/images/side2.pngbin0 -> 1622 bytes
-rw-r--r--examples/opengl/textures/images/side3.pngbin0 -> 2117 bytes
-rw-r--r--examples/opengl/textures/images/side4.pngbin0 -> 1222 bytes
-rw-r--r--examples/opengl/textures/images/side5.pngbin0 -> 1806 bytes
-rw-r--r--examples/opengl/textures/images/side6.pngbin0 -> 2215 bytes
-rw-r--r--examples/opengl/textures/main.cpp53
-rw-r--r--examples/opengl/textures/textures.pro15
-rw-r--r--examples/opengl/textures/textures.qrc10
-rw-r--r--examples/opengl/textures/window.cpp86
-rw-r--r--examples/opengl/textures/window.h66
-rw-r--r--examples/openvg/README40
-rw-r--r--examples/openvg/openvg.pro8
-rw-r--r--examples/openvg/star/main.cpp53
-rw-r--r--examples/openvg/star/star.pro7
-rw-r--r--examples/openvg/star/starwidget.cpp115
-rw-r--r--examples/openvg/star/starwidget.h65
-rw-r--r--examples/painting/README42
-rw-r--r--examples/painting/basicdrawing/basicdrawing.pro17
-rw-r--r--examples/painting/basicdrawing/basicdrawing.qrc6
-rw-r--r--examples/painting/basicdrawing/images/brick.pngbin0 -> 767 bytes
-rw-r--r--examples/painting/basicdrawing/images/qt-logo.pngbin0 -> 3696 bytes
-rw-r--r--examples/painting/basicdrawing/main.cpp53
-rw-r--r--examples/painting/basicdrawing/renderarea.cpp207
-rw-r--r--examples/painting/basicdrawing/renderarea.h83
-rw-r--r--examples/painting/basicdrawing/window.cpp261
-rw-r--r--examples/painting/basicdrawing/window.h87
-rw-r--r--examples/painting/concentriccircles/circlewidget.cpp124
-rw-r--r--examples/painting/concentriccircles/circlewidget.h73
-rw-r--r--examples/painting/concentriccircles/concentriccircles.pro16
-rw-r--r--examples/painting/concentriccircles/main.cpp51
-rw-r--r--examples/painting/concentriccircles/window.cpp93
-rw-r--r--examples/painting/concentriccircles/window.h70
-rw-r--r--examples/painting/fontsampler/fontsampler.pro12
-rw-r--r--examples/painting/fontsampler/main.cpp51
-rw-r--r--examples/painting/fontsampler/mainwindow.cpp372
-rw-r--r--examples/painting/fontsampler/mainwindow.h82
-rw-r--r--examples/painting/fontsampler/mainwindowbase.ui140
-rw-r--r--examples/painting/imagecomposition/imagecomposer.cpp208
-rw-r--r--examples/painting/imagecomposition/imagecomposer.h87
-rw-r--r--examples/painting/imagecomposition/imagecomposition.pro15
-rw-r--r--examples/painting/imagecomposition/imagecomposition.qrc6
-rw-r--r--examples/painting/imagecomposition/images/background.pngbin0 -> 18579 bytes
-rw-r--r--examples/painting/imagecomposition/images/blackrectangle.pngbin0 -> 90 bytes
-rw-r--r--examples/painting/imagecomposition/images/butterfly.pngbin0 -> 36868 bytes
-rw-r--r--examples/painting/imagecomposition/images/checker.pngbin0 -> 10384 bytes
-rw-r--r--examples/painting/imagecomposition/main.cpp55
-rw-r--r--examples/painting/painterpaths/main.cpp51
-rw-r--r--examples/painting/painterpaths/painterpaths.pro17
-rw-r--r--examples/painting/painterpaths/renderarea.cpp130
-rw-r--r--examples/painting/painterpaths/renderarea.h80
-rw-r--r--examples/painting/painterpaths/window.cpp288
-rw-r--r--examples/painting/painterpaths/window.h92
-rw-r--r--examples/painting/painting.pro18
-rw-r--r--examples/painting/transformations/main.cpp51
-rw-r--r--examples/painting/transformations/renderarea.cpp172
-rw-r--r--examples/painting/transformations/renderarea.h90
-rw-r--r--examples/painting/transformations/transformations.pro16
-rw-r--r--examples/painting/transformations/window.cpp180
-rw-r--r--examples/painting/transformations/window.h80
-rw-r--r--examples/qmake/precompile/main.cpp60
-rw-r--r--examples/qmake/precompile/mydialog.cpp47
-rw-r--r--examples/qmake/precompile/mydialog.h54
-rw-r--r--examples/qmake/precompile/mydialog.ui47
-rw-r--r--examples/qmake/precompile/myobject.cpp57
-rw-r--r--examples/qmake/precompile/myobject.h55
-rw-r--r--examples/qmake/precompile/precompile.pro22
-rw-r--r--examples/qmake/precompile/stable.h52
-rw-r--r--examples/qmake/precompile/util.cpp49
-rw-r--r--examples/qmake/tutorial/hello.cpp49
-rw-r--r--examples/qmake/tutorial/hello.h47
-rw-r--r--examples/qmake/tutorial/hellounix.cpp42
-rw-r--r--examples/qmake/tutorial/hellowin.cpp42
-rw-r--r--examples/qmake/tutorial/main.cpp53
-rw-r--r--examples/qtconcurrent/README38
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.cpp146
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.h81
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro17
-rw-r--r--examples/qtconcurrent/imagescaling/main.cpp63
-rw-r--r--examples/qtconcurrent/map/main.cpp81
-rw-r--r--examples/qtconcurrent/map/map.pro16
-rw-r--r--examples/qtconcurrent/progressdialog/main.cpp99
-rw-r--r--examples/qtconcurrent/progressdialog/progressdialog.pro16
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro17
-rw-r--r--examples/qtconcurrent/runfunction/main.cpp72
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.pro16
-rw-r--r--examples/qtconcurrent/wordcount/main.cpp166
-rw-r--r--examples/qtconcurrent/wordcount/wordcount.pro16
-rw-r--r--examples/qtestlib/README38
-rw-r--r--examples/qtestlib/qtestlib.pro10
-rw-r--r--examples/qtestlib/tutorial1/testqstring.cpp64
-rw-r--r--examples/qtestlib/tutorial1/tutorial1.pro13
-rw-r--r--examples/qtestlib/tutorial2/testqstring.cpp80
-rw-r--r--examples/qtestlib/tutorial2/tutorial2.pro13
-rw-r--r--examples/qtestlib/tutorial3/testgui.cpp70
-rw-r--r--examples/qtestlib/tutorial3/tutorial3.pro13
-rw-r--r--examples/qtestlib/tutorial4/testgui.cpp90
-rw-r--r--examples/qtestlib/tutorial4/tutorial4.pro13
-rw-r--r--examples/qtestlib/tutorial5/benchmarking.cpp134
-rw-r--r--examples/qtestlib/tutorial5/containers.cpp268
-rw-r--r--examples/qtestlib/tutorial5/tutorial5.pro13
-rw-r--r--examples/qws/README38
-rw-r--r--examples/qws/dbscreen/dbscreen.cpp95
-rw-r--r--examples/qws/dbscreen/dbscreen.h66
-rw-r--r--examples/qws/dbscreen/dbscreen.pro11
-rw-r--r--examples/qws/dbscreen/dbscreendriverplugin.cpp76
-rw-r--r--examples/qws/framebuffer/framebuffer.pro11
-rw-r--r--examples/qws/framebuffer/main.c585
-rw-r--r--examples/qws/mousecalibration/calibration.cpp144
-rw-r--r--examples/qws/mousecalibration/calibration.h67
-rw-r--r--examples/qws/mousecalibration/main.cpp92
-rw-r--r--examples/qws/mousecalibration/mousecalibration.pro11
-rw-r--r--examples/qws/mousecalibration/scribblewidget.cpp92
-rw-r--r--examples/qws/mousecalibration/scribblewidget.h70
-rw-r--r--examples/qws/qws.pro9
-rw-r--r--examples/qws/simpledecoration/analogclock.cpp110
-rw-r--r--examples/qws/simpledecoration/analogclock.h57
-rw-r--r--examples/qws/simpledecoration/main.cpp59
-rw-r--r--examples/qws/simpledecoration/mydecoration.cpp374
-rw-r--r--examples/qws/simpledecoration/mydecoration.h72
-rw-r--r--examples/qws/simpledecoration/simpledecoration.pro12
-rw-r--r--examples/qws/svgalib/README9
-rw-r--r--examples/qws/svgalib/svgalib.pro19
-rw-r--r--examples/qws/svgalib/svgalibpaintdevice.cpp66
-rw-r--r--examples/qws/svgalib/svgalibpaintdevice.h65
-rw-r--r--examples/qws/svgalib/svgalibpaintengine.cpp190
-rw-r--r--examples/qws/svgalib/svgalibpaintengine.h78
-rw-r--r--examples/qws/svgalib/svgalibplugin.cpp74
-rw-r--r--examples/qws/svgalib/svgalibscreen.cpp353
-rw-r--r--examples/qws/svgalib/svgalibscreen.h83
-rw-r--r--examples/qws/svgalib/svgalibsurface.cpp86
-rw-r--r--examples/qws/svgalib/svgalibsurface.h75
-rw-r--r--examples/richtext/README42
-rw-r--r--examples/richtext/calendar/calendar.pro11
-rw-r--r--examples/richtext/calendar/main.cpp52
-rw-r--r--examples/richtext/calendar/mainwindow.cpp214
-rw-r--r--examples/richtext/calendar/mainwindow.h73
-rw-r--r--examples/richtext/orderform/detailsdialog.cpp156
-rw-r--r--examples/richtext/orderform/detailsdialog.h90
-rw-r--r--examples/richtext/orderform/main.cpp55
-rw-r--r--examples/richtext/orderform/mainwindow.cpp249
-rw-r--r--examples/richtext/orderform/mainwindow.h76
-rw-r--r--examples/richtext/orderform/orderform.pro13
-rw-r--r--examples/richtext/richtext.pro14
-rw-r--r--examples/richtext/syntaxhighlighter/highlighter.cpp147
-rw-r--r--examples/richtext/syntaxhighlighter/highlighter.h84
-rw-r--r--examples/richtext/syntaxhighlighter/main.cpp52
-rw-r--r--examples/richtext/syntaxhighlighter/mainwindow.cpp128
-rw-r--r--examples/richtext/syntaxhighlighter/mainwindow.h75
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.pro19
-rw-r--r--examples/scroller/graphicsview/graphicsview.pro8
-rw-r--r--examples/scroller/graphicsview/main.cpp295
-rw-r--r--examples/scroller/scroller.pro2
-rw-r--r--examples/sql/README40
-rw-r--r--examples/sql/cachedtable/cachedtable.pro13
-rw-r--r--examples/sql/cachedtable/main.cpp57
-rw-r--r--examples/sql/cachedtable/tableeditor.cpp105
-rw-r--r--examples/sql/cachedtable/tableeditor.h72
-rw-r--r--examples/sql/connection.h135
-rw-r--r--examples/sql/drilldown/drilldown.pro21
-rw-r--r--examples/sql/drilldown/drilldown.qrc11
-rw-r--r--examples/sql/drilldown/imageitem.cpp123
-rw-r--r--examples/sql/drilldown/imageitem.h74
-rw-r--r--examples/sql/drilldown/images/beijing.pngbin0 -> 99093 bytes
-rw-r--r--examples/sql/drilldown/images/berlin.pngbin0 -> 81944 bytes
-rw-r--r--examples/sql/drilldown/images/brisbane.pngbin0 -> 57785 bytes
-rw-r--r--examples/sql/drilldown/images/munich.pngbin0 -> 59769 bytes
-rw-r--r--examples/sql/drilldown/images/oslo.pngbin0 -> 41781 bytes
-rw-r--r--examples/sql/drilldown/images/redwood.pngbin0 -> 39050 bytes
-rw-r--r--examples/sql/drilldown/informationwindow.cpp167
-rw-r--r--examples/sql/drilldown/informationwindow.h90
-rw-r--r--examples/sql/drilldown/logo.pngbin0 -> 13378 bytes
-rw-r--r--examples/sql/drilldown/main.cpp65
-rw-r--r--examples/sql/drilldown/view.cpp191
-rw-r--r--examples/sql/drilldown/view.h80
-rw-r--r--examples/sql/masterdetail/albumdetails.xml98
-rw-r--r--examples/sql/masterdetail/database.h96
-rw-r--r--examples/sql/masterdetail/dialog.cpp282
-rw-r--r--examples/sql/masterdetail/dialog.h82
-rw-r--r--examples/sql/masterdetail/images/icon.pngbin0 -> 30095 bytes
-rw-r--r--examples/sql/masterdetail/images/image.pngbin0 -> 166692 bytes
-rw-r--r--examples/sql/masterdetail/main.cpp59
-rw-r--r--examples/sql/masterdetail/mainwindow.cpp429
-rw-r--r--examples/sql/masterdetail/mainwindow.h103
-rw-r--r--examples/sql/masterdetail/masterdetail.pro21
-rw-r--r--examples/sql/masterdetail/masterdetail.qrc6
-rw-r--r--examples/sql/querymodel/customsqlmodel.cpp64
-rw-r--r--examples/sql/querymodel/customsqlmodel.h58
-rw-r--r--examples/sql/querymodel/editablesqlmodel.cpp109
-rw-r--r--examples/sql/querymodel/editablesqlmodel.h62
-rw-r--r--examples/sql/querymodel/main.cpp86
-rw-r--r--examples/sql/querymodel/querymodel.pro15
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.cpp114
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.pro11
-rw-r--r--examples/sql/sql.pro20
-rw-r--r--examples/sql/sqlwidgetmapper/main.cpp51
-rw-r--r--examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro13
-rw-r--r--examples/sql/sqlwidgetmapper/window.cpp158
-rw-r--r--examples/sql/sqlwidgetmapper/window.h89
-rw-r--r--examples/sql/tablemodel/tablemodel.cpp83
-rw-r--r--examples/sql/tablemodel/tablemodel.pro11
-rw-r--r--examples/statemachine/README36
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.pro7
-rw-r--r--examples/statemachine/eventtransitions/main.cpp110
-rw-r--r--examples/statemachine/factorial/factorial.pro11
-rw-r--r--examples/statemachine/factorial/main.cpp175
-rw-r--r--examples/statemachine/pingpong/main.cpp139
-rw-r--r--examples/statemachine/pingpong/pingpong.pro11
-rw-r--r--examples/statemachine/rogue/main.cpp54
-rw-r--r--examples/statemachine/rogue/movementtransition.h107
-rw-r--r--examples/statemachine/rogue/rogue.pro11
-rw-r--r--examples/statemachine/rogue/window.cpp200
-rw-r--r--examples/statemachine/rogue/window.h90
-rw-r--r--examples/statemachine/statemachine.pro18
-rw-r--r--examples/statemachine/trafficlight/main.cpp184
-rw-r--r--examples/statemachine/trafficlight/trafficlight.pro7
-rw-r--r--examples/statemachine/twowaybutton/main.cpp81
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.pro7
-rw-r--r--examples/symbianpkgrules.pri20
-rw-r--r--examples/threads/README40
-rw-r--r--examples/threads/mandelbrot/main.cpp53
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro15
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.cpp239
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.h84
-rw-r--r--examples/threads/mandelbrot/renderthread.cpp215
-rw-r--r--examples/threads/mandelbrot/renderthread.h88
-rw-r--r--examples/threads/queuedcustomtype/block.cpp73
-rw-r--r--examples/threads/queuedcustomtype/block.h70
-rw-r--r--examples/threads/queuedcustomtype/main.cpp128
-rw-r--r--examples/threads/queuedcustomtype/queuedcustomtype.pro7
-rw-r--r--examples/threads/queuedcustomtype/renderthread.cpp109
-rw-r--r--examples/threads/queuedcustomtype/renderthread.h76
-rw-r--r--examples/threads/queuedcustomtype/window.cpp136
-rw-r--r--examples/threads/queuedcustomtype/window.h76
-rw-r--r--examples/threads/semaphores/semaphores.cpp106
-rw-r--r--examples/threads/semaphores/semaphores.pro12
-rw-r--r--examples/threads/threads.pro13
-rw-r--r--examples/threads/waitconditions/waitconditions.cpp125
-rw-r--r--examples/threads/waitconditions/waitconditions.pro21
-rw-r--r--examples/tools/README40
-rw-r--r--examples/tools/codecs/codecs.pro13
-rw-r--r--examples/tools/codecs/encodedfiles/iso-8859-1.txt6
-rw-r--r--examples/tools/codecs/encodedfiles/iso-8859-15.txt8
-rw-r--r--examples/tools/codecs/encodedfiles/utf-16.txtbin0 -> 162 bytes
-rw-r--r--examples/tools/codecs/encodedfiles/utf-16be.txtbin0 -> 160 bytes
-rw-r--r--examples/tools/codecs/encodedfiles/utf-16le.txtbin0 -> 160 bytes
-rw-r--r--examples/tools/codecs/encodedfiles/utf-8.txt6
-rw-r--r--examples/tools/codecs/main.cpp51
-rw-r--r--examples/tools/codecs/mainwindow.cpp202
-rw-r--r--examples/tools/codecs/mainwindow.h87
-rw-r--r--examples/tools/codecs/previewform.cpp101
-rw-r--r--examples/tools/codecs/previewform.h79
-rw-r--r--examples/tools/completer/completer.pro14
-rw-r--r--examples/tools/completer/completer.qrc6
-rw-r--r--examples/tools/completer/fsmodel.cpp63
-rw-r--r--examples/tools/completer/fsmodel.h60
-rw-r--r--examples/tools/completer/main.cpp54
-rw-r--r--examples/tools/completer/mainwindow.cpp281
-rw-r--r--examples/tools/completer/mainwindow.h89
-rw-r--r--examples/tools/completer/resources/countries.txt241
-rw-r--r--examples/tools/completer/resources/wordlist.txt1485
-rw-r--r--examples/tools/contiguouscache/contiguouscache.pro9
-rw-r--r--examples/tools/contiguouscache/main.cpp55
-rw-r--r--examples/tools/contiguouscache/randomlistmodel.cpp96
-rw-r--r--examples/tools/contiguouscache/randomlistmodel.h65
-rw-r--r--examples/tools/customcompleter/customcompleter.pro14
-rw-r--r--examples/tools/customcompleter/customcompleter.qrc5
-rw-r--r--examples/tools/customcompleter/main.cpp54
-rw-r--r--examples/tools/customcompleter/mainwindow.cpp117
-rw-r--r--examples/tools/customcompleter/mainwindow.h76
-rw-r--r--examples/tools/customcompleter/resources/wordlist.txt1454
-rw-r--r--examples/tools/customcompleter/textedit.cpp173
-rw-r--r--examples/tools/customcompleter/textedit.h78
-rw-r--r--examples/tools/customtype/customtype.pro3
-rw-r--r--examples/tools/customtype/main.cpp73
-rw-r--r--examples/tools/customtype/message.cpp89
-rw-r--r--examples/tools/customtype/message.h75
-rw-r--r--examples/tools/customtypesending/customtypesending.pro5
-rw-r--r--examples/tools/customtypesending/main.cpp67
-rw-r--r--examples/tools/customtypesending/message.cpp71
-rw-r--r--examples/tools/customtypesending/message.h71
-rw-r--r--examples/tools/customtypesending/window.cpp79
-rw-r--r--examples/tools/customtypesending/window.h72
-rw-r--r--examples/tools/echoplugin/echoplugin.pro13
-rw-r--r--examples/tools/echoplugin/echowindow/echointerface.h61
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.cpp118
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.h79
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.pro21
-rw-r--r--examples/tools/echoplugin/echowindow/main.cpp56
-rw-r--r--examples/tools/echoplugin/plugin/echoplugin.cpp54
-rw-r--r--examples/tools/echoplugin/plugin/echoplugin.h59
-rw-r--r--examples/tools/echoplugin/plugin/plugin.pro19
-rw-r--r--examples/tools/i18n/i18n.pro28
-rw-r--r--examples/tools/i18n/i18n.qrc18
-rw-r--r--examples/tools/i18n/languagechooser.cpp166
-rw-r--r--examples/tools/i18n/languagechooser.h85
-rw-r--r--examples/tools/i18n/main.cpp54
-rw-r--r--examples/tools/i18n/mainwindow.cpp95
-rw-r--r--examples/tools/i18n/mainwindow.h76
-rw-r--r--examples/tools/i18n/translations/i18n_ar.qmbin0 -> 736 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_ar.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_cs.qmbin0 -> 796 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_cs.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_de.qmbin0 -> 848 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_de.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_el.qmbin0 -> 804 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_el.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_en.qmbin0 -> 810 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_en.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_eo.qmbin0 -> 806 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_eo.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_fr.qmbin0 -> 844 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_fr.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_it.qmbin0 -> 808 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_it.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_jp.qmbin0 -> 722 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_jp.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_ko.qmbin0 -> 690 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_ko.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_no.qmbin0 -> 804 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_no.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_ru.qmbin0 -> 806 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_ru.ts59
-rw-r--r--examples/tools/i18n/translations/i18n_sv.qmbin0 -> 814 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_sv.ts57
-rw-r--r--examples/tools/i18n/translations/i18n_zh.qmbin0 -> 700 bytes
-rw-r--r--examples/tools/i18n/translations/i18n_zh.ts57
-rw-r--r--examples/tools/inputpanel/inputpanel.pro17
-rw-r--r--examples/tools/inputpanel/main.cpp61
-rw-r--r--examples/tools/inputpanel/mainform.ui76
-rw-r--r--examples/tools/inputpanel/myinputpanel.cpp133
-rw-r--r--examples/tools/inputpanel/myinputpanel.h76
-rw-r--r--examples/tools/inputpanel/myinputpanelcontext.cpp131
-rw-r--r--examples/tools/inputpanel/myinputpanelcontext.h81
-rw-r--r--examples/tools/inputpanel/myinputpanelform.ui398
-rw-r--r--examples/tools/plugandpaint/interfaces.h110
-rw-r--r--examples/tools/plugandpaint/main.cpp57
-rw-r--r--examples/tools/plugandpaint/mainwindow.cpp309
-rw-r--r--examples/tools/plugandpaint/mainwindow.h103
-rw-r--r--examples/tools/plugandpaint/paintarea.cpp195
-rw-r--r--examples/tools/plugandpaint/paintarea.h91
-rw-r--r--examples/tools/plugandpaint/plugandpaint.pro28
-rw-r--r--examples/tools/plugandpaint/plugindialog.cpp156
-rw-r--r--examples/tools/plugandpaint/plugindialog.h76
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.pro17
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictoolsplugin.cpp197
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h87
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro19
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.cpp124
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h63
-rw-r--r--examples/tools/plugandpaintplugins/plugandpaintplugins.pro11
-rw-r--r--examples/tools/regexp/main.cpp51
-rw-r--r--examples/tools/regexp/regexp.pro11
-rw-r--r--examples/tools/regexp/regexpdialog.cpp188
-rw-r--r--examples/tools/regexp/regexpdialog.h85
-rw-r--r--examples/tools/settingseditor/inifiles/licensepage.ini46
-rw-r--r--examples/tools/settingseditor/inifiles/qsa.ini26
-rw-r--r--examples/tools/settingseditor/locationdialog.cpp216
-rw-r--r--examples/tools/settingseditor/locationdialog.h84
-rw-r--r--examples/tools/settingseditor/main.cpp51
-rw-r--r--examples/tools/settingseditor/mainwindow.cpp222
-rw-r--r--examples/tools/settingseditor/mainwindow.h91
-rw-r--r--examples/tools/settingseditor/settingseditor.pro17
-rw-r--r--examples/tools/settingseditor/settingstree.cpp262
-rw-r--r--examples/tools/settingseditor/settingstree.h90
-rw-r--r--examples/tools/settingseditor/variantdelegate.cpp316
-rw-r--r--examples/tools/settingseditor/variantdelegate.h81
-rw-r--r--examples/tools/styleplugin/plugin/plugin.pro25
-rw-r--r--examples/tools/styleplugin/plugin/simplestyle.cpp48
-rw-r--r--examples/tools/styleplugin/plugin/simplestyle.h60
-rw-r--r--examples/tools/styleplugin/plugin/simplestyleplugin.cpp64
-rw-r--r--examples/tools/styleplugin/plugin/simplestyleplugin.h64
-rw-r--r--examples/tools/styleplugin/styleplugin.pro11
-rw-r--r--examples/tools/styleplugin/stylewindow/main.cpp57
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.cpp60
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.h54
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.pro19
-rw-r--r--examples/tools/tools.pro26
-rw-r--r--examples/tools/treemodelcompleter/main.cpp54
-rw-r--r--examples/tools/treemodelcompleter/mainwindow.cpp246
-rw-r--r--examples/tools/treemodelcompleter/mainwindow.h88
-rw-r--r--examples/tools/treemodelcompleter/resources/treemodel.txt20
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.cpp97
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.h70
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.pro14
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.qrc5
-rw-r--r--examples/tools/undoframework/commands.cpp168
-rw-r--r--examples/tools/undoframework/commands.h104
-rw-r--r--examples/tools/undoframework/diagramitem.cpp65
-rw-r--r--examples/tools/undoframework/diagramitem.h72
-rw-r--r--examples/tools/undoframework/diagramscene.cpp75
-rw-r--r--examples/tools/undoframework/diagramscene.h74
-rw-r--r--examples/tools/undoframework/images/cross.pngbin0 -> 114 bytes
-rw-r--r--examples/tools/undoframework/main.cpp57
-rw-r--r--examples/tools/undoframework/mainwindow.cpp206
-rw-r--r--examples/tools/undoframework/mainwindow.h99
-rw-r--r--examples/tools/undoframework/undoframework.pro18
-rw-r--r--examples/tools/undoframework/undoframework.qrc6
-rw-r--r--examples/touch/dials/dials.pro8
-rw-r--r--examples/touch/dials/dials.ui77
-rw-r--r--examples/touch/dials/main.cpp58
-rw-r--r--examples/touch/fingerpaint/fingerpaint.pro11
-rw-r--r--examples/touch/fingerpaint/main.cpp51
-rw-r--r--examples/touch/fingerpaint/mainwindow.cpp217
-rw-r--r--examples/touch/fingerpaint/mainwindow.h88
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp211
-rw-r--r--examples/touch/fingerpaint/scribblearea.h80
-rw-r--r--examples/touch/knobs/knob.cpp88
-rw-r--r--examples/touch/knobs/knob.h54
-rw-r--r--examples/touch/knobs/knobs.pro8
-rw-r--r--examples/touch/knobs/main.cpp64
-rw-r--r--examples/touch/pinchzoom/graphicsview.cpp85
-rw-r--r--examples/touch/pinchzoom/graphicsview.h55
-rw-r--r--examples/touch/pinchzoom/images/cheese.jpgbin0 -> 3029 bytes
-rw-r--r--examples/touch/pinchzoom/main.cpp86
-rw-r--r--examples/touch/pinchzoom/mice.qrc5
-rw-r--r--examples/touch/pinchzoom/mouse.cpp199
-rw-r--r--examples/touch/pinchzoom/mouse.h70
-rw-r--r--examples/touch/pinchzoom/pinchzoom.pro16
-rw-r--r--examples/touch/touch.pro2
-rw-r--r--examples/tutorials/README37
-rw-r--r--examples/tutorials/addressbook-fr/README42
-rw-r--r--examples/tutorials/addressbook-fr/addressbook-fr.pro8
-rw-r--r--examples/tutorials/addressbook-fr/part1/addressbook.cpp67
-rw-r--r--examples/tutorials/addressbook-fr/part1/addressbook.h66
-rw-r--r--examples/tutorials/addressbook-fr/part1/main.cpp54
-rw-r--r--examples/tutorials/addressbook-fr/part1/part1.pro9
-rw-r--r--examples/tutorials/addressbook-fr/part2/addressbook.cpp157
-rw-r--r--examples/tutorials/addressbook-fr/part2/addressbook.h84
-rw-r--r--examples/tutorials/addressbook-fr/part2/main.cpp54
-rw-r--r--examples/tutorials/addressbook-fr/part2/part2.pro9
-rw-r--r--examples/tutorials/addressbook-fr/part3/addressbook.cpp215
-rw-r--r--examples/tutorials/addressbook-fr/part3/addressbook.h86
-rw-r--r--examples/tutorials/addressbook-fr/part3/main.cpp52
-rw-r--r--examples/tutorials/addressbook-fr/part3/part3.pro9
-rw-r--r--examples/tutorials/addressbook-fr/part4/addressbook.cpp288
-rw-r--r--examples/tutorials/addressbook-fr/part4/addressbook.h99
-rw-r--r--examples/tutorials/addressbook-fr/part4/main.cpp52
-rw-r--r--examples/tutorials/addressbook-fr/part4/part4.pro9
-rw-r--r--examples/tutorials/addressbook-fr/part5/addressbook.cpp312
-rw-r--r--examples/tutorials/addressbook-fr/part5/addressbook.h102
-rw-r--r--examples/tutorials/addressbook-fr/part5/finddialog.cpp86
-rw-r--r--examples/tutorials/addressbook-fr/part5/finddialog.h68
-rw-r--r--examples/tutorials/addressbook-fr/part5/main.cpp52
-rw-r--r--examples/tutorials/addressbook-fr/part5/part5.pro11
-rw-r--r--examples/tutorials/addressbook-fr/part6/addressbook.cpp393
-rw-r--r--examples/tutorials/addressbook-fr/part6/addressbook.h103
-rw-r--r--examples/tutorials/addressbook-fr/part6/finddialog.cpp82
-rw-r--r--examples/tutorials/addressbook-fr/part6/finddialog.h68
-rw-r--r--examples/tutorials/addressbook-fr/part6/main.cpp52
-rw-r--r--examples/tutorials/addressbook-fr/part6/part6.pro11
-rw-r--r--examples/tutorials/addressbook-fr/part7/addressbook.cpp446
-rw-r--r--examples/tutorials/addressbook-fr/part7/addressbook.h105
-rw-r--r--examples/tutorials/addressbook-fr/part7/finddialog.cpp82
-rw-r--r--examples/tutorials/addressbook-fr/part7/finddialog.h68
-rw-r--r--examples/tutorials/addressbook-fr/part7/main.cpp52
-rw-r--r--examples/tutorials/addressbook-fr/part7/part7.pro11
-rw-r--r--examples/tutorials/addressbook/README42
-rw-r--r--examples/tutorials/addressbook/addressbook.pro10
-rw-r--r--examples/tutorials/addressbook/part1/addressbook.cpp67
-rw-r--r--examples/tutorials/addressbook/part1/addressbook.h66
-rw-r--r--examples/tutorials/addressbook/part1/main.cpp54
-rw-r--r--examples/tutorials/addressbook/part1/part1.pro11
-rw-r--r--examples/tutorials/addressbook/part2/addressbook.cpp157
-rw-r--r--examples/tutorials/addressbook/part2/addressbook.h84
-rw-r--r--examples/tutorials/addressbook/part2/main.cpp54
-rw-r--r--examples/tutorials/addressbook/part2/part2.pro11
-rw-r--r--examples/tutorials/addressbook/part3/addressbook.cpp215
-rw-r--r--examples/tutorials/addressbook/part3/addressbook.h86
-rw-r--r--examples/tutorials/addressbook/part3/main.cpp52
-rw-r--r--examples/tutorials/addressbook/part3/part3.pro11
-rw-r--r--examples/tutorials/addressbook/part4/addressbook.cpp288
-rw-r--r--examples/tutorials/addressbook/part4/addressbook.h99
-rw-r--r--examples/tutorials/addressbook/part4/main.cpp52
-rw-r--r--examples/tutorials/addressbook/part4/part4.pro11
-rw-r--r--examples/tutorials/addressbook/part5/addressbook.cpp312
-rw-r--r--examples/tutorials/addressbook/part5/addressbook.h102
-rw-r--r--examples/tutorials/addressbook/part5/finddialog.cpp86
-rw-r--r--examples/tutorials/addressbook/part5/finddialog.h68
-rw-r--r--examples/tutorials/addressbook/part5/main.cpp52
-rw-r--r--examples/tutorials/addressbook/part5/part5.pro13
-rw-r--r--examples/tutorials/addressbook/part6/addressbook.cpp393
-rw-r--r--examples/tutorials/addressbook/part6/addressbook.h103
-rw-r--r--examples/tutorials/addressbook/part6/finddialog.cpp82
-rw-r--r--examples/tutorials/addressbook/part6/finddialog.h68
-rw-r--r--examples/tutorials/addressbook/part6/main.cpp52
-rw-r--r--examples/tutorials/addressbook/part6/part6.pro13
-rw-r--r--examples/tutorials/addressbook/part7/addressbook.cpp446
-rw-r--r--examples/tutorials/addressbook/part7/addressbook.h105
-rw-r--r--examples/tutorials/addressbook/part7/finddialog.cpp82
-rw-r--r--examples/tutorials/addressbook/part7/finddialog.h68
-rw-r--r--examples/tutorials/addressbook/part7/main.cpp52
-rw-r--r--examples/tutorials/addressbook/part7/part7.pro13
-rw-r--r--examples/tutorials/gettingStarted/gettingStarted.pro2
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/gsqt.pro13
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part1/main.cpp53
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part2/main.cpp63
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part3/main.cpp97
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part4/main.cpp108
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part5/main.cpp134
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/1_readonly.pro17
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/main.cpp56
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/mymodel.cpp70
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/mymodel.h59
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/2_formatting.pro16
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/main.cpp56
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/mymodel.cpp112
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/mymodel.h56
-rwxr-xr-xexamples/tutorials/modelview/3_changingmodel/3_changingmodel.pro16
-rwxr-xr-xexamples/tutorials/modelview/3_changingmodel/main.cpp53
-rwxr-xr-xexamples/tutorials/modelview/3_changingmodel/mymodel.cpp94
-rwxr-xr-xexamples/tutorials/modelview/3_changingmodel/mymodel.h62
-rwxr-xr-xexamples/tutorials/modelview/4_headers/4_headers.pro16
-rwxr-xr-xexamples/tutorials/modelview/4_headers/main.cpp53
-rwxr-xr-xexamples/tutorials/modelview/4_headers/mymodel.cpp91
-rwxr-xr-xexamples/tutorials/modelview/4_headers/mymodel.h57
-rwxr-xr-xexamples/tutorials/modelview/5_edit/5_edit.pro18
-rwxr-xr-xexamples/tutorials/modelview/5_edit/main.cpp50
-rwxr-xr-xexamples/tutorials/modelview/5_edit/mainwindow.cpp60
-rwxr-xr-xexamples/tutorials/modelview/5_edit/mainwindow.h62
-rwxr-xr-xexamples/tutorials/modelview/5_edit/mymodel.cpp101
-rwxr-xr-xexamples/tutorials/modelview/5_edit/mymodel.h70
-rwxr-xr-xexamples/tutorials/modelview/6_treeview/6_treeview.pro13
-rwxr-xr-xexamples/tutorials/modelview/6_treeview/main.cpp50
-rwxr-xr-xexamples/tutorials/modelview/6_treeview/mainwindow.cpp82
-rwxr-xr-xexamples/tutorials/modelview/6_treeview/mainwindow.h66
-rwxr-xr-xexamples/tutorials/modelview/7_selections/7_selections.pro13
-rwxr-xr-xexamples/tutorials/modelview/7_selections/main.cpp50
-rwxr-xr-xexamples/tutorials/modelview/7_selections/mainwindow.cpp109
-rwxr-xr-xexamples/tutorials/modelview/7_selections/mainwindow.h65
-rwxr-xr-xexamples/tutorials/modelview/modelview.pro16
-rwxr-xr-xexamples/tutorials/threads/clock/clock.pro14
-rw-r--r--examples/tutorials/threads/clock/clockthread.cpp66
-rw-r--r--examples/tutorials/threads/clock/clockthread.h64
-rwxr-xr-xexamples/tutorials/threads/clock/main.cpp67
-rwxr-xr-xexamples/tutorials/threads/helloconcurrent/helloconcurrent.cpp61
-rwxr-xr-xexamples/tutorials/threads/helloconcurrent/helloconcurrent.pro16
-rwxr-xr-xexamples/tutorials/threads/hellothread/hellothread.cpp53
-rwxr-xr-xexamples/tutorials/threads/hellothread/hellothread.h54
-rwxr-xr-xexamples/tutorials/threads/hellothread/hellothread.pro17
-rwxr-xr-xexamples/tutorials/threads/hellothread/main.cpp54
-rwxr-xr-xexamples/tutorials/threads/hellothreadpool/hellothreadpool.cpp65
-rwxr-xr-xexamples/tutorials/threads/hellothreadpool/hellothreadpool.pro17
-rwxr-xr-xexamples/tutorials/threads/movedobject/main.cpp69
-rwxr-xr-xexamples/tutorials/threads/movedobject/movedobject.pro18
-rw-r--r--examples/tutorials/threads/movedobject/thread.cpp101
-rw-r--r--examples/tutorials/threads/movedobject/thread.h67
-rw-r--r--examples/tutorials/threads/movedobject/workerobject.cpp87
-rw-r--r--examples/tutorials/threads/movedobject/workerobject.h64
-rw-r--r--examples/tutorials/threads/threads.pro8
-rw-r--r--examples/tutorials/tutorials.pro2
-rw-r--r--examples/tutorials/widgets/childwidget/childwidget.pro7
-rw-r--r--examples/tutorials/widgets/childwidget/main.cpp60
-rw-r--r--examples/tutorials/widgets/nestedlayouts/main.cpp103
-rw-r--r--examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro7
-rw-r--r--examples/tutorials/widgets/toplevel/main.cpp56
-rw-r--r--examples/tutorials/widgets/toplevel/toplevel.pro7
-rw-r--r--examples/tutorials/widgets/widgets.pro8
-rw-r--r--examples/tutorials/widgets/windowlayout/main.cpp62
-rw-r--r--examples/tutorials/widgets/windowlayout/windowlayout.pro7
-rw-r--r--examples/uitools/multipleinheritance/calculatorform.cpp65
-rw-r--r--examples/uitools/multipleinheritance/calculatorform.h62
-rw-r--r--examples/uitools/multipleinheritance/calculatorform.ui303
-rw-r--r--examples/uitools/multipleinheritance/main.cpp52
-rw-r--r--examples/uitools/multipleinheritance/multipleinheritance.pro16
-rw-r--r--examples/uitools/textfinder/forms/input.txt9
-rw-r--r--examples/uitools/textfinder/forms/textfinder.ui89
-rw-r--r--examples/uitools/textfinder/main.cpp55
-rw-r--r--examples/uitools/textfinder/textfinder.cpp155
-rw-r--r--examples/uitools/textfinder/textfinder.h74
-rw-r--r--examples/uitools/textfinder/textfinder.pro12
-rw-r--r--examples/uitools/textfinder/textfinder.qrc6
-rw-r--r--examples/uitools/uitools.pro12
-rw-r--r--examples/webkit/webkit-guide/_copyright.txt40
-rw-r--r--examples/webkit/webkit-guide/_image_assets.htm331
-rw-r--r--examples/webkit/webkit-guide/_index.html322
-rw-r--r--examples/webkit/webkit-guide/anim_accord.htm122
-rw-r--r--examples/webkit/webkit-guide/anim_demo-rotate.htm63
-rw-r--r--examples/webkit/webkit-guide/anim_demo-scale.htm67
-rw-r--r--examples/webkit/webkit-guide/anim_demo-skew.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_gallery.htm114
-rw-r--r--examples/webkit/webkit-guide/anim_panel.htm63
-rw-r--r--examples/webkit/webkit-guide/anim_pulse.htm71
-rw-r--r--examples/webkit/webkit-guide/anim_skew.htm80
-rw-r--r--examples/webkit/webkit-guide/anim_slide1.htm61
-rw-r--r--examples/webkit/webkit-guide/anim_slide2.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide3.htm65
-rw-r--r--examples/webkit/webkit-guide/anim_tabbedSkew.htm88
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_accord.css246
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-rotate.css95
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-scale.css112
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-skew.css98
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_gallery.css110
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_panel.css116
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_pulse.css100
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_skew.css186
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_slide.css148
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_tabbedSkew.css113
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_backgrounds.css105
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_border-img.css70
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_grad-radial.css66
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientBack.css77
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientBackStop.css77
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientButton.css88
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_mask-grad.css60
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_mask-img.css58
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_multicol.css110
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_reflect.css127
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_scroll.css93
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_sel-nth.css63
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_shadow.css145
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_shadowBlur.css145
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-overflow.css119
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-shadow.css67
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-stroke.css75
-rwxr-xr-xexamples/webkit/webkit-guide/css/form_tapper.css108
-rwxr-xr-xexamples/webkit/webkit-guide/css/form_toggler.css200
-rwxr-xr-xexamples/webkit/webkit-guide/css/layout_link-fmt.css137
-rwxr-xr-xexamples/webkit/webkit-guide/css/layout_tbl-keyhole.css147
-rwxr-xr-xexamples/webkit/webkit-guide/css/mob_condjs.css55
-rwxr-xr-xexamples/webkit/webkit-guide/css/mob_mediaquery.css49
-rwxr-xr-xexamples/webkit/webkit-guide/css/mobile.css82
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_desktop.css70
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_mobile.css69
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_touch.css69
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_desktop.css92
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_mobile.css82
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_touch.css86
-rwxr-xr-xexamples/webkit/webkit-guide/css/storage.css156
-rw-r--r--examples/webkit/webkit-guide/css3_backgrounds.htm87
-rw-r--r--examples/webkit/webkit-guide/css3_border-img.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_grad-radial.htm61
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBack.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBackStop.htm92
-rw-r--r--examples/webkit/webkit-guide/css3_gradientButton.htm66
-rw-r--r--examples/webkit/webkit-guide/css3_mask-grad.htm66
-rw-r--r--examples/webkit/webkit-guide/css3_mask-img.htm56
-rw-r--r--examples/webkit/webkit-guide/css3_multicol.htm91
-rw-r--r--examples/webkit/webkit-guide/css3_reflect.htm100
-rw-r--r--examples/webkit/webkit-guide/css3_scroll.htm94
-rw-r--r--examples/webkit/webkit-guide/css3_sel-nth.htm80
-rw-r--r--examples/webkit/webkit-guide/css3_shadow.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_text-overflow.htm117
-rw-r--r--examples/webkit/webkit-guide/css3_text-shadow.htm74
-rw-r--r--examples/webkit/webkit-guide/css3_text-stroke.htm74
-rw-r--r--examples/webkit/webkit-guide/form_tapper.htm74
-rw-r--r--examples/webkit/webkit-guide/form_toggler.htm140
-rwxr-xr-xexamples/webkit/webkit-guide/img/border-frame.pngbin0 -> 5534 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal1.jpgbin0 -> 44584 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal2.jpgbin0 -> 45495 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal3.jpgbin0 -> 51291 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal4.jpgbin0 -> 57195 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal5.jpgbin0 -> 31293 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal6.jpgbin0 -> 30854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal7.jpgbin0 -> 35211 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal8.jpgbin0 -> 35269 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/gradient.jpgbin0 -> 710 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/gray_icon_close.pngbin0 -> 658 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_016.pngbin0 -> 598 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_032.pngbin0 -> 1275 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_036.pngbin0 -> 1803 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_048.pngbin0 -> 1885 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_016.pngbin0 -> 625 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_032.pngbin0 -> 1259 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_036.pngbin0 -> 1755 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_048.pngbin0 -> 1795 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_016.pngbin0 -> 608 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_032.pngbin0 -> 1233 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_036.pngbin0 -> 1777 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_048.pngbin0 -> 1828 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_032.pngbin0 -> 1166 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_036.pngbin0 -> 1668 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_048.pngbin0 -> 1623 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_016.pngbin0 -> 614 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_032.pngbin0 -> 1322 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_036.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_048.pngbin0 -> 1824 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_016.pngbin0 -> 545 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_032.pngbin0 -> 1102 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_036.pngbin0 -> 1595 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_048.pngbin0 -> 1622 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_016.pngbin0 -> 606 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_032.pngbin0 -> 1229 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_036.pngbin0 -> 1771 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_048.pngbin0 -> 1820 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_016.pngbin0 -> 602 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_032.pngbin0 -> 1197 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_036.pngbin0 -> 1731 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_048.pngbin0 -> 1816 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_032.pngbin0 -> 1183 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_036.pngbin0 -> 1742 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_048.pngbin0 -> 1729 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_016.pngbin0 -> 539 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_032.pngbin0 -> 1047 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_036.pngbin0 -> 1487 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_048.pngbin0 -> 1488 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_016.pngbin0 -> 591 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_032.pngbin0 -> 1171 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_036.pngbin0 -> 1726 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_048.pngbin0 -> 1745 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_016.pngbin0 -> 583 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_032.pngbin0 -> 1135 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_036.pngbin0 -> 1600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_048.pngbin0 -> 1644 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_016.pngbin0 -> 606 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_032.pngbin0 -> 1179 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_036.pngbin0 -> 1746 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_048.pngbin0 -> 1675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_016.pngbin0 -> 600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_032.pngbin0 -> 1189 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_036.pngbin0 -> 1657 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_048.pngbin0 -> 1706 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_016.pngbin0 -> 584 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_032.pngbin0 -> 1125 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_036.pngbin0 -> 1596 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_048.pngbin0 -> 1691 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_016.pngbin0 -> 628 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_032.pngbin0 -> 1286 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_036.pngbin0 -> 1832 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_048.pngbin0 -> 1908 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_016.pngbin0 -> 605 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_032.pngbin0 -> 1203 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_036.pngbin0 -> 1728 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_048.pngbin0 -> 1718 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_016.pngbin0 -> 609 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_032.pngbin0 -> 1302 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_036.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_048.pngbin0 -> 1879 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_016.pngbin0 -> 619 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_032.pngbin0 -> 1278 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_036.pngbin0 -> 1798 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_048.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_016.pngbin0 -> 627 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_032.pngbin0 -> 1248 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_036.pngbin0 -> 1805 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_048.pngbin0 -> 1837 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_032.pngbin0 -> 1182 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_036.pngbin0 -> 1668 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_048.pngbin0 -> 1752 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_016.pngbin0 -> 600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_032.pngbin0 -> 1212 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_036.pngbin0 -> 1728 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_048.pngbin0 -> 1675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_016.pngbin0 -> 588 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_032.pngbin0 -> 1198 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_036.pngbin0 -> 1761 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_048.pngbin0 -> 1820 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_016.pngbin0 -> 572 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_032.pngbin0 -> 1164 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_036.pngbin0 -> 1689 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_048.pngbin0 -> 1721 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_check.pngbin0 -> 678 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_check_x24green.pngbin0 -> 776 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_dismiss.pngbin0 -> 613 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_dismiss_x22.pngbin0 -> 539 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-down.pngbin0 -> 605 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-down_x32.pngbin0 -> 3593 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-up.pngbin0 -> 592 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-up_x32.pngbin0 -> 3685 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_expand-nav.pngbin0 -> 675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-collapsed.pngbin0 -> 285 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-collapsed_x13.pngbin0 -> 201 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-expanded.pngbin0 -> 295 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-expanded_x13.pngbin0 -> 3017 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_info.pngbin0 -> 512 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_info_x24.pngbin0 -> 652 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-doc.pngbin0 -> 610 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-email.pngbin0 -> 542 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-external.pngbin0 -> 1106 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-pdf.pngbin0 -> 637 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-ppt.pngbin0 -> 536 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-rss.pngbin0 -> 684 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-sms.pngbin0 -> 1086 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-tel.pngbin0 -> 1205 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-xls.pngbin0 -> 603 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_list-all.pngbin0 -> 545 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_list-all_circ.pngbin0 -> 665 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-start.pngbin0 -> 594 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-top.pngbin0 -> 634 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-up.pngbin0 -> 551 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav_end.pngbin0 -> 643 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_question.pngbin0 -> 802 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_scroll-left.pngbin0 -> 660 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_scroll-right.pngbin0 -> 682 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_trash.pngbin0 -> 717 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land1.jpgbin0 -> 40695 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land2.jpgbin0 -> 38387 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land3.jpgbin0 -> 27180 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land4.jpgbin0 -> 45132 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land5.jpgbin0 -> 85110 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land6.jpgbin0 -> 38369 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land7.jpgbin0 -> 38923 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land8.jpgbin0 -> 54475 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/mask.pngbin0 -> 5842 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal1.jpgbin0 -> 44584 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal2.jpgbin0 -> 45495 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal3.jpgbin0 -> 51291 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal4.jpgbin0 -> 57195 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal5.jpgbin0 -> 31293 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal6.jpgbin0 -> 30854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal7.jpgbin0 -> 35211 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal8.jpgbin0 -> 35269 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land1.jpgbin0 -> 40695 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land2.jpgbin0 -> 38387 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land3.jpgbin0 -> 27180 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land4.jpgbin0 -> 45132 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land5.jpgbin0 -> 85110 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land6.jpgbin0 -> 38369 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land7.jpgbin0 -> 38923 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land8.jpgbin0 -> 54475 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal1.pngbin0 -> 16437 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal2.pngbin0 -> 14736 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal3.pngbin0 -> 15882 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal4.pngbin0 -> 18863 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal5.pngbin0 -> 15854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal6.pngbin0 -> 17339 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal7.pngbin0 -> 17102 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal8.pngbin0 -> 17933 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_accord.js78
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_gallery.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_panel.js53
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_skew.js97
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_backgrounds.js49
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_border-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_grad-radial.js75
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-grad.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_text-overflow.js54
-rwxr-xr-xexamples/webkit/webkit-guide/js/form_tapper.js57
-rwxr-xr-xexamples/webkit/webkit-guide/js/mob_condjs.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/mobile.js50
-rwxr-xr-xexamples/webkit/webkit-guide/js/storage.js94
-rw-r--r--examples/webkit/webkit-guide/layout_link-fmt.htm81
-rw-r--r--examples/webkit/webkit-guide/layout_tbl-keyhole.htm141
-rw-r--r--examples/webkit/webkit-guide/mob_condjs.htm65
-rw-r--r--examples/webkit/webkit-guide/mob_layout.htm59
-rw-r--r--examples/webkit/webkit-guide/mob_mediaquery.htm59
-rw-r--r--examples/webkit/webkit-guide/storage.htm71
-rw-r--r--examples/webkit/webkit-guide/webkit-guide.pro257
-rw-r--r--examples/widgets/README44
-rw-r--r--examples/widgets/analogclock/analogclock.cpp145
-rw-r--r--examples/widgets/analogclock/analogclock.h59
-rw-r--r--examples/widgets/analogclock/analogclock.pro14
-rw-r--r--examples/widgets/analogclock/main.cpp51
-rw-r--r--examples/widgets/calculator/button.cpp63
-rw-r--r--examples/widgets/calculator/button.h58
-rw-r--r--examples/widgets/calculator/calculator.cpp397
-rw-r--r--examples/widgets/calculator/calculator.h107
-rw-r--r--examples/widgets/calculator/calculator.pro16
-rw-r--r--examples/widgets/calculator/main.cpp51
-rw-r--r--examples/widgets/calendarwidget/calendarwidget.pro14
-rw-r--r--examples/widgets/calendarwidget/main.cpp51
-rw-r--r--examples/widgets/calendarwidget/window.cpp461
-rw-r--r--examples/widgets/calendarwidget/window.h127
-rw-r--r--examples/widgets/charactermap/charactermap.pro13
-rw-r--r--examples/widgets/charactermap/characterwidget.cpp177
-rw-r--r--examples/widgets/charactermap/characterwidget.h86
-rw-r--r--examples/widgets/charactermap/main.cpp51
-rw-r--r--examples/widgets/charactermap/mainwindow.cpp195
-rw-r--r--examples/widgets/charactermap/mainwindow.h83
-rw-r--r--examples/widgets/codeeditor/codeeditor.cpp170
-rw-r--r--examples/widgets/codeeditor/codeeditor.h105
-rw-r--r--examples/widgets/codeeditor/codeeditor.pro9
-rw-r--r--examples/widgets/codeeditor/main.cpp55
-rw-r--r--examples/widgets/digitalclock/digitalclock.cpp72
-rw-r--r--examples/widgets/digitalclock/digitalclock.h59
-rw-r--r--examples/widgets/digitalclock/digitalclock.pro11
-rw-r--r--examples/widgets/digitalclock/main.cpp51
-rw-r--r--examples/widgets/groupbox/groupbox.pro11
-rw-r--r--examples/widgets/groupbox/main.cpp51
-rw-r--r--examples/widgets/groupbox/window.cpp189
-rw-r--r--examples/widgets/groupbox/window.h66
-rw-r--r--examples/widgets/icons/iconpreviewarea.cpp141
-rw-r--r--examples/widgets/icons/iconpreviewarea.h77
-rw-r--r--examples/widgets/icons/icons.pro27
-rw-r--r--examples/widgets/icons/iconsizespinbox.cpp70
-rw-r--r--examples/widgets/icons/iconsizespinbox.h59
-rw-r--r--examples/widgets/icons/imagedelegate.cpp105
-rw-r--r--examples/widgets/icons/imagedelegate.h68
-rw-r--r--examples/widgets/icons/images/designer.pngbin0 -> 4205 bytes
-rw-r--r--examples/widgets/icons/images/find_disabled.pngbin0 -> 501 bytes
-rw-r--r--examples/widgets/icons/images/find_normal.pngbin0 -> 838 bytes
-rw-r--r--examples/widgets/icons/images/monkey_off_128x128.pngbin0 -> 7045 bytes
-rw-r--r--examples/widgets/icons/images/monkey_off_16x16.pngbin0 -> 683 bytes
-rw-r--r--examples/widgets/icons/images/monkey_off_32x32.pngbin0 -> 1609 bytes
-rw-r--r--examples/widgets/icons/images/monkey_off_64x64.pngbin0 -> 3533 bytes
-rw-r--r--examples/widgets/icons/images/monkey_on_128x128.pngbin0 -> 6909 bytes
-rw-r--r--examples/widgets/icons/images/monkey_on_16x16.pngbin0 -> 681 bytes
-rw-r--r--examples/widgets/icons/images/monkey_on_32x32.pngbin0 -> 1577 bytes
-rw-r--r--examples/widgets/icons/images/monkey_on_64x64.pngbin0 -> 3479 bytes
-rw-r--r--examples/widgets/icons/images/qt_extended_16x16.pngbin0 -> 834 bytes
-rw-r--r--examples/widgets/icons/images/qt_extended_32x32.pngbin0 -> 1892 bytes
-rw-r--r--examples/widgets/icons/images/qt_extended_48x48.pngbin0 -> 3672 bytes
-rw-r--r--examples/widgets/icons/main.cpp51
-rw-r--r--examples/widgets/icons/mainwindow.cpp442
-rw-r--r--examples/widgets/icons/mainwindow.h116
-rw-r--r--examples/widgets/imageviewer/imageviewer.cpp277
-rw-r--r--examples/widgets/imageviewer/imageviewer.h103
-rw-r--r--examples/widgets/imageviewer/imageviewer.pro15
-rw-r--r--examples/widgets/imageviewer/main.cpp51
-rw-r--r--examples/widgets/lineedits/lineedits.pro14
-rw-r--r--examples/widgets/lineedits/main.cpp51
-rw-r--r--examples/widgets/lineedits/window.cpp256
-rw-r--r--examples/widgets/lineedits/window.h75
-rw-r--r--examples/widgets/movie/animation.mngbin0 -> 5464 bytes
-rw-r--r--examples/widgets/movie/main.cpp51
-rw-r--r--examples/widgets/movie/movie.pro19
-rw-r--r--examples/widgets/movie/movieplayer.cpp210
-rw-r--r--examples/widgets/movie/movieplayer.h96
-rw-r--r--examples/widgets/scribble/main.cpp51
-rw-r--r--examples/widgets/scribble/mainwindow.cpp250
-rw-r--r--examples/widgets/scribble/mainwindow.h92
-rw-r--r--examples/widgets/scribble/scribble.pro13
-rw-r--r--examples/widgets/scribble/scribblearea.cpp215
-rw-r--r--examples/widgets/scribble/scribblearea.h90
-rw-r--r--examples/widgets/shapedclock/main.cpp51
-rw-r--r--examples/widgets/shapedclock/shapedclock.cpp158
-rw-r--r--examples/widgets/shapedclock/shapedclock.h66
-rw-r--r--examples/widgets/shapedclock/shapedclock.pro14
-rw-r--r--examples/widgets/sliders/main.cpp51
-rw-r--r--examples/widgets/sliders/sliders.pro13
-rw-r--r--examples/widgets/sliders/slidersgroup.cpp132
-rw-r--r--examples/widgets/sliders/slidersgroup.h78
-rw-r--r--examples/widgets/sliders/window.cpp145
-rw-r--r--examples/widgets/sliders/window.h84
-rw-r--r--examples/widgets/softkeys/main.cpp50
-rw-r--r--examples/widgets/softkeys/softkeys.cpp188
-rw-r--r--examples/widgets/softkeys/softkeys.h88
-rw-r--r--examples/widgets/softkeys/softkeys.pro15
-rw-r--r--examples/widgets/spinboxes/main.cpp51
-rw-r--r--examples/widgets/spinboxes/spinboxes.pro11
-rw-r--r--examples/widgets/spinboxes/window.cpp251
-rw-r--r--examples/widgets/spinboxes/window.h81
-rw-r--r--examples/widgets/styles/images/woodbackground.pngbin0 -> 7691 bytes
-rw-r--r--examples/widgets/styles/images/woodbutton.pngbin0 -> 7689 bytes
-rw-r--r--examples/widgets/styles/main.cpp53
-rw-r--r--examples/widgets/styles/norwegianwoodstyle.cpp330
-rw-r--r--examples/widgets/styles/norwegianwoodstyle.h78
-rw-r--r--examples/widgets/styles/styles.pro16
-rw-r--r--examples/widgets/styles/styles.qrc6
-rw-r--r--examples/widgets/styles/widgetgallery.cpp275
-rw-r--r--examples/widgets/styles/widgetgallery.h121
-rw-r--r--examples/widgets/stylesheet/images/checkbox_checked.pngbin0 -> 263 bytes
-rw-r--r--examples/widgets/stylesheet/images/checkbox_checked_hover.pngbin0 -> 266 bytes
-rw-r--r--examples/widgets/stylesheet/images/checkbox_checked_pressed.pngbin0 -> 425 bytes
-rw-r--r--examples/widgets/stylesheet/images/checkbox_unchecked.pngbin0 -> 159 bytes
-rw-r--r--examples/widgets/stylesheet/images/checkbox_unchecked_hover.pngbin0 -> 159 bytes
-rw-r--r--examples/widgets/stylesheet/images/checkbox_unchecked_pressed.pngbin0 -> 320 bytes
-rw-r--r--examples/widgets/stylesheet/images/down_arrow.pngbin0 -> 175 bytes
-rw-r--r--examples/widgets/stylesheet/images/down_arrow_disabled.pngbin0 -> 174 bytes
-rw-r--r--examples/widgets/stylesheet/images/frame.pngbin0 -> 253 bytes
-rw-r--r--examples/widgets/stylesheet/images/pagefold.pngbin0 -> 1545 bytes
-rw-r--r--examples/widgets/stylesheet/images/pushbutton.pngbin0 -> 533 bytes
-rw-r--r--examples/widgets/stylesheet/images/pushbutton_hover.pngbin0 -> 525 bytes
-rw-r--r--examples/widgets/stylesheet/images/pushbutton_pressed.pngbin0 -> 513 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_checked.pngbin0 -> 355 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_checked_hover.pngbin0 -> 532 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_checked_pressed.pngbin0 -> 599 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_unchecked.pngbin0 -> 240 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_unchecked_hover.pngbin0 -> 492 bytes
-rw-r--r--examples/widgets/stylesheet/images/radiobutton_unchecked_pressed.pngbin0 -> 556 bytes
-rw-r--r--examples/widgets/stylesheet/images/sizegrip.pngbin0 -> 129 bytes
-rw-r--r--examples/widgets/stylesheet/images/spindown.pngbin0 -> 276 bytes
-rw-r--r--examples/widgets/stylesheet/images/spindown_hover.pngbin0 -> 268 bytes
-rw-r--r--examples/widgets/stylesheet/images/spindown_off.pngbin0 -> 249 bytes
-rw-r--r--examples/widgets/stylesheet/images/spindown_pressed.pngbin0 -> 264 bytes
-rw-r--r--examples/widgets/stylesheet/images/spinup.pngbin0 -> 283 bytes
-rw-r--r--examples/widgets/stylesheet/images/spinup_hover.pngbin0 -> 277 bytes
-rw-r--r--examples/widgets/stylesheet/images/spinup_off.pngbin0 -> 274 bytes
-rw-r--r--examples/widgets/stylesheet/images/spinup_pressed.pngbin0 -> 277 bytes
-rw-r--r--examples/widgets/stylesheet/images/up_arrow.pngbin0 -> 197 bytes
-rw-r--r--examples/widgets/stylesheet/images/up_arrow_disabled.pngbin0 -> 172 bytes
-rw-r--r--examples/widgets/stylesheet/layouts/default.ui329
-rw-r--r--examples/widgets/stylesheet/layouts/pagefold.ui349
-rw-r--r--examples/widgets/stylesheet/main.cpp53
-rw-r--r--examples/widgets/stylesheet/mainwindow.cpp74
-rw-r--r--examples/widgets/stylesheet/mainwindow.h66
-rw-r--r--examples/widgets/stylesheet/mainwindow.ui356
-rw-r--r--examples/widgets/stylesheet/qss/coffee.qss112
-rw-r--r--examples/widgets/stylesheet/qss/default.qss1
-rw-r--r--examples/widgets/stylesheet/qss/pagefold.qss299
-rw-r--r--examples/widgets/stylesheet/stylesheet.pro16
-rw-r--r--examples/widgets/stylesheet/stylesheet.qrc39
-rw-r--r--examples/widgets/stylesheet/stylesheeteditor.cpp93
-rw-r--r--examples/widgets/stylesheet/stylesheeteditor.h67
-rw-r--r--examples/widgets/stylesheet/stylesheeteditor.ui171
-rw-r--r--examples/widgets/tablet/main.cpp60
-rw-r--r--examples/widgets/tablet/mainwindow.cpp274
-rw-r--r--examples/widgets/tablet/mainwindow.h113
-rw-r--r--examples/widgets/tablet/tablet.pro15
-rw-r--r--examples/widgets/tablet/tabletapplication.cpp56
-rw-r--r--examples/widgets/tablet/tabletapplication.h66
-rw-r--r--examples/widgets/tablet/tabletcanvas.cpp275
-rw-r--r--examples/widgets/tablet/tabletcanvas.h114
-rw-r--r--examples/widgets/tetrix/main.cpp54
-rw-r--r--examples/widgets/tetrix/tetrix.pro18
-rw-r--r--examples/widgets/tetrix/tetrixboard.cpp408
-rw-r--r--examples/widgets/tetrix/tetrixboard.h116
-rw-r--r--examples/widgets/tetrix/tetrixpiece.cpp145
-rw-r--r--examples/widgets/tetrix/tetrixpiece.h75
-rw-r--r--examples/widgets/tetrix/tetrixwindow.cpp115
-rw-r--r--examples/widgets/tetrix/tetrixwindow.h76
-rw-r--r--examples/widgets/tooltips/images/circle.pngbin0 -> 165 bytes
-rw-r--r--examples/widgets/tooltips/images/square.pngbin0 -> 94 bytes
-rw-r--r--examples/widgets/tooltips/images/triangle.pngbin0 -> 170 bytes
-rw-r--r--examples/widgets/tooltips/main.cpp54
-rw-r--r--examples/widgets/tooltips/shapeitem.cpp99
-rw-r--r--examples/widgets/tooltips/shapeitem.h70
-rw-r--r--examples/widgets/tooltips/sortingbox.cpp301
-rw-r--r--examples/widgets/tooltips/sortingbox.h106
-rw-r--r--examples/widgets/tooltips/tooltips.pro14
-rw-r--r--examples/widgets/tooltips/tooltips.qrc7
-rw-r--r--examples/widgets/validators/ledoff.pngbin0 -> 562 bytes
-rw-r--r--examples/widgets/validators/ledon.pngbin0 -> 486 bytes
-rw-r--r--examples/widgets/validators/ledwidget.cpp62
-rw-r--r--examples/widgets/validators/ledwidget.h64
-rw-r--r--examples/widgets/validators/localeselector.cpp312
-rw-r--r--examples/widgets/validators/localeselector.h60
-rw-r--r--examples/widgets/validators/main.cpp136
-rw-r--r--examples/widgets/validators/validators.pro23
-rw-r--r--examples/widgets/validators/validators.qrc6
-rw-r--r--examples/widgets/validators/validators.ui468
-rw-r--r--examples/widgets/widgets.pro43
-rw-r--r--examples/widgets/wiggly/dialog.cpp80
-rw-r--r--examples/widgets/wiggly/dialog.h56
-rw-r--r--examples/widgets/wiggly/main.cpp57
-rw-r--r--examples/widgets/wiggly/wiggly.pro16
-rw-r--r--examples/widgets/wiggly/wigglywidget.cpp100
-rw-r--r--examples/widgets/wiggly/wigglywidget.h69
-rw-r--r--examples/widgets/windowflags/controllerwindow.cpp220
-rw-r--r--examples/widgets/windowflags/controllerwindow.h104
-rw-r--r--examples/widgets/windowflags/main.cpp51
-rw-r--r--examples/widgets/windowflags/previewwindow.cpp118
-rw-r--r--examples/widgets/windowflags/previewwindow.h67
-rw-r--r--examples/widgets/windowflags/windowflags.pro13
-rw-r--r--examples/xml/README40
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro20
-rw-r--r--examples/xml/dombookmarks/frank.xbel230
-rw-r--r--examples/xml/dombookmarks/jennifer.xbel93
-rw-r--r--examples/xml/dombookmarks/main.cpp52
-rw-r--r--examples/xml/dombookmarks/mainwindow.cpp145
-rw-r--r--examples/xml/dombookmarks/mainwindow.h75
-rw-r--r--examples/xml/dombookmarks/xbeltree.cpp186
-rw-r--r--examples/xml/dombookmarks/xbeltree.h74
-rw-r--r--examples/xml/htmlinfo/apache_org.html281
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro19
-rw-r--r--examples/xml/htmlinfo/main.cpp118
-rw-r--r--examples/xml/htmlinfo/nokia_com.html215
-rw-r--r--examples/xml/htmlinfo/simpleexample.html11
-rw-r--r--examples/xml/htmlinfo/trolltech_com.html955
-rw-r--r--examples/xml/htmlinfo/w3c_org.html507
-rw-r--r--examples/xml/htmlinfo/youtube_com.html1585
-rw-r--r--examples/xml/rsslisting/main.cpp63
-rw-r--r--examples/xml/rsslisting/rsslisting.cpp247
-rw-r--r--examples/xml/rsslisting/rsslisting.h90
-rw-r--r--examples/xml/rsslisting/rsslisting.pro12
-rw-r--r--examples/xml/saxbookmarks/frank.xbel230
-rw-r--r--examples/xml/saxbookmarks/jennifer.xbel93
-rw-r--r--examples/xml/saxbookmarks/main.cpp56
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp169
-rw-r--r--examples/xml/saxbookmarks/mainwindow.h77
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro28
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.cpp114
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.h68
-rw-r--r--examples/xml/saxbookmarks/xbelhandler.cpp146
-rw-r--r--examples/xml/saxbookmarks/xbelhandler.h78
-rw-r--r--examples/xml/streambookmarks/frank.xbel230
-rw-r--r--examples/xml/streambookmarks/jennifer.xbel93
-rw-r--r--examples/xml/streambookmarks/main.cpp54
-rw-r--r--examples/xml/streambookmarks/mainwindow.cpp174
-rw-r--r--examples/xml/streambookmarks/mainwindow.h79
-rw-r--r--examples/xml/streambookmarks/streambookmarks.pro16
-rw-r--r--examples/xml/streambookmarks/xbelreader.cpp175
-rw-r--r--examples/xml/streambookmarks/xbelreader.h83
-rw-r--r--examples/xml/streambookmarks/xbelwriter.cpp92
-rw-r--r--examples/xml/streambookmarks/xbelwriter.h65
-rw-r--r--examples/xml/xml.pro20
-rw-r--r--examples/xml/xmlstreamlint/main.cpp127
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.pro12
1874 files changed, 138881 insertions, 0 deletions
diff --git a/examples/README b/examples/README
new file mode 100644
index 0000000000..10e14ceef4
--- /dev/null
+++ b/examples/README
@@ -0,0 +1,39 @@
+Qt is supplied with a number of example applications and demonstrations that
+have been written to provide developers with examples of the Qt API in use,
+highlight good programming practice, and showcase features found in each of
+Qt's core technologies.
+
+The example and demo launcher can be used to explore the different categories
+available. It provides an overview of each example, lets you view the
+documentation in Qt Assistant, and is able to launch examples and demos.
+
+Documentation for examples can be found in the Tutorials and Examples section
+of the Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
diff --git a/examples/animation/README b/examples/animation/README
new file mode 100644
index 0000000000..6a892f8655
--- /dev/null
+++ b/examples/animation/README
@@ -0,0 +1,38 @@
+The animation framework aims to provide an easy way for creating animated and
+smooth GUI's. By animating Qt properties, the framework provides great freedom
+for animating widgets and other QObjects. The framework can also be used with
+the Graphics View framework.
+
+The example launcher provided with Qt can be used to explore each of the
+examples in this directory.
+
+Documentation for these examples can be found via the Tutorial and Examples
+link in the main Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro
new file mode 100644
index 0000000000..66a54edc05
--- /dev/null
+++ b/examples/animation/animatedtiles/animatedtiles.pro
@@ -0,0 +1,13 @@
+SOURCES = main.cpp
+RESOURCES = animatedtiles.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/animatedtiles
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS animatedtiles.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/animatedtiles
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000D7D1
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/animatedtiles/animatedtiles.qrc b/examples/animation/animatedtiles/animatedtiles.qrc
new file mode 100644
index 0000000000..c43a979723
--- /dev/null
+++ b/examples/animation/animatedtiles/animatedtiles.qrc
@@ -0,0 +1,11 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/Time-For-Lunch-2.jpg</file>
+ <file>images/centered.png</file>
+ <file>images/ellipse.png</file>
+ <file>images/figure8.png</file>
+ <file>images/kinetic.png</file>
+ <file>images/random.png</file>
+ <file>images/tile.png</file>
+</qresource>
+</RCC>
diff --git a/examples/animation/animatedtiles/images/Time-For-Lunch-2.jpg b/examples/animation/animatedtiles/images/Time-For-Lunch-2.jpg
new file mode 100644
index 0000000000..c57a555490
--- /dev/null
+++ b/examples/animation/animatedtiles/images/Time-For-Lunch-2.jpg
Binary files differ
diff --git a/examples/animation/animatedtiles/images/centered.png b/examples/animation/animatedtiles/images/centered.png
new file mode 100644
index 0000000000..e416156a0e
--- /dev/null
+++ b/examples/animation/animatedtiles/images/centered.png
Binary files differ
diff --git a/examples/animation/animatedtiles/images/ellipse.png b/examples/animation/animatedtiles/images/ellipse.png
new file mode 100644
index 0000000000..2c3ba881c5
--- /dev/null
+++ b/examples/animation/animatedtiles/images/ellipse.png
Binary files differ
diff --git a/examples/animation/animatedtiles/images/figure8.png b/examples/animation/animatedtiles/images/figure8.png
new file mode 100644
index 0000000000..6b058041c4
--- /dev/null
+++ b/examples/animation/animatedtiles/images/figure8.png
Binary files differ
diff --git a/examples/animation/animatedtiles/images/kinetic.png b/examples/animation/animatedtiles/images/kinetic.png
new file mode 100644
index 0000000000..55cfa5515f
--- /dev/null
+++ b/examples/animation/animatedtiles/images/kinetic.png
Binary files differ
diff --git a/examples/animation/animatedtiles/images/random.png b/examples/animation/animatedtiles/images/random.png
new file mode 100644
index 0000000000..415d96f856
--- /dev/null
+++ b/examples/animation/animatedtiles/images/random.png
Binary files differ
diff --git a/examples/animation/animatedtiles/images/tile.png b/examples/animation/animatedtiles/images/tile.png
new file mode 100644
index 0000000000..c8f39d8d40
--- /dev/null
+++ b/examples/animation/animatedtiles/images/tile.png
Binary files differ
diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp
new file mode 100644
index 0000000000..1badb4f3ef
--- /dev/null
+++ b/examples/animation/animatedtiles/main.cpp
@@ -0,0 +1,256 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtCore/qstate.h>
+
+class Pixmap : public QObject, public QGraphicsPixmapItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QPointF pos READ pos WRITE setPos)
+public:
+ Pixmap(const QPixmap &pix)
+ : QObject(), QGraphicsPixmapItem(pix)
+ {
+ setCacheMode(DeviceCoordinateCache);
+ }
+};
+
+class Button : public QGraphicsWidget
+{
+ Q_OBJECT
+public:
+ Button(const QPixmap &pixmap, QGraphicsItem *parent = 0)
+ : QGraphicsWidget(parent), _pix(pixmap)
+ {
+ setAcceptHoverEvents(true);
+ setCacheMode(DeviceCoordinateCache);
+ }
+
+ QRectF boundingRect() const
+ {
+ return QRectF(-65, -65, 130, 130);
+ }
+
+ QPainterPath shape() const
+ {
+ QPainterPath path;
+ path.addEllipse(boundingRect());
+ return path;
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
+ {
+ bool down = option->state & QStyle::State_Sunken;
+ QRectF r = boundingRect();
+ QLinearGradient grad(r.topLeft(), r.bottomRight());
+ grad.setColorAt(down ? 1 : 0, option->state & QStyle::State_MouseOver ? Qt::white : Qt::lightGray);
+ grad.setColorAt(down ? 0 : 1, Qt::darkGray);
+ painter->setPen(Qt::darkGray);
+ painter->setBrush(grad);
+ painter->drawEllipse(r);
+ QLinearGradient grad2(r.topLeft(), r.bottomRight());
+ grad.setColorAt(down ? 1 : 0, Qt::darkGray);
+ grad.setColorAt(down ? 0 : 1, Qt::lightGray);
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(grad);
+ if (down)
+ painter->translate(2, 2);
+ painter->drawEllipse(r.adjusted(5, 5, -5, -5));
+ painter->drawPixmap(-_pix.width()/2, -_pix.height()/2, _pix);
+ }
+
+signals:
+ void pressed();
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *)
+ {
+ emit pressed();
+ update();
+ }
+
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+ {
+ update();
+ }
+
+private:
+ QPixmap _pix;
+};
+
+class View : public QGraphicsView
+{
+public:
+ View(QGraphicsScene *scene) : QGraphicsView(scene) { }
+
+protected:
+ void resizeEvent(QResizeEvent *event)
+ {
+ QGraphicsView::resizeEvent(event);
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(animatedtiles);
+
+ QApplication app(argc, argv);
+
+ QPixmap kineticPix(":/images/kinetic.png");
+ QPixmap bgPix(":/images/Time-For-Lunch-2.jpg");
+
+ QGraphicsScene scene(-350, -350, 700, 700);
+
+ QList<Pixmap *> items;
+ for (int i = 0; i < 64; ++i) {
+ Pixmap *item = new Pixmap(kineticPix);
+ item->setOffset(-kineticPix.width()/2, -kineticPix.height()/2);
+ item->setZValue(i);
+ items << item;
+ scene.addItem(item);
+ }
+
+ // Buttons
+ QGraphicsItem *buttonParent = new QGraphicsRectItem;
+ Button *ellipseButton = new Button(QPixmap(":/images/ellipse.png"), buttonParent);
+ Button *figure8Button = new Button(QPixmap(":/images/figure8.png"), buttonParent);
+ Button *randomButton = new Button(QPixmap(":/images/random.png"), buttonParent);
+ Button *tiledButton = new Button(QPixmap(":/images/tile.png"), buttonParent);
+ Button *centeredButton = new Button(QPixmap(":/images/centered.png"), buttonParent);
+
+ ellipseButton->setPos(-100, -100);
+ figure8Button->setPos(100, -100);
+ randomButton->setPos(0, 0);
+ tiledButton->setPos(-100, 100);
+ centeredButton->setPos(100, 100);
+
+ scene.addItem(buttonParent);
+ buttonParent->scale(0.75, 0.75);
+ buttonParent->setPos(200, 200);
+ buttonParent->setZValue(65);
+
+ // States
+ QState *rootState = new QState;
+ QState *ellipseState = new QState(rootState);
+ QState *figure8State = new QState(rootState);
+ QState *randomState = new QState(rootState);
+ QState *tiledState = new QState(rootState);
+ QState *centeredState = new QState(rootState);
+
+ // Values
+ for (int i = 0; i < items.count(); ++i) {
+ Pixmap *item = items.at(i);
+ // Ellipse
+ ellipseState->assignProperty(item, "pos",
+ QPointF(cos((i / 63.0) * 6.28) * 250,
+ sin((i / 63.0) * 6.28) * 250));
+
+ // Figure 8
+ figure8State->assignProperty(item, "pos",
+ QPointF(sin((i / 63.0) * 6.28) * 250,
+ sin(((i * 2)/63.0) * 6.28) * 250));
+
+ // Random
+ randomState->assignProperty(item, "pos",
+ QPointF(-250 + qrand() % 500,
+ -250 + qrand() % 500));
+
+ // Tiled
+ tiledState->assignProperty(item, "pos",
+ QPointF(((i % 8) - 4) * kineticPix.width() + kineticPix.width() / 2,
+ ((i / 8) - 4) * kineticPix.height() + kineticPix.height() / 2));
+
+ // Centered
+ centeredState->assignProperty(item, "pos", QPointF());
+ }
+
+ // Ui
+ View *view = new View(&scene);
+ view->setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Animated Tiles"));
+ view->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
+ view->setBackgroundBrush(bgPix);
+ view->setCacheMode(QGraphicsView::CacheBackground);
+ view->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+ view->show();
+
+ QStateMachine states;
+ states.addState(rootState);
+ states.setInitialState(rootState);
+ rootState->setInitialState(centeredState);
+
+ QParallelAnimationGroup *group = new QParallelAnimationGroup;
+ for (int i = 0; i < items.count(); ++i) {
+ QPropertyAnimation *anim = new QPropertyAnimation(items[i], "pos");
+ anim->setDuration(750 + i * 25);
+ anim->setEasingCurve(QEasingCurve::InOutBack);
+ group->addAnimation(anim);
+ }
+ QAbstractTransition *trans = rootState->addTransition(ellipseButton, SIGNAL(pressed()), ellipseState);
+ trans->addAnimation(group);
+
+ trans = rootState->addTransition(figure8Button, SIGNAL(pressed()), figure8State);
+ trans->addAnimation(group);
+
+ trans = rootState->addTransition(randomButton, SIGNAL(pressed()), randomState);
+ trans->addAnimation(group);
+
+ trans = rootState->addTransition(tiledButton, SIGNAL(pressed()), tiledState);
+ trans->addAnimation(group);
+
+ trans = rootState->addTransition(centeredButton, SIGNAL(pressed()), centeredState);
+ trans->addAnimation(group);
+
+ QTimer timer;
+ timer.start(125);
+ timer.setSingleShot(true);
+ trans = rootState->addTransition(&timer, SIGNAL(timeout()), ellipseState);
+ trans->addAnimation(group);
+
+ states.start();
+
+#ifdef QT_KEYPAD_NAVIGATION
+ QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
+#endif
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/examples/animation/animation.pro b/examples/animation/animation.pro
new file mode 100644
index 0000000000..4a9064d97e
--- /dev/null
+++ b/examples/animation/animation.pro
@@ -0,0 +1,15 @@
+TEMPLATE = \
+ subdirs
+SUBDIRS += \
+ animatedtiles \
+ appchooser \
+ easing \
+ moveblocks \
+ states \
+ stickman \
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS animation.pro README
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation
+INSTALLS += target sources
diff --git a/examples/animation/appchooser/accessories-dictionary.png b/examples/animation/appchooser/accessories-dictionary.png
new file mode 100644
index 0000000000..e9bd55d918
--- /dev/null
+++ b/examples/animation/appchooser/accessories-dictionary.png
Binary files differ
diff --git a/examples/animation/appchooser/akregator.png b/examples/animation/appchooser/akregator.png
new file mode 100644
index 0000000000..a086f45ab6
--- /dev/null
+++ b/examples/animation/appchooser/akregator.png
Binary files differ
diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro
new file mode 100644
index 0000000000..d4599db840
--- /dev/null
+++ b/examples/animation/appchooser/appchooser.pro
@@ -0,0 +1,13 @@
+SOURCES = main.cpp
+RESOURCES = appchooser.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/appchooser
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS appchooser.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/appchooser
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F5
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/appchooser/appchooser.qrc b/examples/animation/appchooser/appchooser.qrc
new file mode 100644
index 0000000000..28a3e1c4c1
--- /dev/null
+++ b/examples/animation/appchooser/appchooser.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>accessories-dictionary.png</file>
+ <file>akregator.png</file>
+ <file>digikam.png</file>
+ <file>k3b.png</file>
+</qresource>
+</RCC>
diff --git a/examples/animation/appchooser/digikam.png b/examples/animation/appchooser/digikam.png
new file mode 100644
index 0000000000..9de9fb2f80
--- /dev/null
+++ b/examples/animation/appchooser/digikam.png
Binary files differ
diff --git a/examples/animation/appchooser/k3b.png b/examples/animation/appchooser/k3b.png
new file mode 100644
index 0000000000..bbcafcfba1
--- /dev/null
+++ b/examples/animation/appchooser/k3b.png
Binary files differ
diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp
new file mode 100644
index 0000000000..86ec073f6e
--- /dev/null
+++ b/examples/animation/appchooser/main.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <QtGui>
+
+
+class Pixmap : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ Pixmap(const QPixmap &pix, QGraphicsItem *parent = 0)
+ : QGraphicsWidget(parent), orig(pix), p(pix)
+ {
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ {
+ painter->drawPixmap(QPointF(), p);
+ }
+
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent * )
+ {
+ emit clicked();
+ }
+
+ virtual void setGeometry(const QRectF &rect)
+ {
+ QGraphicsWidget::setGeometry(rect);
+
+ if (rect.size().width() > orig.size().width())
+ p = orig.scaled(rect.size().toSize());
+ else
+ p = orig;
+ }
+
+Q_SIGNALS:
+ void clicked();
+
+private:
+ QPixmap orig;
+ QPixmap p;
+};
+
+void createStates(const QObjectList &objects,
+ const QRect &selectedRect, QState *parent)
+{
+ for (int i = 0; i < objects.size(); ++i) {
+ QState *state = new QState(parent);
+ state->assignProperty(objects.at(i), "geometry", selectedRect);
+ parent->addTransition(objects.at(i), SIGNAL(clicked()), state);
+ }
+}
+
+void createAnimations(const QObjectList &objects, QStateMachine *machine)
+{
+ for (int i=0; i<objects.size(); ++i)
+ machine->addDefaultAnimation(new QPropertyAnimation(objects.at(i), "geometry"));
+}
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(appchooser);
+
+ QApplication app(argc, argv);
+
+ Pixmap *p1 = new Pixmap(QPixmap(":/digikam.png"));
+ Pixmap *p2 = new Pixmap(QPixmap(":/akregator.png"));
+ Pixmap *p3 = new Pixmap(QPixmap(":/accessories-dictionary.png"));
+ Pixmap *p4 = new Pixmap(QPixmap(":/k3b.png"));
+
+ p1->setObjectName("p1");
+ p2->setObjectName("p2");
+ 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));
+ p3->setGeometry(QRectF(236.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);
+ scene.addItem(p1);
+ scene.addItem(p2);
+ scene.addItem(p3);
+ scene.addItem(p4);
+
+ QGraphicsView window(&scene);
+ window.setFrameStyle(0);
+ window.setAlignment(Qt::AlignLeft | Qt::AlignTop);
+ window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ QStateMachine machine;
+ machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties);
+
+ QState *group = new QState(&machine);
+ group->setObjectName("group");
+ QRect selectedRect(86, 86, 128, 128);
+
+ QState *idleState = new QState(group);
+ group->setInitialState(idleState);
+
+ QObjectList objects;
+ objects << p1 << p2 << p3 << p4;
+ createStates(objects, selectedRect, group);
+ createAnimations(objects, &machine);
+
+ machine.setInitialState(group);
+ machine.start();
+
+ window.resize(300, 300);
+ window.show();
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h
new file mode 100644
index 0000000000..f0aef6560b
--- /dev/null
+++ b/examples/animation/easing/animation.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ANIMATION_H
+#define ANIMATION_H
+
+#include <QtGui>
+
+#include <QtCore/qpropertyanimation.h>
+
+class Animation : public QPropertyAnimation {
+public:
+ enum PathType {
+ LinearPath,
+ CirclePath,
+ NPathTypes
+ };
+ Animation(QObject *target, const QByteArray &prop)
+ : QPropertyAnimation(target, prop)
+ {
+ setPathType(LinearPath);
+ }
+
+ void setPathType(PathType pathType)
+ {
+ if (pathType >= NPathTypes)
+ qWarning("Unknown pathType %d", pathType);
+
+ m_pathType = pathType;
+ m_path = QPainterPath();
+ }
+
+ void updateCurrentTime(int currentTime)
+ {
+ if (m_pathType == CirclePath) {
+ if (m_path.isEmpty()) {
+ QPointF to = endValue().toPointF();
+ QPointF from = startValue().toPointF();
+ m_path.moveTo(from);
+ m_path.addEllipse(QRectF(from, to));
+ }
+ int dura = duration();
+ const qreal progress = ((dura == 0) ? 1 : ((((currentTime - 1) % dura) + 1) / qreal(dura)));
+
+ qreal easedProgress = easingCurve().valueForProgress(progress);
+ if (easedProgress > 1.0) {
+ easedProgress -= 1.0;
+ } else if (easedProgress < 0) {
+ easedProgress += 1.0;
+ }
+ QPointF pt = m_path.pointAtPercent(easedProgress);
+ updateCurrentValue(pt);
+ emit valueChanged(pt);
+ } else {
+ QPropertyAnimation::updateCurrentTime(currentTime);
+ }
+ }
+
+ QPainterPath m_path;
+ PathType m_pathType;
+};
+
+#endif // ANIMATION_H
diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro
new file mode 100644
index 0000000000..4715f2c826
--- /dev/null
+++ b/examples/animation/easing/easing.pro
@@ -0,0 +1,19 @@
+HEADERS = window.h \
+ animation.h
+SOURCES = main.cpp \
+ window.cpp
+
+FORMS = form.ui
+
+RESOURCES = easing.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/easing
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS easing.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/easing
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F6
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/easing/easing.qrc b/examples/animation/easing/easing.qrc
new file mode 100644
index 0000000000..7e112d3a9d
--- /dev/null
+++ b/examples/animation/easing/easing.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>images/qt-logo.png</file>
+ </qresource>
+ </RCC> \ No newline at end of file
diff --git a/examples/animation/easing/form.ui b/examples/animation/easing/form.ui
new file mode 100644
index 0000000000..b60ade86a4
--- /dev/null
+++ b/examples/animation/easing/form.ui
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>545</width>
+ <height>471</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Easing curves</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QListWidget" name="easingCurvePicker">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>120</height>
+ </size>
+ </property>
+ <property name="verticalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ <property name="movement">
+ <enum>QListView::Static</enum>
+ </property>
+ <property name="isWrapping" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="viewMode">
+ <enum>QListView::IconMode</enum>
+ </property>
+ <property name="selectionRectVisible">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Path type</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QRadioButton" name="lineRadio">
+ <property name="text">
+ <string>Line</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string>buttonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="circleRadio">
+ <property name="text">
+ <string>Circle</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string>buttonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Properties</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Period</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="periodSpinBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <double>-1.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>0.100000000000000</double>
+ </property>
+ <property name="value">
+ <double>-1.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Amplitude</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="amplitudeSpinBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <double>-1.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>0.100000000000000</double>
+ </property>
+ <property name="value">
+ <double>-1.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Overshoot</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDoubleSpinBox" name="overshootSpinBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <double>-1.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>0.100000000000000</double>
+ </property>
+ <property name="value">
+ <double>-1.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="1">
+ <widget class="QGraphicsView" name="graphicsView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <buttongroups>
+ <buttongroup name="buttonGroup"/>
+ </buttongroups>
+</ui>
diff --git a/examples/animation/easing/images/qt-logo.png b/examples/animation/easing/images/qt-logo.png
new file mode 100644
index 0000000000..14ddf2a028
--- /dev/null
+++ b/examples/animation/easing/images/qt-logo.png
Binary files differ
diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp
new file mode 100644
index 0000000000..def1db27de
--- /dev/null
+++ b/examples/animation/easing/main.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include "window.h"
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(easing);
+ QApplication app(argc, argv);
+ Window w;
+ w.resize(400, 400);
+ w.show();
+ return app.exec();
+}
diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp
new file mode 100644
index 0000000000..b466cec3d0
--- /dev/null
+++ b/examples/animation/easing/window.cpp
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "window.h"
+
+Window::Window(QWidget *parent)
+ : QWidget(parent), m_iconSize(64, 64)
+{
+ m_ui.setupUi(this);
+ QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
+ m_ui.easingCurvePicker->setIconSize(m_iconSize);
+ m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
+ buttonGroup->setId(m_ui.lineRadio, 0);
+ buttonGroup->setId(m_ui.circleRadio, 1);
+
+ QEasingCurve dummy;
+ m_ui.periodSpinBox->setValue(dummy.period());
+ m_ui.amplitudeSpinBox->setValue(dummy.amplitude());
+ m_ui.overshootSpinBox->setValue(dummy.overshoot());
+
+ connect(m_ui.easingCurvePicker, SIGNAL(currentRowChanged(int)), this, SLOT(curveChanged(int)));
+ connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(pathChanged(int)));
+ connect(m_ui.periodSpinBox, SIGNAL(valueChanged(double)), this, SLOT(periodChanged(double)));
+ connect(m_ui.amplitudeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(amplitudeChanged(double)));
+ connect(m_ui.overshootSpinBox, SIGNAL(valueChanged(double)), this, SLOT(overshootChanged(double)));
+ createCurveIcons();
+
+ QPixmap pix(QLatin1String(":/images/qt-logo.png"));
+ m_item = new PixmapItem(pix);
+ m_scene.addItem(m_item);
+ m_ui.graphicsView->setScene(&m_scene);
+
+ m_anim = new Animation(m_item, "pos");
+ m_anim->setEasingCurve(QEasingCurve::OutBounce);
+ m_ui.easingCurvePicker->setCurrentRow(int(QEasingCurve::OutBounce));
+
+ startAnimation();
+}
+
+void Window::createCurveIcons()
+{
+ QPixmap pix(m_iconSize);
+ QPainter painter(&pix);
+ QLinearGradient gradient(0,0, 0, m_iconSize.height());
+ gradient.setColorAt(0.0, QColor(240, 240, 240));
+ gradient.setColorAt(1.0, QColor(224, 224, 224));
+ QBrush brush(gradient);
+ const QMetaObject &mo = QEasingCurve::staticMetaObject;
+ QMetaEnum metaEnum = mo.enumerator(mo.indexOfEnumerator("Type"));
+ // Skip QEasingCurve::Custom
+ for (int i = 0; i < QEasingCurve::NCurveTypes - 1; ++i) {
+ painter.fillRect(QRect(QPoint(0, 0), m_iconSize), brush);
+ QEasingCurve curve((QEasingCurve::Type)i);
+ painter.setPen(QColor(0, 0, 255, 64));
+ qreal xAxis = m_iconSize.height()/1.5;
+ qreal yAxis = m_iconSize.width()/3;
+ painter.drawLine(0, xAxis, m_iconSize.width(), xAxis);
+ painter.drawLine(yAxis, 0, yAxis, m_iconSize.height());
+
+ qreal curveScale = m_iconSize.height()/2;
+
+ painter.setPen(Qt::NoPen);
+
+ // start point
+ painter.setBrush(Qt::red);
+ QPoint start(yAxis, xAxis - curveScale * curve.valueForProgress(0));
+ painter.drawRect(start.x() - 1, start.y() - 1, 3, 3);
+
+ // end point
+ painter.setBrush(Qt::blue);
+ QPoint end(yAxis + curveScale, xAxis - curveScale * curve.valueForProgress(1));
+ painter.drawRect(end.x() - 1, end.y() - 1, 3, 3);
+
+ QPainterPath curvePath;
+ curvePath.moveTo(start);
+ for (qreal t = 0; t <= 1.0; t+=1.0/curveScale) {
+ QPoint to;
+ to.setX(yAxis + curveScale * t);
+ to.setY(xAxis - curveScale * curve.valueForProgress(t));
+ curvePath.lineTo(to);
+ }
+ painter.setRenderHint(QPainter::Antialiasing, true);
+ painter.strokePath(curvePath, QColor(32, 32, 32));
+ painter.setRenderHint(QPainter::Antialiasing, false);
+ QListWidgetItem *item = new QListWidgetItem;
+ item->setIcon(QIcon(pix));
+ item->setText(metaEnum.key(i));
+ m_ui.easingCurvePicker->addItem(item);
+ }
+}
+
+void Window::startAnimation()
+{
+ m_anim->setStartValue(QPointF(0, 0));
+ m_anim->setEndValue(QPointF(100, 100));
+ m_anim->setDuration(2000);
+ m_anim->setLoopCount(-1); // forever
+ m_anim->start();
+}
+
+void Window::curveChanged(int row)
+{
+ QEasingCurve::Type curveType = (QEasingCurve::Type)row;
+ m_anim->setEasingCurve(curveType);
+ m_anim->setCurrentTime(0);
+
+ bool isElastic = curveType >= QEasingCurve::InElastic && curveType <= QEasingCurve::OutInElastic;
+ bool isBounce = curveType >= QEasingCurve::InBounce && curveType <= QEasingCurve::OutInBounce;
+ m_ui.periodSpinBox->setEnabled(isElastic);
+ m_ui.amplitudeSpinBox->setEnabled(isElastic || isBounce);
+ m_ui.overshootSpinBox->setEnabled(curveType >= QEasingCurve::InBack && curveType <= QEasingCurve::OutInBack);
+}
+
+void Window::pathChanged(int index)
+{
+ m_anim->setPathType((Animation::PathType)index);
+}
+
+void Window::periodChanged(double value)
+{
+ QEasingCurve curve = m_anim->easingCurve();
+ curve.setPeriod(value);
+ m_anim->setEasingCurve(curve);
+}
+
+void Window::amplitudeChanged(double value)
+{
+ QEasingCurve curve = m_anim->easingCurve();
+ curve.setAmplitude(value);
+ m_anim->setEasingCurve(curve);
+}
+
+void Window::overshootChanged(double value)
+{
+ QEasingCurve curve = m_anim->easingCurve();
+ curve.setOvershoot(value);
+ m_anim->setEasingCurve(curve);
+}
+
diff --git a/examples/animation/easing/window.h b/examples/animation/easing/window.h
new file mode 100644
index 0000000000..bbdf14e0dc
--- /dev/null
+++ b/examples/animation/easing/window.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "ui_form.h"
+#include "animation.h"
+
+class PixmapItem : public QObject, public QGraphicsPixmapItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QPointF pos READ pos WRITE setPos)
+public:
+ PixmapItem(const QPixmap &pix) : QGraphicsPixmapItem(pix)
+ {
+ }
+};
+
+class Window : public QWidget {
+ Q_OBJECT
+public:
+ Window(QWidget *parent = 0);
+private slots:
+ void curveChanged(int row);
+ void pathChanged(int index);
+ void periodChanged(double);
+ void amplitudeChanged(double);
+ void overshootChanged(double);
+
+private:
+ void createCurveIcons();
+ void startAnimation();
+
+ Ui::Form m_ui;
+ QGraphicsScene m_scene;
+ PixmapItem *m_item;
+ Animation *m_anim;
+ QSize m_iconSize;
+
+
+};
diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp
new file mode 100644
index 0000000000..3194c1b623
--- /dev/null
+++ b/examples/animation/moveblocks/main.cpp
@@ -0,0 +1,319 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <QtGui>
+
+//![15]
+class StateSwitchEvent: public QEvent
+{
+public:
+ StateSwitchEvent()
+ : QEvent(Type(StateSwitchType))
+ {
+ }
+
+ StateSwitchEvent(int rand)
+ : QEvent(Type(StateSwitchType)),
+ m_rand(rand)
+ {
+ }
+
+ enum { StateSwitchType = QEvent::User + 256 };
+
+ int rand() const { return m_rand; }
+
+private:
+ int m_rand;
+};
+//![15]
+
+//![16]
+class QGraphicsRectWidget : public QGraphicsWidget
+{
+public:
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,
+ QWidget *)
+ {
+ painter->fillRect(rect(), Qt::blue);
+ }
+};
+//![16]
+
+class StateSwitchTransition: public QAbstractTransition
+{
+public:
+ StateSwitchTransition(int rand)
+ : QAbstractTransition(),
+ m_rand(rand)
+ {
+ }
+
+protected:
+//![14]
+ virtual bool eventTest(QEvent *event)
+ {
+ return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType))
+ && (static_cast<StateSwitchEvent *>(event)->rand() == m_rand);
+ }
+//![14]
+
+ virtual void onTransition(QEvent *) {}
+
+private:
+ int m_rand;
+};
+
+//![10]
+class StateSwitcher : public QState
+{
+ Q_OBJECT
+public:
+ StateSwitcher(QStateMachine *machine)
+ : QState(machine), m_stateCount(0), m_lastIndex(0)
+ { }
+//![10]
+
+//![11]
+ virtual void onEntry(QEvent *)
+ {
+ int n;
+ while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex)
+ { }
+ m_lastIndex = n;
+ machine()->postEvent(new StateSwitchEvent(n));
+ }
+ virtual void onExit(QEvent *) {}
+//![11]
+
+//![12]
+ void addState(QState *state, QAbstractAnimation *animation) {
+ StateSwitchTransition *trans = new StateSwitchTransition(++m_stateCount);
+ trans->setTargetState(state);
+ addTransition(trans);
+ trans->addAnimation(animation);
+ }
+//![12]
+
+private:
+ int m_stateCount;
+ int m_lastIndex;
+};
+
+//![13]
+QState *createGeometryState(QObject *w1, const QRect &rect1,
+ QObject *w2, const QRect &rect2,
+ QObject *w3, const QRect &rect3,
+ QObject *w4, const QRect &rect4,
+ QState *parent)
+{
+ QState *result = new QState(parent);
+ result->assignProperty(w1, "geometry", rect1);
+ result->assignProperty(w2, "geometry", rect2);
+ result->assignProperty(w3, "geometry", rect3);
+ result->assignProperty(w4, "geometry", rect4);
+
+ return result;
+}
+//![13]
+
+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;
+ QGraphicsRectWidget *button3 = new QGraphicsRectWidget;
+ QGraphicsRectWidget *button4 = new QGraphicsRectWidget;
+ button2->setZValue(1);
+ button3->setZValue(2);
+ button4->setZValue(3);
+ QGraphicsScene scene(0, 0, 300, 300);
+ scene.setBackgroundBrush(Qt::black);
+ scene.addItem(button1);
+ scene.addItem(button2);
+ scene.addItem(button3);
+ scene.addItem(button4);
+//![1]
+ QGraphicsView window(&scene);
+ window.setFrameStyle(0);
+ window.setAlignment(Qt::AlignLeft | Qt::AlignTop);
+ window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+#endif
+//![2]
+ QStateMachine machine;
+
+ QState *group = new QState();
+ group->setObjectName("group");
+ QTimer timer;
+ timer.setInterval(1250);
+ timer.setSingleShot(true);
+ QObject::connect(group, SIGNAL(entered()), &timer, SLOT(start()));
+//![2]
+
+//![3]
+ QState *state1;
+ QState *state2;
+ QState *state3;
+ QState *state4;
+ QState *state5;
+ QState *state6;
+ QState *state7;
+
+ state1 = createGeometryState(button1, QRect(100, 0, 50, 50),
+ button2, QRect(150, 0, 50, 50),
+ button3, QRect(200, 0, 50, 50),
+ button4, QRect(250, 0, 50, 50),
+ group);
+//![3]
+ state2 = createGeometryState(button1, QRect(250, 100, 50, 50),
+ button2, QRect(250, 150, 50, 50),
+ button3, QRect(250, 200, 50, 50),
+ button4, QRect(250, 250, 50, 50),
+ group);
+ state3 = createGeometryState(button1, QRect(150, 250, 50, 50),
+ button2, QRect(100, 250, 50, 50),
+ button3, QRect(50, 250, 50, 50),
+ button4, QRect(0, 250, 50, 50),
+ group);
+ state4 = createGeometryState(button1, QRect(0, 150, 50, 50),
+ button2, QRect(0, 100, 50, 50),
+ button3, QRect(0, 50, 50, 50),
+ button4, QRect(0, 0, 50, 50),
+ group);
+ state5 = createGeometryState(button1, QRect(100, 100, 50, 50),
+ button2, QRect(150, 100, 50, 50),
+ button3, QRect(100, 150, 50, 50),
+ button4, QRect(150, 150, 50, 50),
+ group);
+ state6 = createGeometryState(button1, QRect(50, 50, 50, 50),
+ button2, QRect(200, 50, 50, 50),
+ button3, QRect(50, 200, 50, 50),
+ button4, QRect(200, 200, 50, 50),
+ group);
+//![4]
+ state7 = createGeometryState(button1, QRect(0, 0, 50, 50),
+ button2, QRect(250, 0, 50, 50),
+ button3, QRect(0, 250, 50, 50),
+ button4, QRect(250, 250, 50, 50),
+ group);
+ group->setInitialState(state1);
+//![4]
+
+//![5]
+ QParallelAnimationGroup animationGroup;
+ QSequentialAnimationGroup *subGroup;
+
+ QPropertyAnimation *anim = new QPropertyAnimation(button4, "geometry");
+ anim->setDuration(1000);
+ anim->setEasingCurve(QEasingCurve::OutElastic);
+ animationGroup.addAnimation(anim);
+//![5]
+
+//![6]
+ subGroup = new QSequentialAnimationGroup(&animationGroup);
+ subGroup->addPause(100);
+ anim = new QPropertyAnimation(button3, "geometry");
+ anim->setDuration(1000);
+ anim->setEasingCurve(QEasingCurve::OutElastic);
+ subGroup->addAnimation(anim);
+//![6]
+
+ subGroup = new QSequentialAnimationGroup(&animationGroup);
+ subGroup->addPause(150);
+ anim = new QPropertyAnimation(button2, "geometry");
+ anim->setDuration(1000);
+ anim->setEasingCurve(QEasingCurve::OutElastic);
+ subGroup->addAnimation(anim);
+
+ subGroup = new QSequentialAnimationGroup(&animationGroup);
+ subGroup->addPause(200);
+ anim = new QPropertyAnimation(button1, "geometry");
+ anim->setDuration(1000);
+ anim->setEasingCurve(QEasingCurve::OutElastic);
+ subGroup->addAnimation(anim);
+
+//![7]
+ StateSwitcher *stateSwitcher = new StateSwitcher(&machine);
+ stateSwitcher->setObjectName("stateSwitcher");
+ group->addTransition(&timer, SIGNAL(timeout()), stateSwitcher);
+ stateSwitcher->addState(state1, &animationGroup);
+ stateSwitcher->addState(state2, &animationGroup);
+//![7]
+ stateSwitcher->addState(state3, &animationGroup);
+ stateSwitcher->addState(state4, &animationGroup);
+ stateSwitcher->addState(state5, &animationGroup);
+ stateSwitcher->addState(state6, &animationGroup);
+//![8]
+ stateSwitcher->addState(state7, &animationGroup);
+//![8]
+
+//![9]
+ machine.addState(group);
+ machine.setInitialState(group);
+ machine.start();
+//![9]
+
+ window.resize(300, 300);
+ window.show();
+
+ qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro
new file mode 100644
index 0000000000..6451b67886
--- /dev/null
+++ b/examples/animation/moveblocks/moveblocks.pro
@@ -0,0 +1,12 @@
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/moveblocks
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS moveblocks.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/moveblocks
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F7
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/states/accessories-dictionary.png b/examples/animation/states/accessories-dictionary.png
new file mode 100644
index 0000000000..e9bd55d918
--- /dev/null
+++ b/examples/animation/states/accessories-dictionary.png
Binary files differ
diff --git a/examples/animation/states/akregator.png b/examples/animation/states/akregator.png
new file mode 100644
index 0000000000..a086f45ab6
--- /dev/null
+++ b/examples/animation/states/akregator.png
Binary files differ
diff --git a/examples/animation/states/digikam.png b/examples/animation/states/digikam.png
new file mode 100644
index 0000000000..9de9fb2f80
--- /dev/null
+++ b/examples/animation/states/digikam.png
Binary files differ
diff --git a/examples/animation/states/help-browser.png b/examples/animation/states/help-browser.png
new file mode 100644
index 0000000000..db92faa4e7
--- /dev/null
+++ b/examples/animation/states/help-browser.png
Binary files differ
diff --git a/examples/animation/states/k3b.png b/examples/animation/states/k3b.png
new file mode 100644
index 0000000000..bbcafcfba1
--- /dev/null
+++ b/examples/animation/states/k3b.png
Binary files differ
diff --git a/examples/animation/states/kchart.png b/examples/animation/states/kchart.png
new file mode 100644
index 0000000000..1dd115be87
--- /dev/null
+++ b/examples/animation/states/kchart.png
Binary files differ
diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp
new file mode 100644
index 0000000000..1565489069
--- /dev/null
+++ b/examples/animation/states/main.cpp
@@ -0,0 +1,271 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+class Pixmap : public QGraphicsObject
+{
+ Q_OBJECT
+public:
+ Pixmap(const QPixmap &pix) : QGraphicsObject(), p(pix)
+ {
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ {
+ painter->drawPixmap(QPointF(), p);
+ }
+
+ QRectF boundingRect() const
+ {
+ return QRectF( QPointF(0, 0), p.size());
+ }
+
+private:
+ QPixmap p;
+};
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(states);
+
+ QApplication app(argc, argv);
+
+ // Text edit and button
+ QTextEdit *edit = new QTextEdit;
+ edit->setText("asdf lkjha yuoiqwe asd iuaysd u iasyd uiy "
+ "asdf lkjha yuoiqwe asd iuaysd u iasyd uiy "
+ "asdf lkjha yuoiqwe asd iuaysd u iasyd uiy "
+ "asdf lkjha yuoiqwe asd iuaysd u iasyd uiy!");
+
+ QPushButton *button = new QPushButton;
+ QGraphicsProxyWidget *buttonProxy = new QGraphicsProxyWidget;
+ buttonProxy->setWidget(button);
+ QGraphicsProxyWidget *editProxy = new QGraphicsProxyWidget;
+ editProxy->setWidget(edit);
+
+ QGroupBox *box = new QGroupBox;
+ box->setFlat(true);
+ box->setTitle("Options");
+
+ QVBoxLayout *layout2 = new QVBoxLayout;
+ box->setLayout(layout2);
+ layout2->addWidget(new QRadioButton("Herring"));
+ layout2->addWidget(new QRadioButton("Blue Parrot"));
+ layout2->addWidget(new QRadioButton("Petunias"));
+ layout2->addStretch();
+
+ QGraphicsProxyWidget *boxProxy = new QGraphicsProxyWidget;
+ boxProxy->setWidget(box);
+
+ // Parent widget
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, widget);
+ layout->addItem(editProxy);
+ layout->addItem(buttonProxy);
+ widget->setLayout(layout);
+
+ Pixmap *p1 = new Pixmap(QPixmap(":/digikam.png"));
+ Pixmap *p2 = new Pixmap(QPixmap(":/akregator.png"));
+ Pixmap *p3 = new Pixmap(QPixmap(":/accessories-dictionary.png"));
+ Pixmap *p4 = new Pixmap(QPixmap(":/k3b.png"));
+ Pixmap *p5 = new Pixmap(QPixmap(":/help-browser.png"));
+ Pixmap *p6 = new Pixmap(QPixmap(":/kchart.png"));
+
+ QGraphicsScene scene(0, 0, 400, 300);
+ scene.setBackgroundBrush(scene.palette().window());
+ scene.addItem(widget);
+ scene.addItem(boxProxy);
+ scene.addItem(p1);
+ scene.addItem(p2);
+ scene.addItem(p3);
+ scene.addItem(p4);
+ scene.addItem(p5);
+ scene.addItem(p6);
+
+ QStateMachine machine;
+ QState *state1 = new QState(&machine);
+ QState *state2 = new QState(&machine);
+ QState *state3 = new QState(&machine);
+ machine.setInitialState(state1);
+
+ // State 1
+ 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, "rotation", qreal(0));
+ state1->assignProperty(p2, "rotation", qreal(0));
+ state1->assignProperty(p3, "rotation", qreal(0));
+ state1->assignProperty(p4, "rotation", qreal(-270));
+ state1->assignProperty(p5, "rotation", qreal(-90));
+ state1->assignProperty(p6, "rotation", qreal(270));
+ state1->assignProperty(boxProxy, "opacity", qreal(0));
+ state1->assignProperty(p1, "opacity", qreal(1));
+ state1->assignProperty(p2, "opacity", qreal(1));
+ state1->assignProperty(p3, "opacity", qreal(1));
+ state1->assignProperty(p4, "opacity", qreal(0));
+ state1->assignProperty(p5, "opacity", qreal(0));
+ state1->assignProperty(p6, "opacity", qreal(0));
+
+ // State 2
+ 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(p4, "pos", QPointF(64, 48));
+ state2->assignProperty(p5, "pos", QPointF(168, 48));
+ state2->assignProperty(p6, "pos", QPointF(268, 48));
+ state2->assignProperty(p1, "rotation", qreal(-270));
+ state2->assignProperty(p2, "rotation", qreal(90));
+ state2->assignProperty(p3, "rotation", qreal(270));
+ state2->assignProperty(p4, "rotation", qreal(0));
+ state2->assignProperty(p5, "rotation", qreal(0));
+ state2->assignProperty(p6, "rotation", qreal(0));
+ state2->assignProperty(boxProxy, "opacity", qreal(1));
+ state2->assignProperty(p1, "opacity", qreal(0));
+ state2->assignProperty(p2, "opacity", qreal(0));
+ state2->assignProperty(p3, "opacity", qreal(0));
+ state2->assignProperty(p4, "opacity", qreal(1));
+ state2->assignProperty(p5, "opacity", qreal(1));
+ state2->assignProperty(p6, "opacity", qreal(1));
+
+ // State 3
+ state3->assignProperty(button, "text", "Switch to state 1");
+ state3->assignProperty(p1, "pos", QPointF(0, 5));
+ state3->assignProperty(p2, "pos", QPointF(0, 5 + 64 + 5));
+ state3->assignProperty(p3, "pos", QPointF(5, 5 + (64 + 5) + 64));
+ state3->assignProperty(p4, "pos", QPointF(5 + 64 + 5, 5));
+ state3->assignProperty(p5, "pos", QPointF(5 + 64 + 5, 5 + 64 + 5));
+ state3->assignProperty(p6, "pos", QPointF(5 + 64 + 5, 5 + (64 + 5) + 64));
+ state3->assignProperty(widget, "geometry", QRectF(138, 5, 400 - 138, 200));
+ state3->assignProperty(box, "geometry", QRect(5, 205, 400, 90));
+ state3->assignProperty(p1, "opacity", qreal(1));
+ state3->assignProperty(p2, "opacity", qreal(1));
+ state3->assignProperty(p3, "opacity", qreal(1));
+ state3->assignProperty(p4, "opacity", qreal(1));
+ state3->assignProperty(p5, "opacity", qreal(1));
+ state3->assignProperty(p6, "opacity", qreal(1));
+
+ QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2);
+ QSequentialAnimationGroup *animation1SubGroup = new QSequentialAnimationGroup;
+ animation1SubGroup->addPause(250);
+ animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t1->addAnimation(animation1SubGroup);
+ t1->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p1, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p2, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p3, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p4, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p5, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p6, "pos"));
+ t1->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p6, "opacity"));
+
+ QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3);
+ t2->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p1, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p2, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p3, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p4, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p5, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p6, "pos"));
+ t2->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p6, "opacity"));
+
+ QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1);
+ t3->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p1, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p2, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p3, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p4, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p5, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p6, "pos"));
+ t3->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p6, "opacity"));
+
+ machine.start();
+
+ QGraphicsView view(&scene);
+ view.show();
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro
new file mode 100644
index 0000000000..dd5e09f365
--- /dev/null
+++ b/examples/animation/states/states.pro
@@ -0,0 +1,13 @@
+SOURCES += main.cpp
+RESOURCES += states.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/states
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS states.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/states
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F8
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/states/states.qrc b/examples/animation/states/states.qrc
new file mode 100644
index 0000000000..60ab3f7a60
--- /dev/null
+++ b/examples/animation/states/states.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>accessories-dictionary.png</file>
+ <file>akregator.png</file>
+ <file>digikam.png</file>
+ <file>help-browser.png</file>
+ <file>k3b.png</file>
+ <file>kchart.png</file>
+</qresource>
+</RCC>
diff --git a/examples/animation/stickman/animation.cpp b/examples/animation/stickman/animation.cpp
new file mode 100644
index 0000000000..af7144be2c
--- /dev/null
+++ b/examples/animation/stickman/animation.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "animation.h"
+
+#include <QPointF>
+#include <QIODevice>
+#include <QDataStream>
+
+class Frame
+{
+public:
+ Frame() {
+ }
+
+ int nodeCount() const
+ {
+ return m_nodePositions.size();
+ }
+
+ void setNodeCount(int nodeCount)
+ {
+ while (nodeCount > m_nodePositions.size())
+ m_nodePositions.append(QPointF());
+
+ while (nodeCount < m_nodePositions.size())
+ m_nodePositions.removeLast();
+ }
+
+ QPointF nodePos(int idx) const
+ {
+ return m_nodePositions.at(idx);
+ }
+
+ void setNodePos(int idx, const QPointF &pos)
+ {
+ m_nodePositions[idx] = pos;
+ }
+
+private:
+ QList<QPointF> m_nodePositions;
+};
+
+Animation::Animation()
+{
+ m_currentFrame = 0;
+ m_frames.append(new Frame);
+}
+
+Animation::~Animation()
+{
+ qDeleteAll(m_frames);
+}
+
+void Animation::setTotalFrames(int totalFrames)
+{
+ while (m_frames.size() < totalFrames)
+ m_frames.append(new Frame);
+
+ while (totalFrames < m_frames.size())
+ delete m_frames.takeLast();
+}
+
+int Animation::totalFrames() const
+{
+ return m_frames.size();
+}
+
+void Animation::setCurrentFrame(int currentFrame)
+{
+ m_currentFrame = qMax(qMin(currentFrame, totalFrames()-1), 0);
+}
+
+int Animation::currentFrame() const
+{
+ return m_currentFrame;
+}
+
+void Animation::setNodeCount(int nodeCount)
+{
+ Frame *frame = m_frames.at(m_currentFrame);
+ frame->setNodeCount(nodeCount);
+}
+
+int Animation::nodeCount() const
+{
+ Frame *frame = m_frames.at(m_currentFrame);
+ return frame->nodeCount();
+}
+
+void Animation::setNodePos(int idx, const QPointF &pos)
+{
+ Frame *frame = m_frames.at(m_currentFrame);
+ frame->setNodePos(idx, pos);
+}
+
+QPointF Animation::nodePos(int idx) const
+{
+ Frame *frame = m_frames.at(m_currentFrame);
+ return frame->nodePos(idx);
+}
+
+QString Animation::name() const
+{
+ return m_name;
+}
+
+void Animation::setName(const QString &name)
+{
+ m_name = name;
+}
+
+void Animation::save(QIODevice *device) const
+{
+ QDataStream stream(device);
+ stream << m_name;
+ stream << m_frames.size();
+ foreach (Frame *frame, m_frames) {
+ stream << frame->nodeCount();
+ for (int i=0; i<frame->nodeCount(); ++i)
+ stream << frame->nodePos(i);
+ }
+}
+
+void Animation::load(QIODevice *device)
+{
+ if (!m_frames.isEmpty())
+ qDeleteAll(m_frames);
+
+ m_frames.clear();
+
+ QDataStream stream(device);
+ stream >> m_name;
+
+ int frameCount;
+ stream >> frameCount;
+
+ for (int i=0; i<frameCount; ++i) {
+
+ int nodeCount;
+ stream >> nodeCount;
+
+ Frame *frame = new Frame;
+ frame->setNodeCount(nodeCount);
+
+ for (int j=0; j<nodeCount; ++j) {
+ QPointF pos;
+ stream >> pos;
+
+ frame->setNodePos(j, pos);
+ }
+
+ m_frames.append(frame);
+ }
+}
diff --git a/examples/animation/stickman/animation.h b/examples/animation/stickman/animation.h
new file mode 100644
index 0000000000..51edda6e63
--- /dev/null
+++ b/examples/animation/stickman/animation.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ANIMATION_H
+#define ANIMATION_H
+
+#include <QPointF>
+#include <QList>
+#include <QString>
+
+class Frame;
+QT_BEGIN_NAMESPACE
+class QIODevice;
+QT_END_NAMESPACE
+class Animation
+{
+public:
+ Animation();
+ ~Animation();
+
+ void setTotalFrames(int totalFrames);
+ int totalFrames() const;
+
+ void setCurrentFrame(int currentFrame);
+ int currentFrame() const;
+
+ void setNodeCount(int nodeCount);
+ int nodeCount() const;
+
+ void setNodePos(int idx, const QPointF &pos);
+ QPointF nodePos(int idx) const;
+
+ QString name() const;
+ void setName(const QString &name);
+
+ void save(QIODevice *device) const;
+ void load(QIODevice *device);
+
+private:
+ QString m_name;
+ QList<Frame *> m_frames;
+ int m_currentFrame;
+};
+
+#endif
diff --git a/examples/animation/stickman/animations/chilling b/examples/animation/stickman/animations/chilling
new file mode 100644
index 0000000000..a81fc7a18c
--- /dev/null
+++ b/examples/animation/stickman/animations/chilling
Binary files differ
diff --git a/examples/animation/stickman/animations/dancing b/examples/animation/stickman/animations/dancing
new file mode 100644
index 0000000000..462f66f89b
--- /dev/null
+++ b/examples/animation/stickman/animations/dancing
Binary files differ
diff --git a/examples/animation/stickman/animations/dead b/examples/animation/stickman/animations/dead
new file mode 100644
index 0000000000..9859b4b4cd
--- /dev/null
+++ b/examples/animation/stickman/animations/dead
Binary files differ
diff --git a/examples/animation/stickman/animations/jumping b/examples/animation/stickman/animations/jumping
new file mode 100644
index 0000000000..12661a15f8
--- /dev/null
+++ b/examples/animation/stickman/animations/jumping
Binary files differ
diff --git a/examples/animation/stickman/graphicsview.cpp b/examples/animation/stickman/graphicsview.cpp
new file mode 100644
index 0000000000..23036efe92
--- /dev/null
+++ b/examples/animation/stickman/graphicsview.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "graphicsview.h"
+#include "stickman.h"
+
+#include <QtGui/QKeyEvent>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsView>
+
+GraphicsView::GraphicsView(QWidget *parent) : QGraphicsView(parent), m_editor(0) {}
+
+void GraphicsView::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Escape)
+ close();
+ emit keyPressed(Qt::Key(e->key()));
+}
+
+
diff --git a/examples/animation/stickman/graphicsview.h b/examples/animation/stickman/graphicsview.h
new file mode 100644
index 0000000000..9cf87b63e6
--- /dev/null
+++ b/examples/animation/stickman/graphicsview.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GRAPHICSVIEW_H
+#define GRAPHICSVIEW
+
+#include <QtGui/QGraphicsView>
+
+class MainWindow;
+class GraphicsView: public QGraphicsView
+{
+ Q_OBJECT
+public:
+ GraphicsView(QWidget *parent = 0);
+
+protected:
+ void keyPressEvent(QKeyEvent *);
+
+signals:
+ void keyPressed(int key);
+
+private:
+ MainWindow *m_editor;
+};
+
+#endif
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
new file mode 100644
index 0000000000..4abcdc22e5
--- /dev/null
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "lifecycle.h"
+#include "stickman.h"
+#include "node.h"
+#include "animation.h"
+#include "graphicsview.h"
+
+#include <QtCore>
+#include <QtGui>
+
+class KeyPressTransition: public QSignalTransition
+{
+public:
+ KeyPressTransition(GraphicsView *receiver, Qt::Key key)
+ : QSignalTransition(receiver, SIGNAL(keyPressed(int))), m_key(key)
+ {
+ }
+ KeyPressTransition(GraphicsView *receiver, Qt::Key key, QAbstractState *target)
+ : QSignalTransition(receiver, SIGNAL(keyPressed(int))), m_key(key)
+ {
+ setTargetState(target);
+ }
+
+ virtual bool eventTest(QEvent *e)
+ {
+ if (QSignalTransition::eventTest(e)) {
+ QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0);
+ return (key.toInt() == int(m_key));
+ }
+
+ return false;
+ }
+private:
+ Qt::Key m_key;
+};
+
+//! [4]
+class LightningStrikesTransition: public QEventTransition
+{
+public:
+ LightningStrikesTransition(QAbstractState *target)
+ : QEventTransition(this, QEvent::Timer)
+ {
+ setTargetState(target);
+ qsrand((uint)QDateTime::currentDateTime().toTime_t());
+ startTimer(1000);
+ }
+
+ virtual bool eventTest(QEvent *e)
+ {
+ return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
+ }
+};
+//! [4]
+
+LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
+ : m_stickMan(stickMan), m_keyReceiver(keyReceiver)
+{
+ // Create animation group to be used for all transitions
+ m_animationGroup = new QParallelAnimationGroup();
+ const int stickManNodeCount = m_stickMan->nodeCount();
+ for (int i=0; i<stickManNodeCount; ++i) {
+ QPropertyAnimation *pa = new QPropertyAnimation(m_stickMan->node(i), "pos");
+ m_animationGroup->addAnimation(pa);
+ }
+
+ // Set up initial state graph
+//! [3]
+ m_machine = new QStateMachine();
+ m_machine->addDefaultAnimation(m_animationGroup);
+//! [3]
+
+ m_alive = new QState(m_machine);
+ m_alive->setObjectName("alive");
+
+ // Make it blink when lightning strikes before entering dead animation
+ QState *lightningBlink = new QState(m_machine);
+ lightningBlink->assignProperty(m_stickMan->scene(), "backgroundBrush", Qt::white);
+ lightningBlink->assignProperty(m_stickMan, "penColor", Qt::black);
+ lightningBlink->assignProperty(m_stickMan, "fillColor", Qt::white);
+ lightningBlink->assignProperty(m_stickMan, "isDead", true);
+
+//! [5]
+ QTimer *timer = new QTimer(lightningBlink);
+ timer->setSingleShot(true);
+ timer->setInterval(100);
+ QObject::connect(lightningBlink, SIGNAL(entered()), timer, SLOT(start()));
+ QObject::connect(lightningBlink, SIGNAL(exited()), timer, SLOT(stop()));
+//! [5]
+
+ m_dead = new QState(m_machine);
+ m_dead->assignProperty(m_stickMan->scene(), "backgroundBrush", Qt::black);
+ m_dead->assignProperty(m_stickMan, "penColor", Qt::white);
+ m_dead->assignProperty(m_stickMan, "fillColor", Qt::black);
+ m_dead->setObjectName("dead");
+
+ // Idle state (sets no properties)
+ m_idle = new QState(m_alive);
+ m_idle->setObjectName("idle");
+
+ m_alive->setInitialState(m_idle);
+
+ // Lightning strikes at random
+ m_alive->addTransition(new LightningStrikesTransition(lightningBlink));
+//! [0]
+ lightningBlink->addTransition(timer, SIGNAL(timeout()), m_dead);
+//! [0]
+
+ m_machine->setInitialState(m_alive);
+}
+
+void LifeCycle::setDeathAnimation(const QString &fileName)
+{
+ QState *deathAnimation = makeState(m_dead, fileName);
+ m_dead->setInitialState(deathAnimation);
+}
+
+void LifeCycle::start()
+{
+ m_machine->start();
+}
+
+void LifeCycle::addActivity(const QString &fileName, Qt::Key key)
+{
+ QState *state = makeState(m_alive, fileName);
+ m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state));
+}
+
+QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName)
+{
+ QState *topLevel = new QState(parentState);
+
+ Animation animation;
+ {
+ QFile file(animationFileName);
+ if (file.open(QIODevice::ReadOnly))
+ animation.load(&file);
+ }
+
+ const int frameCount = animation.totalFrames();
+ QState *previousState = 0;
+ for (int i=0; i<frameCount; ++i) {
+ animation.setCurrentFrame(i);
+
+//! [1]
+ QState *frameState = new QState(topLevel);
+ const int nodeCount = animation.nodeCount();
+ for (int j=0; j<nodeCount; ++j)
+ frameState->assignProperty(m_stickMan->node(j), "pos", animation.nodePos(j));
+//! [1]
+
+ frameState->setObjectName(QString::fromLatin1("frame %0").arg(i));
+ if (previousState == 0)
+ topLevel->setInitialState(frameState);
+ else
+//! [2]
+ previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), frameState);
+//! [2]
+
+ previousState = frameState;
+ }
+
+ // Loop
+ previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), topLevel->initialState());
+
+ return topLevel;
+
+}
+
+LifeCycle::~LifeCycle()
+{
+ delete m_machine;
+ delete m_animationGroup;
+}
diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h
new file mode 100644
index 0000000000..1bf3661f6c
--- /dev/null
+++ b/examples/animation/stickman/lifecycle.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIFECYCLE_H
+#define LIFECYCLE_H
+
+#include <Qt>
+
+class StickMan;
+QT_BEGIN_NAMESPACE
+class QStateMachine;
+class QAnimationGroup;
+class QState;
+class QAbstractState;
+class QAbstractTransition;
+QT_END_NAMESPACE
+class GraphicsView;
+class LifeCycle
+{
+public:
+ LifeCycle(StickMan *stickMan, GraphicsView *keyEventReceiver);
+ ~LifeCycle();
+
+ void setDeathAnimation(const QString &fileName);
+ void addActivity(const QString &fileName, Qt::Key key);
+
+ void start();
+
+private:
+ QState *makeState(QState *parentState, const QString &animationFileName);
+
+ StickMan *m_stickMan;
+ QStateMachine *m_machine;
+ QAnimationGroup *m_animationGroup;
+ GraphicsView *m_keyReceiver;
+
+ QState *m_alive;
+ QState *m_dead;
+ QState *m_idle;
+};
+
+#endif
diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp
new file mode 100644
index 0000000000..08df766509
--- /dev/null
+++ b/examples/animation/stickman/main.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "animation.h"
+#include "node.h"
+#include "lifecycle.h"
+#include "stickman.h"
+#include "graphicsview.h"
+
+#include <QtCore>
+#include <QtGui>
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(stickman);
+ QApplication app(argc, argv);
+
+ StickMan *stickMan = new StickMan;
+ stickMan->setDrawSticks(false);
+
+ QGraphicsTextItem *textItem = new QGraphicsTextItem();
+ textItem->setHtml("<font color=\"white\"><b>Stickman</b>"
+ "<p>"
+ "Tell the stickman what to do!"
+ "</p>"
+ "<p><i>"
+ "<li>Press <font color=\"purple\">J</font> to make the stickman jump.</li>"
+ "<li>Press <font color=\"purple\">D</font> to make the stickman dance.</li>"
+ "<li>Press <font color=\"purple\">C</font> to make him chill out.</li>"
+ "<li>When you are done, press <font color=\"purple\">Escape</font>.</li>"
+ "</i></p>"
+ "<p>If he is unlucky, the stickman will get struck by lightning, and never jump, dance or chill out again."
+ "</p></font>");
+ qreal w = textItem->boundingRect().width();
+ QRectF stickManBoundingRect = stickMan->mapToScene(stickMan->boundingRect()).boundingRect();
+ textItem->setPos(-w / 2.0, stickManBoundingRect.bottom() + 25.0);
+
+ QGraphicsScene scene;
+ scene.addItem(stickMan);
+ scene.addItem(textItem);
+ 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);
+
+ LifeCycle cycle(stickMan, &view);
+ cycle.setDeathAnimation(":/animations/dead");
+
+ cycle.addActivity(":/animations/jumping", Qt::Key_J);
+ cycle.addActivity(":/animations/dancing", Qt::Key_D);
+ cycle.addActivity(":/animations/chilling", Qt::Key_C);
+ cycle.start();
+
+ return app.exec();
+}
diff --git a/examples/animation/stickman/node.cpp b/examples/animation/stickman/node.cpp
new file mode 100644
index 0000000000..3077dffb12
--- /dev/null
+++ b/examples/animation/stickman/node.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "node.h"
+#include "stickman.h"
+
+#include <QRectF>
+#include <QPainter>
+#include <QGraphicsSceneMouseEvent>
+
+Node::Node(const QPointF &pos, QGraphicsItem *parent)
+ : QGraphicsObject(parent), m_dragging(false)
+{
+ setPos(pos);
+ setFlag(QGraphicsItem::ItemSendsGeometryChanges);
+}
+
+Node::~Node()
+{
+}
+
+QRectF Node::boundingRect() const
+{
+ return QRectF(-6.0, -6.0, 12.0, 12.0);
+}
+
+void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ painter->setPen(Qt::white);
+ painter->drawEllipse(QPointF(0.0, 0.0), 5.0, 5.0);
+}
+
+QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ if (change == QGraphicsItem::ItemPositionChange)
+ emit positionChanged();
+
+ return QGraphicsObject::itemChange(change, value);
+}
+
+void Node::mousePressEvent(QGraphicsSceneMouseEvent *)
+{
+ m_dragging = true;
+}
+
+void Node::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ if (m_dragging)
+ setPos(mapToParent(event->pos()));
+}
+
+void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ m_dragging = false;
+}
diff --git a/examples/animation/stickman/node.h b/examples/animation/stickman/node.h
new file mode 100644
index 0000000000..cefb3a81ac
--- /dev/null
+++ b/examples/animation/stickman/node.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef NODE_H
+#define NODE_H
+
+#include <QGraphicsItem>
+
+class Node: public QGraphicsObject
+{
+ Q_OBJECT
+public:
+ Node(const QPointF &pos, QGraphicsItem *parent = 0);
+ ~Node();
+
+ QRectF boundingRect() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+signals:
+ void positionChanged();
+
+protected:
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value);
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
+
+private:
+ bool m_dragging;
+};
+
+#endif
diff --git a/examples/animation/stickman/stickman.cpp b/examples/animation/stickman/stickman.cpp
new file mode 100644
index 0000000000..8b474579c2
--- /dev/null
+++ b/examples/animation/stickman/stickman.cpp
@@ -0,0 +1,337 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "stickman.h"
+#include "node.h"
+
+#include <QPainter>
+#include <QTimer>
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+static const qreal Coords[NodeCount * 2] = {
+ 0.0, -150.0, // head, #0
+
+ 0.0, -100.0, // body pentagon, top->bottom, left->right, #1 - 5
+ -50.0, -50.0,
+ 50.0, -50.0,
+ -25.0, 50.0,
+ 25.0, 50.0,
+
+ -100.0, 0.0, // right arm, #6 - 7
+ -125.0, 50.0,
+
+ 100.0, 0.0, // left arm, #8 - 9
+ 125.0, 50.0,
+
+ -35.0, 75.0, // lower body, #10 - 11
+ 35.0, 75.0,
+
+ -25.0, 200.0, // right leg, #12 - 13
+ -30.0, 300.0,
+
+ 25.0, 200.0, // left leg, #14 - 15
+ 30.0, 300.0
+
+};
+
+static const int Bones[BoneCount * 2] = {
+ 0, 1, // neck
+
+ 1, 2, // body
+ 1, 3,
+ 1, 4,
+ 1, 5,
+ 2, 3,
+ 2, 4,
+ 2, 5,
+ 3, 4,
+ 3, 5,
+ 4, 5,
+
+ 2, 6, // right arm
+ 6, 7,
+
+ 3, 8, // left arm
+ 8, 9,
+
+ 4, 10, // lower body
+ 4, 11,
+ 5, 10,
+ 5, 11,
+ 10, 11,
+
+ 10, 12, // right leg
+ 12, 13,
+
+ 11, 14, // left leg
+ 14, 15
+
+};
+
+StickMan::StickMan()
+{
+ m_sticks = true;
+ m_isDead = false;
+ m_pixmap = QPixmap("images/head.png");
+ m_penColor = Qt::white;
+ m_fillColor = Qt::black;
+
+ // Set up start position of limbs
+ for (int i=0; i<NodeCount; ++i) {
+ m_nodes[i] = new Node(QPointF(Coords[i * 2], Coords[i * 2 + 1]), this);
+ connect(m_nodes[i], SIGNAL(positionChanged()), this, SLOT(childPositionChanged()));
+ }
+
+ for (int i=0; i<BoneCount; ++i) {
+ int n1 = Bones[i * 2];
+ int n2 = Bones[i * 2 + 1];
+
+ Node *node1 = m_nodes[n1];
+ Node *node2 = m_nodes[n2];
+
+ QPointF dist = node1->pos() - node2->pos();
+ m_perfectBoneLengths[i] = sqrt(pow(dist.x(),2) + pow(dist.y(),2));
+ }
+
+ startTimer(10);
+}
+
+StickMan::~StickMan()
+{
+}
+
+void StickMan::childPositionChanged()
+{
+ prepareGeometryChange();
+}
+
+void StickMan::setDrawSticks(bool on)
+{
+ m_sticks = on;
+ for (int i=0;i<nodeCount();++i) {
+ Node *node = m_nodes[i];
+ node->setVisible(on);
+ }
+}
+
+QRectF StickMan::boundingRect() const
+{
+ // account for head radius=50.0 plus pen which is 5.0
+ return childrenBoundingRect().adjusted(-55.0, -55.0, 55.0, 55.0);
+}
+
+int StickMan::nodeCount() const
+{
+ return NodeCount;
+}
+
+Node *StickMan::node(int idx) const
+{
+ if (idx >= 0 && idx < NodeCount)
+ return m_nodes[idx];
+ else
+ return 0;
+}
+
+void StickMan::timerEvent(QTimerEvent *)
+{
+ update();
+}
+
+void StickMan::stabilize()
+{
+ static const qreal threshold = 0.001;
+
+ for (int i=0; i<BoneCount; ++i) {
+ int n1 = Bones[i * 2];
+ int n2 = Bones[i * 2 + 1];
+
+ Node *node1 = m_nodes[n1];
+ Node *node2 = m_nodes[n2];
+
+ QPointF pos1 = node1->pos();
+ QPointF pos2 = node2->pos();
+
+ QPointF dist = pos1 - pos2;
+ qreal length = sqrt(pow(dist.x(),2) + pow(dist.y(),2));
+ qreal diff = (length - m_perfectBoneLengths[i]) / length;
+
+ QPointF p = dist * (0.5 * diff);
+ if (p.x() > threshold && p.y() > threshold) {
+ pos1 -= p;
+ pos2 += p;
+
+ node1->setPos(pos1);
+ node2->setPos(pos2);
+ }
+ }
+}
+
+QPointF StickMan::posFor(int idx) const
+{
+ return m_nodes[idx]->pos();
+}
+
+//#include <QTime>
+void StickMan::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ /* static int frames = 0;
+ static QTime time;
+ if (frames++ % 100 == 0) {
+ frames = 1;
+ time.restart();
+ }
+
+ if (time.elapsed() > 0) {
+ painter->setPen(Qt::white);
+ painter->drawText(0, 0, QString::number(frames / (time.elapsed() / 1000.0)));
+ }*/
+
+ stabilize();
+ if (m_sticks) {
+ painter->setPen(Qt::white);
+ for (int i=0; i<BoneCount; ++i) {
+ int n1 = Bones[i * 2];
+ int n2 = Bones[i * 2 + 1];
+
+ Node *node1 = m_nodes[n1];
+ Node *node2 = m_nodes[n2];
+
+ painter->drawLine(node1->pos(), node2->pos());
+ }
+ } else {
+ // first bone is neck and will be used for head
+
+ QPainterPath path;
+ path.moveTo(posFor(0));
+ path.lineTo(posFor(1));
+
+ // right arm
+ path.lineTo(posFor(2));
+ path.lineTo(posFor(6));
+ path.lineTo(posFor(7));
+
+ // left arm
+ path.moveTo(posFor(3));
+ path.lineTo(posFor(8));
+ path.lineTo(posFor(9));
+
+ // body
+ path.moveTo(posFor(2));
+ path.lineTo(posFor(4));
+ path.lineTo(posFor(10));
+ path.lineTo(posFor(11));
+ path.lineTo(posFor(5));
+ path.lineTo(posFor(3));
+ path.lineTo(posFor(1));
+
+ // right leg
+ path.moveTo(posFor(10));
+ path.lineTo(posFor(12));
+ path.lineTo(posFor(13));
+
+ // left leg
+ path.moveTo(posFor(11));
+ path.lineTo(posFor(14));
+ path.lineTo(posFor(15));
+
+ painter->setPen(QPen(m_penColor, 5.0, Qt::SolidLine, Qt::RoundCap));
+ painter->drawPath(path);
+
+ {
+ int n1 = Bones[0];
+ int n2 = Bones[1];
+ Node *node1 = m_nodes[n1];
+ Node *node2 = m_nodes[n2];
+
+ QPointF dist = node2->pos() - node1->pos();
+
+ qreal sinAngle = dist.x() / sqrt(pow(dist.x(), 2) + pow(dist.y(), 2));
+ qreal angle = asin(sinAngle) * 180.0 / M_PI;
+
+ QPointF headPos = node1->pos();
+ painter->translate(headPos);
+ painter->rotate(-angle);
+
+ painter->setBrush(m_fillColor);
+ painter->drawEllipse(QPointF(0,0), 50.0, 50.0);
+
+ painter->setBrush(m_penColor);
+ painter->setPen(QPen(m_penColor, 2.5, Qt::SolidLine, Qt::RoundCap));
+
+ // eyes
+ if (m_isDead) {
+ painter->drawLine(-30.0, -30.0, -20.0, -20.0);
+ painter->drawLine(-20.0, -30.0, -30.0, -20.0);
+
+ painter->drawLine(20.0, -30.0, 30.0, -20.0);
+ painter->drawLine(30.0, -30.0, 20.0, -20.0);
+ } else {
+ painter->drawChord(QRectF(-30.0, -30.0, 25.0, 70.0), 30.0*16, 120.0*16);
+ painter->drawChord(QRectF(5.0, -30.0, 25.0, 70.0), 30.0*16, 120.0*16);
+ }
+
+ // mouth
+ if (m_isDead) {
+ painter->drawLine(-28.0, 2.0, 29.0, 2.0);
+ } else {
+ painter->setBrush(QColor(128, 0, 64 ));
+ painter->drawChord(QRectF(-28.0, 2.0-55.0/2.0, 57.0, 55.0), 0.0, -180.0*16);
+ }
+
+ // pupils
+ if (!m_isDead) {
+ painter->setPen(QPen(m_fillColor, 1.0, Qt::SolidLine, Qt::RoundCap));
+ painter->setBrush(m_fillColor);
+ painter->drawEllipse(QPointF(-12.0, -25.0), 5.0, 5.0);
+ painter->drawEllipse(QPointF(22.0, -25.0), 5.0, 5.0);
+ }
+ }
+ }
+}
+
+
+
diff --git a/examples/animation/stickman/stickman.h b/examples/animation/stickman/stickman.h
new file mode 100644
index 0000000000..eeebbef283
--- /dev/null
+++ b/examples/animation/stickman/stickman.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef STICKMAN_H
+#define STICKMAN_H
+
+#include <QGraphicsObject>
+
+static const int NodeCount = 16;
+static const int BoneCount = 24;
+
+class Node;
+QT_BEGIN_NAMESPACE
+QT_END_NAMESPACE
+class StickMan: public QGraphicsObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor penColor WRITE setPenColor READ penColor)
+ Q_PROPERTY(QColor fillColor WRITE setFillColor READ fillColor)
+ Q_PROPERTY(bool isDead WRITE setIsDead READ isDead)
+public:
+ StickMan();
+ ~StickMan();
+
+ virtual QRectF boundingRect() const;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+ int nodeCount() const;
+ Node *node(int idx) const;
+
+ void setDrawSticks(bool on);
+ bool drawSticks() const { return m_sticks; }
+
+ QColor penColor() const { return m_penColor; }
+ void setPenColor(const QColor &color) { m_penColor = color; }
+
+ QColor fillColor() const { return m_fillColor; }
+ void setFillColor(const QColor &color) { m_fillColor = color; }
+
+ bool isDead() const { return m_isDead; }
+ void setIsDead(bool isDead) { m_isDead = isDead; }
+
+public slots:
+ void stabilize();
+ void childPositionChanged();
+
+protected:
+ void timerEvent(QTimerEvent *e);
+
+private:
+
+ QPointF posFor(int idx) const;
+
+ Node *m_nodes[NodeCount];
+ qreal m_perfectBoneLengths[BoneCount];
+
+ uint m_sticks : 1;
+ uint m_isDead : 1;
+ uint m_reserved : 30;
+
+ QPixmap m_pixmap;
+ QColor m_penColor;
+ QColor m_fillColor;
+};
+
+#endif // STICKMAN_H
diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro
new file mode 100644
index 0000000000..a4f5aafb2d
--- /dev/null
+++ b/examples/animation/stickman/stickman.pro
@@ -0,0 +1,24 @@
+HEADERS += stickman.h \
+ animation.h \
+ node.h \
+ lifecycle.h \
+ graphicsview.h
+SOURCES += main.cpp \
+ stickman.cpp \
+ animation.cpp \
+ node.cpp \
+ lifecycle.cpp \
+ graphicsview.cpp
+
+RESOURCES += stickman.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/stickman
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS stickman.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/stickman
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F9
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/stickman/stickman.qrc b/examples/animation/stickman/stickman.qrc
new file mode 100644
index 0000000000..e5d66cf2c7
--- /dev/null
+++ b/examples/animation/stickman/stickman.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>animations/chilling</file>
+ <file>animations/dancing</file>
+ <file>animations/dead</file>
+ <file>animations/jumping</file>
+</qresource>
+</RCC> \ No newline at end of file
diff --git a/examples/dbus/complexpingpong/complexping.cpp b/examples/dbus/complexpingpong/complexping.cpp
new file mode 100644
index 0000000000..4e17486439
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexping.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdio.h>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QFile>
+#include <QtCore/QDebug>
+#include <QtCore/QProcess>
+#include <QtDBus/QtDBus>
+
+#include "ping-common.h"
+#include "complexping.h"
+
+void Ping::start(const QString &name, const QString &oldValue, const QString &newValue)
+{
+ Q_UNUSED(oldValue);
+
+ if (name != SERVICE_NAME || newValue.isEmpty())
+ return;
+
+ // open stdin for reading
+ qstdin.open(stdin, QIODevice::ReadOnly);
+
+ // find our remote
+ iface = new QDBusInterface(SERVICE_NAME, "/", "com.trolltech.QtDBus.ComplexPong.Pong",
+ QDBusConnection::sessionBus(), this);
+ if (!iface->isValid()) {
+ fprintf(stderr, "%s\n",
+ qPrintable(QDBusConnection::sessionBus().lastError().message()));
+ QCoreApplication::instance()->quit();
+ }
+
+ connect(iface, SIGNAL(aboutToQuit()), QCoreApplication::instance(), SLOT(quit()));
+
+ while (true) {
+ printf("Ask your question: ");
+
+ QString line = QString::fromLocal8Bit(qstdin.readLine()).trimmed();
+ if (line.isEmpty()) {
+ iface->call("quit");
+ return;
+ } else if (line == "value") {
+ QVariant reply = iface->property("value");
+ if (!reply.isNull())
+ printf("value = %s\n", qPrintable(reply.toString()));
+ } else if (line.startsWith("value=")) {
+ iface->setProperty("value", line.mid(6));
+ } else {
+ QDBusReply<QDBusVariant> reply = iface->call("query", line);
+ if (reply.isValid())
+ printf("Reply was: %s\n", qPrintable(reply.value().variant().toString()));
+ }
+
+ if (iface->lastError().isValid())
+ fprintf(stderr, "Call failed: %s\n", qPrintable(iface->lastError().message()));
+ }
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+
+ if (!QDBusConnection::sessionBus().isConnected()) {
+ fprintf(stderr, "Cannot connect to the D-Bus session bus.\n"
+ "To start it, run:\n"
+ "\teval `dbus-launch --auto-syntax`\n");
+ return 1;
+ }
+
+ Ping ping;
+ ping.connect(QDBusConnection::sessionBus().interface(),
+ SIGNAL(serviceOwnerChanged(QString,QString,QString)),
+ SLOT(start(QString,QString,QString)));
+
+ QProcess pong;
+ pong.start("./complexpong");
+
+ app.exec();
+}
diff --git a/examples/dbus/complexpingpong/complexping.h b/examples/dbus/complexpingpong/complexping.h
new file mode 100644
index 0000000000..bf54e630a8
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexping.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COMPLEXPING_H
+#define COMPLEXPING_H
+
+#include <QtCore/QObject>
+#include <QtCore/QFile>
+#include <QtDBus/QDBusInterface>
+
+class Ping: public QObject
+{
+ Q_OBJECT
+public slots:
+ void start(const QString &, const QString &, const QString &);
+public:
+ QFile qstdin;
+ QDBusInterface *iface;
+};
+
+#endif
diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro
new file mode 100644
index 0000000000..ff4b9c236a
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexping.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QT -= gui
+CONFIG += qdbus
+
+# Input
+HEADERS += complexping.h ping-common.h
+SOURCES += complexping.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/dbus/complexpingpong/complexpingpong.pro b/examples/dbus/complexpingpong/complexpingpong.pro
new file mode 100644
index 0000000000..cd618d549d
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexpingpong.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+CONFIG += ordered
+win32:CONFIG += console
+SUBDIRS = complexping.pro complexpong.pro
diff --git a/examples/dbus/complexpingpong/complexpong.cpp b/examples/dbus/complexpingpong/complexpong.cpp
new file mode 100644
index 0000000000..f16afd3121
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexpong.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTimer>
+#include <QtDBus/QtDBus>
+
+#include "ping-common.h"
+#include "complexpong.h"
+
+// the property
+QString Pong::value() const
+{
+ return m_value;
+}
+
+void Pong::setValue(const QString &newValue)
+{
+ m_value = newValue;
+}
+
+void Pong::quit()
+{
+ QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
+}
+
+QDBusVariant Pong::query(const QString &query)
+{
+ QString q = query.toLower();
+ if (q == "hello")
+ return QDBusVariant("World");
+ if (q == "ping")
+ return QDBusVariant("Pong");
+ if (q.indexOf("the answer to life, the universe and everything") != -1)
+ return QDBusVariant(42);
+ if (q.indexOf("unladen swallow") != -1) {
+ if (q.indexOf("european") != -1)
+ return QDBusVariant(11.0);
+ return QDBusVariant(QByteArray("african or european?"));
+ }
+
+ return QDBusVariant("Sorry, I don't know the answer");
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+
+ QObject obj;
+ Pong *pong = new Pong(&obj);
+ pong->connect(&app, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit()));
+ pong->setProperty("value", "initial value");
+ QDBusConnection::sessionBus().registerObject("/", &obj);
+
+ if (!QDBusConnection::sessionBus().registerService(SERVICE_NAME)) {
+ fprintf(stderr, "%s\n",
+ qPrintable(QDBusConnection::sessionBus().lastError().message()));
+ exit(1);
+ }
+
+ app.exec();
+ return 0;
+}
+
diff --git a/examples/dbus/complexpingpong/complexpong.h b/examples/dbus/complexpingpong/complexpong.h
new file mode 100644
index 0000000000..cc05972f02
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexpong.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COMPLEXPONG_H
+#define COMPLEXPONG_H
+
+#include <QtCore/QObject>
+#include <QtDBus/QDBusAbstractAdaptor>
+#include <QtDBus/QDBusVariant>
+
+class Pong: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "com.trolltech.QtDBus.ComplexPong.Pong")
+ Q_PROPERTY(QString value READ value WRITE setValue)
+public:
+ QString m_value;
+ QString value() const;
+ void setValue(const QString &newValue);
+
+ Pong(QObject *obj) : QDBusAbstractAdaptor(obj)
+ { }
+signals:
+ void aboutToQuit();
+public slots:
+ QDBusVariant query(const QString &query);
+ Q_NOREPLY void quit();
+};
+
+#endif
diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro
new file mode 100644
index 0000000000..166293beed
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexpong.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QT -= gui
+CONFIG += qdbus
+
+# Input
+HEADERS += complexpong.h
+SOURCES += complexpong.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/dbus/complexpingpong/ping-common.h b/examples/dbus/complexpingpong/ping-common.h
new file mode 100644
index 0000000000..532517394b
--- /dev/null
+++ b/examples/dbus/complexpingpong/ping-common.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#define SERVICE_NAME "com.trolltech.QtDBus.PingExample"
diff --git a/examples/dbus/dbus-chat/chat.cpp b/examples/dbus/dbus-chat/chat.cpp
new file mode 100644
index 0000000000..5cc12caafa
--- /dev/null
+++ b/examples/dbus/dbus-chat/chat.cpp
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "chat.h"
+#include <QtGui/QApplication>
+#include <QtGui/QMessageBox>
+
+#include "chat_adaptor.h"
+#include "chat_interface.h"
+
+ChatMainWindow::ChatMainWindow()
+ : m_nickname(QLatin1String("nickname"))
+{
+ setupUi(this);
+ sendButton->setEnabled(false);
+
+ connect(messageLineEdit, SIGNAL(textChanged(QString)),
+ this, SLOT(textChangedSlot(QString)));
+ connect(sendButton, SIGNAL(clicked(bool)), this, SLOT(sendClickedSlot()));
+ connect(actionChangeNickname, SIGNAL(triggered(bool)), this, SLOT(changeNickname()));
+ connect(actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(aboutQt()));
+ connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(exiting()));
+
+ // add our D-Bus interface and connect to D-Bus
+ new ChatAdaptor(this);
+ QDBusConnection::sessionBus().registerObject("/", this);
+
+ com::trolltech::chat *iface;
+ iface = new com::trolltech::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
+ //connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
+ QDBusConnection::sessionBus().connect(QString(), QString(), "com.trolltech.chat", "message", this, SLOT(messageSlot(QString,QString)));
+ connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));
+
+ NicknameDialog dialog;
+ dialog.cancelButton->setVisible(false);
+ dialog.exec();
+ m_nickname = dialog.nickname->text().trimmed();
+ emit action(m_nickname, QLatin1String("joins the chat"));
+}
+
+ChatMainWindow::~ChatMainWindow()
+{
+}
+
+void ChatMainWindow::rebuildHistory()
+{
+ QString history = m_messages.join( QLatin1String("\n" ) );
+ chatHistory->setPlainText(history);
+}
+
+void ChatMainWindow::messageSlot(const QString &nickname, const QString &text)
+{
+ QString msg( QLatin1String("<%1> %2") );
+ msg = msg.arg(nickname, text);
+ m_messages.append(msg);
+
+ if (m_messages.count() > 100)
+ m_messages.removeFirst();
+ rebuildHistory();
+}